Skip to content

fix(spec)!: refuse a flow node that takes a branch which parks the run before its other out-edges - #38970

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-38875-conditioned-edge-pause-drop
Dec 2, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-38875-conditioned-edge-pause-drop

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #38875
Claims: #38875 7312510992. The #38976 boot fix in this diff is also landing on its own (split at the filer's request 7323909818); this PR merges main after it.

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no published skill teaches conditioned out-edges of one node to a pausing step, nor an inclusive decision ahead of one (git grep over skills/ at 6fcf88d: no conditioned-edge, mode: 'inclusive' or durable-pause branching text); the refusal's own message carries the prescription at every door, and content/docs/automation/flows.mdx teaches it here

维护者速读

  • 用户能看到什么变化:流程作者保存或发布流程时,若某个节点先走的一条分支会挂起运行(审批、填写页面、等待),而同一节点之后还有别的分支要走,现在会被直接拒绝并给出改法;之前能保存,运行时后面那条分支被悄悄丢掉,不报任何错。
  • 为什么做:这是上一张"并发分支上两处挂起"拒绝的顺序版孪生,延续同一裁决,保证条件成立的分支不会无声丢失;不改引擎让它在恢复后回头补走剩下的分支。
  • 出错会怎样:最坏情况是某个条件其实互斥、实际不会丢分支的流程被拒,作者需改成先判断再分支、或把会挂起的分支放到最后;仓库内示例与文档没有一个被拒,改动可直接撤回。
  • 要你做什么:无

What changes

A flow in which one node takes an out-edge whose branch reaches a node that parks the run, BEFORE another out-edge of the same traversal, is refused by FlowSchema, so every door that parses a flow refuses it: objectstack validate, the metadata save (draft and active, 422 INVALID_METADATA), publish, and registerFlow. It is the sequential twin of the fan-out rule PR #38871 landed (two pauses on concurrent branches), by the same precedent and the same card invariant: no branch whose condition holds is silently dropped. The engine is not changed; it is not made to come back for the remaining edges after a resume.

The mechanism, read from traverseNext (packages/services/service-automation/src/dag-traversal.ts, unchanged) and measured below: within one traversal a node takes its conditioned out-edges one after another in declaration order (every one whose condition holds, except on a decision without mode: 'inclusive', which takes only the first), then its isDefault edges when no condition held, then its unconditional edges together; each is awaited before the next. A pause throws a suspend signal that unwinds the whole traversal, and a resumed run continues from the node that parked, never back at the node. So every edge the node would have taken after a branch that parks is never taken, and nothing reports it.

  • packages/spec/src/automation/flow-concurrent-pause.ts: sequentialPauseRefusals(flow, FLOW_PAUSE_CAPABLE_NODE_TYPES), beside concurrentPauseRefusals, sharing its graph reader (now pauseGraph, the node/edge views and the "any path" pause walk, factored out unchanged) and its pause-type population. Not exported from any entry point (api-surface unchanged).
    • Traversal passes mirror the fan-out rule's grouping over every non-fault out-edge: one pass for a node that does not pick a branch by label; per label for an approval / approval_revise and a decision that declares config.conditions, plus the whole set for such a decision whose no-match pick no edge claims.
    • On a decision that declares config.conditions, a run matching none of them picks default; the passes model what claims it, as traverseNext does: edges labelled default (a label pass already); else EVERY isDefault out-edge whatever its label, as one pass (added in patch round 1); else nothing, and then the whole set. A literal true condition makes the pick unreachable, and adds neither.
    • Within a pass, an edge X is awaited before: the later conditioned edges (not on a first-match decision) and every unconditional edge, when X is conditioned (an edge carrying both condition and isDefault is conditioned, as the engine buckets it); the later isDefault edges and every unconditional edge, when X is an isDefault edge. Conditioned and default edges never run in one pass together.
    • Refused: the first edge in that order whose branch reaches a pausing node along ANY path (the fan-out rule's reading) and that has edges after it. One refusal per pass, deduplicated across a label-picking node's passes, anchored at that edge (edges.N), naming the node, the pausing node(s) and every edge left untaken, with the prescription: make the branch that parks the last one the node takes (declared after its conditioned siblings, with no unconditional sibling beside it), or chain the steps onto one branch; where only one branch should run, route them through a decision (on an inclusive decision, delete mode: 'inclusive'; on a decision that already takes only the first true edge, mark the unconditional otherwise-branch isDefault: true and keep one isDefault edge per node). Conditions are judged as if they may all hold.
    • The module header gains a section for the sequential twin (mechanism, measured shapes, boundaries), and its former "Accepted — not every branch runs" list now points to it.
  • packages/spec/src/automation/flow.zod.ts: the call, after the fan-out rule.
  • packages/spec/src/migrations/entries/semantic/19.flow-sequential-branch-durable-pause-refused.ts: the ADR-0087 D3 semantic entry (structured TODO: whether the author meant every branch or one is not recorded). The changeset carries adr-0087: registered flow-sequential-branch-durable-pause-refused.
  • content/docs/automation/flows.mdx, under "Parallel approvals": the sentence that listed "conditioned edges out of one node" as still accepted is corrected, and a paragraph teaches what is refused (all four members), why, what to write instead, and what stays accepted. Under "Branching", the paragraph that said dropping isDefault runs the sibling "in parallel with abort" now says what happens: the sibling runs after the conditioned edges, and with abort a screen the run parks there, the sibling is never taken, and the schema refuses that spelling.
  • .changeset/38838-fanout-pause-refusal.md line 16: DELIBERATE CORRECTION of a pending release note (see Acceptance notes).
  • packages/plugins/plugin-approvals/src/flow-route.integration.test.ts: the approvals: a node fanning out to two approval steps opens two pending requests in one run, and the second has no suspension, so deciding it never moves the run #38838 conditional fan-out fixture now routes through a decision (its two edge conditions out of start are this card's refused shape); the reproduction is pinned refused at the metadata door, and the prescribed shape is pinned at run level (see Tests). Both publish-refusal describes (approvals: a node fanning out to two approval steps opens two pending requests in one run, and the second has no suspension, so deciding it never moves the run #38838's and this one) now boot ONE kernel in beforeAll(boot, 30_000) and shut it down in afterAll, instead of a cold kernel.bootstrap() inside each case (plugin-approvals flow-route test: the first #38838 case times out at 5 s on loaded CI shards (cold kernel boot) #38976: the first case timed out at vitest's 5 s default on loaded CI shards). The cases share it safely: each saves under its own flow name and reads back only that name, the refusals write nothing, and the one write per describe (the control's publish) is a row no other case reads.

Measured shapes (real AutomationEngine + real ApprovalService, better-sqlite3, on base 8338d07029 with the rule's population emptied, every condition true unless named)

Each run: execute, read pending requests, approve each pending request in turn, read the run's final status and its non-skipped steps. x1 is an assignment node unless it is a decision; s_sync an assignment to its own end.

# shape (out-edges of x1, in declaration order) measured verdict
a [true] → a_review, [true] → b_review (the card) one request (a_review); after its decision the run completes; b_review never ran refused
b [true] → a_review, [true] → s_sync the run completes after a_review; s_sync never ran refused
c [true] → s_sync, [true] → a_review (pause last) s_sync ran, then a_review parked; completes accepted
d the same as b on a decision with mode: 'inclusive' s_sync never ran refused
e the same as b on an exclusive decision (no mode) a_review only, by design (first match) accepted
f [false] → s_sync, isDefault → a_review default parks; nothing after it; s_sync skipped by its condition accepted
g [true] → a_review, unconditional → s_sync s_sync never ran refused
g2 unconditional → s_sync declared FIRST, [true] → a_review s_sync never ran (the unconditional bucket runs last) refused
h [false] → s_x, isDefault → a_review, unconditional → s_sync s_sync never ran refused
i [true] → s1 → a_review (two hops), [true] → s_sync s_sync never ran refused
k exclusive decision: [true] → a_review, unconditional → s_sync s_sync never ran refused
j [true] → subflow whose child parks on an approval, [true] → s_sync child request decided, run completes; s_sync never ran accepted by the parse (boundary: subflow / map are not judged by type); run-time only, carried by #38876

After the rule, the same harness: a, b, d, g, g2, h, i, k refused at registerFlow; c, e, f, j registered and ran as above.

Patch round 1, the label-routed decision's no-match pick (x1 a decision with config.conditions: [{ label: 'hi', expression: 'record.amount > 1000' }], an edge labelled hi to a synchronous step, record amount 100 so nothing matches; measured at head 6fcf88d, where the rule accepted every row, then again after the change):

# the isDefault edges of x1, in declaration order measured verdict
S1 label: 'x' → a_review, unlabelled → s_sync a_review parked, the run completed after its decision, s_sync never ran refused (was accepted)
S1b label: 'x' → a_review, label: 'y' → s_sync the same: s_sync never ran refused (was accepted)
S1c unlabelled → s_sync, label: 'x' → a_review (parking one last) s_sync ran, then a_review parked; completes accepted
S1d one isDefault edge, label: 'x' → a_review parks, completes accepted

Tests

  • packages/spec/src/automation/flow-concurrent-pause.test.ts (54 cases, 27 new, through FlowSchema.safeParse): new describe "a branch that parks the run, taken before its siblings, is refused" — the card shape with path edges.1, the lead sentence, the resume sentence and the prescription, and the fan-out sentence not fired; b; i; the first branch reaching each of screen / wait / approval; d with the mode: 'inclusive' prescription; mutually exclusive conditions refused; g and g2 (anchor moves with declaration order); k; h; three conditioned branches, one refusal at the first that parks. New describe of controls: c; e (no mode and mode: 'exclusive'); isDefault beside conditioned ones; a fault edge; an approval's guarded approve / reject edges each to a pause; the subflow boundary; the population is the caller's; malformed members skipped. Shape k also asserts the exclusive-decision prescription (mark the otherwise-branch isDefault: true; never "route them through a decision"). Patch round 1 adds: an isDefault edge that parks before a later isDefault edge of a plain node; an edge carrying both condition and isDefault taken with the conditioned ones; and a describe "a label-routed decision: its no-match pick is judged as the engine claims it" — S1 and S1b refused, S1c and S1d accepted, a decision with no fallback edge whose guarded a branch parks beside a b edge refused (only the whole-set pass meets them), one refusal when the same edge is first to park in its label pass and the whole set, and a control: branches under different labels with a claimed fallback parse. The approvals: a node fanning out to two approval steps opens two pending requests in one run, and the second has no suspension, so deciding it never moves the run #38838 controls "a conditional fan-out" and S17 (isDefault beside an unconditional sibling) now say that the fan-out rule stays silent on them and the sequential rule refuses them, pinned in the new describes.
  • packages/plugins/plugin-approvals/src/flow-route.integration.test.ts (29 cases, 5 new; real kernel, ObjectQL, metadata protocol, automation engine, approvals plugin): new top-level describe [#38875] a branch that parks the run, taken before a sibling, is refused at publish — active save → { code: 'INVALID_METADATA', status: 422 } naming the node, the parking branch and the untaken edge, no row; draft save → the same envelope, no row; registerFlow throws the same lead; CONTROL: the pause-last shape publishes. In the witness describe, a run-level CONTROL: the pause-last shape runs s_sync, parks at a_review, and its decision completes the run.
Test and ablation readings (head 6fcf88d)
  • Patch round 1 (head ff5ffa5 unless named): src/automation/flow-concurrent-pause.test.ts Tests 54 passed (54); @objectstack/spec local project (vitest run --project local, what pnpm test runs; at 3578d2a, the spec sources are unchanged since): Test Files 919 passed, Tests 29073 passed, 1 todo; @objectstack/plugin-approvals full (at 3578d2a): 142 files, 2265 passed, and flow-route.integration.test.ts at ff5ffa5 29 passed; spec and plugin-approvals typecheck exit 0.
  • Patch round 1 ablations, each through scripts/ablation-replace.mjs on flow-concurrent-pause.ts against the spec file (it imports src), landed and restored (blob == HEAD bb1506e770): the whole-set pass removed (passes.push(taken)) → 1 failed / 53 passed; a default edge not awaited before later default edges (defaults.slice(i + 1) dropped) → 3 failed / 51; the isDefault-claim pass emptied → 2 failed / 52; the dedupe across passes disabled → 1 failed / 53; a decision never read as a label picker → 10 failed / 44; an edge with both condition and isDefault left out of the conditioned bucket → 1 failed / 53.
  • Per-case timings of the two publish-refusal describes (verbose reporter, one run each, shared box): before, at 3578d2a (a kernel booted inside each case) — approvals: a node fanning out to two approval steps opens two pending requests in one run, and the second has no suspension, so deciding it never moves the run #38838: active save 967 ms, draft save 43 ms, registration 2 ms, control 161 ms; this card's: 39, 40, 1, 88 ms. After, at ff5ffa5 (one kernel per describe, booted in beforeAll) — approvals: a node fanning out to two approval steps opens two pending requests in one run, and the second has no suspension, so deciding it never moves the run #38838: 16, 6, 4, 119 ms; this card's: 6, 6, 1, 47 ms. The boot now runs in the hook, under its own 30 s budget, not in the first case's 5 s.
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/automation/flow-concurrent-pause.test.ts (head 6fcf88d): Tests 46 passed (46).
  • pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 (head 6fcf88d): Test Files 142 passed (142), Tests 2265 passed (2265).
  • pnpm --filter @objectstack/spec typecheck && pnpm --filter @objectstack/plugin-approvals typecheck: exit 0 (test layer: 8 files / 321 errors / 27 pinned signatures held in the ledger, unchanged).
  • Suites holding a pausing node beside an edge condition / isDefault (helper-built fixtures the literal scan cannot read), all green: service-automation 28 files, 698 tests; lint 11 files, 1646; metadata-protocol 5 files, 366; objectql 4 files, 51; spec 13 files incl. src/migrations, 1333; cli test/migrate-meta-engine-guidance.test.ts, 3.
  • At 6fcf88d the spec full run did not finish inside the 595 s cap (exit 124): that command ran the repo project too. Patch round 1 ran the local project, which is what pnpm test runs (above); test:repo is CI's.
  • Ablation via scripts/ablation-replace.mjs on flow-concurrent-pause.ts (the guard that skips an edge with nothing after it made to skip every edge), spec rebuilt, ablation-dist-preflight marker present in 2 built files: spec file 13 failed / 33 passed (every refusal and the boundary count red, every control green); integration file 3 failed / 26 passed (active save, draft save and registration red; both controls green). Restore: blob == HEAD befa0d8869, git diff HEAD empty, whole tree clean, rebuilt, preflight --absent exit 0 over 610 built files, both files green again (46/46, 29/29).

Acceptance notes

  • Corpus search. Every example stack's flows judged by the rule (examples/*/objectstack.config.ts; showcase through its flows index, its stack import needs an unbuilt connector): 38 flows, 12 with a pausing node, 0 refused. A literal scan (TypeScript AST) of every tracked TS/TSX/MTS/MD/MDX file under packages, examples, ui, content/docs, skills, docs and apps that mentions edges: 2342 nodes + edges literals, 2208 with both as arrays; 1 hit outside the positive control: packages/lint/src/lint-flow-patterns.test.ts:987 (guardFlow, an exclusive decision with a conditioned edge to a screen beside an unconditional sibling, shape k), a raw lint fixture built to draw flow-decision-unconditional-branch and judged by the linter only, never parsed through FlowSchema (the lint suite is green); not an authored flow, left untouched. Positive control: the scanner refuses the card's shape. Helper-built fixtures are covered by the suites listed under Tests.
  • Conditions are judged as if they may all hold. Two conditioned edges whose conditions exclude each other are refused when the earlier one reaches a pause (measured correct at run time when they do exclude), because the parse cannot evaluate them, the same reading the fan-out rule takes for its S13. The prescription names the decision that makes the choice explicit, and the pause-last ordering. Narrower alternative (refuse only literal true conditions) would leave shape a's silent drop possible for any real condition; raised for the contract review.
  • Wider than the card's two-conditioned-edges shape, by measurement. The card names two conditioned edges; the same unwind drops an unconditional sibling of a conditioned or isDefault branch that parks (g, g2, h, k measured), including on an exclusive decision. Those are refused too, since the route says to refuse exactly the shapes that lose and the invariant is that no branch whose condition holds is dropped (an unconditional edge always holds). This turns fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871's S17 reading (isDefault beside an unconditional sibling, "accepted: leaves no orphan request") into a refusal when the default branch parks; the fan-out rule's own S17 control still holds (it asserts that rule stays silent). Raised for the contract review.
  • Not reached by this parse (declared boundaries, met only at run time): a subflow / map whose child pauses on a branch taken before others (shape j, measured: the later sibling dropped), and a plugin-registered pausing type. A run-time refusal would live in dag-traversal.ts; it is not built here, and flows: a fan-out to an approval and a subflow whose child pauses loses the parent branch continuation (the subflow branch never resumes) #38876 (a subflow branch's pause loses the rest of the parent traversal) carries it.
  • DELIBERATE CORRECTION of a pending release note: .changeset/38838-fanout-pause-refusal.md (PR fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871, not yet released) listed "conditioned out-edges of one node, which run one after another" as still accepted, which this PR makes false. Corrected sentence: "Still accepted: one pausing branch beside branches that never pause, an approval after a parallel region, an approval's approve / reject edges each to its own step, and the branches of a decision that has a fallback edge, each to its own step. Conditioned out-edges of one node run one after another, so they never pause together; a branch among them that parks before another is refused by its sibling rule, flow-sequential-branch-durable-pause-refused." node scripts/check-empty-changeset.mjs --base origin/main is red on this file by design (exit 1); the seat's record confirms the correction.
  • Carried nits (not fixed): on a label-routed decision whose no-match pick is claimed, an unlabelled edge or one labelled with no declared condition label is never taken, yet forms its own pass and can be refused for a loss the pause does not cause (the linter already reports the edge as flow-decision-unconditional-branch); and a pausing edge already anchored by its label pass ends the whole-set pass without naming the edges only the no-match run leaves untaken.
  • Refused at save, not only at publish: the metadata door runs the flow schema on a draft save too (measured again here), so the route's "refuse at publish" lands earlier than publish.
  • Base is 8338d07029; origin/main is 18 commits ahead of the head at patch round 1. They touch packages/spec (a record-lock schema, a new step-19 semantic entry, regenerated snapshots) but none of this diff's paths or the engine traversal, so no merge was made.
  • Owed before landing: contract-tier review (published schema, narrowing); the dogfood battery on the final head (title carries !).
  • File surface: the claim's surface, plus .changeset/38838-fanout-pause-refusal.md (one line, added to the surface by the seat for patch round 1); dag-traversal.ts untouched.

Verification

Read first, by risk:

  1. packages/spec/src/automation/flow-concurrent-pause.ts: traversalPasses and awaitedBefore (which edges one traversal awaits before which), then sequentialPauseRefusals.
  2. packages/spec/src/automation/flow.zod.ts: the call after the fan-out rule.
  3. packages/plugins/plugin-approvals/src/flow-route.integration.test.ts: the new describe at the foot and the reworked conditionalFanOut fixture.

Two-minute check: pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/automation/flow-concurrent-pause.test.ts, expected Tests 54 passed (54).

Local gates (patch round 1, head ff5ffa5)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack re-derived the same 122 families at ff5ffa5; all 122 run there: 121 exit 0, and check-empty-changeset exit 1 on the DELIBERATE CORRECTION above (expected; the seat's record confirms it). check:dual-build-cjs-loads first read PREREQUISITE NOT MET (six packages unbuilt in the rebuilt worktree) and was re-run after building them. --ran: 122 derived, 122 run, 0 NOT-MEASURED, 0 UNRUN. pnpm --filter @objectstack/spec check:generated: all 14 generated artifacts up to date.

Local gates (head 6fcf88d)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 122 families for this diff; all 122 run, every one exit 0. Eight first runs read PREREQUISITE NOT MET (exit 3: five spec gates on a dist older than the last source edit, check:skill-examples on an unbuilt client SDK, check:i18n on an unbuilt CLI, check:dual-build-cjs-loads on unbuilt packages); two timed out at a 300 s per-gate budget (check-comment-mask-corpus, check:query-options-erasure) and check:type-check-debt was cut off by the batch budget; the CLI vitest family ran separately under the verify lock. Each was re-run after building its prerequisite (spec; the client-react closure; the CLI closure) or with a longer budget, and the recorded exit is that re-run's. --ran reconciliation: 122 derived, 122 run, 0 NOT-MEASURED, 0 UNRUN. pnpm --filter @objectstack/spec check:generated: all 14 generated artifacts up to date (no generated file changes). Repository-wide scans (pnpm lint and the rest of the CI farm) are CI's.


Generated by Claude Code

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 11 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/flows.mdx (via FlowSchema (symbol, a top-level const))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via FlowSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-4.mdx (via FlowSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-7.mdx (via FlowSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-1.mdx (via FlowSchema (symbol, a top-level const))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 254 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 182 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 776dddf570443c8760c263fe569302a793f802b4 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from fded2365c77f0b8859493d81e934803a580b5fd8 — the merge of head ff5ffa51adb35b4337c47017dfa0e34cb868abf5 into base 776dddf570443c8760c263fe569302a793f802b4, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin fded2365c77f0b8859493d81e934803a580b5fd8 && git checkout fded2365c77f0b8859493d81e934803a580b5fd8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 776dddf570443c8760c263fe569302a793f802b4 ff5ffa51adb35b4337c47017dfa0e34cb868abf5 && git checkout -B drift-repro 776dddf570443c8760c263fe569302a793f802b4 && git merge --no-ff ff5ffa51adb35b4337c47017dfa0e34cb868abf5

node scripts/docs-audit/affected-docs.mjs --json 776dddf570443c8760c263fe569302a793f802b4

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 776dddf570443c8760c263fe569302a793f802b4 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6fcf88d894a8eaa05f4fc1a8b280662cb480b509
Local-runs: probe — the brief asks for the 13 shapes checked against the engine, a corpus re-measure with a positive control and the ablation, and the rule's exactness could not be settled by reading; nothing was checked out, built or written (inline scripts from the sibling worktree objectstack-issue-38578, tree e7992991b8, sources read with git show 6fcf88d894:PATH and compiled in memory; that tree's traverseNext body hashes equal to the head's, sha256 47893ec7…, and its logic-nodes.ts has an empty diff against the head). Runs and exits: (0) record-recognisers.mjs --template exit 0, --template --paths=CSV exit 1 on my own usage, --template --paths P… exit 0; (1) the head's rule on a 33-shape battery, exit 0; (2) real AutomationEngine, built-in decision and a generic pausing executor, 31 runs with every pause resumed: exit 1 on my own script (package resolution from the repo root), rerun from the package directory exit 0; (3) differential fuzz of the rule against the head's traverseNext body driven by a model executeNode: exit 0 with a node-set metric I discarded, rerun on visit counts exit 0; (4) literal corpus scan of 1258 files: exit 0 with JSON fences unread, rerun exit 0; (5) the five example stacks imported and every flow judged, exit 0 each; (6) every docs and skills snippet with a guarded edge beside a sibling listed, exit 0; (7) the head's 46 spec cases run in memory under 16 mutants and against the base module, exit 0; (8) real-engine controls for the default-claim corners, exit 0; (9) real engine on the subflow boundary shape, exit 0; (10) the fan-out rule of base and head compared on 20,000 random graphs, exit 0; (11) rule readings and message checks for the corners, exit 0; (12) this record read through contractReviewRecordReading: exit 0, then exit 1 on my own shell quoting while correcting two lines the reader could not attribute, then exit 0.
Scope: packages/spec/src/automation/flow-concurrent-pause.ts, packages/spec/src/automation/flow.zod.ts, packages/spec/src/migrations/entries/semantic/19.flow-sequential-branch-durable-pause-refused.ts + packages/spec/src/automation/flow-concurrent-pause.test.ts, packages/plugins/plugin-approvals/src/flow-route.integration.test.ts (in the diff); read, not reviewed: packages/services/service-automation/src/dag-traversal.ts, packages/services/service-automation/src/run-resume.ts, packages/services/service-automation/src/builtin/logic-nodes.ts, packages/lint/src/lint-flow-patterns.ts, packages/lint/src/lint-flow-patterns.test.ts, packages/spec/src/migrations/entries/semantic/19.flow-concurrent-branch-durable-pause-refused.ts, content/docs/automation/flows.mdx, .changeset/38875-conditioned-edge-pause-drop.md, .changeset/38838-fanout-pause-refusal.md, skills/objectstack-automation/references/state-machines-and-approvals.md, skills/objectstack-automation/evals/flows-triggers-approvals.json

Full review of the head. Base 8338d07029; origin/main is at d38006b9b3 and has moved under none of the diff's paths, packages/spec/src/automation, the semantic entries or the two engine files. dag-traversal.ts is untouched by the diff (stat empty under packages/services).

① Derived judgments

Read against traverseNext (dag-traversal.ts 666-854 at the head), the suspend throw in executeNode (641-644), the resume continuation (run-resume.ts 2060-2064: traverseNext on the parked node, then the run is over) and the decision executor (logic-nodes.ts 60-90).

What holds:

  • The order the rule mirrors is the engine's. Fault edges are dropped, a picked label narrows the set, then three buckets: conditioned edges awaited one by one in declaration order (only the first true one when node.type === 'decision' without mode: 'inclusive'), isDefault edges awaited one by one when no condition held, the rest under Promise.all. awaitedBefore states exactly that: a conditioned edge before the later conditioned ones (none on a first-match decision) and every unconditional edge; a default edge before the later default edges and every unconditional edge; conditioned and default never in one pass. A resumed run never returns to the node, so whatever stood after a branch that parked is not taken.
  • The dev's table, measured again (probe 2, real engine, every pause resumed). Lost, and refused by the rule (probe 1): a, b, d, g, g2, h, i, k. Each ran x1 and the pausing node only, completed after the one resume, and the later sibling never ran. Kept, and accepted: c (s_sync ran, then the pause), e (first match only), f (the default parks with nothing after it; with a true condition the default is skipped), the fault edge (not taken on success). j, the subflow boundary: the child parked, the parent parked at sub, and after the child's resume the parent completed with s_sync never run (probe 9); the rule accepts it, as declared. My pausing node was a generic supportsPause executor, not the approval service, so "one request opened" is the dev's reading; which nodes ran and how the run ended are mine.
  • The widening beyond the card is right, and it is declared. g, g2, h and k are the same unwind: the conditioned loop and the default loop are both awaited before the unconditional bucket starts, so a conditioned or isDefault branch that parks leaves every unconditional sibling untaken, on an exclusive decision too. Controls (probe 2): with the guard false the unconditional sibling runs; with the default branch synchronous and the unconditional one pausing, both run. The fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871 S17 fixture itself (isDefault to a pause beside one unconditional edge) loses the sibling when measured (h2) and is now refused at edges.2. That flips the earlier "accepted: leaves no orphan request" reading for the case where the default branch parks, which is consistent with it: no request is orphaned, a branch is lost, and this card's invariant is the lost branch. Declared in the module header (the "Not this rule's" list now hands both members to the sequential rule), the PR body's acceptance notes, the changeset's "What is refused" and the entry's surface.
  • "Pause last", an exclusive decision alone, a default beside conditioned edges and a fault edge are safe. Measured as above, and the fuzz agrees: probe 3 ran the head's own traverseNext body over 4,669 random reachable graphs (plain nodes, exclusive, inclusive and label-routed decisions, approvals, screens; every assignment of condition truths, label picks and approval outcomes), comparing each run against one in which a pause continues in place. 1,122 graphs lose a node visit and are refused; 2,926 lose none and are accepted.
  • The any-path reading refuses no shape that runs correctly, beyond its declared cost. Reconvergence after the branches (both conditioned branches flowing into one approval) is refused and really loses the second branch (probe 2: s_sync never ran). Chains, an approval's guarded approve / reject edges, the revise back-edge and a pause-last node upstream of a revise loop are accepted (probe 1). The declared cost is conditions that exclude each other: probe 2 confirms such a pair routes one branch per record and runs correctly, and it is refused. I judge that reading right, as it was for fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871's S13: the parse cannot evaluate a condition, the narrower alternative the dev raises (literal true only) would leave the card's silent drop authorable for every real condition, the refusal is loud, and the rewrite keeps behaviour exactly when the conditions do exclude each other (an exclusive decision, probe 2). Unlike the earlier literal-true case there is no member of this class the parse can read without evaluating.
  • The fan-out rule is unchanged by the refactor. Probe 10: base and head concurrentPauseRefusals return identical output on 20,000 random graphs, 5,927 of them refused.

What does not hold:

  • S1 (should-fix). The no-match pick of a label-routed decision is not modelled when isDefault edges claim it, and one losing shape is accepted. When the decision executor returns default and no edge is labelled default, traverseNext claims every isDefault out-edge, whatever label each carries, and awaits them one by one. traversalPasses groups by label only, so two isDefault edges with different labels (one labelled, one not; or the two branch edges of labels a and b both marked) are never in one pass. Probe 8, real engine, no condition matching: the first isDefault branch parked, the run completed after its resume, and the second never ran; with the first branch synchronous both ran. Probe 11: the rule returns 0 refusals for both spellings. Probe 3 found the same class and no other: all 8 graphs where the rule is silent and a run loses a visit are this shape.
    • Why this grade and no higher: the shape needs two default edges on one node, which flows.mdx already calls invalid ("at most one per node") and os validate reports as flow-multiple-default-edges (advisory, not gating), and no prescription of this PR or of fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871 leads to it. It is still a branch dropped with no error in a shape the parse can read, and the rule already refuses the same pair on a plain node (probe 1, two defaults).
    • Closes with: on a decision that declares config.conditions and has no non-fault out-edge labelled default, one more pass holding every isDefault out-edge (the engine's own claim), with a refusal pin and a control.

Named, not findings against this diff:

② Semver level

  • Metadata-protocol: narrowed takes at least minor on a package the diff moves; the changeset is '@objectstack/spec': minor. The plugin-approvals change is a test file and publishes nothing. Correct.
  • Clause-②: no (narrowing) is breaking by definition, so the ! in the title and in the changeset's first line is right. Both declaration lines are line-initial in the PR body and in the changeset; the claim 7312510992 carries the same pair.
  • The changeset carries the FROM / TO mapping and the one-line fix, and exactly one disposition marker, adr-0087: registered flow-sequential-branch-durable-pause-refused, whose id equals the entry's id and the file name's slug under step 19 (spec is at 19.0.0-next.3).
  • The entry is in the form of its sibling 19.flow-concurrent-branch-durable-pause-refused: the four prose fields, a D3 structured TODO with the reason no D2 conversion exists, acceptance criteria quoting the refusal's lead, no conversionIds. It names the sibling entry and the same ruling. The registry is generated from the directory, so the file is the registration, as it was for fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871.
  • No exported symbol is added: flow.zod.ts is the module's only importer, so the api-surface claim stands.

③ Boundary flags

  • Loud, with the envelope. The integration describe asserts toMatchObject({ code: 'INVALID_METADATA', status: 422 }) on the active save and on the draft save, the lead sentence, the named pausing node, and that no row was written; registerFlow is asserted to throw the same lead. Read, not re-run: the three cases are red on the base by construction (the save and the registration succeed there; probe 2 registered and ran every refused shape on a tree without the rule), and the two controls do not depend on the rule.
  • Refused at draft save: consistent. The call sits in the same FlowSchema.superRefine as the region rule and the fan-out rule, directly after the latter, so every door that parses a flow refuses it, a draft included, as fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871 does.
  • The prescription is usable; each rewrite was checked through the rule and on the engine. Pause last (c): accepted, s_sync runs before the pause. Chain, either order: accepted, both steps run across the resume. A decision in front: accepted, one branch taken. mode: 'inclusive' deleted: accepted, first match only. Two pausing branches chained: both run over two resumes. An unconditional pausing branch beside an unconditional synchronous one is accepted and both run, so "no unconditional sibling beside it" is about the conditioned or default spelling only. One clause misses for one shape, see N2.
  • Corpus, re-measured with the head's rule. Probe 5, by import: 38 flows across the five example stacks, 12 with a pausing node, 0 refused (the dev's numbers), positive control 1 refusal in each run. The stacks were imported from tree e7992991b8; no example flow file differs between it and the head. Probe 4, literal scan at the head (controls: the card shape as TypeScript, as a JSON fence and as a fenced defineFlow each 1 hit; pause-last 0): docs 7 files / 26 literals / 0 refused; skills 3 / 6 / 0; example sources 7 / 54 / 0; package, app and ui sources 50 / 104 (39 with both arrays) / 0; tests and fixtures 773 / 2,261 / 5 literals refused. Of the five, two are sequential: packages/lint/src/lint-flow-patterns.test.ts:987 (the dev's guardFlow) and this PR's own malformed-member case; three are the fan-out rule's and predate this PR. The shipped DocuSign connector flows carry unresolved members in my scan; read by hand they hold no pausing node. My scanner counts differ from the dev's 2,342 / 2,208 because it is a different scanner; the hit list is the same. No shipped flow, example, template or doc is refused.
  • guardFlow (lint-flow-patterns.test.ts:987): harmless, nothing to fix in this PR. It is a raw lint input, never parsed through FlowSchema; it is shape k (an exclusive decision, a guarded edge to a screen beside an unconditional sibling). The linter's advisory finding and its hint stay right, and the hint's fix (isDefault: true on the sibling) is accepted by the new rule and routes one branch (probes 2 and 11). What the measurement does contradict is older text outside the diff, see the observation at the end of this section.
  • flows.mdx edits: accurate. The corrected "Still accepted" sentence no longer lists conditioned edges out of one node. The new paragraph's order of edges, the two refused bullets, the three rewrites, "two branches that each park the run cannot both be taken from one node in any order: chain them" (true: shape a is refused in either order and the chain runs both) and the accepted list each match the rule and the engine. Two prose items elsewhere, N6 and N7.
  • Skills-docs: none holds. Probe 6 lists every node in a docs or skills snippet that has a guarded edge and a sibling: six, each a decision (exclusive, or label-routed with an isDefault fallback), plus the docs' inclusive example whose branches are synchronous notifications. The skill's worked approval flow (needs_director, a decision) and the onboarding-wizard eval (a decision whose out-edges carry exclusive conditions to screens) stay accepted. No skill teaches conditioned out-edges of a non-decision node, or an inclusive decision, ahead of a pausing step.
  • The run-time half is not built, and the PR says so. "Not reached by this parse" in the PR body, the changeset's "Not judged", the entry and the module header each state that a subflow / map whose child pauses drops the later edges at run time and is not judged; the dev report names flows: a fan-out to an approval and a subflow whose child pauses loses the parent branch continuation (the subflow branch never resumes) #38876 as the carrier. The PR body does not carry the number (N8).
  • Dev flags. The Clause-② arm: no (narrowing) is right. The widening and the S17 flip: right, see ①. The narrower alternative: not taken, see ①. The in-place measurement edit and the background build are process notes with no bearing on the head (the tree at the head is what I read). No merge of origin/main: nothing it moved is under this diff.
  • Check-runs on this head when read (15:59Z): 58 completed green, 16 skipped, 6 still running (Test Core 1/12 and 5/12, the Test UI aggregate, Type Check workspace, two dogfood shards), none red. The PR is a draft with no auto-merge armed. PR author is objectstack-fleet[bot]. The diff reads and writes no data, so the SQL push-down check has nothing to read.
  • Observation for the seat, outside this diff. Three older texts say a guarded decision's unconditional sibling runs "on every pass, in parallel" with the guarded branch: the flow-decision-unconditional-branch message and its test comment ("the abort screen AND the wizard behind it"), and flows.mdx 2128-2131. Measured (k), when the guarded branch parks the sibling does not run at all, and conditioned edges are awaited before the unconditional bucket in any case. The skill sentence "the engine evaluates each out-edge's condition and follows every match" (state-machines-and-approvals.md 79-81) is likewise stale for an exclusive decision. None is this PR's doing; the flows.mdx one is N7 because the PR now refuses the shape that sentence walks the reader into.

④ Design judgment

  • flow-concurrent-pause.ts. The twin belongs beside the fan-out rule and reuses it rather than copying it: pauseGraph is the fan-out rule's own node and edge views, out-edge index and pause walk lifted out (probe 10 shows that rule's output unchanged), the population stays the caller's parameter with one constant at the one call site, and picksBranchByLabel, decisionDefaultUnclaimed and named are shared. traversalPasses repeats concurrentGroups' label loop over a different edge set; small, and the docblock says which reading it follows. Against the route ([P2] engine ADR: durable pause inside structured regions (unlock topology-level parallel approvals / waits / subflows) #3267 「禁」 and fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871) it makes the spec's own limit real at authoring and takes no working capability away: every refused shape either loses a branch in some run or belongs to the declared "conditions may all hold" class, and the engine is not touched. Against its bar, the card's invariant, it falls short at S1. The defensive member reads and the edges.N anchor are sound.
  • flow.zod.ts. Eleven lines: the import and the call, in the fan-out rule's loop shape, with the same constant. Holds.
  • The ADR-0087 entry. Correct in form (②); surface, replacement and reason follow the rule and the measurements. Its enumerated shape list omits two members, N5.
  • flow-concurrent-pause.test.ts. The pins assert substance, through the real parse: path, the lead sentence, the resume sentence, both prescriptions. Probe 7 ran the head's 46 cases in memory (the harness replaces FlowSchema with a shim raising exactly the two rules' issues, so a control there reads "neither rule refuses it"): 46 green at the head; 13 red / 33 green under the dev's ablation and again against the base module, the 13 being every refusal case plus the boundary count, which reproduces the dev's reading. Mutants that each red a committed case: an exclusive decision exempted, default edges not judged, unconditional siblings not counted, every decision read as inclusive, every node read as first-match, fault edges kept in the pass, label-picking nodes judged as one pass, the pause walk cut to the direct target, a default edge not awaited before unconditional ones, later conditioned siblings not counted, declaration order ignored.
    • S2 (should-fix). Two parts of the stated contract have no pin that fails when they are removed (probe 7, 0 red each): the whole-set pass for a decision whose no-match pick no edge claims (the passes.push(taken) line; the PR body and the docblock both state it), and "an isDefault edge before the later default edges" (defaults.slice(i + 1)). Probe 1 has the shapes that would catch them: a label-routed decision without a fallback whose a branch is guarded and pauses beside a b edge, and two default edges on a plain node, the first pausing. S1's fix brings a third.
    • Unpinned as well, lesser: the dedupe across passes (N3), a label-routed decision as the label-picking source (only an approval is), and an edge carrying both condition and isDefault landing in the conditioned bucket.
  • flow-route.integration.test.ts. Reworking conditionalFanOut through a decision is correct: its two exclusive edge conditions out of start are now the refused class, and the approvals: a node fanning out to two approval steps opens two pending requests in one run, and the second has no suspension, so deciding it never moves the run #38838 control keeps its meaning (one branch taken, publishes). The new describe pins the refusal at the metadata door on a real kernel with a publish control, and the witness describe gains a run-level control for the prescribed shape whose decision completes the run.

Findings:

  • must-fix: none.
  • open on this head: S1 (the isDefault claim of the no-match pick) and S2 (two unpinned clauses), each graded where it is stated above.

Nits (none moves the head by itself; N6 to N8 are prose faces):

  • N1: on a label-routed decision whose no-match pick is claimed, an unlabelled edge, or one labelled with no declared condition label, is never taken, yet such edges form passes of their own and can be refused. Probe 8: with an isDefault fallback parking beside an unlabelled sibling, the sibling does not run whether the fallback parks or not; the rule refuses and names a loss the pause does not cause. All 9 fuzz graphs refused without a lossy run are this class. The fan-out rule groups the same way, and the linter already reports the edge (flow-decision-unconditional-branch, advisory). S1's remodel of the passes can absorb it.
  • N2: for shape k the node is already an exclusive decision, and the message still says "route them through a decision". The working rewrite there is the first clause, or isDefault: true on the sibling when it is the otherwise-branch (accepted, one branch runs); naming it would help.
  • N3: a pausing edge already anchored by its label pass ends the whole-set pass with no second refusal, so the edges only the no-match run leaves untaken are not named (probe 11: the label-b edge is absent from the message). Unpinned.
  • N4: the fan-out file's describe "controls: shapes that park at one place are accepted" still holds the S17 fixture, which the twin now refuses at edges.2; the neighbouring conditional fan-out control got a comment saying so, this one did not.
  • N5: the "what is refused" lists in the changeset, flows.mdx and the entry's surface omit two members the rule refuses: an isDefault edge that parks before a later isDefault edge, and the whole-set pass of a label-routed decision without a fallback.
  • N6: .changeset/38838-fanout-pause-refusal.md line 16 still lists "conditioned out-edges of one node, which run one after another" as accepted. Both changesets are pending, so one release's notes would say both; flows.mdx carried the same sentence and this PR corrected it there.
  • N7: flows.mdx 2128-2131 (not in the diff; the page is on the docs-drift list for this PR) tells the reader that dropping isDefault makes the sibling run in parallel with the abort screen. With abort a screen that flow is now refused at the parse, and before this PR the sibling never ran (k).
  • N8: the PR body says the run-time half is reported and not built, without naming flows: a fan-out to an approval and a subflow whose child pauses loses the parent branch continuation (the subflow branch never resumes) #38876.

Implemented-by: claude/issue-38875-conditioned-edge-pause-drop
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: PASS

…e claims it; pin every pass clause (#38875)

Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
Co-authored-by: Claude <noreply@anthropic.com>
…, and correct the fan-out note and the isDefault paragraph (#38875)

Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: ff5ffa51adb35b4337c47017dfa0e34cb868abf5
Local-runs: probe — the delta order asks for the round-1 shapes re-run on the real engine, the differential fuzz re-run against the new rule and the ablations reproduced, and none of the three can be settled by reading; nothing was checked out or built, and nothing but this record remains on disk: three API responses were saved to a scratch directory while reading and removed again (inline scripts on stdin from the sibling worktree objectstack-issue-38578, tree e7992991b8; sources read with git show SHA:PATH and compiled in memory; that tree's traverseNext body hashes equal to the head's and to the round-1 head's, sha256 47893ec7…, its logic-nodes.ts and its lint-flow-patterns.ts have an empty diff against the head, and its flow.zod.ts differs from the head's by the two rule calls only). Runs and exits: (0) record-recognisers.mjs --template exit 0, --template --paths with the delta's paths exit 0, again with the PR's eight paths exit 0; (1) real AutomationEngine, built-in decision, a generic pausing executor, 16 shapes with every pause resumed, each also read through the rule at 6fcf88d894 and at the head: exit 0; four more shapes for the two guards and the declared-default corner: exit 0; (2) lintFlowPatterns on two of those shapes: exit 0; (3) differential fuzz, first cut, 6,000 graphs: exit 0, its over-refusal classifier looked at the refusing node only and was discarded; (4) the same with never-taken edges pruned, 15,000 graphs: exit 0; (5) the same over five seeds of 20,000 graphs and one 20,000-graph run with fault edges: exit 0 each; (6) the head's 54 spec cases run in memory under 11 mutants, against the round-1 rule module and unmutated: exit 0; (7) rule readings, prescription arms, two guard mutants, and the fan-out rule of 6fcf88d894 and the head compared on 20,000 random graphs: exit 0; (8) five never-taken-edge shapes through the head rule: exit 0; (9) every member of the corrected release note through both head rules, 14 shapes: exit 0; (10) this record read through contractReviewRecordReading: exit 0 with one findings line read as open, reworded, exit 0 with none open.
Scope: packages/spec/src/automation/flow-concurrent-pause.ts, packages/spec/src/automation/flow.zod.ts, packages/spec/src/migrations/entries/semantic/19.flow-sequential-branch-durable-pause-refused.ts + packages/spec/src/automation/flow-concurrent-pause.test.ts, packages/plugins/plugin-approvals/src/flow-route.integration.test.ts (in the diff); read, not reviewed: packages/services/service-automation/src/dag-traversal.ts, packages/services/service-automation/src/run-resume.ts, packages/services/service-automation/src/builtin/logic-nodes.ts, packages/lint/src/lint-flow-patterns.ts, packages/lint/src/lint-flow-patterns.test.ts, content/docs/automation/flows.mdx, .changeset/38875-conditioned-edge-pause-drop.md, .changeset/38838-fanout-pause-refusal.md, skills/objectstack-automation/references/state-machines-and-approvals.md

Delta review of 6fcf88d894..ff5ffa51ad (three commits, no merge) against my record 7317003405, which left S1 and S2 open. Merge base 8338d07029; flow.zod.ts and everything under packages/services and packages/lint are untouched by the delta. Card #38976 is folded in (Fixes #38976). PR author is objectstack-fleet[bot].

① Derived judgments

Read against traverseNext (dag-traversal.ts 666-854 at the head: the claim of a picked label at 683-692, then the three buckets), the decision executor (logic-nodes.ts: the first matching condition's label, else default) and the resume continuation (run-resume.ts 2060-2064).

  • S1 is closed, exactly. The delta adds one pass in traversalPasses: on a decision that declares config.conditions, has no literal-true condition and no non-fault out-edge labelled default, every isDefault out-edge whatever its label. That is the engine's own fallback claim (line 688: when no out-edge carries the default label, every out-edge with isDefault is claimed), and awaitedBefore then orders the pass as the engine buckets it.
    • Real engine (probe 1), no condition matching, every pause resumed. Lost: two isDefault edges, labelled x to the pause and unlabelled to a step; labelled x and y; the two branch edges of labels a and b both marked. Each ran the pausing node and what follows it, completed after the one resume, and the second default branch never ran. The rule at 6fcf88d894 is silent on all three; the head refuses each, at the parking edge, naming the dropped one.
    • Accepted, and safe when measured: S1c (the step's default edge declared first, the parking one last: the step ran, then the pause, then completion) and S1d (one isDefault edge to the pause: parks, completes; with the condition matching only the hi branch runs). Controls: the first default synchronous, both run; a claimed edge carrying a true condition beside a plain default runs alone, as the engine's condition bucket has it, and is accepted; beside an edge labelled default the two isDefault edges are not claimed at all (only the labelled edge's step ran), and the pair is accepted; with a literal-true condition the pick is never made (only the hi branch ran), and the pair is accepted. A fault-typed edge labelled default does not claim (the pausing default parked and the second was lost), and the rule refuses that pair.
  • The differential fuzz (probes 4 and 5). The head's own traverseNext body, driven by a model executeNode, over random reachable graphs of plain nodes, exclusive, inclusive and label-routed decisions (literal true and a declared default label included), approvals, screens and waits; every assignment of condition truths, decision matches and approval outcomes; a run counts as lossy when a node is visited fewer times than in the run where a pause continues in place. Graphs the metadata door refuses by the module's declared boundary (an approval without approve and reject edges, a declared condition label no edge carries) are left out. Five seeds, 100,000 graphs:
    • lossy and refused by the sequential rule 67,441; lossy and refused by the fan-out rule alone 2,236; lossy and accepted by both: 0 (with the round-1 sequential rule in its place, 168 lossy graphs are accepted);
    • no loss and accepted 24,051; no loss, refused by the fan-out rule alone 5,407 (an orphaned request is not a lost visit); no loss, refused by the sequential rule 865;
    • head against round 1: 191 graphs newly refused, 188 of them lossy, none newly accepted.
    • The 865, and the 3 newly refused without a loss, all dissolve when edges no run can take are pruned: none is left over. The 3 are the carried N1 class one step removed: the refusing decision sits behind an edge of a label-routed decision that no pick selects (unlabelled, or under an undeclared label), so the node never runs. With fault edges generated (20,000 graphs, the model never fails a node): 0 lossy accepted; 1 newly refused without a loss, whose pause is reachable through a fault edge only, which the any-path reading rightly counts.
  • The fan-out rule is not moved by the delta (probe 7): concurrentPauseRefusals of 6fcf88d894 and of the head return identical output on 20,000 random graphs, 12,656 of them refused.
  • Named, graded N9 below: one corner of the new pass. The literal-true guard reads "the no-match pick is unreachable". A declared condition that is itself labelled default, placed before the literal true, still picks default; with two isDefault edges and no edge labelled default the engine claims both, the first parks and the second is lost (probe 1), and the head rule is silent. The metadata door refuses that flow on other grounds: flow-branch-label-unmatched, gating, because no edge carries the declared label (probe 2). The same guard sits in decisionDefaultUnclaimed since fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871, and the corner shows there as well: with no claimant at all the engine takes every out-edge, a guarded branch parked and its sibling was lost (probe 1).

② Semver level

Unchanged by the delta and still correct: '@objectstack/spec': minor with ! and the line-initial Clause-②: no (narrowing) / Metadata-protocol: narrowed pair in the PR body and the changeset; one disposition marker, adr-0087: registered flow-sequential-branch-durable-pause-refused, equal to the entry's id. The newly refused shapes are members of the same narrowing and are now named in the changeset's "What is refused" and the entry's surface. The edit to .changeset/38838-fanout-pause-refusal.md changes one prose line and leaves its bump (minor) and its marker alone. No exported symbol is added. The plugin-approvals change is a test file.

③ Boundary flags

  • DELIBERATE CORRECTION of .changeset/38838-fanout-pause-refusal.md, line 16, judged sentence by sentence. The file is the pending release note of PR fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871 (merged 2026-12-01T12:23Z); on origin/main it is byte-identical to the merge base, and this PR changes that one line and nothing else in it.
    • On the merge base the line's first sentence read: "Still accepted: one pausing branch beside branches that never pause, an approval after a parallel region, an approval's approve / reject edges each to its own step, the branches of a decision that has a fallback edge, each to its own step, and conditioned out-edges of one node, which run one after another." This PR makes its last member false: the first of two conditioned out-edges that parks is refused.
    • On this head, sentence one: "Still accepted: one pausing branch beside branches that never pause, an approval after a parallel region, an approval's approve / reject edges each to its own step, and the branches of a decision that has a fallback edge, each to its own step." True of the code that ships. Probe 9, both head rules: an unconditional pausing branch beside unconditional steps, an approval's approve / reject edges each to a pausing step, and a decision's branches each to a pausing step with a fallback (an isDefault edge, a default-labelled edge, one existing branch edge marked isDefault, and an edge-branched decision with an isDefault fallback) are accepted by both. The first member holds in the note's own frame, set by its line 10 (out-edges with no condition, not isDefault); see N12 for the reading outside it.
    • Sentence two: "Conditioned out-edges of one node run one after another, so they never pause together; a branch among them that parks before another is refused by its sibling rule, flow-sequential-branch-durable-pause-refused." True. They are awaited one by one, so two pauses never open at once; the parking one first is refused by the sequential rule with the fan-out rule silent, and the parking one last is accepted (probe 9). The id is the entry's.
    • Sentence three, "Not judged: …", is unchanged and still true.
    • Nothing else in that note is made false. Lines 10, 12, 14 and 18 read against both rules: the three prescribed rewrites (the pausing steps chained; a decision in front with its fallback marked isDefault: true; "marking one existing branch edge isDefault: true is enough") are each accepted by both rules; the no-fallback decision is still refused by the fan-out rule, and its literal-true exemption still holds.
    • The PR body declares the correction, names the note and quotes the corrected text, which matches the file. Check Changeset is red on this head on exactly this file with the DELIBERATE CORRECTION signature (job 142861484809), as designed. This record confirms the correction of .changeset/38838-fanout-pause-refusal.md.
  • plugin-approvals flow-route test: the first #38838 case times out at 5 s on loaded CI shards (cold kernel boot) #38976. Each of the two publish-refusal describes now boots one kernel in a beforeAll hook with a 30 s budget and shuts it down in afterAll; no case calls boot() any more. Read case by case: every case saves under a name of its own (fan_out_active, fan_out_draft, fan_out_conditional; branches_active, branches_draft, branches_last) and reads sys_metadata filtered by that name; the two refusals per describe assert that nothing was written under their name; the control's row is read by the control alone; the registration case builds its own AutomationEngine and touches neither kernel. The assertions are unchanged, and no case depends on another's order. afterAll is reached on failure: vitest 4.1.12 runs it in a finally around the suite ("afterAll runs even if beforeAll or suite children fail", @vitest/runner runSuite), and the hook guards a half-built kernel with kernel?.shutdown() inside a try. The fix is the card's first ask, and its premise is met: no case pays a kernel boot inside the 5 s default. Test Core (11/12) is green on this head; the card's own re-check (three consecutive green runs) is the seat's to read.
  • N2, N4, N5, N7, N8: closed. On an exclusive decision the message's third arm now reads "where a sibling is the otherwise-branch, mark it isDefault: true … keep one isDefault edge per node" and no longer "route them through a decision" (probe 7: shape k draws that arm, and its rewrite is accepted; an inclusive decision still draws the mode arm, a plain node the decision arm). The S17 fixture carries its comment. The changeset, flows.mdx and the entry's surface list the four refused members, and the entry's replacement carries the exclusive-decision rewrite. The flows.mdx isDefault paragraph now says what the engine does (the sibling is taken after the conditioned edges; with abort a screen the run parks, e_no is never taken and the schema refuses the spelling), which is shape k as measured. The PR body names flows: a fan-out to an approval and a subflow whose child pauses loses the parent branch continuation (the subflow branch never resumes) #38876 as the carrier of the run-time half.
  • Carried, as the PR body states: N1 and N3. The body's sentence for N1 names the label-routed decision whose no-match pick is claimed; the fuzz shows the same reading on two neighbours, restated under N1 below.
  • Dev flags. No merge of origin/main: right, the 18 commits move none of this diff's paths nor the traversal. The dev re-added the worktree and ran six single-file ablations outside the verify lock: process notes with no bearing on the head. The dev's "CI not read": read here at 18:06Z, 66 green, 14 skipped, 4 red, none running; the red are three Check Changeset runs (the correction above) and one PR-body guards run from 17:51Z that failed because card plugin-approvals flow-route test: the first #38838 case times out at 5 s on loaded CI shards (cold kernel boot) #38976 carried no claim naming this branch; the claim was posted at 17:53Z (7320000712) and the 17:54Z run of the same guard is green. The PR is a draft with no auto-merge armed and still carries needs:dogfood-battery.
  • The diff reads and writes no data, so the SQL push-down check has nothing to read.
  • For the seat, a filing input, not a finding on this PR. Both texts the dev names still stand at the head (and on origin/main): skills/objectstack-automation/references/state-machines-and-approvals.md 79-81 says the engine "follows every match — and an out-edge with NO condition ALWAYS runs (all such edges execute in PARALLEL)", and the flow-decision-unconditional-branch message (lint-flow-patterns.ts 1515-1516) says an unconditional out-edge "is traversed on EVERY pass, in parallel with whichever guarded branch matched". Measured (round-1 shape k, and the head's own flows.mdx paragraph now says so): an exclusive decision follows the first match only, the unconditional sibling is taken after the conditioned edges and not beside them, and when the guarded branch parks it is never taken. The rule's docblock (line 1216) and a test comment (lint-flow-patterns.test.ts 1059, "the abort screen AND the wizard behind it") repeat it.

④ Design judgment

  • flow-concurrent-pause.ts. The logic is one else if of eight lines and one message arm. The new pass is placed where the model lives (traversalPasses), reuses hasLiteralTrueCondition and the shared default constant, and is the else of the unclaimed case, so the two no-match readings cannot both fire. It filters on isDefault === true over the non-fault edges, as the engine's claim does over the same set, and leaves the buckets to awaitedBefore, so a claimed edge that also carries a condition is judged with the conditioned ones. The header and the function docblock state the claim order (label default, else every isDefault edge, else the whole set). Against the card's invariant it now holds on every graph the fuzz could build. The message arm for an exclusive decision is correct for shape k and for the S1 pair; one wording gap, N11.
  • 19.flow-sequential-branch-durable-pause-refused.ts. surface and replacement follow the rule as changed; id, reason and the acceptance criteria are untouched and still true.
  • flow-concurrent-pause.test.ts: S2 is closed. Probe 6 runs the head's 54 cases in memory (the worktree's FlowSchema plus the two rules' issues from the module under test): 54 green at the head; the round-1 rule module under the same cases, 3 red (the two S1 pins and the shape-k prescription pin). Each stated clause now has a pin that reds when it is removed, and the dev's six counts reproduce exactly:
    • the whole-set pass removed: 1 red (the no-fallback case);
    • a default edge not awaited before later defaults: 3 red;
    • the isDefault-claim pass emptied: 2 red;
    • the dedupe across passes disabled: 1 red;
    • a decision never read as a label picker: 10 red; scoped to traversalPasses alone, 2 red (both new controls);
    • an edge with both condition and isDefault left out of the conditioned bucket: 1 red.
    • Also red when removed: the exclusive-decision prescription arm (1), and the claim taking only unlabelled isDefault edges (2). Not pinned: the new pass's two exemption guards, N10.
  • flow-route.integration.test.ts. The reshaping is sound, see ③. Two top-level describes each own a kernel, as the file's two older describes already do.

Findings:

  • must-fix: none.
  • should-fix: none.
  • Both items record 7317003405 left open, S1 and S2, are closed on this head.

Nits (none moves the head by itself; N12 is a prose face):

  • N1 (carried, restated): an out-edge of a label-picking node that no pick selects is read as takeable, both as a member of a pass and as a path to a pause or to a node. Probe 8: the head refuses a pass of such edges on a decision whose no-match pick is claimed (round 1's N1), on an exhaustive decision (a literal true; an unlabelled pass, a default-labelled pass, or a label declared after the true), and on an approval's edges under neither approve nor reject. All 865 loss-free refusals of probe 5 are this class: 684 dissolve when the unlabelled and undeclared-label edges of label-routed decisions are pruned, 4 more with an approval's stray edges, the last 177 with the edges only a pick shadowed by a literal true could select. The 3 the delta adds are among the 684. The round-1 rule refuses 862 of the same graphs. The linter already reports the decision's edge.
  • N3 (carried): a pausing edge already anchored by its label pass ends a later pass with no second refusal, so the edges only that later pass leaves untaken are not named. The new claim pass inherits it.
  • N9: the corner under ①. Graded a nit because the metadata door refuses the flow with a gating finding and the shape needs a condition labelled with the engine's own sentinel beside a literal true and two default edges; it is still a lost branch the parse reads as fine. Closes with: treat the no-match pick as reachable when a declared condition is labelled default, in both readers of hasLiteralTrueCondition.
  • N10: the new pass's two exemptions have no failing pin (probe 6, 0 red each): dropping the literal-true guard refuses the exhaustive pair, and dropping the default-label guard refuses the pair beside a default-labelled edge (probe 7), both of which the engine runs without loss (probe 1). Unlike round 1's S2 these regress towards a loud refusal of a shape with two default edges, never towards a silent drop. One control each closes it.
  • N11: on a decision whose parking edge is itself the isDefault edge beside an unconditional sibling, the otherwise-arm cannot be followed as written: marking the sibling as well leaves two default edges, the parking one first, still refused (probe 7). The message's first clause and "keep one isDefault edge per node" lead out of it.
  • N12: sentence two of the corrected note names only the conditioned-before-conditioned member of the sibling rule. A conditioned or isDefault branch that parks beside an unconditional sibling is refused too (probe 9), and a reader taking "one pausing branch beside branches that never pause" outside the note's frame would expect it accepted. The sibling's own changeset, in the same release, lists every member.

Implemented-by: claude/issue-38875-conditioned-edge-pause-drop
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

L1 ACCEPT · PR #38970 (#38875, #38976) · head ff5ffa51adb35b4337c47017dfa0e34cb868abf5 · read 2026-12-01T18:11Z

席位核对 · ACCEPT

ACCEPT · repo:objectstack@os-justin · head ff5ffa51adb35b4337c47017dfa0e34cb868abf5

  1. Shape. Draft, base main, Fixes #38875 and Fixes #38976 first; branch matches both claims (7312510992, 7320000712). PR body PATCHed by the seat after patch round 1.
  2. Premise measured. The engine's sequential out-edge traversal (dag-traversal.ts traverseNext; untouched) loses a later branch when an earlier one parks; the dev measured 13 shapes before the rule (every refused shape registered and ran, the later branch never ran) plus S1/S1b after L2. The rule (sequentialPauseRefusals, beside fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871's fan-out rule, sharing its graph reader and pause population) refuses those shapes at draft and active save, publish and registerFlow, with a prescription; the safe shapes (pause last, an exclusive decision alone, a default beside conditioned edges, a fault edge, S1c, S1d) stay accepted. Corpus: 0 shipped flows refused.
  3. Gates (check-runs at this head). 66 success · 14 expected skip; Lint & Repo Gates and TypeScript Type Check success; Dogfood battery (opt-in) success (3/3 shards). Red, by design or superseded: Check Changeset ×3 (the DELIBERATE CORRECTION below), one 17:52Z PR-body guards run superseded green at 17:55Z after the plugin-approvals flow-route test: the first #38838 case times out at 5 s on loaded CI shards (cold kernel boot) #38976 claim. L2 at CONTRACT_REVIEW_TIER: PASS 7317003405 with S1/S2 open → delta PASS 7320538666 on this head, no open finding (S1: 100,000-graph fuzz, 0 lossy accepted against 168 for round 1; S2: six ablations reproduce 1/3/2/1/10/1). Test Core (11/12) green on this head.
  4. DELIBERATE CORRECTION — confirmed. .changeset/38838-fanout-pause-refusal.md line 16 is a pending release note of merged PR fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871; this PR rewrites the sentence that listed "conditioned out-edges of one node" as accepted. The same-head at-tier delta PASS 7320538666 judges it sentence by sentence: both rewritten sentences are true of the code that ships under both rules, and nothing else in that note is made false. Per landing-operations the red check-empty-changeset stands; the gate is not changed.
  5. Accepted deviations and carried nits. The refusal is wider than the card's two-conditioned-edges shape (a parking conditioned/default branch also loses an unconditional sibling; fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out #38871's S17 reading flips when the default branch parks) — measured lossy, declared in the changeset, flows.mdx and the entry. Carried nits: N1 and N3 (messages naming a loss the pause does not cause / not naming every untaken edge), N9 (a condition labelled default ahead of a literal true still loses a branch and this rule is silent — the metadata door gates it via flow-branch-label-unmatched), N10 (the new pass's two exemption guards unpinned), N11 (the otherwise-arm wording when the parking edge is itself the isDefault edge), N12 (the corrected note's second sentence names only one member). The run-time half (a subflow/map child pausing on an earlier branch) is carried by flows: a fan-out to an approval and a subflow whose child pauses loses the parent branch continuation (the subflow branch never resumes) #38876, named in the body. plugin-approvals flow-route test: the first #38838 case times out at 5 s on loaded CI shards (cold kernel boot) #38976 folded: one kernel per describe in beforeAll(boot, 30_000) with afterAll shutdown; cases independent (each its own flow name, refusals write nothing); per-case 967 ms → 16 ms on the first case.
  6. Out of scope. skills/objectstack-automation/references/state-machines-and-approvals.md (~79–81) and the flow-decision-unconditional-branch lint message (packages/lint/src/lint-flow-patterns.ts ~1515–1516, docblock ~1216, test comment ~1059) still say the unconditional sibling runs "in parallel"; measured (shape k), it never runs when the guarded branch parks — filed separately by the seat.
  7. Landing. Not governed by path (check-governed-merges --pr 38970: 0 of 8 paths, +808/−40), but a declared narrowing (Clause-②: no (narrowing)): landed by the maintainer (ruling of 2026-11-19 on governance: the guard scripts join the governed register, .claude/** lands by declared rule-change, and a narrowed spec change lands only by the maintainer #35321). git merge-tree against current main clean. Hand-off follows; the seat does not enqueue.

Clause-②: no (narrowing) · Metadata-protocol: narrowed

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 1, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

维护者速读

Head-sha: ff5ffa51adb35b4337c47017dfa0e34cb868abf5

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Queue kick, recorded · 2026-12-01T23:37Z · PR #38970 dequeued (CI_FAILURE) from group gh-readonly-queue/main/pr-38970-387224383c….

Signature: only the Governed Surface Guard (run 46767419307) failed: "#38970 — declares a narrowing and is NOT cleared: no authorized APPROVED review is on record (authorized: os-zhuang), and no authorized account enqueued it". Lint & Type Check, PR-Body Guards and Spec Liveness passed in the same group. The enqueue at 2026-12-01T23:11Z was by hotlong, which is not on the authorized list for a declared narrowing (ruling of 2026-11-19 on #35321). Not a flake and not this diff's code; nothing reached main.

Remedy unchanged from the hand-off 7320597836: an APPROVED review by @os-zhuang at head ff5ffa51adb35b4337c47017dfa0e34cb868abf5 (or os-zhuang's own enqueue). The seat does not re-enqueue. The PR is no longer a draft and still merges cleanly against current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs:dogfood-battery size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flows: when two conditioned out-edges of one node both hold and the first branch pauses, the second branch never runs (silently dropped)

3 participants