Skip to content

fix(service-automation): the region refusal walks the child's suspension chain strictly and names the link it cannot read - #29403

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-y9hvos
Nov 2, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-y9hvos

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #29333

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:区域(loop / parallel / try_catch)内子流程挂起被拒绝时,取消子运行挂起链改用严格读取;链中间某一环读不到时,已读到的环照常取消,读不到的那一环仍交给 cancelRun,并记一条 error 点名该运行。
  • 为什么改:原来用降级读取,中间环读不到就当作"没有挂起",遍历停在那里,它和它下面的运行一直停在存储里,只留一条 warn。
  • 风险与回滚:只改取消路径的读取方式;恢复门禁等其它读者仍用原来的降级遍历,未改。拒绝本身(文字、不可路由)不变。回滚即还原 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 behind resolveSuspensionChain moves into walkSuspensionChain(runId, load); only the loader is a parameter, so there is still one walk with the same depth bound and cycle guard. resolveSuspensionChain calls it with the degrading loadSuspendedRun, exactly as before, so the resume gate and its other readers see no change. New resolveSuspensionChainForCancel calls it with the strict loadSuspendedRunStrict (the read cancelRun already takes) and returns { chain, unreadable? }, where unreadable names the link whose read threw, with the cause. A link that is simply not found still ends the chain.
  • dag-traversal.ts runRegion: the region refusal's cancel now walks through resolveSuspensionChainForCancel. Every link it read is cancelled, deepest first. If a link could not be read, that run is still handed to cancelRun first (it reads again, owns the error record for that run if the store is still unreadable, and is a no-op if the run is gone), and one error record names it: any run it is itself parked on was never reached and may still be parked. The refusal is thrown after, unchanged.
  • fix(service-automation): the region refusal cancels its child run even when the suspension store cannot be read #29329's empty-chain branch is subsumed, not dropped: an unreadable child now comes back as unreadable = the child, so it gets the same single cancelRun. 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 a cancelRun that returned false. 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: .changeset/29333-region-refusal-deeper-chain-cancel.md, @objectstack/service-automation patch.

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 at wait):

  • middle link unreadable (the store's load always throws for deal_mid rows): the refusal text is unchanged; deal_review ends cancelled; exactly one chain error record names deal_mid's run id; cancelRun is called for deal_mid then deal_review, deepest first. deal_mid and deal_ask are still in the store, asserted as such.
  • CONTROL, all readable: all three runs end cancelled, cancelRun is called deepest first, and nothing is logged at error.

Acceptance notes

  • deal_ask (below the unreadable link) stays parked. Its id is only recorded in deal_mid's row (subflow: correlation), and a SuspendedRun carries no parent pointer, so nothing can reach it while that row cannot be read. The error record says so and tells the operator to cancel the remaining runs once the store answers.
  • When the unreadable link's store is still down, two error records 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
ablation-replace: anchor "return await this.loadSuspendedRunStrict(id);" x1 -> x0
ablation-replace: ok mutation landed: anchor 1 -> 0, blob c937469c8834 -> ebabde87953c
  × an unreadable store: … the child run gets exactly one cancelRun, …          (#29166)
  × a store that answers again by the cancel: …                                  (#29166)
  × the middle link cannot be read: the child is cancelled, one `error` record names the middle run, …
  AssertionError: one record names the unreadable link: expected [] to have a length of 1 but got +0
  Tests  3 failed | 21 passed (24)
ablation-replace: ok restored: blob == HEAD (c937469c8834) and `git diff HEAD` is empty

The CONTROL stays green under the mutation, as it should. The test imports ./engine.js from src, so no dist leg applies.

Final head a06cb53
head a06cb531 (merge of main 5924e500, which carries #29329, onto e6d2696f):
pnpm --filter '@objectstack/service-automation...' build, typecheck, test   under os-verify-lock, VERDICT command-exit 0
  typecheck exit 0 · Test Files 260 passed (260) · Tests 3342 passed (3342)
vitest run src/subflow-region-suspension.test.ts                              Tests 24 passed (24)
turbo build ./packages/** (78/78) then pnpm check:dual-build-cjs-loads and pnpm lint   VERDICT command-exit 0
dispatch-gates --ran: 62 derived, 62 run, 0 NOT-MEASURED (all exit 0)

Two first answered exit 3 (prerequisite, nothing measured) and were re-run green:
check-plugin-teardown-shape --self-test (after git fetch origin 621a4876…, its pinned fixture commit)
check:dual-build-cjs-loads (after the ./packages/** build above)

Generated by Claude Code

…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>
…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>
…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
@github-actions github-actions Bot added size/m 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 Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/service-automation, touching 9 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 cancelRun (literal, a string literal in runRegion))

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

  • content/docs/releases/v16.mdx (via AutomationEngine (symbol, a top-level class))
  • content/docs/releases/v17/17-0.mdx (via AutomationEngine (symbol, a top-level class))
  • content/docs/releases/v17/17-6.mdx (via AutomationEngine (symbol, a top-level class))

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
  • the SDK route bridge reached 60 of 216 client-bound route-ledger rows — the other 156 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 156: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 101 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 — 10 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 7f277a86f670a956dcdf677937c1894706992bee → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 6f24ebf9ffaa10041744a9887f6b86a85ff3bd9e — the merge of head a06cb531b411f3ec885d95acae405c6fef2e60ce into base 7f277a86f670a956dcdf677937c1894706992bee, 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 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

⚠️ 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 7f277a86f670a956dcdf677937c1894706992bee → 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

domain:server#3 · os-steve · session_01ADHkmQJdgarUjPLNgFBY67

席位核对 · ACCEPT · PR #29403 · 2026-11-02T14:13Z

Head-sha: a06cb531b411f3ec885d95acae405c6fef2e60ce

维护者速读(席位终稿)

核对六项

  1. 形态:draft → main;Fixes #29333,与认领一致;4 个文件 +144/-18,都在申报面内(service-automation 的遍历、引擎、测试,本卡 changeset)。
  2. 前提实测:席位读了净 diff。还是一个遍历(walkSuspensionChain,同样的深度上限和防环),只把读取器作为参数;降级的 resolveSuspensionChain 行为不变。读不到的环先交给 cancelRun,再按从深到浅取消已读到的环,拒绝随后照常抛出。fix(service-automation): the region refusal cancels its child run even when the suspension store cannot be read #29329 的空链分支被吸收而不是删掉:子运行读不到时,现在作为 unreadable 得到同一次 cancelRun;真的不存在时不再发一次返回 false 的空取消,没有行为差别。fix(service-automation): the region refusal cancels its child run even when the suspension store cannot be read #29329 的两条测试未改动,照样通过。本面无须契约复审:没有已发布 schema 或受管路径,Clause-②: no。
  3. 门禁:dev 报告(6579287897):包内 3342/3342、typecheck 0;dispatch-gates 62 derived / 62 run / 0 NOT-MEASURED,全部 exit 0;pnpm lint 0。消融:把严格读取器换回降级的,3 条转红,恢复后干净。dogfood 不适用(无 !,不是收窄)。入队前席位读本 head 全部 check-run。
  4. 接受的偏差:分支曾先合入 fix(service-automation): the region refusal cancels its child run even when the suspension store cannot be read #29329 的头分支以便提前开工,fix(service-automation): the region refusal cancels its child run even when the suspension store cannot be read #29329 合并后与 main 的冲突按本分支解决;PR 在 fix(service-automation): the region refusal cancels its child run even when the suspension store cannot be read #29329 合并后才开,接受。无被迫的测试改动。
  5. 开放问题裁定:读不到的那一环之下的运行仍会挂着,因为它们的 id 只存在那一环的行里,SuspendedRun 没有父指针。裁定 A:维持现状,error 记录就是答案。B(给 SuspendedRun 加 parentRunId)会改持久化行的形状,只在存储连续两次读不到时才有作用,不值得为此改格式,本席不立卡。范围外发现:无。
  6. 落地条款:Clause-②: no,Metadata-protocol: none,PR 正文与 changeset 都有。semver:@objectstack/service-automation patch。check-governed-merges --pr 29403:入队前复核。落地授权,维护者原话:「按照 pm-dispatch 规则复核过的都授权」(2026-10-25T11:35Z)。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 2, 2026 14:38
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 02bceb7 Nov 2, 2026
49 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-y9hvos branch November 2, 2026 15:01
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 size/m 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.

automation: the region refusal leaves a deeper suspended run uncancelled when a middle link of the suspension chain cannot be read

1 participant