Repository navigation
fix(service-automation): the region refusal walks the child's suspension chain strictly and names the link it cannot read - #29403
Conversation
…n when the suspension chain cannot be read runRegion read the chain it cancels through the degrading loader, so an unreadable store gave an empty chain: no cancelRun, only a warn, and the child run stayed parked. An empty chain now cancels the child run once through cancelRun, whose strict read owns the error record. Claude-Session: https://claude.ai/code/session_01ADHkmSmWmYVtGXXtTcxTr3 Co-authored-by: Claude <noreply@anthropic.com>
…hen its suspension chain reads empty The previous commit carried only the red tests; this is the fix it names. runRegion reads the chain through the degrading loader, so an unreadable store gave an empty chain and no cancelRun. An empty chain now calls cancelRun(childRunId) once; its strict read owns the error record. Claude-Session: https://claude.ai/code/session_01ADHkmSmWmYVtGXXtTcxTr3 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmSmWmYVtGXXtTcxTr3 Co-authored-by: Claude <noreply@anthropic.com>
…e level deep by design A child's region call fails the child run; its caller meets an ordinary, routable child failure and stays armed (seat ruling 6576815635, option B). Comments only. Claude-Session: https://claude.ai/code/session_01ADHkmSmWmYVtGXXtTcxTr3 Co-authored-by: Claude <noreply@anthropic.com>
…to claude/project-thread-y9hvos
…ion chain strictly and names the link it cannot read runRegion's cancel of a region-refused child chain read each link through the degrading loader, so an unreadable link deeper in the chain stopped the walk with only a warn and left that run, and every run below it, parked. The cancel path now walks through resolveSuspensionChainForCancel, which shares the one walk with resolveSuspensionChain but reads through the strict loader and reports the link whose read threw. Every read link is cancelled, the unreadable link is still handed to cancelRun, and one error record names it. The degrading resolveSuspensionChain is unchanged for its other readers. Claude-Session: https://claude.ai/code/session_01ADHkmS5997viAw9y7Jknnz Co-authored-by: Claude <noreply@anthropic.com>
…-y9hvos # Conflicts: # packages/services/service-automation/src/dag-traversal.ts # packages/services/service-automation/src/subflow-region-suspension.test.ts
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 3 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 10 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 6f24ebf9ffaa10041744a9887f6b86a85ff3bd9e && git checkout 6f24ebf9ffaa10041744a9887f6b86a85ff3bd9e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7f277a86f670a956dcdf677937c1894706992bee a06cb531b411f3ec885d95acae405c6fef2e60ce && git checkout -B drift-repro 7f277a86f670a956dcdf677937c1894706992bee && git merge --no-ff a06cb531b411f3ec885d95acae405c6fef2e60ce
node scripts/docs-audit/affected-docs.mjs --json 7f277a86f670a956dcdf677937c1894706992bee
|
|
domain:server#3 · os-steve · session_01ADHkmQJdgarUjPLNgFBY67 席位核对 · ACCEPT · PR #29403 · 2026-11-02T14:13ZHead-sha: 维护者速读(席位终稿)
核对六项
|
Requested by Steve · project thread
Fixes #29333
Clause-②: no
Metadata-protocol: none
维护者速读
cancelRun,并记一条error点名该运行。dag-traversal.ts这一段和engine.ts新增的方法。packages/services/service-automation/src/dag-traversal.ts(runRegion的取消段),再看engine.ts的resolveSuspensionChainForCancel/walkSuspensionChain,最后看测试文件末尾新增的两例。pnpm --filter @objectstack/service-automation exec vitest run src/subflow-region-suspension.test.ts,预期 24 例全过。What changes
engine.ts: the chain walk behindresolveSuspensionChainmoves intowalkSuspensionChain(runId, load); only the loader is a parameter, so there is still one walk with the same depth bound and cycle guard.resolveSuspensionChaincalls it with the degradingloadSuspendedRun, exactly as before, so the resume gate and its other readers see no change. NewresolveSuspensionChainForCancelcalls it with the strictloadSuspendedRunStrict(the readcancelRunalready takes) and returns{ chain, unreadable? }, whereunreadablenames the link whose read threw, with the cause. A link that is simply not found still ends the chain.dag-traversal.tsrunRegion: the region refusal's cancel now walks throughresolveSuspensionChainForCancel. Every link it read is cancelled, deepest first. If a link could not be read, that run is still handed tocancelRunfirst (it reads again, owns theerrorrecord for that run if the store is still unreadable, and is a no-op if the run is gone), and oneerrorrecord names it: any run it is itself parked on was never reached and may still be parked. The refusal is thrown after, unchanged.unreadable= the child, so it gets the same singlecancelRun. A child that is truly not found (the strict store answered "no row") gets no cancel, where fix(service-automation): the region refusal cancels its child run even when the suspension store cannot be read #29329 sent acancelRunthat returnedfalse. fix(service-automation): the region refusal cancels its child run even when the suspension store cannot be read #29329's two tests pass unedited..changeset/29333-region-refusal-deeper-chain-cancel.md,@objectstack/service-automationpatch.Tests
Two cases added at the end of
src/subflow-region-suspension.test.ts(no existing test edited), on a three-run chain caller →loop→deal_review→deal_mid→deal_ask(parks atwait):loadalways throws fordeal_midrows): the refusal text is unchanged;deal_reviewendscancelled; exactly one chainerrorrecord namesdeal_mid's run id;cancelRunis called fordeal_midthendeal_review, deepest first.deal_midanddeal_askare still in the store, asserted as such.cancelled,cancelRunis called deepest first, and nothing is logged aterror.Acceptance notes
deal_ask(below the unreadable link) stays parked. Its id is only recorded indeal_mid's row (subflow:correlation), and aSuspendedRuncarries no parent pointer, so nothing can reach it while that row cannot be read. Theerrorrecord says so and tells the operator to cancel the remaining runs once the store answers.errorrecords appear for it:cancelRun's own skipped-cancellation line for that run, and the chain record for the runs below it. They say different things, so both stay.Verification
Ablation (scripts/ablation-replace.mjs, on-disk proof): the cancel walk read through the degrading loader again
The CONTROL stays green under the mutation, as it should. The test imports
./engine.jsfromsrc, so nodistleg applies.Final head a06cb53
Generated by Claude Code