Repository navigation
fix(lint): flow-region-shape-invalid points at the region container at fault - #29821
Conversation
… names (red until the refusal carries it) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbYhWa8iJ59Un7Uevvs
…onShapeError names Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWp3uyRGHgDR5oyquZ
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWp3uyRGHgDR5oyquZ
…iner; lint changeset Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWp3uyRGHgDR5oyquZ
📓 Docs Drift Check5 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin f6d1e00988b51fc027988dd483c84ecb919461df && git checkout f6d1e00988b51fc027988dd483c84ecb919461df
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5ac50e482a00ef82ee915cb7eb7c63e75438a28a ccbd58d404215f811646c99056ca96cafdb7aff9 && git checkout -B drift-repro 5ac50e482a00ef82ee915cb7eb7c63e75438a28a && git merge --no-ff ccbd58d404215f811646c99056ca96cafdb7aff9
node scripts/docs-audit/affected-docs.mjs --json 5ac50e482a00ef82ee915cb7eb7c63e75438a28a |
|
domain:server#3 · os-warren · session_01JQwxbYyp6wSRcywGFK2L4A 维护者速读
席位核对ACCEPT ·
|
Requested by Warren · project thread
Fixes #29558
Clause-②: no
Metadata-protocol: none
维护者速读
flow-region-shape-invalid的发现不再只指向整个流程,而是指向引擎拒收时点名的那个区域容器(并行、循环、try_catch),路径与 where 都落到该节点。FlowRegionShapeError,lint 直接读它。packages/lint/src/validate-flow-region-shape.ts的containerAtFault(),其后是同目录测试文件里新增的三个容器用例。pnpm --filter @objectstack/lint exec vitest run src/validate-flow-region-shape.test.ts,预期 10/10 通过。What changes
validateFlowRegionShape(packages/lint/src/validate-flow-region-shape.ts) now anchors its finding on the region container the engine's refusal names. Since #29719 (PR #29789),validateControlFlowthrows the exportedFlowRegionShapeError, carrying the container'snodeIdand itspathinside the flow. The newcontainerAtFault()reads both with oneinstanceof FlowRegionShapeErrorcheck:pathbecomes the flow path plus the container path, in lint spelling:flows[1]+['nodes', 1, 'config', 'try', 'nodes', 0]givesflows[1].nodes[1].config.try.nodes[0](spellPath()).wherebecomesflow 'NAME' › node 'ID'.messageis unchanged: still the engine's sentence behind the flow's name. Still one rule, one judge, one spelling: there is no second call and nothing parses the sentence.One finding per flow, which is one finding per container. The engine throws once, at a flow's first malformed region, and the rule makes exactly the engine's call. Reporting further containers would need a second walk beside the engine's, which the card rules out. A flow with two malformed regions therefore still takes two fixes, as the rule's explanation already says.
Forced path-only pin moves, each limited to the asserted path (claim 6593246940, amendments 6593285300 and the one adding the dogfood file):
packages/cli/test/validate-flow-region-shape.test.ts: the assembled-artifact case'sflows[1]→flows[1].nodes[1].packages/metadata-protocol/src/runtime-authoring-gate.flow-region.test.ts: three cases move fromflows[0]to the container.packages/metadata-protocol/src/protocol.draft-publish-verdict.test.ts: the draft read's item-relative path''→nodes.1.config.try.nodes.0.packages/qa/dogfood/test/flow-region-malformed-publish.dogfood.test.ts: the draft read's"path":""→"path":"nodes.1", its comment, and one docblock phrase.A
@objectstack/lintpatch changeset carries the move.Why
The card: an author reading
flow-region-shape-invalidlearned only that the flow was refused, not whichparallel,looportry_catchwas malformed. The location now comes from the contract the spec half (#29719) added, not from the sentence.Tests
packages/lint/src/validate-flow-region-shape.test.ts: three new cases under[#29558](a top-leveltry_catch, a one-branchparallelnested in a try region, aloopinside the second branch of aparallel), plus the first case and the non-record-entry case moved to the container path. 10/10.All at head
ccbd58d4, each underscripts/pm/os-verify-lock.sh, verdict line quoted:Test runs
pnpm --filter @objectstack/lint typecheck && pnpm --filter @objectstack/lint test: VERDICT command-exit 0; Test Files 192 passed (192), Tests 7945 passed (7945). The lint typecheck covers its tests (check:test-typecheck).pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-flow-region-shape.test.ts: VERDICT command-exit 0; Tests 10 passed (10).pnpm --filter @objectstack/cli exec vitest run --project unit --maxWorkers=2 test/validate-flow-region-shape.test.ts: VERDICT command-exit 0; Tests 7 passed (7).authoring-rule-command-parity.test.tsis integration tier and unedited, so it is left to CI.pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/runtime-authoring-gate.flow-region.test.ts src/protocol.draft-publish-verdict.test.ts(after a lint build): VERDICT command-exit 0; Test Files 2 passed (2), Tests 57 passed (57).pnpm --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood exec vitest run --maxWorkers=2 test/flow-region-malformed-publish.dogfood.test.ts: VERDICT command-exit 0; Tests 3 passed (3).Ablation (one, on the reader)
node scripts/ablation-replace.mjsreplaced the reader's one line (theinstanceof FlowRegionShapeErrorreturn) withreturn undefined;: anchor x1 to x0, blob37494f85f3c3to122265b776ae. The rule's test file then went red, Tests 5 failed, 5 passed: the first case, the three[#29558]container cases and the non-record-entry case. Restored by the tool: blob after restore37494f85f3c3equals HEAD,git diff HEADempty. The test imports the rule from source, so no build sits between the mutation and the run.Acceptance notes
56820bac, cherry-picked asb9930969) missed one in-file pin, the non-record-entry case (flows[2]→flows[2].nodes[1]); fixed in its own commit.os explainentry (rule-explanations.ts) says nothing about the location, so it was left alone.Verification
node scripts/pm/dispatch-gates.mjs --commandsatccbd58d4derived 63 families; all were run with exit codes recorded before any pipe;--ranreconciliation: 63 derived, 62 run, 1 NOT MEASURED, 0 unrun.pnpm check:dual-build-cjs-loads, reason: it reads built output of every package (PREREQUISITE NOT MET, exit 3, seven packages withoutdist/); CI'sLint & Repo Gatesruns it.node scripts/check-plugin-teardown-shape.mjs --self-testfirst exited 3 because its pinned fixture commit was outside this shallow clone; after fetching that commit it exited 0 (48 cases pass).Human Minimum
packages/specholds no runtime logic. (Nopackages/specchange.)pnpm lintruns in CI.main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code