Skip to content

fix(spec)!: refuse two durable pauses on concurrent branches of one flow fan-out - #38871

Merged
os-zhuang merged 8 commits into
mainfrom
claude/issue-38838-fanout-pause-refusal
Dec 1, 2026
Merged

os-zhuang merged 8 commits into
mainfrom
claude/issue-38838-fanout-pause-refusal

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

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

Fixes #38838

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no published skill teaches a fan-out to pausing steps, nor the region rule's pause population (git grep over skills/: no fan-out-to-approval shape, no region-pause 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 whose node fans out over unconditional edges to two or more branches that each reach a node that parks the run 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. This is the top-level-graph sibling of the region rule (a loop / parallel / try_catch body may not hold screen / wait / approval / approval_revise), by the same precedent: a durable pause where the run cannot park. The engine is not changed; it is not made to serialise the branches.

  • packages/spec/src/automation/flow-concurrent-pause.ts (new; flow.zod.ts is over 1,000 lines, so the new rule family lives in a sibling module and flow.zod.ts only adds the call beside the region rule): concurrentPauseRefusals(flow, FLOW_PAUSE_CAPABLE_NODE_TYPES). Same population as the region rule, no second copy. Not exported from any entry point (api-surface unchanged).
    • Concurrent edges mirror traverseNext: out-edges with no condition, not isDefault, not type: 'fault'. On an approval / approval_revise node and on a decision that declares config.conditions, only edges sharing one label run together, so they are grouped by label. One more group for a decision that declares config.conditions and has no out-edge labelled default nor marked isDefault: true: a run matching no condition picks default, no edge claims it, and traverseNext runs every unconditional out-edge together, so that whole set is a group. An EXHAUSTIVE decision adds no such group: one of whose config.conditions has the expression true (a string whose trimmed text is exactly true, the CEL literal the executor evaluates), since a condition then always matches and the no-match pick is unreachable. Any other always-true expression (1 == 1, (true)), or conditions that together cover every record, is still refused: the parse does not evaluate or prove coverage.
    • A branch reaches a pausing node along ANY path of the flow's edges (conditions, defaults, faults, back-edges included), the reading save-notice-placement.ts already takes; the walk stops at a branch's first pausing node, and one node reached by two branches counts for both.
    • One refusal per fan-out group, anchored at the edge that opens the second pausing branch, naming the fan-out node and each branch, with the prescription: chain the steps; one approval with several approver groups and behavior: 'unanimous'; a decision whose fallback edge is marked isDefault: true when only one branch should run; and why a parallel region is no way out. The decision-without-fallback group has its own sentence: "Decision route declares config.conditions but no fallback edge — none of its out-edges is labelled default or marked isDefault: true — and its branches reach nodes that park the run: … Mark the fallback edge isDefault: true (or label it default), so a run that matches no condition takes exactly one branch."
  • packages/spec/src/automation/flow.zod.ts: the call, after the region rule, and one sentence on FLOW_PAUSE_CAPABLE_NODE_TYPES naming its second reader.
  • packages/spec/src/migrations/entries/semantic/19.flow-concurrent-branch-durable-pause-refused.ts: the ADR-0087 D3 semantic entry (structured TODO; the rewrite is a graph rewrite whose intended shape no artifact records). The changeset carries adr-0087: registered flow-concurrent-branch-durable-pause-refused.
  • content/docs/automation/flows.mdx, under "Parallel approvals": what is refused, why, what to write instead, what stays accepted, what is not judged.
  • packages/plugins/plugin-approvals/src/flow-route.integration.test.ts: the [N2] measurement pin (which asserted that both requests open) is removed and the shape is now pinned refused at the metadata door (see Tests).

Measured shapes (real AutomationEngine + real ApprovalService, better-sqlite3, on this branch's base 13a0d3fedf, before the rule)

# shape measured verdict here
S1 start → two approvals over two unconditional edges (the card) two pending requests, suspension at a_review only; deciding b_review → RESUME_TARGET_LOST refused
S2 one approval + a synchronous branch to its own end (either edge order) one request, parks, decision completes the run, sync branch's outputs kept accepted
S2d one approval + a synchronous dead-end branch parks and resumes correctly accepted
S3 two synchronous branches MERGING into one approval (no join node) the approval runs once per branch: two pending requests on the same node, second → RESUME_TARGET_LOST refused
S3p parallel region, then an approval one request, parks, resumes accepted
S3j join_gateway, then an approval not runnable at all (No executor registered for node type 'join_gateway'), so no native join exists n/a
S4 an approval with two approve-labelled edges to two approvals after the decision, two pending requests in one run refused
S5 an approval's approve / reject edges, each to an approval one request after the decision accepted
S6 approval beside a wait run parks at the wait; the approval's decision "resumes" the run from the wait node refused
S14 approval beside a screen same as S6, at the screen refused
S9 approval two hops down one branch, approval on the other two pending, second orphaned refused
S10 one approval + a sync branch reconverging after it parks once, resumes (the shared node runs twice, unrelated to pausing) accepted
S12 two branches each to an approval through an edge condition, both true two pending, second orphaned refused
S13 same, conditions mutually exclusive one request, correct refused (the parse cannot evaluate conditions; see Acceptance notes)
S7 / S8 conditioned out-edges of ONE node to two approvals sequential, never concurrent; one request; with both conditions true the later sibling never runs (S7) accepted: leaves no orphan request
S15 a decision declaring config.conditions (high, low), edges labelled high / low to two pausing nodes, no fallback edge, a run matching neither measured in the L2 review on the real engine and the built-in decision executor: both pausing nodes run their on-entry work, one suspension kept refused (prescription: mark the fallback edge isDefault: true)
S15c the same with a fallback edge isDefault: true, or labelled default the no-match run takes the fallback only accepted
S18 the S15 decision with a literal true catch-all condition (expression: 'true', or ' true '), no fallback edge measured in the L2 delta review on the real engine: a matching record pauses at a only, any other at b only; the unclaimed-branch warning never fires (the lint suite's own correct-shape control, lint-flow-patterns.test.ts ~1196-1215) accepted: exhaustive
S18b the same with 1 == 1 or (true) as the catch-all not read as exhaustive by the parse refused (prescription: mark one branch edge isDefault: true)
S16 a fault edge beside a success edge to a second pausing node the fault edge runs only when the node fails, instead of its success edges (read) accepted
S17 an isDefault edge beside an unconditional sibling the default edge is awaited before the unconditional bucket; never together (read) accepted
S11 approval beside a subflow whose child pauses on an approval two pending (root a_review, child c_review), two suspensions (a_review, child c_review); each decision resumes its own run; the parent completes on a_review's decision and its continuation after sub never runs accepted by the parse (subflow / map are not judged by type, by the region rule's ruling D); no orphan request, a dropped continuation; engine half filed as #38876

Tests

  • packages/spec/src/automation/flow-concurrent-pause.test.ts (new, 27 cases, through FlowSchema.safeParse): S1, approval beside screen / wait / approval, S9, S3, S4, S12/S13 refused with path and message; one refusal per group anchored on the second pausing branch; S15 refused with its own sentence (and the plain fan-out sentence not fired), S15c accepted with isDefault: true and with label: 'default'; S18 accepted with 'true' and ' true '; S18b refused with 1 == 1 and (true); a fault edge labelled default does not claim the no-match pick; controls S2, S10, S3p, S5, decision branches, conditional fan-out, S16 (fault beside success), S17 (isDefault beside an unconditional sibling); boundaries: subflow not judged, the population is the caller's, malformed members skipped.
  • packages/plugins/plugin-approvals/src/flow-route.integration.test.ts, new top-level describe [#38838] a fan-out to two approval steps is refused at publish (real kernel, ObjectQL, metadata protocol, automation engine, approvals plugin): active save → { code: 'INVALID_METADATA', status: 422 } naming the fan-out and b_review, no active row; draft save → the same envelope (measured: the schema half of the door runs on drafts, so this never reaches publish); registerFlow throws the same lead; CONTROL: the conditional fan-out publishes. A run-level control in the witness describe: the conditional fan-out opens one request and its decision completes the run.
  • The [N2] sibling assertion on routeOutcome keeps its pin one layer closer to the code: approval-route.test.ts, describe routeOutcome measures "later" from the decision, not the opening.
Test and ablation readings (head 9310080)
  • pnpm --filter @objectstack/spec test: 918 files, 29003 passed, 1 todo.

  • pnpm --filter @objectstack/plugin-approvals test: 143 files, 2264 passed.

  • pnpm --filter @objectstack/service-automation exec vitest run: 301 files, 4468 passed.

  • pnpm --filter @objectstack/spec typecheck && pnpm --filter @objectstack/plugin-approvals typecheck: exit 0.

  • Unfixed direction (the new integration file against a spec dist built from the base): 3 failed (active save succeeded, draft save succeeded, registration succeeded), control green.

  • Ablation via scripts/ablation-replace.mjs on flow-concurrent-pause.ts (the guard that skips a group with fewer than two pausing branches made to skip every group, by appending || true), spec rebuilt, ablation-dist-preflight marker present in 2 built files: spec file 11 failed / 8 passed (every refusal and both boundary counts red, the 8 controls green); integration file 3 failed / 21 passed (the three refusals red, control green). Restore: blob == HEAD 95a1b4e711, git diff HEAD empty, rebuilt, preflight --absent exit 0, both files green again (19/19, 24/24).

  • Patch round 1 ablations (scripts/ablation-replace.mjs on flow-concurrent-pause.ts, spec file imports src, restore blob == HEAD 78673f96ea and git diff HEAD empty after each): fault filter removed -> 1 failed (S16) | 22 passed; isDefault filter removed -> 1 failed (S17) | 22 passed; the decision fallback group disabled -> 1 failed (S15 refusal) | 22 passed; restored 23/23.

  • Patch round 2 ablation (scripts/ablation-replace.mjs, the exhaustive exemption disabled: blob 5204ea5091 -> ec3c0ef9b2): the two S18 controls red (2 failed | 25 passed); restored blob == HEAD 5204ea5091, git diff HEAD empty, 27/27.

Acceptance notes

  • Corpus search (shipped flows, examples, fixtures, docs): every example stack's flows judged by the rule (examples/*/objectstack.config.ts; showcase via its flows index): 38 flows, 12 with a pausing node, 0 refused. A literal scan of 868 TS files under packages/** and examples/** (1953 nodes+edges literals) and 52 docs/skills files (15 code-fence literals): 1 hit outside this PR's own test, packages/lint/src/lint-flow-patterns.test.ts:1148, a deliberately misauthored fixture (an inert decision fanning out to two screens) for the flow-decision-unconditional-branch lint rule, judged raw by the linter and never parsed through FlowSchema; not an authored flow, left untouched. Positive control: the scanner refuses the card's shape. Helper-built fixtures the literal scan cannot read are covered by running the suites that hold them: spec, plugin-approvals and service-automation in full, and every test file naming a pausing node type in lint, metadata-protocol, objectql, runtime, rest, client, verify, organizations, trigger-schedule and cli (all green).
  • Corpus, decisions routing by label (repo-wide literal scan at head ddae2cf, ui/** included and quoted JSON keys now read: 1152 TS/TSX files, 2320 nodes+edges literals; 125 md/mdx files, 17 literals): 51 decisions declare config.conditions; 38 have no fallback edge (35 in test files, 2 in the docstring examples of the conversion entry flow-decision-mode-inclusive-explicit, 1 in a flows.mdx fence whose branches carry edge conditions). Refused by the rule: 3 literals, none a shipped flow, none parsed through FlowSchema except this PR's own: packages/lint/src/lint-flow-patterns.test.ts:1148 (an inert decision with no conditions to two screens, a raw lint fixture), ui/packages/app-shell/src/views/studio-design/flowGrouping.test.ts:30 (HotCRM's lead_conversion with its edge conditions stripped for a grouping test, the earlier scan missed it because its keys are quoted), and this PR's malformed-member case. The earlier note's lint-flow-patterns.test.ts:1198 reading was wrong: that fixture ends its conditions with a literal true catch-all, a correct shape, now accepted (S18). Positive control (S15 shape) refused; negative controls (isDefault fallback; literal true catch-all) accepted.
  • Conditions are judged as if they may all hold (S13). Two concurrent branches each reaching an approval through a condition are refused even when the conditions are exclusive, because the parse cannot evaluate them, and S12 showed the same shape breaking when both hold. The prescription names the decision that makes the choice explicit. Narrower alternative (only unconditional paths) would leave S12's orphan request possible; raised for the contract review.
  • Refused at save, not only at publish: the metadata door runs the flow schema on a draft save too (measured), so the route's "refuse at publish" lands earlier than publish.
  • Not reached by this parse (declared boundaries, met only at run time): a subflow / map on a concurrent branch whose child pauses (S11, measured broken), and a plugin-registered pausing type. An engine-side refusal for S11 would live in service-automation, outside this PR's surface (held in flight elsewhere); reported to the seat.
  • A label-picking node whose picked label no edge carries runs every edge. Modelled for a decision's default pick (S15, refused), except where a literal true condition makes it unreachable (S18, accepted). Not modelled for the other picks, because the metadata door already refuses both shapes they come from: a decision condition label no edge carries (flow-branch-label-unmatched) and an approval without exact approve / reject edges (flow-approval-decision-unrouted, measured on the first fixture).
  • approval-route.ts (routeOutcome docblock: "which a flow can declare") and approval-route.test.ts (pointer to "the fan-out pin in flow-route.integration.test.ts") now describe a shape the schema refuses; both files are outside this PR's surface and are left as they are, reported to the seat.
  • Base is 13a0d3fedf; origin/main is 7 commits ahead, none touching a path of this diff 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 dispatched surface plus the sibling module and its test (the 1,000-line rule), the ADR-0087 semantic entry and the changeset, as the dispatch allows.

Verification

Read first, by risk:

  1. packages/spec/src/automation/flow-concurrent-pause.ts: concurrentGroups (which edges run together) and pausesFrom (what a branch reaches).
  2. packages/spec/src/automation/flow.zod.ts: the call after the region rule.
  3. packages/plugins/plugin-approvals/src/flow-route.integration.test.ts: the new describe at the foot.

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

Local gates (head 9310080)

node scripts/pm/dispatch-gates.mjs --commands derived 122 families for this diff; 121 run, every one exit 0; 1 NOT MEASURED: pnpm check:dual-build-cjs-loads (exit 3, PREREQUISITE NOT MET: it reads every package's dist and ten packages are unbuilt in this worktree). --ran reconciliation: 122 accounted, 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 14 documentable anchor(s).

12 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), isDefault (symbol, a field of interface EdgeView))
  • content/docs/kernel/services-checklist.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/permissions/authentication.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/permissions/authorization.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/permissions/permission-metadata.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/permissions/permission-sets.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/permissions/positions.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/permissions/profiles.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/protocol/objectui/layout-dsl.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/ui/apps.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/ui/pages.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/ui/print-pages.mdx (via isDefault (symbol, a field of interface EdgeView))

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

  • content/docs/releases/implementation-status.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/releases/v13.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/releases/v15.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/releases/v17/17-0.mdx (via FlowSchema (symbol, a top-level const), isDefault (symbol, a field of interface EdgeView))
  • content/docs/releases/v17/17-4.mdx (via FlowSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-5.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/releases/v17/17-7.mdx (via FlowSchema (symbol, a top-level const), isDefault (symbol, a field of interface EdgeView))
  • content/docs/releases/v18/18-0.mdx (via isDefault (symbol, a field of interface EdgeView))
  • content/docs/releases/v18/18-1.mdx (via FlowSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-2.mdx (via isDefault (symbol, a field of interface EdgeView))

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
  • 6 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 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 b06efa9a97ad0b771856056cc74b22f190633360 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 66b0a3454ac4cce0e31da40a9f38979e59ce9c55 — the merge of head ddae2cf6081495018b5d1091cb7b3a3a33cc888f into base b06efa9a97ad0b771856056cc74b22f190633360, 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 66b0a3454ac4cce0e31da40a9f38979e59ce9c55 && git checkout 66b0a3454ac4cce0e31da40a9f38979e59ce9c55
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b06efa9a97ad0b771856056cc74b22f190633360 ddae2cf6081495018b5d1091cb7b3a3a33cc888f && git checkout -B drift-repro b06efa9a97ad0b771856056cc74b22f190633360 && git merge --no-ff ddae2cf6081495018b5d1091cb7b3a3a33cc888f

node scripts/docs-audit/affected-docs.mjs --json b06efa9a97ad0b771856056cc74b22f190633360

⚠️ 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 b06efa9a97ad0b771856056cc74b22f190633360 → 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: 931008016d982d6b05ba7dc9ccbc97c9154d76cb
Local-runs: probe — the brief asks for a corpus re-measure with a positive control, and the rule's exactness on one shape could not be settled by reading; nothing was checked out, built or written (inline npx tsx -e scripts run from the sibling worktree objectstack-issue-38578 for its node_modules, the rule compiled in memory from git show 931008016d:packages/spec/src/automation/flow-concurrent-pause.ts). Runs and exits: (1) rule on the card shape, exit 0; (2) real AutomationEngine + built-in decision executor + a generic pausing executor on a label-routed decision, first attempt exit 1 on my own script error (top-level await), rerun exit 0; (3) all five example stacks imported and every flow judged, exit 0; (4) literal scan of 797 files holding nodes/edges literals, exit 0; (5) 15-shape battery plus four in-memory mutants of the rule, exit 0; (6) one mutant against the test file's own isDefault control fixture, 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-concurrent-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/builtin/logic-nodes.ts, packages/services/service-automation/src/run-resume.ts, packages/plugins/plugin-approvals/src/approval-node.ts, packages/lint/src/lint-flow-patterns.ts, packages/plugins/plugin-approvals/src/approval-route.ts, packages/plugins/plugin-approvals/src/approval-route.test.ts, content/docs/automation/flows.mdx, .changeset/38838-fanout-pause-refusal.md

① Derived judgments

Read against traverseNext and executeNode at the head (dag-traversal.ts 666-854, 596-662), the decision executor (logic-nodes.ts 60-90) and the approval executor (approval-node.ts 274-286).

What holds:

  • The concurrent set mirrors the engine. traverseNext drops type: 'fault' edges first, then buckets by edge.condition (run one at a time, awaited), edge.isDefault (one at a time, only when no condition held) and the rest (Promise.all). concurrentGroups keeps exactly that last bucket: e.type !== 'fault' && !e.condition && e.isDefault !== true. Probe 5: a fault edge beside a success edge, an isDefault edge beside an unconditional one, and a conditioned edge beside an unconditional one are each accepted (0 refusals), and each is sequential in the engine.
  • The label grouping mirrors the engine for a claimed label. With a branchLabel, traverseNext narrows the out-edges to those carrying it and only then buckets them, so only same-label unconditional edges run together. The approval executor's two success exits are branchLabel: 'approve' and suspend, and its resume carries the decision's label; the decision executor returns a label exactly when config.conditions is non-empty and none otherwise. picksBranchByLabel reads the same two facts. Probe 5: approve/reject to two approvals accepted, two approve edges refused, an inert decision (no config.conditions) with two unconditional edges refused, which is right: it routes as a plain node.
  • The dev's table agrees with the code for S1, S2, S2d, S3, S3p, S4, S5, S6, S9, S10, S12, S13, S14 and S7/S8 (conditioned out-edges of one node are awaited one after another; the first pause throws the suspend signal and unwinds the loop). S3 (a merge node runs once per arriving branch) follows from executeNode having no join.
  • Reading A is the right one. The parse cannot evaluate a condition; B would leave S12 (measured orphan) authorable. A also matches the region rule, which refuses by structure and never by what a run would evaluate, and the rewrite it asks for is always available (a decision, or conditions on one node's own out-edges, which the engine runs sequentially). Its only cost is S13, and the message says so. I checked the any-path walk for a correct shape it would refuse beyond S13 (reconvergence after the pause, chains, the revise back-edge, a pause behind a fault edge) and found none: each refused variant has a run in which two pauses open.

What does not hold:

  • F1 (must-fix). A label-routed decision with no claimant for the no-match branch is accepted, and it opens two pauses in one run. When no entry of config.conditions matches, the executor returns DEFAULT_BRANCH_LABEL; traverseNext claims it with an out-edge labelled default or marked isDefault, and when neither exists it logs a warning and considers every out-edge, so the labelled, unconditional branch edges all land in the Promise.all bucket. Probe 2, on the real engine (tree e7992991b8, whose logic-nodes.ts is identical to the head's and whose dag-traversal.ts differs from it only outside traverseNext): decision with conditions high / low, edges labelled high and low to two pausing nodes, no default edge. A matching record pauses at one node (controls, both arms); a record matching neither runs both pausing nodes' on-entry work and the run holds one suspension, at a_review; with an isDefault edge added, neither runs. The pausing nodes were a generic supportsPause executor, not the approval service, so the orphan pending request itself is inferred from S1's mechanism (same Promise.all, same two executors), not re-measured. Probe 5: the PR's rule returns 0 refusals for this shape.
    • This is statically decidable from what the rule already reads (config.conditions, edge label, isDefault), and it is the any-path argument turned round: the parse cannot tell that some condition always holds either.
    • No other door refuses it. flow-branch-label-unmatched exempts default by name (lint-flow-patterns.ts, "never counted as unclaimed"), and flows.mdx documents label routing ("Branch on the node") as a supported style. The module header's boundary ("a label-picking node whose picked label no out-edge carries ... is not modelled") is justified in the PR body by flow-approval-decision-unrouted, which covers approvals only.
    • The PR's own prescription leads here: the refusal message, flows.mdx, the changeset and the ADR-0087 entry's replacement all say to put a decision in front "so exactly one is taken", and the header lists a decision's branches under "Correct ... (one branch is taken)". For this style without a default that sentence is measured false.
    • Remedy, either of: (a, preferred) treat the whole unconditional out-edge set of a decision that declares config.conditions and has no out-edge labelled default or marked isDefault as one more concurrent group, with the prescription "mark the fallback isDefault: true", a refusal pin, a control with the default edge, and the four texts brought in line; or (b) if the seat rules that out of this PR, qualify the prescription in all four texts (a decision with a default branch), state the boundary with its true reason, and file the card. (a) is preferred because a second narrowing later is a second breaking change for the same authors. Corpus cost of (a), probe 3: the example stacks hold 0 decisions declaring config.conditions.

Named, not findings against this diff:

  • S7 (a later true conditioned sibling is dropped once an earlier one pauses) and S11 (a subflow whose child pauses) leave no orphan request but drop a continuation. S11 is outside the population by ruling D; both are the dev's out-of-scope findings and are the seat's to file. I confirm S7 by reading (the awaited loop is unwound by the suspend signal and resume re-enters at the paused node only).
  • A screen or wait whose labelled out-edges are picked by a caller-supplied branchLabel on the resume route is judged as one group (probe 5: refused). Conservative and correct: a resume without a label runs them together.

② Semver level

  • Metadata-protocol: narrowed takes at least minor on a package the diff moves (AGENTS.md, Post-Task Checklist 3); the changeset is '@objectstack/spec': minor. Correct. The plugin-approvals change is a test file and publishes nothing.
  • 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 the changeset.
  • The changeset carries the FROM / TO mapping and the one-line fix, and exactly one disposition marker, adr-0087: registered flow-concurrent-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 has the four required fields in the form of its precedent, 18.structured-region-body-pause-and-end-refused (prose surface, D3 structured TODO with the reason no D2 conversion exists, acceptance criteria quoting the refusal). conversionIds is rightly absent. Its replacement carries the F1 sentence and moves with F1.
  • No exported symbol is added: the module is imported by flow.zod.ts only and automation/index.ts is untouched, 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 message lead and the named branch, and that no row was written; registerFlow is asserted to throw the same lead. The message names the fan-out node and each branch with what it reaches, says why, and gives three rewrites and two non-exits. Usable, subject to F1's one sentence.
  • Refused at draft save: consistent. The rule sits in the same FlowSchema.superRefine as the region rule, and the save door parses every body, draft or active, so the region rule is refused at draft save by the same mechanism. Not measured by me: whether a draft stored before this rule is re-parsed at promotion (the open question protocol-promoted-draft-spec-refusal.ts records for non-object types); registerFlow refuses it either way.
  • Corpus, re-measured. Probe 3: 38 flows across the five example stacks, 12 with a pausing node, 0 refused (the dev's numbers), positive control 1 refusal. Probe 4 (scanner positive control 1, negative control 0): docs 12 files / 69 graphs / 0 refused; skills 3 / 6 / 0; example sources 7 / 60 / 0; package, app and ui sources 26 / 41 / 0 (four helper-built graphs in packages/metadata-core/src/flow-cycle-corpus.ts refused only under a worst-case typing; read by hand, every node is assignment, start or end); tests and fixtures 749 / 2154 / 2 hits. The two hits: packages/lint/src/lint-flow-patterns.test.ts:1150 (the dev's, a raw lint fixture) and ui/packages/app-shell/src/views/studio-design/flowGrouping.test.ts:30, which the dev's scan did not reach (it covered packages/** and examples/**). The second is HotCRM's lead_conversion with edge conditions stripped for a grouping test; the file never parses it through FlowSchema. Neither is a shipped flow. The head's check-runs agree: Test Core 12/12 and Test UI 16/16 green.
  • Skills-docs: none holds. No skill teaches a fan-out to pausing steps or the region rule's population. skills/objectstack-automation/references/state-machines-and-approvals.md:79-82 teaches that unconditional out-edges run in parallel and tells the author to guard every branch; its worked example is not refused (probe 4).
  • Dev flags. Open question A / B: A, see ①, with F1 as its corollary. S7 and S11: the seat's cards, see ①. The stale pointers in approval-route.ts (168, "which a flow can declare") and approval-route.test.ts (256, "the fan-out pin in flow-route.integration.test.ts"): this diff removes the pin the second one names; nit N2. The routeOutcome sibling assertion keeps a unit pin (approval-route.test.ts 259-279, read). Deviations: the sibling module, its test, the entry and the changeset are within what a narrowing owes; the PR body's S11 row carries the corrected reading; origin/main has moved to 81aacd342e with no change under the touched paths or the two engine files (diff stat empty).
  • SQL push-down: the diff reads and writes no data. PR author is objectstack-fleet[bot]. The PR is a draft with no auto-merge armed; the dogfood battery shards were in progress when read.

④ Design judgment

  • flow-concurrent-pause.ts. A sibling module is the right shape: flow.zod.ts is past 2,000 lines and already delegates saveNoticePlacementRefusals and flowStartConfigRefusals the same way. The population is a parameter, passed as FLOW_PAUSE_CAPABLE_NODE_TYPES at the one call site, so there is no second copy; the two approval type names are imported constants. Against [P2] engine ADR: durable pause inside structured regions (unlock topology-level parallel approvals / waits / subflows) #3267 and ruling D it makes the spec's own limit real on the top-level graph and takes no working capability away, with subflow / map kept out by the caller's population. Against its bar (the card's invariant, quoted in its header) it falls short at F1. The defensive member reads and the edges[i] anchor are sound.
  • flow.zod.ts. The call sits directly after the region rule and reuses its constant; the docblock sentence on the constant names its second reader. Holds.
  • The ADR-0087 entry. Correct in form (②); its replacement moves with F1.
  • flow-concurrent-pause.test.ts. The nine refusal cases and the two function-level boundary cases assert path and message through the real parse and are red without the rule; that count (11 red, 8 green) matches the file's structure, and probe 5 reproduces the dev's ablation on the card shape (1 to 0). Two parts of the stated contract have no pin that fails when they are removed:
    • F2 (should-fix). No fixture carries a type: 'fault' edge; the mutant with the fault filter deleted is not seen by any committed case (probe 5 shows the shape that would catch it: 0 at the head, 1 under the mutant).
    • F3 (should-fix). The control named for isDefault pairs it with a conditioned edge, leaving one non-conditioned edge at the node, so it is green with the isDefault filter deleted (probe 6: 0 refusals under the mutant). It needs an unconditional sibling.
    • Unpinned as well, lesser: approval_revise as a label-picking source, and the inert decision.
  • flow-route.integration.test.ts. Flipping [N2] is correct: it measured the defect, and its replacement pins the refusal at the metadata door on a real kernel, with a publish control and a run-level control whose decision completes the run. The three refusal cases are red on the base by construction (the save and the registration succeed there), as the dev's ablation reports.

Findings:

  • must-fix: F1.
  • should-fix: F2, F3.
  • nit N1: the module header files "edge conditions on the fan-out node itself" under "Correct"; the dev measured S7 dropping the later true sibling. "Accepted: leaves no orphan request" is the true heading.
  • nit N2: the two stale comments in approval-route.ts and approval-route.test.ts.
  • nit N3: the entry could carry relevantWhen: { kind: 'stack-declares', keys: ['flows'] }; its precedent does not, and omitting it only keeps the entry listed.

Implemented-by: claude/issue-38838-fanout-pause-refusal
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: FAIL

…concurrent group; fault and isDefault filters pinned

Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
Co-authored-by: Claude <noreply@anthropic.com>
… fallback edge marked

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: 0ff60730c66b843e8ddd56932ecb36320be209ba
Local-runs: probe — the delta's new group had to be judged against the engine, and the brief asks for the earlier probes re-run; nothing was checked out, built or written (inline npx tsx -e scripts from the sibling worktree objectstack-issue-38578, the rule compiled in memory from git show 0ff60730c6:packages/spec/src/automation/flow-concurrent-pause.ts; that worktree's logic-nodes.ts has an empty diff against this head and its traverseNext body hashes equal). Runs and exits: (1) 13-shape battery plus five in-memory mutants of the new rule, exit 0; (2) real AutomationEngine + built-in decision executor on the fallback remedy and on the isDefault-beside-unconditional shape: attempt one exit 1 and attempt two exit 0 with nothing run, both on my own script's flow names (uppercase, refused at registration), third attempt exit 0; (3) all five example stacks imported and the literal corpus rescanned with the new rule, exit 0; (4) real engine on a label-routed decision with a literal true catch-all, exit 0.
Scope: packages/spec/src/automation/flow-concurrent-pause.ts, packages/spec/src/migrations/entries/semantic/19.flow-concurrent-branch-durable-pause-refused.ts + packages/spec/src/automation/flow-concurrent-pause.test.ts (in the delta 9310080..0ff6073; flow.zod.ts and the integration test are unchanged by it); read, not reviewed: packages/services/service-automation/src/dag-traversal.ts, packages/services/service-automation/src/builtin/logic-nodes.ts, packages/spec/src/automation/flow-altitude.ts, packages/lint/src/lint-flow-patterns.ts, packages/lint/src/lint-flow-patterns.test.ts, packages/lint/src/authoring-rules.ts, content/docs/automation/flows.mdx, .changeset/38838-fanout-pause-refusal.md

DELTA review from 931008016d982d6b05ba7dc9ccbc97c9154d76cb (record 7305435830: FAIL, must-fix F1, should-fix F2 and F3, nits N1 to N3) to this head: two commits, five files, +151 / -27.

① Derived judgments

  • F1: closed.
    The fallback group mirrors traverseNext exactly. The engine drops fault edges, claims the default pick with an out-edge labelled default, else with an isDefault edge, and with neither considers every out-edge, of which only the unconditional, non-default ones run under Promise.all. decisionDefaultUnclaimed asks the same question in the same order (non-fault edge labelled FLOW_DECISION_DEFAULT_BRANCH_LABEL, or isDefault), on a decision that declares config.conditions only, and the group it adds is the same unconditional set. The label constant is the spec's own (flow-altitude.ts, value default), not a second literal. Probe 1: my F1 shape is refused with the new sentence at edges.2; an isDefault fallback, a default-labelled fallback, one pausing branch only, branch edges that also carry conditions, an edge-conditioned decision and an approval's approve / reject are accepted; a fault edge labelled default does not claim. Probe 2, real engine: the F1 shape still opens both pauses on a no-match record at the base; with the existing low edge also marked isDefault: true a high, a low and a no-match record each open exactly one pause, so the prescription works without adding an edge.
    The boundary sentence now carries its true reason, and I checked it: lintFlowPatterns is a gating rule on the runtime publish surface (authoring-rules.ts), and flow-branch-label-unmatched and flow-approval-decision-unrouted are both severity error.

  • S1 (should-fix) — the fallback group refuses a decision whose conditions end in a literal catch-all, which runs correctly, and nothing in the message, the docs, the changeset or the entry says an exhaustive decision is not exempt.

    • The shape: conditions: [{ label: 'Yes', expression: 'record.score > 50' }, { label: 'No', expression: 'true' }], edges Yes and No to two pausing nodes, no fallback edge. Probe 4, real engine: a matching record pauses at a only, a non-matching one at b only, a record whose first condition faults (null or absent field) fails the run with no pause opened, and the unclaimed-branch warning never fires. The no-match pick is unreachable, so no run opens two pauses. With the No edge also marked isDefault: true the same two records route the same way.
    • It is refused at this head. This is the repo's own control for a correctly routed label decision: packages/lint/src/lint-flow-patterns.test.ts 1196-1215, "does NOT flag a decision that routes by conditions[] alone", Yes / No (true) to two screen nodes. Probe 3 reports it as a fallback refusal. The PR body counts that fixture as "the S15 shape"; it is not, S15's conditions leave a gap and this one's cannot. It is a raw lint fixture, so no test reds.
    • Unlike S13, this sub-case needs no evaluation: a condition whose expression is the literal true is readable by the parse the same way config.conditions and the labels are. Reading A (the parse cannot evaluate a condition) justifies refusing a decision whose exhaustiveness would have to be proved; it does not reach this one.
    • The cost is not stated. The new message opens "When a run matches none of the conditions", which is false for this author, and has no counterpart of the fan-out message's "A condition further down a branch does not exempt it, because the flow cannot be checked". flows.mdx, the changeset's "What is refused" paragraph and the entry's surface describe the refusal structurally and give the same reason. None says that conditions covering every record are refused all the same, nor that marking an existing branch edge isDefault: true is the whole fix ("the fallback edge" presumes one exists; "or label it default" would unclaim the catch-all's own label).
    • Closes with either: (a, preferred) no fallback group when a condition's expression is the literal true, pinned by a control of that shape; or (b) the refusal kept as it is and the cost stated in the fallback message, flows.mdx, the changeset and the entry: refused even when the conditions cover every record, because the parse does not check that, and marking the catch-all's edge (or any one branch edge) isDefault: true clears it. Either way the PR body's reading of the :1198 fixture is corrected.
    • Graded below F1 because the refusal is loud, the fix is one key on one edge, and relaxing it later is a widening, not a second break.
  • The rest of ① is unchanged by the delta: the plain concurrent set, the label groups and the any-path walk are the lines judged at 931008016d, and probe 1 returns the same answers for them.

② Semver level

Unchanged and still right: @objectstack/spec minor, Clause-②: no (narrowing) with Metadata-protocol: narrowed, the !, one adr-0087: registered marker whose id matches the entry. The delta widens what is refused inside the same breaking change, and the changeset's BREAKING paragraph, "What is refused" and "Still accepted" now name the decision without a fallback edge and its one-line fix. The entry's surface and replacement carry it too. No exported symbol is added (ConcurrentGroup and decisionDefaultUnclaimed are module-private).

③ Boundary flags

  • Corpus, re-measured with the new rule (probe 3). Example stacks by import: 38 flows, 0 refused, 0 decisions declaring config.conditions. Literal scan (scanner positive control on the F1 shape: refused; negative control with isDefault: accepted): docs 12 files / 69 graphs / 0 refused; skills 3 / 6 / 0; example sources 7 / 60 / 0; package, app and ui sources 27 / 41 / 0; tests and fixtures 750 / 2157 / 4 literals refused. Label-routed decisions with no fallback edge: 40 by my scanner (36 in tests, 2 in docs, 2 in the conversion entry's docstring) against the dev's 38; none outside tests is refused. The four refused literals: lint-flow-patterns.test.ts:1150 (inert decision, raw lint fixture), lint-flow-patterns.test.ts:1200 (the S1 shape above), this PR's own malformed-member case, and ui/packages/app-shell/src/views/studio-design/flowGrouping.test.ts:30, which the dev's count of three does not list: HotCRM's lead_conversion with its edge conditions stripped for a grouping test, never parsed through FlowSchema. No shipped flow, example, template or doc is refused.
  • Envelope and doors. Unchanged: the new refusal leaves through the same ctx.addIssue loop, so the 422 INVALID_METADATA pins of the integration describe cover its door. Its own sentence is pinned at the parse (path edges.2, lead, prescription).
  • Skills-docs: none still holds: the skills teach edge-conditioned decisions, and probe 3 finds no label-routed decision in skills/.
  • S17's header note says the isDefault-beside-unconditional order is "read, not measured". Probe 2 measures it: only the default edge's target runs its on-entry work and the unconditional sibling never starts.
  • Check-runs on this head when read: every completed run green (Check Changeset, Lint gates, Type Check gates, Build Core, Build Docs, Dogfood Regression Gate); Test Core, Test UI and two dogfood shards still running. The PR is a draft with no auto-merge armed. No data access in the delta, so the SQL push-down check has nothing to read.

④ Design judgment

  • flow-concurrent-pause.ts. The extra group is the smallest change that makes the rule meet its own bar for the no-match pick: one predicate, one more entry in the list concurrentGroups already returns, a flag choosing the sentence. It reuses the walk and the anchor. A decision that also has two same-label edges to two pauses gets both sentences at one path (probe 1); each states a different fact, which is acceptable. The header now separates "Correct" from "Accepted — leaves no orphan request" and files S7 and the isDefault sibling under the second, which is what the engine does. S1 is where the new group overreaches.
  • The ADR-0087 entry. surface and replacement follow the rule. See N4.
  • flow-concurrent-pause.test.ts.
    • F2: closed.
      The new control puts a type: 'fault' edge beside a success edge, each to an approval. Probe 1: accepted at the head, refused at edges.2 with the fault filter deleted from the concurrent set, so the control reds under that mutant.
    • F3: closed.
      The control now pairs isDefault with an unconditional sibling. Probe 1: accepted at the head, refused at edges.2 with the isDefault filter deleted.
    • The F1 pins hold their substance: with the fallback group deleted the refusal case goes to accepted; with the claim made blind to isDefault, or to the default label, the matching control is refused (probe 1, three mutants). The fan-out prescription's pinned sentence was updated with the message.
  • N1: closed. The header split is as asked.

No must-fix. Open on this head: S1.

Nits (none moves the head by itself):

  • N2 (carried): the stale comments in approval-route.ts 168 and approval-route.test.ts 256.
  • N3 (carried): the entry carries no relevantWhen; its precedent does not either.
  • N4: the entry's acceptanceCriteria still describes and quotes the fan-out refusal only; the decision-without-fallback refusal and its sentence are not in it.
  • N5: the e.type !== 'fault' clause of decisionDefaultUnclaimed has no pin (a fault edge labelled default); probe 1 shows the head answers it correctly.

Implemented-by: claude/issue-38838-fanout-pause-refusal
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: PASS

…ustive and owes no fallback edge

Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
Co-authored-by: Claude <noreply@anthropic.com>
… other always-true conditions stay refused

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: ddae2cf6081495018b5d1091cb7b3a3a33cc888f
Local-runs: probe — the exemption had to be judged against the engine and its door against the linter, and the brief asks for the S1 probe and the mutants re-run; nothing was checked out, built or written (inline npx tsx -e scripts from the sibling worktree objectstack-issue-38578, the rule compiled in memory from git show ddae2cf608:packages/spec/src/automation/flow-concurrent-pause.ts; that worktree's logic-nodes.ts, lint-flow-patterns.ts and schemaless-node-config.zod.ts have empty diffs against this head and its traverseNext body hashes equal). Runs and exits: (1) real AutomationEngine, built-in decision executor and lintFlowPatterns on ten literal-true catch-all variants, exit 0; (2) the same on a case-only label mismatch with a fallback edge, exit 0; (3) 15-shape battery through the rule at this head and at 0ff60730c6, plus five in-memory mutants, exit 0; (4) the five example stacks imported and the literal corpus rescanned, exit 0; (5) this record read through contractReviewRecordReading, exit 0.
Scope: packages/spec/src/automation/flow-concurrent-pause.ts, packages/spec/src/migrations/entries/semantic/19.flow-concurrent-branch-durable-pause-refused.ts + packages/spec/src/automation/flow-concurrent-pause.test.ts (in the delta 0ff6073..ddae2cf; flow.zod.ts and the integration test are unchanged by it); read, not reviewed: packages/services/service-automation/src/dag-traversal.ts, packages/services/service-automation/src/builtin/logic-nodes.ts, packages/spec/src/automation/schemaless-node-config.zod.ts, packages/lint/src/lint-flow-patterns.ts, packages/lint/src/authoring-rules.ts, content/docs/automation/flows.mdx, .changeset/38838-fanout-pause-refusal.md

DELTA review from 0ff60730c66b843e8ddd56932ecb36320be209ba (record 7306129808: PASS, should-fix S1, nits N2 to N5) to this head: two commits, five files, +80 / -11.

① Derived judgments

  • S1: closed.
    hasLiteralTrueCondition reads exactly what the executor evaluates: logic-nodes.ts wraps each expression as { dialect: 'cel', source } and returns the first branch that holds, so a condition whose trimmed text is true always holds once reached. Probe 1, real engine: with expression: 'true' a matching record pauses at a only and any other at b only; the same with ' true '; with the catch-all listed first every record takes it; the unclaimed-branch warning never fires. Probe 3: the three shapes are accepted at this head and were refused at 0ff60730c6; 1 == 1, (true), !false, TRUE, a boolean true and a { dialect, source } envelope are still refused, and the S15 gap shape and the card shape are unchanged. A decision with a catch-all and two same-label edges to two approvals still gets the fan-out sentence, so the exemption does not reach the label groups.
    The cost is now stated where an author meets it: the fallback message says one existing branch edge marked isDefault: true is enough and that conditions covering every record are refused all the same unless one is the literal true; flows.mdx, the changeset and the entry's surface and replacement say the same. The PR body's corpus note now reads the lint control as the correct shape it is.

  • A non-string true is not exempt, and nothing depends on it. Probe 3: a boolean expression still adds the fallback group. Probe 1: registerFlow refuses it on its own ("1 invalid expression ... config.conditions[1].expression"). I did not run objectstack validate; DecisionConditionSchema declares expression: z.string(). Either way the exemption admits nothing here.

  • What the exemption admits that breaks, and which door covers it. An exhaustive decision can still run every out-edge when the catch-all's own label is not claimed, because the engine claims a picked label with e.label === branchLabel and falls back to every out-edge otherwise. Probe 1, each with two pausing branches and no fallback edge, each accepted by the rule at this head (probe 3):

    • catch-all labelled Otherwise, edges Yes / No: both pauses open. lintFlowPatterns answers flow-branch-label-unmatched at severity error, which gates os validate and the runtime publish door (authoring-rules.ts, CLI_AND_RUNTIME, tier gating). The door covers it. A bare registerFlow does not run the linter, the same limit this boundary has had since the first head.
    • catch-all with an empty or missing label: refused at registerFlow by the decision config's own parse. Covered.
    • catch-all labelled No, its edge labelled no; and No (trailing blank) against No: both pauses open, the engine warns, and the linter is silent. lint-flow-patterns.ts compares labels trimmed and lower-cased (edgeLabelOf, and the declaredLabels set), the engine compares them exactly. The door does not cover a label that differs from its edge only by case or surrounding blanks.
    • That gap is not the exemption's. Probe 1: two ordinary conditions Yes / No with edges yes / No and no catch-all open both pauses with the linter silent; probe 2: the same decision with an isDefault fallback edge, which the rule accepted at 0ff60730c6 and at 931008016d alike, opens both pauses too. So the class is authorable with or without the exemption; the previous head refused its no-fallback member only incidentally, with a sentence about a missing fallback edge that would not have named the mistake.
    • Where it goes: the linter's comparison (or a parse rule that reads every condition label against the out-edges exactly) is its own change, in packages/lint, outside this diff, and it reaches every decision, pausing or not. It is the seat's to file: reach measured through registerFlow + execute and lintFlowPatterns; a decision condition label that differs from its out-edge's label only by case or surrounding blanks passes flow-branch-label-unmatched and at run time claims no edge, so every out-edge runs; dedupe words: branch label case mismatch lint lowercases, flow-branch-label-unmatched trim toLowerCase engine exact, decision label whitespace every out-edge.
    • A correction to my record 7306129808: it said of the boundary sentence "I checked it". I had checked the rule's tier and severity, not how it compares labels. The sentence holds for a label no edge carries under the linter's normalised reading, and not for the two spellings above. See N6.
  • The rest of ① is unchanged by the delta: the concurrent set, the label groups, the fallback group and the any-path walk are the lines judged before, and probe 3 returns the same answers for them at both heads.

② Semver level

Unchanged and still right: @objectstack/spec minor, Clause-②: no (narrowing) with Metadata-protocol: narrowed, the !, one adr-0087: registered marker whose id matches the entry. The delta narrows what the same breaking change refuses, and the changeset's "What is refused" paragraph says which decisions are exhaustive and which are not. hasLiteralTrueCondition is module-private; no exported symbol is added.

③ Boundary flags

  • Corpus, re-measured with this head's rule (probe 4). Scanner controls: the gap shape as literal text is refused, the literal-true catch-all is accepted. Example stacks by import: 38 flows, 0 refused. Literal scan: docs 12 files / 69 graphs / 0 refused; skills 3 / 6 / 0; example sources 7 / 60 / 0; package, app and ui sources 27 / 41 / 0; tests and fixtures 750 / 2157 / 3 literals refused, the same three the PR body now lists (lint-flow-patterns.test.ts:1150, the flowGrouping.test.ts:30 trimmed fixture, this PR's own malformed-member case). The lint suite's correct-shape control is no longer refused. The scan finds 19 decisions carrying a literal true condition (17 in tests, 1 in docs, 1 in package source), so the exempted idiom is one the repo writes.
  • Message. The fallback sentence stays a usable prescription and no longer states a premise that is false for an exhaustive author. Envelope and doors are unchanged from the head judged first: the same ctx.addIssue loop, the same 422 INVALID_METADATA pins.
  • Skills-docs: none still holds; the delta teaches nothing a skill carries.
  • Check-runs on this head when read: 44 completed green, 12 skipped, 20 still running (Test Core and Test UI shards, two type checks, two dogfood shards), none red. The PR is a draft with no auto-merge armed. No data access in the delta, so the SQL push-down check has nothing to read.

④ Design judgment

  • flow-concurrent-pause.ts. The exemption is the narrowest reading that is exact: one string comparison on what the executor itself evaluates, placed in decisionDefaultUnclaimed, so it switches off the fallback group and nothing else. Refusing every other always-true spelling keeps reading A intact, and the message says so. The header's new paragraph states the rule, its reason and its limits; one sentence of it overstates the door (N6).
  • The ADR-0087 entry. surface and replacement follow the rule; acceptanceCriteria still does not (N4).
  • flow-concurrent-pause.test.ts. The pins hold the substance (probe 3 mutants): with the exemption deleted both S18 controls are refused; with the trim deleted the padded control is refused; loosened to a substring test, (true) is accepted; loosened to any non-empty string, 1 == 1 and the S15 gap shape are accepted; with the fault clause deleted from the claim, the new fault-edge-labelled-default case is accepted. Each mutant reds a committed case.
  • N5: closed. The fault clause of the claim is pinned.

No must-fix. No should-fix.

Nits (none moves the head by itself):

  • N2 (carried): the stale comments in approval-route.ts 168 and approval-route.test.ts 256.
  • N3 (carried): the entry carries no relevantWhen; its precedent does not either.
  • N4 (carried): the entry's acceptanceCriteria describes and quotes the fan-out refusal only.
  • N6: the header says a catch-all whose label no edge carries "is the door's flow-branch-label-unmatched refusal", and that the door "already refuses" a condition label no edge carries. Measured, that holds unless the label differs from its edge only by case or surrounding blanks. The PR body's boundary note repeats it. The wording can be corrected with the card above; graded a nit because the sentence changes nothing the rule does and the gap it hides is the linter's.

Implemented-by: claude/issue-38838-fanout-pause-refusal
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 #38871 (#38838) · head ddae2cf6081495018b5d1091cb7b3a3a33cc888f · read 2026-12-01T09:38Z

席位核对 · ACCEPT

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

  1. Shape. Base main, Fixes #38838 first after the seat signature; no keyword binds another card. The card's invariant ("no pending approval request may exist whose decision cannot resume its run") holds for every shape the parse can see; the shapes it cannot (a subflow / map child, by ruling D) are flows: a fan-out to an approval and a subflow whose child pauses loses the parent branch continuation (the subflow branch never resumes) #38876, and S7's dropped sibling is flows: when two conditioned out-edges of one node both hold and the first branch pauses, the second branch never runs (silently dropped) #38875.
  2. Premise measured. Reproduced by PR fix(approvals): "the approval ended here" is judged by the content of the body the run ran, so it survives restarts #38825's pin, then 18 shapes measured or read against traverseNext before and during review; the rule refuses exactly the concurrent groups that open two pauses, plus a label-routed decision with no reachable fallback, and exempts a literal true catch-all.
  3. Gates (check-runs at this head). 68 success · 12 expected skip · 0 failed · 0 pending; Lint & Repo Gates and TypeScript Type Check success; Dogfood battery (opt-in) success (3/3 shards) on this head, as a narrowing owes. L2 at CONTRACT_REVIEW_TIER: FAIL 7305435830 (F1 must-fix, F2/F3 should-fix) → delta PASS 7306129808 with S1 open → delta PASS 7306980471 on this head, no open grade. Ablations red for each filter, the fallback group and the literal-true exemption.
  4. Accepted deviations. (a) Route by the seat, on the [P2] engine ADR: durable pause inside structured regions (unlock topology-level parallel approvals / waits / subflows) #3267 / feat(spec)!: a structured region body refuses a pause-capable node and an 'end' node #18688 region-rule precedent (claim 7302435827): refuse at the first save (draft or active), publish and registerFlow; the engine is untouched. (b) The dev's open question (a branch reaching a pause only through a condition counts) taken as A, any path counts, by the save-notice-placement precedent and confirmed by L2. (c) F1 remedy (a) over (b) and S1 exempted, the seat's choices recorded at each round. (d) The rule sits in a new sibling module because flow.zod.ts is over 2,000 lines.
  5. Out of scope. flows: when two conditioned out-edges of one node both hold and the first branch pauses, the second branch never runs (silently dropped) #38875 (S7), flows: a fan-out to an approval and a subflow whose child pauses loses the parent branch continuation (the subflow branch never resumes) #38876 (S11), approvals: flow_route later-step comparison drops a request stamped in the same millisecond as the decision, and the no-checksum gloss names fewer causes than the code #38839 row 7305196544 (two stale comments in approval-route.*). Two raw fixtures carry refused shapes and are never parsed through FlowSchema (lint-flow-patterns.test.ts:1148, flowGrouping.test.ts:30). Skills-docs: none with its reason in the PR body (no published skill teaches the shape).
  6. Landing. Not governed (check-governed-merges --pr 38871: 0 of 7 paths, +896/-35). K = 2. git merge-tree against main 3c617a2 clean; no path of this diff changed on main. Narrowing with the dogfood battery green on this head: ready + auto-merge now. Maintainer veto window on the route stands until merge.

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

维护者速读

  • 是什么:流程里一个节点分叉到两个会挂起的步骤(如两个审批)时,会出现「批了也推不动流程」的孤儿待审请求。本 PR 在保存、发布和注册时拒绝这种写法,并给出改法;没有兜底分支的条件路由 decision 同样拒绝,以字面量 true 兜底的穷尽写法不拒。引擎不改。
  • 为什么要你批:它收窄了作者能写的东西(Clause-② no (narrowing)),按 2026-11-19 你在 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 的裁决,这类 PR 由你落地。席位先前误按普通 PR 入队,队列守卫在 2026-12-01T10:16Z 把它退了出来,没有任何改动进入 main。
  • 风险:低。全仓 0 个已发布的流程、示例、模板或文档被拒;契约档复审三轮后 PASS、无遗留项;dogfood 电池在此 head 上通过;CI 68 项全绿。
  • 要你做什么:审批本 PR,head ddae2cf6081495018b5d1091cb7b3a3a33cc888f;契约审核 PASS 评论 7306980471,席位 ACCEPT 7307003184。

Head-sha: ddae2cf6081495018b5d1091cb7b3a3a33cc888f

Queue kick, recorded: the merge-group runs of this PR (groups pr-38871-ae9d2ade… and pr-38871-b5667357…) failed only on the Governed Surface Guard, which reads the declared narrowing on the body and the changeset and found no authorized APPROVED review and no authorized enqueuer. Every other lane passed. Not a flake and not this diff's code: a landing-path error by the seat, which enqueued a narrowing PR itself. Remedy is this hand-off. Approval requested at the head above; after it, the seat lands it (or the approver enqueues it).

@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
objectstack-fleet Bot requested a review from os-zhuang December 1, 2026 10:18
@os-zhuang
os-zhuang added this pull request to the merge queue Dec 1, 2026
@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, 2026-12-01T11:48Z · PR #38871 dequeued with CI_FAILURE from group gh-readonly-queue/main/pr-38871-ac97540f75.

Signature: workflow Lint & Type Check, run 46637075803, job Type Check · workspace (142606292210), started 11:30:28Z; at 11:47:02Z the log reads ##[error]The runner has received a shutdown signal and the job is cancelled. No error TS line anywhere in the log (0 hits). The aggregate TypeScript Type Check failed only on that cancelled lane (type-check lane typecheck-workspace concluded failure).

Initial judgement: the runner was shut down, not this PR's diff. The three facts:

  1. Not this diff: the same lane is success on this PR's head ddae2cf6 (09:31:40Z).
  2. Queue base, same lane, green: group pr-38898 (run 46633010999, 11:05Z) passed Lint & Type Check on the base this group was built on.
  3. First error is the runner shutdown, not an assertion: yes.

Action needed: one re-enqueue, as is. This PR declares a narrowing, so the queue guard admits only the maintainer's enqueue; the seat does not re-enqueue it. @os-zhuang — please re-add it to the queue when convenient.

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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue 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

3 participants