Repository navigation
fix(approvals): a recall or subflow-parent strand reports the hook refusal that stranded the run - #34999
Conversation
… 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>
Claude-Session: https://claude.ai/code/session_012MmDsNmJFXm6DALa3xPdkp Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MmDsNmJFXm6DALa3xPdkp Co-authored-by: Claude <noreply@anthropic.com>
…refusal pin Claude-Session: https://claude.ai/code/session_012MmDsNmJFXm6DALa3xPdkp Co-authored-by: Claude <noreply@anthropic.com>
…sume-failure-refusal
📓 Docs Drift CheckThis PR changes 3 package(s): 10 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 8 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 174 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 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
|
|
repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C 席位核对 · L1 ACCEPT · Head-sha: 9b417c9 · 2026-11-17T22:41ZCard #34638, claim 6948207060. Opened by the seat on the maintainer's order (card comment). The seat read the contract diff itself.
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 |
|
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). |
|
repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C Contract reviewServed-tier: Inputs read: card #34638 (body and all six comments), PR #34999 (body, file list, its three comments, and the net diff from merge base Check-runs on this head: 69, all completed. 58 concluded ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
S1 (should-fix) —
Implementing files, sentence by sentence:
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.
Break attempts that did not break it:
Nits:
S1 and S2 are open on this head. A head that closes them owes a delta read. Implemented-by: 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>
…sume-failure-refusal
|
repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C 席位核对 · L1 delta ACCEPT · Head-sha: 8c0b7ce · 2026-11-19T05:56ZThe dev's delta report is 7001052178 on #34638. It closes S1 and S2 of record 6963905172, plus N1–N3, and merges origin/main.
|
|
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. |
|
repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C Contract reviewServed-tier: Delta round on record 6963905172 (head 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 The delta is three commits: Check-runs on this head: 73, all completed. 60 concluded ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. S1: closed.
S2: closed.
Files, sentence by sentence, on this head:
Break attempts that did not break it:
Earlier nits:
New nits:
Nits alone remain, so this round ends the review of this PR's contract. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-lizheng · session_012MmDsS4GoHCgYwA2uv3n3C Landing · Head-sha: 8c0b7ce · 2026-11-19T06:01Z
State: ready + auto-merge now (L1 delta ACCEPT above). #34638 closes on merge. |
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,预期全部通过。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_FAILEDalready carriesinnerRefusaland the refusal's markeduserMessage(#34579, PR #34619). Two doors report a stranded run on a success answer instead, throughresumeFailure: the recall door, whose own resume stranded, and a subflow parent that stranded after the run this door resumed advanced (throughdecideand throughrecall). Those reports carriedcode,runId,statusandrepairableonly.ResumeFailureReport(packages/spec/src/contracts/approval-service.ts) gains two optional members,innerRefusal({ code, message }, the engine'sAutomationResult.innerRefusal) anduserMessage. The names and shapes are the thrownRESUME_FAILED's.innerRefusalis absent when the strand met no refusal;userMessagecan ride alone. Both are read the way the thrownRESUME_FAILEDreads them: aninnerRefusaloutside its declared shape and a blank or non-stringuserMessageare dropped.userMessageis in the run's locale (AutomationContext.locale, the starter's).ResumeFailureDetailsSchemais unchanged: on the resume door these members already ride the error envelope.packages/services/service-automation/src/engine.ts:takeSubflowParentStrandreturns the stranded parent'sinnerRefusal/userMessagebesiderunId,repairableanderror, read from the parent's own result (inner-refusal.tsdocblock 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, throughrecognisedRefusal(the specFlowInnerRefusalSchemaplusdeclaredUserMessage), inserviceResumeandparentStrandReport(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 throughdecideandrecall, each carryinnerRefusaland the markeduserMessage; 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 (blankuserMessage, unregistered code, non-string members) reaches recall'sresumeFailurewithout 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
session_012MmDsNmJFXm6DALa3xPdkppushed this branch, and its own permission classifier refused its relaypr_create. This body is the seat's, written from the pushed commits and changeset.ResumeFailureReportonly (as pushed; the contracts interface), or onResumeFailureDetailsSchema(the shared zod schema). The dev recommends the former, so nothing is declared that a channel does not fill.inner-refusal.ts(a docblock in the same package) andscripts/engine-double-contract.pinned.json(written by the gate's--write).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
serviceResumeread reverted, 3 red (the malformed shapes on the recall's own strand); theparentStrandReportread 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 --commands103 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