Repository navigation
fix(runtime)!: bind a resume approval to the screen it was given on - #34753
Conversation
A handed-off resume_run now names the screen its values were given for (ActionConfirmationHandOff.run.screenNodeId). dispatchActionResume takes it back and step 5 refuses a run no longer paused on that screen with 409 RESOURCE_CONFLICT, leaving the run where it is. An elicited approval is bound the same way. Without the key, the current screen is resumed as before. Claude-Session: https://claude.ai/code/session_01ADHkmSKdmdbBugjg8QSZGa Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmSKdmdbBugjg8QSZGa Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 178 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 c72dbb805842c4533d4e888158bc9a514c92e779 && git checkout c72dbb805842c4533d4e888158bc9a514c92e779
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3bbda33b78fff2681db9c09732347bc62ffc4cc6 85b5f360e19824f42dea785b8036c39c1caf8dbd && git checkout -B drift-repro 3bbda33b78fff2681db9c09732347bc62ffc4cc6 && git merge --no-ff 85b5f360e19824f42dea785b8036c39c1caf8dbd
node scripts/docs-audit/affected-docs.mjs --json 3bbda33b78fff2681db9c09732347bc62ffc4cc6
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz Final head for review: |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 1f37c11 · 2026-11-17T10:21Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmTHGRTjPqZAcBuo9WH 席位核对L1 first review · REWORK (declaration and prose only; the code is accepted as read) · head Rework items
Checklist (read on GitHub at this head, not from the report)
Owed after this
|
…n binding Claude-Session: https://claude.ai/code/session_01ADHkmSKdmdbBugjg8QSZGa Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz Final head for review (supersedes 6945242171): |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 51975cc · 2026-11-17T11:15Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmTHGRTjPqZAcBuo9WH 席位核对L1 delta · ACCEPT · head Delta
The two deviations the area named
Re-read at this head
Owed after this
|
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract reviewServed-tier: Inputs read: card #34515 body and all six comments (analysis 6932866004, ruling 6942893807, claim 6943219796, registration 6943263230, dev report 6944537865, seat correction 6945347284); PR #34753 body, its 8-file list, the net diff against merge-base Check-runs on this head: 72, all completed, none pending: 60 success, 12 skipped, 0 failed. Skipped: the ① Derived judgments
② Semver levelClause-②: yes (narrowing) — the right single line for a diff that both widens and narrows. AGENTS.md allows
③ Boundary flags
④ Design judgmentpackages/spec/src/contracts/ai-service.ts, against ruling 6942893807 (A), its first consumer (
S1 (should-fix) — the contract does not state the narrowing this PR declares BREAKING. In ai-service.ts rule 4, "Elicited packages/runtime/src/domains/mcp.ts, action-dispatch.ts, action-execution.ts, against the contract:
N1 (nit) — the compare is read-then-resume, not atomic with the engine's Open on this head: S1, and the two escalations in ③ (the maintainer's confirmation of the BREAKING elicited cell; the cloud card). No finding of the failing grade. Implemented-by: VERDICT: PASS |
…mation contract The elicited accept of a resume_run is bound to the screen the run was parked on when the person was asked; a run that moved on meanwhile is refused 409 and stays where it is. The host-door guide also names the 400 for an unusable screenNodeId and the looping-wizard limit. Claude-Session: https://claude.ai/code/session_01ADHkmSKdmdbBugjg8QSZGa Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz Final head for review (supersedes 6946459224): |
|
repo:objectstack#2 · os-steve · session_01ADHkmTHGRTjPqZAcBuo9WH 席位核对L1 delta · ACCEPT · head Delta (one commit, 2 files, +8/−2, prose only)
Re-read at this head
Owed after this
|
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 85b5f36 · 2026-11-17T12:01Z |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract reviewServed-tier: The surface is an approval and resume gate, which is authorisation-adjacent; this delta itself moves prose only. Delta record over 6946628926 (VERDICT PASS on What the delta is, read in the tree: one commit whose parent is the reviewed head, nothing from Check-runs on this head: 74, all completed, none pending: 62 success, 12 skipped, 0 failed. Skipped: the ① Derived judgmentsNothing derived moved: the delta adds no key, no code path and no refusal. Every judgment of 6946628926 ① stands as written there, re-read at this head against the unchanged mcp.ts, action-dispatch.ts and action-execution.ts. The two the delta's prose now speaks to, re-derived:
② Semver levelClause-②: yes (narrowing) — unchanged, and still the right single line for a diff that both widens and narrows; body and changeset carry it identically. Nothing in the delta bears on the level: ③ Boundary flags
④ Design judgmentpackages/spec/src/contracts/ai-service.ts, rule 4, against the code it cites (
content/docs/ui/actions.mdx, read for agreement: the 400 sentence and the looping-wizard sentence are both true of the code and agree with the changeset. One paragraph line is left long after the insert; cosmetic, S1: closed N1 (nit) — not moved by this delta. The compare is read-then-resume, not atomic with the engine's No must-fix, no should-fix. Open on this head: nits N1, N2 (jsdoc part) and N3; the escalation of the BREAKING elicited cell to the maintainer at Tier H; and the seat's own read of objectstack-ai/cloud#4549 before its governed step. Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmQ2SN4K183oqAvUajA Seat record · 2026-11-17T12:06Z · Head-sha: 85b5f36 维护者速读
席位意见:同意合并。三种复现都关住,宿主不传键时行为不变;收窄那一路已点明交你确认。 席位核对
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44080397986 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Steve · project thread
Fixes #34515
Clause-②: yes (narrowing) — narrowed: an MCP
resume_runof a declared-gated flow action on a client that is asked in place (form-modeelicitation), where the person accepts after the wizard moved on to another screen in the meantime, is now refused409 RESOURCE_CONFLICTand resumes nothing, where it resumed the screen the run had moved on to. Widened beside it:ActionConfirmationHandOff.run.screenNodeIdandActionResumeRequest.screenNodeIdare new optional keys, and a host call that omitsscreenNodeIdbehaves as before.Metadata-protocol: none
Skills-docs: none — no skill under
skills/**teaches what a second resume of one run does (skills/objectstack-ai/SKILL.mdlines 211–217 andskills/objectstack-platform/SKILL.mdline 344 teach the hand-off, theconfirmrefusal and the elicitation answers only);content/docs/ui/actions.mdxgains the rule in this change.repo:objectstack#2 · os-steve · session_01ADHkmSKdmdbBugjg8QSZGa
维护者速读
resume_run待办现在记下当时停住的那一屏(run.screenNodeId),宿主批准时把它传回dispatchActionResume;流程已经不在那一屏就拒绝(409RESOURCE_CONFLICT),流程原地不动。在客户端里当场确认的情形同样绑定当屏。resume_run、用户先在应用里推进后才批,三种情形都把第一屏的值以批准人身份交给了第二屏并直接走完流程(裁决 6942893807,选项 A)。screenNodeId的调用照旧续跑当前屏。唯一变严的一路(BREAKING):客户端当场确认时,若人点确认前向导已被推进到别的屏,以前会续跑那一屏,现在拒 409、什么都不续跑,agent 需在当前屏重新发起。循环回到同一屏节点的向导仍分不开(已知局限,未见实际用例)。回滚即撤掉本 PR。packages/runtime/src/domains/mcp.ts(refuseUnresumableAdmittedRun第 5 步的比对、交出待办处写screenNodeId、当场确认分支)、packages/spec/src/contracts/ai-service.ts(ActionConfirmationHandOff.run.screenNodeId与规则 4 散文)、packages/runtime/src/action-confirmation-handoff-33690.test.ts(新[#34515]一组)。pnpm --filter @objectstack/runtime exec vitest run src/action-confirmation-handoff-33690.test.ts -t 34515,预期 7 条全绿(4 条拒绝、1 条 400、2 条 CONTROL)。packages/spec/src契约,先过契约复审)。What changes
A multi-screen wizard stays
pausedunder the same run id as it moves from screen to screen. The host resume door's step 2 refuses only a run that is no longer paused, so a second resume of one handed-offresume_runpassed steps 2 to 5 and submitted the first screen's values to the screen the run had moved on to, as the approver. Reproduced onmain(dc66d33) on a real stack before any code, in all three ways the card names (readings under Verification).@objectstack/spec/contracts,ai-service.ts):ActionConfirmationHandOff.rungains the optionalscreenNodeId: theScreenSpec.nodeIdthe run was parked on when the call was handed off, the screenvalueswere given for. Rule 4's prose and theIActionConfirmationServicedocblock say the approval is bound to that screen when the host passes it back, and that a run on another screen is refused409 RESOURCE_CONFLICTand stays where it is. The old sentence that left "voiding an item whose run has moved on" to the host is replaced; deciding an item once stays the host's. Rule 4's elicited-acceptbullet states the same binding for aresume_runasked in place: bound to the screen the run was parked on when the person was asked, refused409 RESOURCE_CONFLICTif the run moved on meanwhile, the run left where it is.resumeActionRun,domains/mcp.ts): step 5's helperrefuseUnresumableAdmittedRunnow returns the screen it read, and the hand-off writes itsnodeIdintorun.screenNodeId(omitted when the engine named none).dispatchActionResume→resumeActionRunRequest):ActionResumeRequestgains the optionalscreenNodeId(action-dispatch.ts). Given, it rideswiring.hostDoorinto step 5, which refuses a run paused on another screen with409 RESOURCE_CONFLICTbeforeresume()is called, so nothing is consumed. AscreenNodeIdthat is not a non-empty string is refused400before the run is read.409 RESOURCE_CONFLICTand nothing resumes. Onmainthe same call answered 200 and resumed the screen the run had moved on to, with the values the agent gave for the first one. This is the narrowing theClause-②line declares; the agent asks again on the screen the run is on now. Same defect class, same function, no contract change.RESOURCE_CONFLICT/ 409, the code step 5 already answers for "paused, but not on a screen". No new code is minted, so the error-code ledger is untouched.action-execution.ts): the enforced-set comment of the confirmation gate now names the host resume door (dispatchActionResume) beside the host action door.content/docs/ui/actions.mdx, "Resume a handed-off run as the person who approved it", passesscreenNodeId: handOff.run.screenNodeIdin the example and states the 409, the 400 for anull, empty or non-stringscreenNodeId, and the looping-wizard limit..changeset/34515-resume-approval-bound-to-screen.md,@objectstack/specand@objectstack/runtimepatch, with the BREAKING paragraph for the elicited path (before and after) and its ADR-0087 dispositionnot-required (no-migration-prescription): no schema key, value or metadata type moves, and the moved answer is a runtime refusal at the MCP door.screenNodeIdfollowsScreenSpec.nodeId(packages/spec/src/contracts/automation-service.ts), the id the engine already serves for a parked screen; the seat analysis 6932866004 proposed the same name.Tests
packages/runtime/src/action-confirmation-handoff-33690.test.ts: the harness's automation double takes an optional screen list;resumemoves the run to the next screen (stillpaused, same run id) and completes it after the last. The single-screen default behaves as before. Newdescribe('[#34515] …'), seven cases:screen_1(run now onscreen_2), the second is refused409 RESOURCE_CONFLICT,resumecalled once, run still onscreen_2;resume_runcalls, two items: approving the second after the first is refused 409;resumenot called;screenNodeIdof''or7: refused 400 beforegetRun;packages/qa/dogfood/test/action-confirmation-handoff-33690.dogfood.test.ts(real stack, real automation engine, real MCP over HTTP, the host approval throughdispatchActionResume): the fixture gains a gated two-screen wizard action and a gated one-screen action; three cases: the same item approved twice (first 200 and the run onstep_2, second 409 and still onstep_2), an item approved after the person advanced the wizard throughPOST /automation/FLOW/runs/RUN/resume(409), and CONTROL single screen completes.[#33690]case "a resume sent N times resumes 0 times" pins the hand-off withtoEqual; it now expectsrun: { runId, values, screenNodeId: 'screen_1' }.Acceptance notes
nodeId(option D of the analysis, a pause id from the engine). No flow doing that was found; not filed.screenNodeIdbehaves as before. The cloud host must storerun.screenNodeIdwith the pending item and pass it back on approval. Cloud half: objectstack-ai/cloud#4549 (comment 6944653166).resume_runtool itself (an agent resuming an ungated action) is not bound to a screen: the agent's own call submits to the current screen, as before. Not in this card.detailsdiscriminator, matching its sibling ("paused, but not on a screen"); the message names both screens.Verification
Reproduction on main (dc66d33), before any code
Real stack (
bootStack,SecurityPlugin,MCPServerPlugin, a confirmation-service double), a gated flow action over a two-screen wizard (step_1,step_2, both collecting an optionalcomment). The person starts it in the app (REST/actions, run paused onstep_1), the agent calls MCPresume_run(handed off), the host approves throughdispatchActionResumewithconfirm: true:step_2; approve ✨ Set up Copilot instructions #2 → 200, runcompleted(step_2submitted with step 1's bag).resume_runtwice (two items,call 1/call 2): approve item 1 → 200, onstep_2; approve item 2 → 200,completed.POST /automation/FLOW/runs/RUN/resume) → onstep_2; approve the item → 200,completed.step_2, still paused.Ablation (head bd71f4d, the step-5 comparison disabled through scripts/ablation-replace.mjs)
git diff HEADempty.dist, rebuilt under the lock): 2 failed (the two 409 cases), 4 passed. Restore leg: runtime rebuilt,ablation-dist-preflight --absent✓ (marker absent from all 12 built files), dogfood 6/6.Local runs (head 85b5f36, the contract sentence and the docs lines; no code change)
dispatch-gates --commands: 113 derived (the same set as at 51975cc); 113 run, all exit 0 (sixpackages/specgates that readdistfirst answered exit 3 for a stale build and were re-run green afterpnpm --filter @objectstack/spec build);--ranreconciliation: 113 accounted for, 0 NOT-MEASURED.ai-service.tsandcontent/docs/ui/actions.mdxonly.Local runs (head 51975cc, after the changeset narrowing and a merge of main 6dd5716)
pnpm --filter @objectstack/dogfood test, underos-verify-lock): exit 0, Test Files 478 passed, 3 skipped (481); Tests 4058 passed, 68 skipped (4126).dispatch-gates --commands: 113 derived; 113 run, all exit 0;--ranreconciliation: 113 accounted for, 0 NOT-MEASURED.check-adr-0087-registration: exit 0 (BREAKING,!and the Clause-② narrowing read together; dispositionnot-required (no-migration-prescription)).Local runs (head 1f37c11, earlier round)
pnpm --filter @objectstack/runtime test: exit 0, 611 files, 11345 passed, 19 skipped.pnpm --filter @objectstack/runtime typecheck,@objectstack/spec typecheck,@objectstack/dogfood typecheck: exit 0.packages/specaction-confirmation-contract.pin.test.ts: 14/14.check:generated: all artifacts current (itscheck:test-typechecklane needed a 4096 MB heap and then read OK).dispatch-gates --commands: 113 derived; 113 run, all exit 0 (three first answered exit 3 for prerequisites and were re-run green after fetching the teardown fixture commit and building./packages/**);--ranreconciliation: 0 NOT-MEASURED.Generated by Claude Code