Skip to content

feat(runtime,mcp)!: a confirmation-gated action never runs on the MCP caller's own confirm — run_action and resume_run hand it to the person - #34202

Merged
objectstack-fleet[bot] merged 12 commits into
mainfrom
claude/area-A5-33690
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 12 commits into
mainfrom
claude/area-A5-33690

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5

Requested by Steedos · project thread

Fixes #33690

Clause-②: no (narrowing)
Metadata-protocol: semantic
Skills-docs: follow-up #34210

维护者速读

  • 改了什么:作者声明 ai.requiresConfirmation: true 的动作,经 MCP run_action / resume_run 调用时,不再因调用方自己发的 confirm: true 而执行;改为交给宿主的待确认服务(返回待确认编号),没有该服务时拒绝(428,reason: no_confirmation_service)。
  • 为什么改:AI 自己说“已确认”就能跑高危动作,等于没有确认;裁决要求由本人在应用里确认。
  • 风险与回滚:BREAKING——依赖 confirm: true 无人值守跑这类动作的脚本/代理会被挂起或拒绝;开源版无该服务,这类调用一律 428。回滚即 revert 本 PR。
  • 先看:packages/runtime/src/action-dispatch.ts(admitResolvedAction 中新分支,只对 MCP 门生效);packages/runtime/src/domains/mcp.ts(resume_run 的移交分支);packages/runtime/src/action-execution.ts(handOffActionConfirmation)。
  • 两分钟验证:pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/action-confirmation-handoff-33690.test.ts,预期 16 个全绿(同一请求发 5 次,执行 0 次、5 个待确认编号)。
  • 需要你做的:无,席位落地。

What changes

BREAKING for an MCP client, an agent or a script that runs an action declaring ai.requiresConfirmation: true through run_action or resume_run by sending confirm: true itself. Ruled on the card (re-sequencing comment 6890862846): the caller's own confirm: true never counts on such a call. The person it runs as confirms it in the app.

This implements the hand-off and refusal steps of the amended confirmation contract (AI_ACTION_CONFIRMATION_CAPABILITY, the docblock of packages/spec/src/contracts/ai-service.ts, read and not edited). No door elicits yet (#33712), so every declared-gated MCP call takes the hand-off.

  • Hand-off (MCP door only). After every admission gate, the subject load and the caller-scope subject verdict included, a declared-gated call goes to the host's IActionConfirmationService (registered under ACTION_CONFIRMATION_SERVICE) through submit. The tool answers status: 'pending_confirmation' with the service's pendingId, a plain message, actionName and objectName. That answer is the tool's successful result. Nothing runs, and no action_invocation row is written. A resume_run hand-off carries run: { runId, values }, and the run stays paused.
  • No service (the open-source build ships none): the call is refused 428 ACTION_CONFIRMATION_REQUIRED with details.reason: 'no_confirmation_service', with or without confirm: true.
  • A service that answers no pendingId is a fault. The call fails and nothing runs.
  • AI service account acting for itself: refused as before (ADR-0151 D3 rule 3). Its refusal now carries details.reason: 'service_account' at every action door.
  • Unchanged (bounds):
    • REST /actions stays outside the gate for a person.
    • A host's door (dispatchAction) under the ai posture still reads confirm. The hand-off is keyed on the MCP door, not the posture.
    • The MCP delete_record and delete_records gates still read confirm: true.
    • confirm stays accepted on run_action and resume_run; it is not read, and its tool text says so.

Files:

  • packages/runtime/src/action-execution.ts:
    • aiDoorConfirmation
    • resolveActionConfirmationService
    • handOffActionConfirmation
    • refuseDeniedSubjectBeforeHandOff
    • the service_account reason
    • invokeBusinessAction returns the pending answer.
  • Runtime wiring:
    • action-dispatch.ts: confirmationHandOff on the resolved call, the handedOff run outcome, and handOffAdmittedAction after the verdict.
    • domains/mcp.ts: resumeAdmissionRefusal answers the hand-off step (name kept, ADR-0066 anchors it), and refuseUnresumableAdmittedRun is factored out so the hand-off branch runs steps 4 and 5 first.
  • packages/mcp/src/mcp-http-tools.ts: the run_action / resume_run descriptions teach the pending answer and the refusal.

Tests

  • New packages/runtime/src/action-confirmation-handoff-33690.test.ts (16 tests):
    • Sent 5 times with confirm: true, the call executes 0 times, and each attempt is held with its own pending id.
    • The member is not read.
    • A delegated agent is handed off for its person.
    • A flow starts no run; a declarative update writes nothing.
    • A denied record is 404 with no hand-off.
    • With no service, the call is 428 with the reason.
    • A missing pendingId throws.
    • An account is refused with service_account and nothing is read.
    • resume_run: 5 sends resume 0 times, the run rides the hand-off, and with no service the run stays paused.
    • CONTROLs: REST /actions for a person, the host door under the ai posture, and a plain action.
  • New packages/mcp/src/mcp-action-confirmation-handoff-33690.test.ts (4 tests) uses the real MCP HTTP door:
    • The pending answer is a non-error result.
    • The no-service envelope keeps code + status + details.reason.
    • The member stays in both schemas.
  • New dogfood twin packages/qa/dogfood/test/action-confirmation-handoff-33690.dogfood.test.ts runs the real stack, SecurityPlugin, MCP over HTTP and a service double. Sent 3 times, the call writes 0 times and is held 3 times for the person. CONTROL: an undeclared action runs at once.
  • Flipped pins (they encoded the caller's confirm: true running the action):
    • packages/runtime/src/action-confirmation-gate.test.ts: the MCP-door describe.
    • packages/runtime/src/mcp-resume-run.test.ts: the confirmed resume, the account details, and the delegated CONTROL.
    • packages/runtime/src/action-dispatch.test.ts: the ADR-0151 D3 rule 3 account details, plus the person and delegated MCP CONTROLs.
    • packages/runtime/src/domains/api-action-forward.test.ts: in the MCP list_actions offers sys_api_key.revoke_api_key as runnable to an API-key caller, and run_action then refuses it 403 #28943 pair, the gated call is now held. The API-key guard and the session revoke are kept on a twin that declares no confirmation.
    • packages/runtime/src/mcp-system-object-action-exposure.test.ts: the HITL gate test.
    • packages/runtime/src/platform-admin-action-gate.test.ts: the ruling E CONTROL. Gated actions are held for member and admin; ungated ones are unchanged.
    • packages/mcp/src/mcp-resume-run-tool.test.ts: the tool text.
    • examples/app-todo/test/mcp-actions.test.ts: step 7.
    • packages/qa/dogfood/test/approval-decide-over-mcp.dogfood.test.ts
    • packages/qa/dogfood/test/approval-read-over-mcp.dogfood.test.ts
    • packages/qa/dogfood/test/mcp-system-object-action-exposure.dogfood.test.ts

Acceptance notes

  • Approvals over MCP. On a host without a pending-confirmation service, the approve, reject, recall, send-back and resubmit actions ([Decision] Should an approver be able to see and decide their pending approvals over MCP? #32442) are now refused at MCP for a person. That is the ruling: the person decides in the app.
  • Pre-forward refusals. An api-typed declared-gated action whose forward would be refused (the sys_api_key credential guard, an organization-role endpoint) is now held or refused at the confirmation step before that refusal is reached. The contract places the hand-off after admission and before execution, and those refusals sit in the forward. list_actions still marks them unavailable.
  • No-service message wording. The message says to perform the action in the app. It does not name a client that supports confirmation, because no door elicits yet (MCP transport: server-to-client elicitation mid-call, so supporting clients confirm in place (UX upgrade over the email hold) #33712).
  • Stale served text. The served skill text (packages/mcp/src/skill-md.ts, and its mirror ui/apps/console/src/pages/developer/objectstack-skill.ts) and TOOL_RETIRED_KEY_GUIDANCE in packages/spec/src/ai/tool.zod.ts still teach confirm: true for run_action. The mirror is outside this card's surface, so this is reported for follow-up. Skills-docs: above names the published skills.
  • Grader. packages/qa/scenarios/src/runner/observe.ts rule 1 reads a successful write call as applied, so a hand-off answer would be graded applied on a host that registers the service. No open-source stack registers one. This is reported for follow-up.

Verification

Final head 292c638502. Every family CI runs is read from this PR's check-runs, not re-run here.

Focused pins and suites
  • pnpm --filter @objectstack/runtime exec vitest run (whole package) at 2266f4da70, the last source commit before the main merge: Test Files 610 passed (610), Tests 12430 passed, 19 skipped. RUNTIME_EXIT=0.
  • pnpm --filter @objectstack/mcp exec vitest run (whole package) at 2266f4da70: Test Files 66 passed (66), Tests 1189 passed (1189). MCP_EXIT=0.
  • The four runtime files whose pins flipped last, plus mcp-resume-run-tool.test.ts: Test Files 4 passed (4), Tests 160 passed; Test Files 1 passed (1), Tests 10 passed.
  • At 292c638502, re-run after the test-only commits that followed the battery:
    • The five touched dogfood files (the hand-off twin, mcp-delete-record-confirmation, the two approvals files, and the system-object exposure file): Test Files 5 passed (5), Tests 35 passed (35).
    • src/mcp-system-object-action-exposure.test.ts: Test Files 1 passed (1), Tests 11 passed (11).
  • @objectstack/example-todo test, @objectstack/runtime typecheck (with check:test-typecheck) and @objectstack/mcp typecheck all exit 0 at 56a42d81e2, after the closure build exited 0.
  • eslint --no-inline-config on every changed .ts file: exit 0.
Ablation: put the caller's confirm back as the confirmation

Both legs used node scripts/ablation-replace.mjs, which checks that the anchor hits, that the mutation lands on disk, and that the restore matches the blob at HEAD.

  • A1, packages/runtime/src/action-execution.ts:
    • Mutation: confirmationHandOff: { door: 'mcp', … } was replaced with confirmation: input. Anchor x1 to x0; blob fa5e3071e0da to 93e90f85b005.
    • Result: action-confirmation-handoff-33690.test.ts went red, Tests 6 failed, 10 passed. Among the failures: "the same request with confirm: true, sent 5 times, executes 0 times and is held 5 times with a pending id", "holds the call with the member and without it alike", and "no service registered: refused 428 … reason no_confirmation_service".
    • Restore: blob back to fa5e3071e0da; git diff HEAD empty.
  • A2, packages/runtime/src/domains/mcp.ts:
    • Mutation: if (handOff) { was replaced with if (handOff && (input as any)?.confirm !== true) {. Blob 0be1c84eed37 to a50361d0cffd.
    • Result: red, Tests 2 failed, 14 passed. The failures were "confirm: true sent 5 times resumes 0 times; each call is held with a pending id carrying its run and values" and "no service registered: refused 428, reason no_confirmation_service, and the run stays paused".
    • Restore: blob back to 0be1c84eed37; git diff HEAD empty.
  • After both legs, git diff HEAD measured 0 bytes.
Full dogfood battery (the title carries a bang)
  • Run at 56a42d81e2 under the verify lock (VERDICT command-exit 0 for the batch; DOGFOOD=1): Test Files 2 failed, 466 passed, 3 skipped (471); Tests 1 failed, 3959 passed, 42 skipped (4002).
  • Both reds were consequences of this change, and both are fixed in this PR by test-only commits:
    • The new twin's ai.description was under the 40-character floor. That made a ZodError at collection.
    • mcp-delete-record-confirmation.dogfood.test.ts compared the delete gate's detail keys with run_action's, which now carry reason. The pin now leaves reason aside and asserts that the delete gate carries none, per the bounds.
  • Both files were re-run green at 292c638502 (above). The battery was not re-run end to end after those two test-only commits, and CI runs it.
Gates
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 74 families derived at 292c638502. 72 ran with exit 0.
  • Two are NOT MEASURED:
    • check:dual-build-cjs-loads: exit 3, PREREQUISITE NOT MET, because there is no full workspace build here.
    • check:type-check-debt: a lock queue-timeout, and then the re-measure was killed by my own timeout wrapper.
  • --ran reconciliation: "74 derived famil(ies) accounted for — 72 run, 2 NOT-MEASURED", exit 0.
  • node scripts/check-platform-checklist.mjs --changed-from origin/main: OK, 29 anchors judged, 0 lost.
  • Body gates run before opening:
    • check-changeset-no-major --event: exit 0, narrowing arm, Metadata-protocol: semantic.
    • check-adr-0087-registration: exit 0, not-required (already-registered).
    • check-partof-closing-keyword: exit 0.
    • check-closing-keyword-parity --body: binds only the card named on line 4 of this body.
  • git merge-tree --write-tree is clean against origin/main and against the head of the open spec PR that edits ai-service.ts.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5

…n, never run it on the caller's confirm

run_action and resume_run no longer read the confirm member on an action
declaring ai.requiresConfirmation: true. After every admission gate and the
caller-scope subject verdict, the call is handed to the host's
pending-confirmation service (ACTION_CONFIRMATION_SERVICE) and answered
status pending_confirmation with the pending id; with no service it is
refused 428 ACTION_CONFIRMATION_REQUIRED, reason no_confirmation_service.
An AI service account keeps its refusal, now carrying reason service_account.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
…sume_run; add the changeset

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
…aller's confirm; add the dogfood twin

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
…rmation contract

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
…t already-registered

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
… MCP caller's confirm

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
…; the delete-gate parity pin leaves run_action's reason aside

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
@github-actions github-actions Bot added size/xl 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 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/mcp, @objectstack/runtime, touching 33 documentable anchor(s).

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

  • content/docs/permissions/authorization.mdx (via buildMcpBridge (symbol, a top-level function))

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

  • content/docs/releases/v18/18-5.mdx (via IActionConfirmationService (symbol, a top-level type), pending_confirmation (literal, a string literal in a comment in McpActionBridge; a string literal in a comment on a changed line; a string literal in handOffActionConfirmation; a string literal in registerActionTools))

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 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 — 37 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 dfb8ed3570b3be1cfbc3758ff791ace7c31fa1a2 → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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 dfb8ed3570b3be1cfbc3758ff791ace7c31fa1a2 → 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#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Review claim (review-a, S3) · head 292c638 · 2026-11-16T01:15Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 292c638502c81c2d62204640365ffd1c715afa83
Local-runs: none
Scope: packages/runtime/src/action-execution.ts, packages/runtime/src/action-dispatch.ts, packages/runtime/src/domains/mcp.ts, packages/mcp/src/mcp-http-tools.ts, packages/runtime/src/action-confirmation-handoff-33690.test.ts, packages/mcp/src/mcp-action-confirmation-handoff-33690.test.ts, packages/qa/dogfood/test/action-confirmation-handoff-33690.dogfood.test.ts, packages/runtime/src/action-confirmation-gate.test.ts, packages/runtime/src/action-dispatch.test.ts, packages/runtime/src/mcp-resume-run.test.ts, packages/runtime/src/domains/api-action-forward.test.ts, packages/runtime/src/mcp-system-object-action-exposure.test.ts, packages/runtime/src/platform-admin-action-gate.test.ts, packages/mcp/src/mcp-resume-run-tool.test.ts, examples/app-todo/test/mcp-actions.test.ts, packages/qa/dogfood/test/approval-decide-over-mcp.dogfood.test.ts, packages/qa/dogfood/test/approval-read-over-mcp.dogfood.test.ts, packages/qa/dogfood/test/mcp-system-object-action-exposure.dogfood.test.ts, packages/qa/dogfood/test/mcp-delete-record-confirmation.dogfood.test.ts + packages/spec/src/contracts/ai-service.ts, packages/spec/src/migrations/entries/semantic/18.action-requires-confirmation-elicited.ts, packages/runtime/src/flow-start-admission.ts, packages/mcp/src/mcp-server-runtime.ts, packages/mcp/src/skill-md.ts, packages/spec/src/ai/tool.zod.ts, .github/workflows/ci.yml (all read, not reviewed)

Read: card #33690 body and its four comments (triage 6890545596, re-sequencing 6890862846, claim 6898081431, dev report 6904293454), the PR body, the net diff 86350e12..292c6385 (20 files, +1360/-293), and the check-runs on the head. Every completed check-run on the head is success or skipped; both Check Changeset runs are success.

① Derived judgments

Each change the diff implies, judged against the tree:

  • run_action, gated action, confirm: true no longer runs it — right. invokeBusinessAction no longer passes confirmation: input; it sets confirmationHandOff, and admitResolvedAction takes the aiDoorConfirmation branch, which has no request parameter and so cannot read the member in any spelling.
  • resume_run, same — right. resumeAdmissionRefusal lost its request parameter; the hand-off runs after steps 4 and 5 (refuseUnresumableAdmittedRun), and the run stays parked.
  • New successful answer status: 'pending_confirmation' on both tools — right. It matches ActionConfirmationPending in the spec, and the tool relays it through textResult as a non-error result.
  • 428 details gain reason (no_confirmation_service at MCP; service_account for an account at every action door, REST and the host door included) — right. Additive, from the spec's closed set, and the changeset says so.
  • The confirmation step moves after the subject load for a non-account caller — right, by contract step 2. A gated call on a record the caller cannot read now answers 404 where it answered 428, and a refused call may have read its subject. An account is still refused before the load.
  • No action_invocation row for a hand-off — right. The call did not run; the contract makes the pending item the host's record.
  • confirm stays in both input schemas, unread — right for this card; no schema narrowing is published. Its retirement is open question B (③).
  • No public export moves. packages/runtime/src/index.ts exports only dispatchAction and its three types from these files; ResolvedActionRun gaining handedOff is internal.
  • Pre-forward refusals of an api-typed gated action (the sys_api_key guard, organization-role endpoints) are now answered by the confirmation step first — right. They sit in the forward, after admission; the pins keep the guard on an ungated twin.

Flipped pins: I read all eleven existing test files against the dev report's flipped_pins. Each moves only what the declaration says:

  • "runs on confirm: true" becomes "refused no_confirmation_service with and without the member";
  • account refusals gain reason: 'service_account';
  • the dropped "reads no record" assertion in action-confirmation-gate.test.ts follows from the reordering above;
  • the delete-gate parity pin sets reason aside and asserts the delete gate carries none.

No pin outside the confirmation behaviour was loosened. The REST, host-door and ungated controls are kept or added.

② Semver level

  • Clause-②: no (narrowing) and Metadata-protocol: semantic appear line-initial in both the PR body and the changeset.
  • semantic is right: no key or accepted value is added or removed; what an author's ai.requiresConfirmation: true means at the MCP door changes.
  • minor on @objectstack/runtime and @objectstack/mcp is right: a kind other than none takes at least minor on each package the diff moves, and those are the two it moves (the examples and qa hunks are tests).
  • Narrowing-arm obligations, all present:
    • ! in the title;
    • the BREAKING banner with FROM and TO lines in the changeset;
    • exactly one ADR-0087 marker, not-required (already-registered action-requires-confirmation-elicited); the entry exists at the merge base and its surface is this declaration.
  • The dogfood battery obligation is judged in ③.

③ Boundary flags

④ Design judgment

The narrowing makes the spec's own refusal real. The contract on main (AI_ACTION_CONFIRMATION_CAPABILITY, ai-service.ts) already says the caller's confirm never counts on a declared-gated call at run_action and resume_run, and that the doors enforce it "in the change that enforces it". This is that change. Elicitation (step 1) is declared and not delivered; that is a tracked implementation gap (#33712, re-sequenced by ruling 6890862846), and the fallback taken is step 2 or 3, never the member.

Attempts to break the hand-off, all failed:

  • Other doors. buildMcpBridge in domains/mcp.ts is the only McpActionBridge implementation, so stdio and HTTP share the one path. runResolvedAction has two callers: the MCP door (hand-off) and the REST renderer (never sets confirmationHandOff). No other MCP tool runs an action.
  • REST /actions, the host door under ai, flow starts: unchanged, as the contract's bounds and the card say; pinned by three controls.
  • Spellings of confirm. The hand-off branch takes no request. A non-boolean top-level value fails the tool schema, and params.confirm meets the param contract.
  • A service that throws, or misbehaves.
    • submit rejecting propagates and nothing dispatches.
    • A missing or empty pendingId throws.
    • A resolution that throws, or a registration without submit, reads as no service and answers 428.
    • Every case fails closed.
  • Account and delegated agent. An account is refused before the subject load and never handed off; a delegated agent is handed off for its person.
  • Multi-candidate resume_run. The first admitted candidate decides; a gated candidate that used to be skipped without confirm now hands off, which is stricter, never looser.

Findings:

  1. should-fix — the served skill still teaches the member. packages/mcp/src/skill-md.ts (lines 480-502, published in the package this PR marks BREAKING) and TOOL_RETIRED_KEY_GUIDANCE in packages/spec/src/ai/tool.zod.ts still tell an agent to send confirm: true on run_action and resume_run. The contract's "When it binds" says the enforcing change "also moves the shipped prescriptions that describe the member". Nothing runs wrongly; on a host with a service, an agent taught to retry creates a second pending item for the person. Carrier mcp: the served MCP skill and TOOL_RETIRED_KEY_GUIDANCE still teach run_action confirm: true, which the MCP door no longer reads since the confirmation hand-off #34209 exists; it must ship in the same release as this changeset and takes its own review. No head move is asked of this PR.
  2. nit — migration entry wording. Entry action-requires-confirmation-elicited keys its switch on "the release whose changelog says the AI doors confirm by elicitation", and this changeset says the doors do not elicit yet. A reader could conclude the switch has not happened. Fold into mcp: the served MCP skill and TOOL_RETIRED_KEY_GUIDANCE still teach run_action confirm: true, which the MCP door no longer reads since the confirmation hand-off #34209.
  3. nit — bridged registry tools are outside this change. bridgeTools (mcp-server-runtime.ts) serves a host AI service's ToolRegistry over the long-lived MCP server and runs each tool through the registry's own execute. The open build registers no such service, and the contract names only run_action and resume_run. Whether a host's action-backed tools take the hand-off is the host's; not measured here. Worth one card on the host side.
  4. nit — no pin for a rejecting submit, and a resolution fault reads as "no pending-confirmation service" in the message. Both fail closed.
  5. nit — changeset Skills-docs: line still reads "follow-up owed … rewrites it to #N" while the PR body names skills: objectstack-ai and objectstack-platform still describe the MCP action confirmation gate as a caller confirm; it is now a hand-off to the host service #34210; the line ships in CHANGELOG.md.
  6. nit — the hand-off does not ask the arm's own start refusals (a flow's requiredPermissions, the api forward guards), so a person can be asked to approve a call that is refused on approval. The contract re-checks every gate at approval, so nothing runs.

Implemented-by: claude/area-A5-33690
Reviewed-by: session_01QsR2jTjrNnh6b2BkCXFugM

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Review — PASS (one prose fix owed before landing)

Head-sha: 292c638502c81c2d62204640365ffd1c715afa83
Reviewer: review-a (areas S1 + S3) · read 2026-11-16T01:22Z · diff read against the merge base with main 86350e12 (20 files, +1360/−293, matches the PR files list)
Implemented-by: session_01QsR2jTEivi2wogPpeo3xd5 (area S3 dispatch) · Reviewed-by: session_01QsR2jTjrNnh6b2BkCXFugM; the contract face by an isolated sub-agent at CONTRACT_REVIEW_TIER

Contract face: a declared narrowing, so the whole diff is under the CONTRACT_REVIEW_TIER record, comment 6904719554 (PASS, Local-runs: none). This ACCEPT read adopts it and adds the two items below.

Owed

  1. Before landing (prose only, a delta review of the changeset). The changeset's Skills-docs: line still reads "follow-up owed … (the area files the card and rewrites it to #N)". That is release text with a placeholder in it. Rewrite it to follow-up #34210, as the PR body already says.
  2. Before the next release (carried by mcp: the served MCP skill and TOOL_RETIRED_KEY_GUIDANCE still teach run_action confirm: true, which the MCP door no longer reads since the confirmation hand-off #34209, no head move here). The record's should-fix applies: the MCP server's own served skill (packages/mcp/src/skill-md.ts) and TOOL_RETIRED_KEY_GUIDANCE still tell an agent that the server refuses a requiresConfirmation action without confirm: true. This PR makes that false, because the door hands the action off. An AI agent reads that text from the server it is talking to, so mcp: the served MCP skill and TOOL_RETIRED_KEY_GUIDANCE still teach run_action confirm: true, which the MCP door no longer reads since the confirmation hand-off #34209 has to land in the same release as this changeset. Name that dependency on mcp: the served MCP skill and TOOL_RETIRED_KEY_GUIDANCE still teach run_action confirm: true, which the MCP door no longer reads since the confirmation hand-off #34209.

What holds (from the record, checked where named)

  • Every MCP door takes the hand-off. buildMcpBridge is the only action bridge, so stdio and HTTP share one path, and the hand-off branch reads no request field, so no spelling of confirm reaches it. If the service throws, returns no pendingId or has no submit, the door fails closed. With no service the answer is 428 ACTION_CONFIRMATION_REQUIRED with reason no_confirmation_service. REST /actions, the host door and flow starts are left unchanged, within the bounds the contract states.
  • Flipped pins. The eleven existing files move only what the declaration says.
  • Declaration. The title has ! and the changeset has a BREAKING banner with FROM → TO. The ADR-0087 marker is right. semantic is right. runtime and mcp take minor. Retiring confirm from the input schemas is the maintainer's open question on mcp: the served MCP skill and TOOL_RETIRED_KEY_GUIDANCE still teach run_action confirm: true, which the MCP door no longer reads since the confirmation hand-off #34209 and is outside this PR.
  • The battery. CI's Dogfood Regression Gate success on this head does not count as the battery: it is the aggregate over a shard matrix that pull_request runs skip. What covers this head is the full local battery at 56a42d81e2, a test-only delta of three files since then, and both previously red files green at the head. The shards run again in the merge queue. I accept that.

Nits (no re-review needed)

These are the record's five:

  • the migration entry's "doors confirm by elicitation" wording;
  • the host AI service's tool registry is not routed (that is a host-side card);
  • there is no pin for a rejecting submit;
  • the stale changeset Skills-docs: line, which is item 1 above;
  • start refusals are re-checked only at approval.

Gates: at review time 38 success, 18 skipped, none red.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM
Review claim (review-a, S3) · head a18a85c · 2026-11-16T01:49Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Review — PASS (delta)

Head-sha: a18a85ca6e1b65ace8c22d2e79a44412c102a70a
Reviewer: review-a (areas S1 + S3) · read 2026-11-16T01:49Z · delta 292c6385..a18a85ca: one commit, a18a85ca (changeset only, 1 file, +1/−1)
Implemented-by: session_01QsR2jTEivi2wogPpeo3xd5 (area S3 dispatch) · Reviewed-by: session_01QsR2jTjrNnh6b2BkCXFugM
Prior verdict: PASS with one prose fix owed, 6904724788 · contract record 6904719554 PASS

The owed prose fix is done. In .changeset/33690-ai-action-confirmation-hand-off.md, the Skills-docs: line now reads follow-up #34210. #34210 is open, domain:skills, carries Blocked-by: #34202, and names the two skills files and the eval exercise the old placeholder listed. Nothing else in the changeset or the PR moved, so the Clause-②: no (narrowing) and Metadata-protocol: semantic lines and the adr-0087 marker are byte-identical to the reviewed head.

The contract record still holds. The delta touches no code, schema, docblock or governed text, only the declaration line the record already named as owed. Record 6904719554 therefore covers this head, and no new record is needed.

Still owed (unchanged): #34209 must land in the same release, because packages/mcp/src/skill-md.ts and TOOL_RETIRED_KEY_GUIDANCE still teach confirm: true.

Gates: at review time 34 success, 18 skipped, none red, so every check is green.

Can land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5

席位核对

ACCEPT and landing · area S3 · 2026-11-16T01:50Z · head a18a85ca6e1b65ace8c22d2e79a44412c102a70a

Ready + auto-merge under the area S3 landing line (maintainer, project thread, 2026-11-15T11:06Z) and the pm-dispatch landing procedure (maintainer, 2026-11-15T15:56Z).


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 16, 2026 01:50
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43788698581 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (2/8) — 失败步骤: Run this shard's tests

    @objectstack/spec:test:repo:  FAIL   repo  scripts/root-index.test.ts > content/docs/references/index.mdx (the committed page) > states no count that its own rows contradict
      ↳ 失败原因: @objectstack/spec:test:repo: AssertionError: expected [ 218, 1663 ] to deeply equal [ 218, 1664 ]
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 16 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

Merged via the queue into main with commit 60fca0f Nov 16, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-A5-33690 branch November 16, 2026 02:56
This was referenced Nov 16, 2026
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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant