Skip to content

fix(approvals): a recall or subflow-parent strand reports the hook refusal that stranded the run - #34999

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-34638-resume-failure-refusal
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-34638-resume-failure-refusal

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #34638

Clause-②: yes
Metadata-protocol: none

维护者速读

  • 改了什么:审批「撤回」这扇门,以及子流程把父流程卡住的那条路,以前在成功响应里用 resumeFailure 报告「运行卡住了」,但不带原因。现在 resumeFailure 带上 innerRefusal(拒绝码与原文)和 userMessage(钩子声明的、按发起该运行的人的语言给出的那句话;无人发起的运行给出原文),与决策门抛出的 RESUME_FAILED 用同样的字段名和形状。
  • 为什么改:同一种「被钩子拒绝而卡住」,从决策门进来能看到原因,从撤回门或子流程进来却看不到,审批人只知道卡住、不知道为什么。
  • 风险与回滚:只新增两个可选字段(拒绝时才出现,故障时不出现),code / repairable 的读法不变;是对已发布类型 ResumeFailureReport 的放宽(Clause-②: yes),落地前欠一次契约审核。回滚即 revert。
  • 先看:packages/spec/src/contracts/approval-service.ts(ResumeFailureReport 两个新字段与文档块)、packages/plugins/plugin-approvals/src/approval-service.ts(撤回门与子流程父流程的填充点)、packages/services/service-automation/src/engine.ts(takeSubflowParentStrand 带回拒绝)。
  • 两分钟验证:pnpm --filter @objectstack/plugin-approvals exec vitest run src/resume-failure-refusal.test.ts,预期全部通过。
  • 需要你做的:无,席位落地;落地前席位路由一次契约审核(L2)。

What changes

When an approval decision strands its flow run because the next step was refused (a record hook's declared refusal, a validation rule, a permission), the thrown RESUME_FAILED already carries innerRefusal and the refusal's marked userMessage (#34579, PR #34619). Two doors report a stranded run on a success answer instead, through resumeFailure: the recall door, whose own resume stranded, and a subflow parent that stranded after the run this door resumed advanced (through decide and through recall). Those reports carried code, runId, status and repairable only.

  • ResumeFailureReport (packages/spec/src/contracts/approval-service.ts) gains two optional members, innerRefusal ({ code, message }, the engine's AutomationResult.innerRefusal) and userMessage. The names and shapes are the thrown RESUME_FAILED's. innerRefusal is absent when the strand met no refusal; userMessage can ride alone. Both are read the way the thrown RESUME_FAILED reads them: an innerRefusal outside its declared shape and a blank or non-string userMessage are dropped. userMessage is in the run's locale (AutomationContext.locale, the starter's). ResumeFailureDetailsSchema is unchanged: on the resume door these members already ride the error envelope.
  • packages/services/service-automation/src/engine.ts: takeSubflowParentStrand returns the stranded parent's innerRefusal / userMessage beside runId, repairable and error, read from the parent's own result (inner-refusal.ts docblock kept true).
  • packages/plugins/plugin-approvals/src/approval-service.ts: the recall door's own strand, the batch resume's strand and the subflow-parent sites (now built by one helper) fill both members when the strand met a refusal. Both members are read once, through recognisedRefusal (the spec FlowInnerRefusalSchema plus declaredUserMessage), in serviceResume and parentStrandReport (L2 S2).
  • scripts/engine-double-contract.pinned.json: the gate-required ledger row for the new test's engine double.

Tests

  • packages/plugins/plugin-approvals/src/resume-failure-refusal.test.ts (new): recall into a refusing hook, and the subflow-parent strand through decide and recall, each carry innerRefusal and the marked userMessage; a CONTROL strand that met no refusal carries neither (absent, not empty).
  • packages/services/service-automation/src/resume-failure-refusal.test.ts (new): the engine's subflow-parent strand carries the parent's refusal.
  • packages/spec/src/contracts/resume-failure-report.pin.test.ts: the type pin restated for the two optional members.
  • resume-failure-refusal.test.ts (L2 round): a plugin node's malformed pair (blank userMessage, unregistered code, non-string members) reaches recall's resumeFailure without those members, on the own strand and the parent strand; a well-formed pair rides whole (CONTROL).
  • batch-item-recall-resumes-batch.test.ts: a refused batch resume carries the pair (N3).

Acceptance notes

Verification

L2 fix round, final head 8c0b7ce (origin/main merged, no conflict), under the shared verify lock: plugin-approvals 124/124 files, 1766/1766 tests; spec 855/855 files, 27365 passed + 1 todo; service-automation 289/289 files, 4184/4184 tests; all three typechecks exit 0. Ablations: the serviceResume read reverted, 3 red (the malformed shapes on the recall's own strand); the parentStrandReport read reverted, 3 red (the parent strand); the batch arm's spread removed, 1 red (N3); CONTROL green throughout, restore checked by hash. dispatch-gates --commands: 103 derived, 100 exit 0, 3 NOT MEASURED locally (need a full workspace build; green in CI). Overlap-check clean. CI on 8c0b7ce: 58 success, 11 skipped, 0 failed.

Earlier round, superseded:

Reported by the dev at 9b417c9 (origin/main e9f65a3 merged in): spec, service-automation and plugin-approvals typecheck exit 0; plugin-approvals 123 / 123 files, 1731 / 1731 tests; service-automation 288 / 288 files, 4134 / 4134 tests; spec 848 / 848 files; dispatch-gates --commands 103 derived, 103 run, all exit 0; overlap-check clean. Ablations: the recall spread removed (2 red), the pair removed from the parent-strand helper (4 red), the engine carry removed (the engine pin red, and after a rebuild the approvals pins 4 red); controls held. CI on this PR is the seat's to read.


Generated by Claude Code

… the subflow-parent strand

Claude-Session: https://claude.ai/code/session_012MmDsNmJFXm6DALa3xPdkp
Co-authored-by: Claude <noreply@anthropic.com>
…or subflow-parent strand

ResumeFailureReport gains innerRefusal / userMessage (the names and shapes
the thrown RESUME_FAILED carries); the engine's SubflowParentStrand carries
the stranded parent's refusal; the recall door and every subflow-parent
builder fill the pair when the strand met a refusal.

Claude-Session: https://claude.ai/code/session_012MmDsNmJFXm6DALa3xPdkp
Co-authored-by: Claude <noreply@anthropic.com>
@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 Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/plugin-approvals, @objectstack/service-automation, @objectstack/spec, touching 20 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/services/service-automation/src/inner-refusal.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/automation/approvals.mdx (via innerRefusal (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand), userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand), RESUME_FAILED (literal, a string literal in parentStrandReport; a string literal in recall; a string literal in resumeBatchOfRecalledItem; a string literal in resumeRecordedOutcome))
  • content/docs/automation/flows.mdx (via ApprovalService (symbol, a top-level class), bubbleToParent (symbol, a method of class AutomationEngine), RESUME_FAILED (literal, a string literal in parentStrandReport; a string literal in recall; a string literal in resumeBatchOfRecalledItem; a string literal in resumeRecordedOutcome))
  • content/docs/frontend/plugins/plugin-chatbot.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))
  • content/docs/permissions/authentication.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))
  • content/docs/permissions/system-context.mdx (via describeEffectiveAccess (sdk, the bare tail of client method security.describeEffectiveAccess, bound to GET /api/v1/security/users/:id/effective-access))
  • content/docs/protocol/kernel/error-handling.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))
  • content/docs/protocol/kernel/http-protocol.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))
  • content/docs/ui/actions.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))
  • content/docs/ui/translations.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))
  • content/docs/ui/views.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))

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

  • content/docs/releases/v17/17-1.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))
  • content/docs/releases/v17/17-4.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))
  • content/docs/releases/v17/17-6.mdx (via ApprovalService (symbol, a top-level class))
  • content/docs/releases/v17/index.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))
  • content/docs/releases/v18/18-1.mdx (via ApprovalService (symbol, a top-level class), innerRefusal (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand), userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))
  • content/docs/releases/v18/18-3.mdx (via RESUME_FAILED (literal, a string literal in parentStrandReport; a string literal in recall; a string literal in resumeBatchOfRecalledItem; a string literal in resumeRecordedOutcome))
  • content/docs/releases/v18/18-4.mdx (via describeEffectiveAccess (sdk, the bare tail of client method security.describeEffectiveAccess, bound to GET /api/v1/security/users/:id/effective-access))
  • content/docs/releases/v18/18-6.mdx (via userMessage (symbol, a field of interface ResumeFailureReport; a field of interface SubflowParentStrand))

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
  • 1 changed file(s) yielded no anchor (packages/services/service-automation/src/inner-refusal.ts) — pages documenting those are invisible to this run
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 174 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 f848e3739f36fdfadc58cb4ce07defda6e624cba → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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 f848e3739f36fdfadc58cb4ce07defda6e624cba → 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#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C

席位核对 · L1 ACCEPT · Head-sha: 9b417c9 · 2026-11-17T22:41Z

Card #34638, claim 6948207060. Opened by the seat on the maintainer's order (card comment). The seat read the contract diff itself.

Item Reading
Shape Draft, base main, Fixes #34638; Clause-②: yes, Metadata-protocol: none. Nine files (+593 −38): spec contracts/approval-service.ts and its type pin, service-automation engine.ts (+ an inner-refusal.ts docblock), plugin-approvals approval-service.ts, two new test files, the engine-double ledger row, and a changeset (spec, service-automation and plugin-approvals patch).
Contract ResumeFailureReport gains optional innerRefusal?: FlowInnerRefusal and userMessage?: string, the names and shapes of the decision doors' thrown RESUME_FAILED (#34579). Absent on a fault that met no refusal. Never synthesised from prose, and never part of the failure class (code and repairable read as before). ResumeFailureDetailsSchema is unchanged. The ApprovalDecisionResult docblock's old ⛔ ("they ride the ERROR") is rewritten so it stays true: not top-level, but carried on resumeFailure. Additive widening of a published type, so Clause-②: yes is right.
Premise Held at c513d62: recall built resumeFailure without the pair, and SubflowParentStrand carried no refusal. The engine now hands the parent's refusal through takeSubflowParentStrand.
Tests New approvals pins: recall, and the subflow parent through decide and through recall, each carry both members. CONTROLs: a strand on a fault carries neither (absent, not empty). The engine pin is the same, with its CONTROL. Ablations reported by the dev.
Overlap git merge-tree with origin/main: clean (the branch is behind main; CI runs on the merged ref).
Gates Dev's local run at 9b417c9: 103 derived families, all exit 0. CI on this head is read before landing.
Open question Where the pair is declared (ResumeFailureReport only, as pushed, or the shared ResumeFailureDetailsSchema) goes to the L2.
Landing Not governed. Owed before the queue: a contract-review-tier L2 record (packages/spec/src/** contract face) and every check green.

Contract-review-handoff: l2-review#3 — CONTRACT_REVIEW_TIER not taken yet in this seat (two at-tier reviews of this seat in flight); the seat reviews at tier itself or hands off at sign-off (2026-11-17T22:41Z) · head 9b417c9

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C

Contract-review-claim: session_012MmDsS4GoHCgYwA2uv3n3C · head 9b417c9 · 2026-11-17T22:57Z

The lane reviews at tier itself: an isolated reviewer sub-agent at CONTRACT_REVIEW_TIER (the request route to l2-review#3 has been silent since 19:13Z).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9b417c941ddf021399952547b23edc40d2c5fb86
Local-runs: none
Scope: packages/spec/src/contracts/approval-service.ts + packages/plugins/plugin-approvals/src/approval-service.ts, packages/services/service-automation/src/engine.ts, packages/services/service-automation/src/inner-refusal.ts
Security-touching: no

Inputs read: card #34638 (body and all six comments), PR #34999 (body, file list, its three comments, and the net diff from merge base e9f65a3b to this head), and the check-runs on this head. The seat's L1 ACCEPT comment on the PR was fetched with the others and is not used as evidence. Read to judge, never reviewed: the cited code at this head (run-resume.ts, runtime-identity.ts and dag-traversal.ts in service-automation; packages/types/src/stranded-decision.ts; packages/rest/src/approvals-routes.ts; api/automation-api.zod.ts and contracts/automation-service.ts in spec; the hook refusal catalogue in packages/runtime), the two rulings the contract cites (the #16472 ruling, comment 5567695080; ruling B′ on #24914, comment 6303788292) and the record on PR #34619 that filed this card (6938300180). The two new test files, the type pin and the pin ledger are the lane seat's ACCEPT at TIER_DEFAULT; they were read only to see what the head pins.

Check-runs on this head: 69, all completed. 58 concluded success and 11 skipped; none failed and none is pending. The successes include Lint & Repo Gates, TypeScript Type Check (workspace, source gates, consumer gates, debt ledger), Test Core and its ten shards, Build Core, Check Changeset, Spec property liveness, Governed Surface Queue Guard, Type Check UI, Test UI and its sixteen shards, Build & E2E UI, Live E2E UI and Dogfood Regression Gate. Lint UI concluded skipped.

① Derived judgments

  • ResumeFailureReport (@objectstack/spec/contracts) gains innerRefusal?: FlowInnerRefusal and userMessage?: string. Right: both are optional, innerRefusal reuses the type declared once in api/automation-api.zod.ts, and code, runId, status and repairable keep their types and meanings. The report minus what it adds is still ResumeFailureDetails.
  • ApprovalRecallResult.resumeFailure and ApprovalDecisionResult.resumeFailure widen through that type alone. Right: both stay optional under the same absence rule.
  • No Zod schema moves (ResumeFailureDetailsSchema, FlowFailureDetailsSchema and FlowInnerRefusalSchema are untouched) and no export is added or removed. Right: no generated artifact is owed, and the spec artifact gates in TypeScript Type Check are green.
  • Wire: the 200 answers of POST …/approvals/requests/:id/recall and of the decision doors gain two optional keys inside resumeFailure, present only when the engine reported them. Right: the REST door relays the service result verbatim (res.json(out)), and the status code, resumed, resumeError and the four existing report members answer what they answered before. A consumer that asserted the exact four-key report sees up to six on a refused strand, which the member's "Optional and ADDITIVE" already allowed.
  • SubflowParentStrand, the return value of AutomationEngine.takeSubflowParentStrand (@objectstack/service-automation), gains the same two optional members. Right: additive on a return value.
  • ApprovalResumeSurface.takeSubflowParentStrand (@objectstack/plugin-approvals, the surface a host implements) now returns its three members plus the optional pair. Right: a host that returns the three-member shape still satisfies it, and what the service reads from the engine widens by two optional members.
  • No error code is minted. Right: the report's code is still this package's one registered literal, RESUME_FAILED, and innerRefusal.code is relayed from the engine.
  • The thrown RESUME_FAILED envelope and StrandedDecisionDetails are untouched. Right: the decision door's own strand answers exactly what it answered.

② Semver level

  • patch on @objectstack/spec, @objectstack/service-automation and @objectstack/plugin-approvals is right. Metadata-protocol: none is the right kind, since nothing a metadata author can write changes, and a non-protocol widening ships patch (AGENTS.md, Post-Task step 3). The three packages the diff moves are the three named; @objectstack/rest only relays and @objectstack/types is untouched. Check Changeset concluded success.
  • Clause-②: yes is right, and it is line-initial in the PR body and in the changeset body: a published type grows by two optional members and nothing accepted before is refused.
  • Nothing is breaking, so no ADR-0087 disposition and no migration is owed; the changeset's "No migration" sentence is right.
  • Changeset prose against the diff: accurate, except the parenthesis "(the declared sentence in the caller's locale)". That is S1 below. The changeset ships as CHANGELOG text, so it is corrected in the same edit as the docblock.

③ Boundary flags

  • Open question, where the pair is declared: on ResumeFailureReport only, as pushed.
  • Triage on the card (6938361547) said no maintainer card is needed unless this review finds otherwise. It does not: the [Decision] Must a resume failure reach the CALLER in a shape it can act on? — the family question triage reserved, now that its instance cards have each measured their own half and stopped at the same contract #16472 ruling fixes what a report must carry and forbids a new code, and caps no further member; ruling B′'s semantics for the pair are kept (④).
  • The PR was opened by the seat on the maintainer's order and its body is the seat's; the PR author is objectstack-fleet[bot], and the diff is the dev's pushed branch. No effect on the contract. The body's Verification paragraph (the dev's local counts and ablations) is not relied on here; the check-runs above are the verdict.
  • Out of the claim's listed surface, inner-refusal.ts: accepted. The hunk is a docblock, and it is the sentence the engine.ts hunk would otherwise leave false ("no caller reads their result").
  • Out of the claim's listed surface, scripts/engine-double-contract.pinned.json: the lane seat's. It adds two rows for the new test file's engine double and removes none.
  • The claim listed ResumeFailureDetailsSchema and the diff does not touch it. That agrees with the answer above.
  • Security-touching: no, and why. No hunk adds, removes or changes a permission, sharing, credential, token or authentication check, and none teaches one. On disclosure: the refusal's diagnostic text already reaches the same caller on the same answer in resumeError (the recall door copies the resume failure text, and the parent-strand prose embeds the strand's error), so innerRefusal.message is a substring of what that caller reads today. userMessage is new on these answers. It is the text its producer marked for end users, no access decision reads it, and the decision doors' 500 has carried it since approvals: a hook refusal in the step after an approval answers 500 RESUME_FAILED after the decision is recorded, stranding the run and the record — surface the refusal as a 4xx before finalizing #34579. On a parent strand the refused write ran under the parent run's own principal and the reader is the door's caller. I read that as a relay of text already meant for end users, not as security behaviour, so the line reads no.
  • Reviewed-by: this record was rendered by an isolated reviewer sub-agent. Its environment names no session of its own (its remote session is the seat's), so the line carries the seat's session, as the brief directs. The diff was produced by the dev's branch; the seat wrote the PR body only.
  • SQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join.
  • Outside the diff, not a finding on this head: resumeRecordedOutcome also serves the auto-reject, send-back and resubmit doors, and those keep resumeError and drop resumeFailure (their result types declare none). A parent strand behind an auto-reject therefore reaches its caller as prose only, the refusal included. That is older than this PR, and the card scoped the recall door and the parent strand through decide and recall. The seat may file it.

④ Design judgment

packages/spec/src/contracts/approval-service.ts (the hits file), against the rulings it implements and its first consumer:

  • The [Decision] Must a resume failure reach the CALLER in a shape it can act on? — the family question triage reserved, now that its instance cards have each measured their own half and stopped at the same contract #16472 ruling holds. The report still tells the registered code, the stranded run's id and repairable, the status code does not move, and the pair is optional, additive and "never part of the failure class".
  • Ruling B′ holds for innerRefusal: it is the engine's own member under the type declared once, nested beside the report's code and never replacing it, present only when a refusal was met and never synthesised from prose.
  • userMessage rides inside resumeFailure, not at the top level of the 200 answer. Right: the top-level userMessage is the error envelope's channel, and this answer is a success. The rewritten prohibition on ApprovalDecisionResult.resumed says so and stays true, because the decision door's own strand still rides the error.
  • That rewrite reverses no ruling. The prohibition it rewrites was already there before PR fix(approvals): RESUME_FAILED carries the refusal that stranded the run #34619 (that PR's record calls it existing), and what it guarded still holds: the decision door's own strand is never told on the success answer. Whether resumeFailure should carry the pair was left to a follow-up card by that record (its N2), and this card is that follow-up.
  • The channel map in the interface docblock is accurate: the resume door carries innerRefusal in error.details and userMessage at the envelope's top level, and the decision doors' thrown RESUME_FAILED carries both on its body.
  • First consumer: the producer in plugin-approvals and its tests. No reader of resumeFailure exists in ui/ or packages/client at this head, so the docblock is all a future reader has. That is why S1 matters.

S1 (should-fix) — ResumeFailureReport.userMessage says the hook's sentence is "in the caller's locale"; on this channel the tree serves the run's locale.

  • Every strand this report tells is a resumed leg: the recall door's own resume, or the bubble that resumes a parent.
  • AutomationContext.locale, in the same package, states the rule: a resumed leg renders in the starter's locale "whoever resumes it", and a run no person started (a record-change, schedule or webhook trigger) carries none.
  • The code follows that rule. resolveRunDataContext hands the run's locale to the write ("worded for the person who started the run"), deciderSegmentContext moves userId and the grants to the decider and leaves locale, and serviceResume hands the engine no locale.
  • So an approver whose decision strands a subflow parent reads the language of whoever started the run (usually the submitter), and a record-change run answers the hook's declared message as authored.
  • Everywhere else in this docblock "caller" is the reader of the report, so the sentence promises the reader's language. The changeset repeats it in a parenthesis, and the PR body's summary line does too.
  • Nothing in the head pins it: the new approvals test says in its header that the locale is "the runtime's choice" and pins the carrier only.
  • Fix, wording only, in the member docblock and the changeset: the run's locale, which is the language of whoever started the run, and the authored message when no person started it.
  • The same sentence has stood on StrandedDecisionDetails.userMessage in @objectstack/types since PR fix(approvals): RESUME_FAILED carries the refusal that stranded the run #34619. That file is outside this diff, so correcting it or filing it is the seat's. Whether a decision should be re-worded for the decider is a design question for its own card.

Implementing files, sentence by sentence:

  • packages/services/service-automation/src/engine.ts: agrees. The strand is recorded only on the 'stranded' exit, and carriedRefusalOfResult(parentRes) copies what that exit put on the parent's own result (...readCarriedRefusal(err) in run-resume.ts). A fault spreads nothing, so "absent, never synthesised from error's text" holds.
  • packages/services/service-automation/src/inner-refusal.ts: agrees. The added exception is true: a parent on the 'stranded' exit does carry the members on its result, and the strand is now the one reader of them.
  • packages/plugins/plugin-approvals/src/approval-service.ts: agrees on what is filled, and where. There are five construction sites of resumeFailure and all five carry the pair: the three parent-strand sites through parentStrandReport, and the recall door's own strand and the batch resume's own strand through resumeRefusalOf(err). The exits that report nothing still report nothing. It does not agree on how the pair is read: S2.

S2 (should-fix) — the success channel skips the two reads the thrown channel applies, so the two approvals channels can answer one engine result differently.

  • On the thrown path strandedDecisionDetails drops an innerRefusal whose code is outside the closed ErrorCode set or whose message is not a string, and reads userMessage through declaredUserMessage, so a blank or non-string value is not a marking.
  • On this path serviceResume keeps both members whenever they are not undefined, the recall arm and the batch arm spread them last into the report, and parentStrandReport copies the strand's members the same way.
  • The engine's own data nodes never produce a malformed member. But the engine brands whatever a node executor returns (attachCarriedRefusal(…, result) in dag-traversal.ts; pickCarried passes any string and any defined innerRefusal), and node types are open to plugins.
  • A plugin node that returns a blank userMessage on the step after a recall puts a blank userMessage on the 200 answer, where the contract says "presence IS the marking" with the "same semantics as on every other channel". The same result through decide carries none. An unregistered innerRefusal.code likewise reaches the wire under a member typed with the closed set.
  • The diff also leaves a standing sentence in serviceResume false: "the recogniser in @objectstack/types validates it before anything reaches the wire". That was true while the thrown envelope was the only reader; the recall and batch reports now read the same value with no recogniser.
  • Fix: apply the same two reads once where the pair is built for this channel (serviceResume and parentStrandReport), and correct that comment.

Break attempts that did not break it:

  • A fault-stranded run or parent carries neither member: the fault spreads nothing on the recall door's own strand, on the batch resume's own strand, or on any parent strand.
  • A parent strand names the parent's run id and the parent's refusal, never the child's.
  • A strand is deleted on read, so no refusal from an earlier resume can ride a later report.
  • The exits with no report (a lost run, the tolerated duplicate, a failure with no engine status) gain nothing.
  • With the engine's own producers the spread cannot overwrite code, runId, status or repairable, because serviceResume builds the carried object with the two keys only.
  • No lookup failure can reach the batch report: batchRunId is set only just before the resume.

Nits:

  • N1 (nit) — the ⛔ paragraph on ResumeFailureDetailsSchema still counts code as the one member a parse strips. Since this diff the parse strips the refusal pair too (the head's own pin measures it), and "Which is exactly why" now follows the refusal sentence, not the code one. The advice ("never as a way to obtain the report") is unchanged and still right.
  • N2 (nit) — the changeset says both members are absent when the strand met no refusal. userMessage can ride alone, on a marked throw outside the 400 range. The member docblocks state each rule on its own and are right. This is the looseness the PR fix(approvals): RESUME_FAILED carries the refusal that stranded the run #34619 record accepted as its N1.
  • N3 (nit) — the batch arm is unpinned. resumeBatchOfRecalledItem spreads resumeRefusalOf(err) into its own strand report, and no test in the head drives a refused batch resume; the new file covers the recall door's own strand and the parent strand through decide and recall. Read, the arm agrees with the contract, but removing that spread would leave every gate green. The lane seat's face.
  • N4 (nit, prose, the seat's) — docs. content/docs/automation/approvals.mdx names resumeFailure nowhere at this head, so the diff makes nothing on that page false; its one strand callout describes the decision door's own strand (the 500) and stays true. Left untold there: the same refusal now reaches a recall, and a decision inside a subflow whose parent is refused, on a 200 answer in resumeFailure. content/docs/automation/flows.mdx is the only page under content/docs that names resumeFailure, and it spells the report as an exact four-key object; for a refused parent the report now carries two more keys. The approvals callout's "the sentence to show the approver" shares S1's imprecision and is outside this diff.

S1 and S2 are open on this head. A head that closes them owes a delta read.

Implemented-by: claude/issue-34638-resume-failure-refusal
Reviewed-by: session_012MmDsS4GoHCgYwA2uv3n3C

VERDICT: PASS

…he strip paragraph counts the refusal pair

Claude-Session: https://claude.ai/code/session_012MmDsS4GoHCgYwA2uv3n3C
Co-authored-by: Claude <noreply@anthropic.com>
…e thrown RESUME_FAILED does

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C

席位核对 · L1 delta ACCEPT · Head-sha: 8c0b7ce · 2026-11-19T05:56Z

The dev's delta report is 7001052178 on #34638. It closes S1 and S2 of record 6963905172, plus N1–N3, and merges origin/main.

Item Reading
S1 The ResumeFailureReport.userMessage docblock and the changeset say the run's locale (AutomationContext.locale, the starter's). No runtime change.
S2 ApprovalService.recognisedRefusal reads the pair once in serviceResume and once in parentStrandReport: FlowInnerRefusalSchema.safeParse plus declaredUserMessage. New pins: 8 malformed-pair cases and the N3 batch pin. Ablations: 3, 3 and 1 red, CONTROL green, restore checked by hash.
Open question Where the recogniser lives. Seat ruling: option A. Keep the spec-schema read: it is the declaration carriedInnerRefusal implements by hand, so it is the same rule, and @objectstack/types stays out of this diff.
Out of scope StrandedDecisionDetails.userMessage (packages/types) still says "the caller's locale" on the thrown channel. It is noted in the seat's hand-over and is not part of this PR.
Gates CI on 8c0b7ce: 58 success, 11 skipped, 0 failed. Mergeable clean. Locally, 103 gate families derived: 100 exit 0, 3 not measured locally (they need a full build; green in CI). Overlap-check clean. No dogfood battery is owed (Clause-②: yes, no !).
PR body The seat updated it to this head (the locale wording, the read rule, tests, verification).
Owed A delta contract-review-tier L2 record on this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C

Contract-review-claim: session_012MmDsS4GoHCgYwA2uv3n3C · head 8c0b7ce · 2026-11-19T05:56Z

A fresh isolated reviewer sub-agent at CONTRACT_REVIEW_TIER renders the delta record.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 8c0b7ce7a05a10278f47c1c99baed3c674882425
Local-runs: none
Scope: packages/spec/src/contracts/approval-service.ts + packages/plugins/plugin-approvals/src/approval-service.ts, packages/services/service-automation/src/engine.ts, packages/services/service-automation/src/inner-refusal.ts, .changeset/34638-resume-failure-refusal.md
Security-touching: no

Delta round on record 6963905172 (head 9b417c941d), which left S1 and S2 open.

Inputs read: card #34638 (body and all eight comments, the dev's delta report 7001052178 among them), PR #34999 (body, file list, its six comments), the delta from 9b417c941d to this head, the net diff against main, and the check-runs on this head. The seat's L1 delta comment and its ruling on the open question were fetched with the others and are not used as evidence. Read to judge, never reviewed: packages/types/src/stranded-decision.ts, packages/types/src/thrown-http-error.ts, packages/spec/src/api/automation-api.zod.ts, packages/spec/src/contracts/automation-service.ts and packages/services/service-automation/src/runtime-identity.ts, all at this head. The test files, the type pin and the pin ledger are the lane seat's ACCEPT at TIER_DEFAULT.

The delta is three commits: 34fd229f09 (docblock and changeset wording), c5762e51ce (the read) and 8c0b7ce7a0 (a merge of origin/main). The merge moved plugin-approvals/src/approval-service.ts, engine.ts and ten lines of the hits file. None of that touches the refusal pair, the strand or resumeFailure; it is main's own work on other cards. engine.ts and inner-refusal.ts carry no change of this PR since the earlier record.

Check-runs on this head: 73, all completed. 60 concluded success and 13 skipped; none failed and none is pending. The successes include Lint & Repo Gates, TypeScript Type Check (workspace, source gates, consumer gates, debt ledger), Test Core and its ten shards, Build Core, Check Changeset, Spec property liveness, Governed Surface Queue Guard, Type Check UI, Test UI and its sixteen shards, Build & E2E UI, Live E2E UI and Dogfood Regression Gate. Lint UI concluded skipped. The PR is a draft and reads mergeable clean.

① Derived judgments

  • The published types are the ones the earlier record judged: ResumeFailureReport gains optional innerRefusal and userMessage, and nothing else in @objectstack/spec moves. The delta changes docblock text only in the hits file. Right: no schema, export or generated artifact moves.
  • The delta adds one runtime rule in @objectstack/plugin-approvals: a private static ApprovalService.recognisedRefusal. It keeps innerRefusal only when FlowInnerRefusalSchema.safeParse accepts it and userMessage only when declaredUserMessage reads a marking. Right: it is private, it returns the two keys and nothing else, and it adds no export.
  • Wire, against the earlier head: a well-formed pair rides resumeFailure exactly as before. A malformed member is now dropped where it was relayed. Right: the earlier head never shipped, so no released answer narrows, and the member docblocks now state the drop.
  • Wire, the thrown RESUME_FAILED: unchanged. serviceResume now reads the pair before it throws, and strandedDecisionDetails reads it again. The second read accepts everything the first one kept, so the envelope answers what it answered.
  • The new value import, FlowInnerRefusalSchema from @objectstack/spec/api, adds no dependency. @objectstack/spec is already a dependency of the plugin, and @objectstack/types (already imported here) loads the same entry for ErrorCode.
  • No error code is minted, and @objectstack/types and @objectstack/rest stay out of the diff.

② Semver level

  • patch on @objectstack/spec, @objectstack/service-automation and @objectstack/plugin-approvals still stands. The delta adds no package and no published member. Check Changeset concluded success.
  • Clause-②: yes still stands, line-initial in the PR body and in the changeset. Metadata-protocol: none still stands: nothing a metadata author writes changes.
  • Nothing is breaking, so no ADR-0087 disposition and no migration is owed.
  • Changeset prose against the tree: accurate on this head. The locale parenthesis now names the starter's language and the authored message. The absence sentence now lets userMessage ride alone. The new sentence on the read (an unregistered code, a non-string message, a blank or non-string userMessage are dropped) is what recognisedRefusal does.

③ Boundary flags

  • Open question, where the innerRefusal recogniser lives: A, keep the schema read. I judged it against the live tree, not against the seat's ruling.
    • carriedInnerRefusal (packages/types/src/stranded-decision.ts) keeps a value when it is an object, its message is a string and ErrorCode.safeParse(code) succeeds, and it returns code and message only.
    • FlowInnerRefusalSchema is a non-strict z.object of code: ErrorCode and message: z.string(), with no default, transform or refinement. It keeps the same values and strips the same extra keys.
    • Both read one ErrorCode: stranded-decision.ts imports it from @objectstack/spec/api, which re-exports error-code-ledger.zod, the module automation-api.zod.ts imports it from.
    • null, a string, an empty object and an empty-string message get the same answer from both. The one input they split on is an array that carries its own code and message properties. No producer makes one.
    • The own-strand value passes recognisedRefusal before it reaches either channel, so the thrown envelope and the recall report cannot answer one engine result differently, whatever the two readers do alone. The parent strand has the success channel only.
    • So it is the same rule today. B would add a public export to @objectstack/types to share six lines. What A leaves behind is N5.
  • The dev's deviation (the schema read in place of the module-private function) is that same question, answered above.
  • Out-of-scope note in the dev's report, StrandedDecisionDetails.userMessage still says "the caller's locale": true at this head, outside this diff, and the earlier record already left it to the seat. It is not a finding here.
  • Out-of-scope note in the dev's report, four stray log files at a filesystem root from a void ablation attempt: not in the tree and not in the diff. The seat's.
  • The merge of origin/main was ordered by the coordinator, with no rebase and no force-push. It brought no conflict and nothing into the files' refusal hunks.
  • Security-touching: no, as on the earlier head. The delta's one runtime hunk drops malformed relay values. It adds, removes or changes no permission, sharing, credential, token or authentication check, and it teaches none.
  • Reviewed-by: this record was rendered by an isolated reviewer sub-agent whose remote session is the seat's, so the line carries the seat's session, as the brief directs.
  • SQL push-down: no finding. The delta adds no query, no id materialisation and no in-app join.

④ Design judgment

No must-fix, no should-fix.

S1: closed.

  • The ResumeFailureReport.userMessage docblock now says the sentence is in the run's locale (AutomationContext.locale), the language of whoever started the run, and the catalogue's authored message when no person started it.
  • That agrees with the tree. AutomationContext.locale says a resumed leg renders in the starter's locale whoever resumes it and is absent on a run no person started. resolveRunDataContext carries the run's locale to the write.
  • "Usually the submitter, not this report's caller" removes the promise the old sentence made to the reader. The changeset and the PR body say the same.
  • No runtime change, which is right: the finding was the wording.

S2: closed.

  • Both reads now run where the pair is built for this channel: once in serviceResume, which feeds the recall arm and the batch arm through resumeRefusalOf, and once in parentStrandReport, which the three parent-strand sites share.
  • All five construction sites of resumeFailure are covered. err.resumeRefusal is set at one line only, from the recognised value, and read only through resumeRefusalOf.
  • userMessage goes through declaredUserMessage, the function the thrown channel calls, so a blank or non-string value is no marking on either channel.
  • innerRefusal goes through the spec schema, which is the thrown channel's rule (③).
  • The comment the earlier record found false is rewritten and now true: the thrown envelope's recogniser reads the value again, and the recall and batch reports have no reader after that line.
  • The member docblocks and the changeset state the drop, so the contract's "same semantics as on every other channel" holds for a malformed value too.

Files, sentence by sentence, on this head:

  • packages/spec/src/contracts/approval-service.ts (the hits file): holds. The strip paragraph, the innerRefusal read sentence and the userMessage paragraph each agree with the code they describe. ResumeFailureDetailsSchema declares runId, status and repairable and none of the three members the paragraph says a parse strips.
  • packages/plugins/plugin-approvals/src/approval-service.ts: agrees. recognisedRefusal does what its docblock says, and a member that fails its read is dropped while the strand is still told.
  • packages/services/service-automation/src/engine.ts and inner-refusal.ts: unchanged by this PR since the earlier record, and they still agree. The engine relays the parent's members unread, and its docblock claims no read. The read is the approvals service's, which is where the spec member places it.
  • .changeset/34638-resume-failure-refusal.md: agrees (②).

Break attempts that did not break it:

  • A null innerRefusal from a plugin node fails the schema and is dropped. It never reaches the report or the envelope.
  • The spread cannot overwrite code, runId, status or repairable: recognisedRefusal returns at most the two keys, and the schema strips any extra key a node put on innerRefusal.
  • A marked userMessage beside a malformed innerRefusal still rides, and the reverse. Each member is read on its own.
  • A fault-stranded run carries neither member: both sources are undefined, and the function returns an empty object.
  • The exits that report nothing (a lost run, the tolerated duplicate, a failure with no engine status) still report nothing. The 'stranded' test in front of each own-strand site is untouched.
  • The thrown envelope loses nothing it carried: the second read keeps every value the first one kept.

Earlier nits:

  • N1: closed. The strip paragraph counts code, innerRefusal and userMessage, and names the code as one of them.
  • N2: closed. The changeset states each absence rule on its own.
  • N3: closed on the lane seat's face. The head carries a pin that drives one refused batch resume and reads the pair off resumeFailure. Its ablation is the dev's report and was not re-run here.
  • N4: open, the seat's, as ordered. content/docs/automation/approvals.mdx and flows.mdx are outside this diff; the diff still makes neither page false.

New nits:

  • N5 (nit, follow-up, outside this diff) — one rule now has two spellings. carriedInnerRefusal hand-implements what FlowInnerRefusalSchema declares. They agree today. A member later added to the schema would ride the success channel and be stripped on the thrown one. @objectstack/types already imports @objectstack/spec/api, so that function could call the schema. The seat may file it.
  • N6 (nit, prose) — ResumeFailureReport.innerRefusal still says "copied verbatim" two sentences before it says a value outside the declared shape is dropped. The two declared members are verbatim; a key beyond them is stripped. Accepted as it stands.

Nits alone remain, so this round ends the review of this PR's contract.

Implemented-by: claude/issue-34638-resume-failure-refusal
Reviewed-by: session_012MmDsS4GoHCgYwA2uv3n3C

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C

Landing · Head-sha: 8c0b7ce · 2026-11-19T06:01Z

Probe Reading
Check-runs on 8c0b7ce 60 success, 13 skipped, 0 in progress, 0 failed. Lint & Repo Gates, TypeScript Type Check, Test Core, Test UI and Type Check UI: all success.
Contract review The delta record on this head (just above), served at CONTRACT_REVIEW_TIER and checked by verify-review-tier: PASS. No must-fix, no should-fix. S1, S2 and N1–N3 closed. N5 and N6 are nits: N5 is a follow-up, N6 is accepted. N4 (the docs pages) is the seat's and goes into its hand-over.
Mergeable · governed mergeable_state clean. check-governed-merges.mjs --pr 34999: not governed. No dogfood battery is owed (Clause-②: yes, no ! in the title).

State: ready + auto-merge now (L1 delta ACCEPT above). #34638 closes on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 19, 2026 06:02
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 8f49499 Nov 19, 2026
74 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34638-resume-failure-refusal branch November 19, 2026 06:32
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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

approvals: recall and the subflow-parent strand report resumeFailure without the hook refusal (innerRefusal, userMessage)

2 participants