Repository navigation
Commit 91f6845
fix(workflow): key an edge's fact the way the node lists are keyed (#2530)
Fixes #2425
Owner: Dev-4
Reviewer: Birfy
Written-by: Dev-4
Base: 90a5944
Risk tier: T3
## What changed
`validateWorkflow` compared the edge's canonical artifact
(`splitEndpoint` returns `formatArtifactSpec`) against the node's raw
`inputs`/`outputs` arrays with `Array.prototype.includes`. Every other
producer/consumer rule in `core/src/shared/workflow.js` (`producersOf`,
`consumersOf`, `dependencyEdges`, `input/without-producer`,
`output/without-consumer`, and the declared `inputs`/`deliverables`
sets) reads those lists through `canonicalSpec`, so a definition the
engine can run was refused as `edge/misaligned` when one fact was
spelled with a space on a node and without one on its edge — and
`workflow-store.js` turns the first problem into `workflow/invalid`, so
the user cannot save it.
After: both lists are keyed the way the rest of the engine keys them, so
`text: draft` on a node and `text:draft` on its edge are one fact. A
fact the consumer genuinely does not take in is still refused — that
direction is asserted as a control.
## Verification at the tip
Tip SHA: d25ccfc
Ran:
- red first on a clean `90a594471b5886737b433e116f6397aa8ca2b6f2` tree
carrying only `core/test/workflow-edge-canonical-spec.test.js`: `# tests
4 / # pass 2 / # fail 2` — both `edge/misaligned`, one for a space on
the producer (`outputs: ['text: draft']`) and one for a space on the
consumer (`inputs: ['text: draft']`); the two controls (an edge-side
space, and a fact the consumer does not take in) passed on the base by
design.
- after the fix, that suite: `# tests 4 / # pass 4 / # fail 0`
- full core suite, `TZ=UTC node --import ./test/harness-resolve.mjs
--test "test/*.test.js"`: `# tests 2931 / # pass 2931 / # fail 0`
- `node scripts/build-client.mjs --check`: exit 0 (the module is not in
the client bundle, so `client.js` is untouched)
- `node scripts/ds-bot-patches.mjs check`: `ok ds-bot/ =
Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5)`, `ok 10 patches
apply cleanly in order`, `ok core/ equals ds-bot/ + patches/ds-bot/`
- `node scripts/ds-bot-patches.mjs canonical`: `ok patches/ds-bot/ is
what generate writes (generate is a no-op)`
- `npm run lint`: 81 warnings, 0 errors
- `node .github/scripts/changelog.mjs check`: `36 fragment(s) in
changelog.d/ are well formed`
- `ARCH_DOCS_BASE=90a59447 node scripts/check-arch-docs.mjs`: `OK (5
changed file(s))`
`patches/ds-bot/files/src/shared/workflow.js` and
`patches/ds-bot/files/test/workflow-edge-canonical-spec.test.js` are
whole-file mirrors written by `generate` (the file is new in FlyBot and
has no `.patch` header); nothing here was edited by hand.
Not run: the smoke test (no `index.js` or `src/host` behaviour change)
and CI itself.
Docs-not-needed: no owned path, module or contract changes; the check
now agrees with the rule the module already documents (#1291 debt).
## Checkpoint
<!-- flybot:checkpoint -->
```json
{
"pr": 2530,
"claim": "Dev-4",
"issue": 2425,
"summary": "The edge alignment check compared the edge's canonical artifact against the raw node inputs/outputs with includes, so a definition the engine runs was refused as edge/misaligned when one fact was spelled with a space on a node and without one on its edge. Both lists are now keyed through canonicalSpec, the way producersOf, consumersOf and dependencyEdges already read them. Red first at 90a5944: 2 of 4 new tests failed, one for each side carrying the space; the two controls passed on the base.",
"files": [
"core/src/shared/workflow.js",
"core/test/workflow-edge-canonical-spec.test.js",
"patches/ds-bot/files/src/shared/workflow.js",
"patches/ds-bot/files/test/workflow-edge-canonical-spec.test.js",
"changelog.d/2425-workflow-edge-canonical-spec.fixed.md"
],
"checks": {
"ran": "TZ=UTC node --import ./test/harness-resolve.mjs --test \"test/*.test.js\"; node scripts/build-client.mjs --check; node scripts/ds-bot-patches.mjs check; node scripts/ds-bot-patches.mjs canonical; npm run lint",
"result": "green",
"at": "d25ccfc4021452ffa13b8c012ea1fcf199467cff"
},
"next": "ready for the Verdict at d25ccfc"
}
```
<!-- /flybot:checkpoint -->
Co-authored-by: Danyang Chen <birfychen@gmail.com>1 parent f665272 commit 91f6845
5 files changed
Lines changed: 127 additions & 2 deletions
File tree
- changelog.d
- core
- test
- patches/ds-bot/files
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
638 | 641 | | |
639 | 642 | | |
640 | 643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
638 | 641 | | |
639 | 642 | | |
640 | 643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
0 commit comments