Skip to content

feat(runtime,mcp): ask the person in their MCP client before a confirmation-gated action runs - #34318

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

objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/area-A5-33712

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
Part of #33712
Clause-②: no
Metadata-protocol: semantic (at the MCP door, an author's ai.requiresConfirmation: true is confirmed in place for a client that advertises elicitation. The dev confirms the level against the diff and, if it holds, adds the PR body's Skills-docs: line.)
Skills-docs: follow-up #34210 (widened to cover the in-client question and the declined / cancelled / timed_out refusals)

维护者速读

  1. 改了什么:本地(stdio)连接的 MCP 客户端若支持「征询」,执行需确认的动作时直接在客户端弹框问用户:同意就执行一次,拒绝、关闭或超时(5 分钟)就拒绝,不再走邮件挂起。
  2. 为什么改:落实确认契约第 1 步(征询优先);不支持征询的客户端仍走 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 的挂起审批,行为不变。
  3. 风险与回滚:只影响声明了 ai.requiresConfirmation: true 且客户端声明了征询能力的 stdio 调用;远程 HTTP 接口行为与字节均未变。回滚即还原本 PR。
  4. 先看:packages/runtime/src/action-dispatch.ts(confirmAdmittedAction 的征询分支)、packages/mcp/src/action-confirmation-elicitation.ts(超时与取消的判读)、packages/runtime/src/domains/mcp.ts(resume_run 分支)。
  5. 两分钟验证:pnpm --filter @objectstack/mcp exec vitest run src/mcp-action-confirmation-handoff-33690.test.ts,应见 18 个用例全绿,其中 stdio 同意/拒绝/取消与 HTTP 仍挂起各有专用例。
  6. 需要你做的:无。两个问题已由你裁定(MCP transport: server-to-client elicitation mid-call, so supporting clients confirm in place (UX upgrade over the email hold) #33712 评论 6909391261):远程 HTTP 接口暂不征询,继续走邮件审批,直到 MCP Streamable HTTP door: ask the person in-client (elicitation) for a confirmation-gated action, via sessions for elicitation-capable clients #34321;用户取消或超时时直接拒绝,不发邮件。本 PR 与两项裁决一致。

What changes

Step 1 of the amended confirmation contract (AI_ACTION_CONFIRMATION_CAPABILITY, packages/spec/src/contracts/ai-service.ts) at the MCP run_action and resume_run doors, on the server that can carry it.

  • @objectstack/mcp, new action-confirmation-elicitation.ts: actionConfirmationElicitorFor(server, extra) answers an elicitor for the open tool call, or undefined when the client did not advertise form-mode elicitation on this server's initialize (the SDK reads an empty elicitation: {} as form mode). The elicitor sends ONE elicitation/create (form mode, empty requestedSchema) through extra.sendRequest, related to the tool call, bounded by ACTION_CONFIRMATION_ELICITATION_TIMEOUT_MS (five minutes, the door's bound the contract asks the door to name; a door constant, no authorable key), abandoned on the call's abort signal. It reads the result's action only (a loose schema, so a form payload the SDK's own ElicitResultSchema would reject cannot turn an accept into a failure). A timeout reads as timed_out; an error answer, an aborted call and a closed connection read as cancel (the abort check comes first because the SDK rejects an aborted request with a RequestTimeout error too).
  • mcp-http-tools.ts: both tools pass { elicitConfirmation } as a third bridge argument only when the elicitor exists; otherwise the bridge is called with exactly the two arguments it got before. McpActionBridge.runAction / resumeRun gain the optional door?: McpActionCallDoor. Both tool descriptions gain one sentence on the in-client question.
  • @objectstack/runtime: action-dispatch.ts confirmAdmittedAction (was handOffAdmittedAction) asks the elicitor after the same caller-scope subject verdict the hand-off asks, so the contract's step order holds (every admission gate, the subject load and its verdict, then the person). accept returns to runResolvedAction, which dispatches as any admitted call (the action_invocation row is written as for any run). decline / cancel / timed_out are refused 428 ACTION_CONFIRMATION_REQUIRED with reason declined / cancelled / timed_out, through the existing confirmationRefusalOf. An elicitor that throws reads as cancelled. Nothing is handed off on any answer. action-execution.ts gains elicitActionConfirmation and actionConfirmationElicitSubject (the action, its label, the object, the record id, and the record's title via resolveRecordTitle, left out rather than replaced by the id). domains/mcp.ts forwards the door from the bridge and gives resumeActionRun the same branch: accept resumes the parked run, any other answer refuses and the run stays paused.
  • An AI service account is refused at the confirmation step before the subject load, so it is never elicited. A non-capable client takes the hand-off unchanged.

Tests

  • packages/runtime/src/action-confirmation-handoff-33690.test.ts, two new top-level describes on the existing harness (the real buildMcpBridge over a kernel double; nameField: 'name' added to its object so the question can carry a title): run_action accept runs once and hands nothing off, the elicitor gets { actionName, actionLabel, objectName, recordId, recordTitle: 'Ada' }; an accept covers one call; decline / cancel / timed_out refused with their reasons, nothing runs, nothing submitted; a failing elicitor reads cancelled; an account and an unreadable record are refused before the elicitor is called; an ungated action is never asked; resume_run accept resumes with the call's values, decline keeps the run paused, an account is refused before asking.
  • packages/mcp/src/mcp-action-confirmation-handoff-33690.test.ts, three new top-level describes: a real SDK Client on the long-lived server's StdioServerTransport (newline framing over two pipes) advertising elicitation: {}: accept (one form-mode request naming action, object, record title and id), accept with an unread payload, decline, cancel, an error answer, and resume_run accept / decline; a client without the capability is never asked and the bridge gets two arguments. Streamable HTTP: a client that advertised elicitation at initialize is handed off on the next POST, answered application/json; a non-gated call answers plain JSON. actionConfirmationElicitorFor against a real Client over the SDK's in-memory pair: accept / decline / cancel, timed_out at a 50 ms bound, cancel when the client closes the connection mid-question, cancel on an error answer.

Acceptance notes

  • The Streamable HTTP door does not elicit in this PR, so this is Part of. Measured on @modelcontextprotocol/sdk 1.32.1 (LATEST_PROTOCOL_VERSION 2025-11-25): the door builds a fresh Server per POST (handleHttpRequest, stateless, no session id), so the server that answers tools/call never ran _oninitialize and holds no client capabilities; and a client's answer to a server request arrives as a separate POST, which in stateless mode reaches another fresh server with no pending request (server request ids are per-instance counters, so they cannot even be routed by id). Streaming the tools/call response alone carries the question out but nothing can carry the answer back. Eliciting there needs Streamable HTTP sessions (Mcp-Session-Id), which is an architecture decision; the options are in the report on the card. Until then the contract's own rule holds there: a door that cannot elicit hands off and is never refused for that alone.
  • Cancel and timeout are refused, as the spec contract says, not handed off. The card body (written before the contract landed) and the dispatch read "cancel or a timeout, fall back to the hold-and-email path"; the contract on main (step 4, and ACTION_CONFIRMATION_REFUSAL_REASONS) refuses them with cancelled / timed_out. This PR follows the spec text and does not edit packages/spec; the conflict is raised for a ruling on the card. Flipping it is two branches in elicitActionConfirmation.
  • The no-service message keeps leaving out "use a client that supports confirmation". It is one message for both doors, and on Streamable HTTP no client can be elicited yet, so the sentence would still be false for most callers. It is restored with the HTTP half.
  • The served skill's confirmation prose (skill-md.ts) is untouched; it stays with 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.
  • Ablations (each through scripts/ablation-replace.mjs, restore verified git diff HEAD empty): elicit branch in confirmAdmittedAction removed: 6 run_action pins red; elicit branch in resumeActionRun removed: resume accept / decline red; the tool's elicitor forced undefined: 5 stdio pins red ("expected [] to have a length of 1 but got +0"); the account refusal in aiDoorConfirmation removed: both account-before-asking pins red; the capability check in actionConfirmationElicitorFor removed: the non-capable stdio pin and the HTTP pin red.

Verification

Readings at head 3557594b65 unless named (merge of origin/main at 0f74af49d5; the only commit after it drops two inert lint comments in a test file).

Package tests (each under the shared verify lock, exit captured per part)
  • @objectstack/mcp test: 66 files / 1204 tests passed (exit 0).
  • @objectstack/runtime test (full): 607 files passed, 11101 tests passed / 19 skipped (exit 0), at c09b8aa557, before the origin/main merge, which moved no runtime source (two unrelated runtime test files). At the final head, the five confirmation files (action-confirmation-handoff-33690, mcp-resume-run, action-confirmation-gate, action-dispatch, mcp-system-object-action-exposure): 149 tests passed.
  • Direct dependents of @objectstack/mcp (its public exports grew): @objectstack/verify 52 files / 439 passed; @objectstack/http-conformance 20 / 292; @objectstack/example-todo 9 / 249; @objectstack/cli unit layer 423 / 6010 (integration layer declared to CI). @objectstack/dogfood is the battery: not run (no !, no (narrowing) arm). The runtime's dependents are not re-run: its package exports did not move.
  • pnpm --filter @objectstack/mcp typecheck and pnpm --filter @objectstack/runtime typecheck: exit 0, test layers within their ledgers.
  • eslint (--no-inline-config) on the eight touched source and test files: exit 0. The repo-wide pnpm lint is left to CI.
Derived gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 70 commands. 68 ran in one loop, each with its exit captured before any pipe: all exit 0. check:type-check-debt (re-measure, 0 entries, OK) and check:dual-build-cjs-loads (123 entries load) ran afterwards under the lock: exit 0. --ran: 70 derived, 70 run, 0 NOT-MEASURED, 0 UNRUN.

git merge-tree --write-tree against PR #34236's head c53ea9d147 and against origin/main: both clean.

Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5

🤖 Generated with Claude Code

@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 41 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/mcp/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

31 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 4c0cf65f79a7db985edc349d3615d3bb52d6362e.

⛔ 7 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/mcp/src/index.ts) — pages documenting those are invisible to this run
  • 1 cross-cutting symbol(s) contributed no route anchor: recordId (4 routes)
  • 1 anchor(s) matched too much of the corpus to be a work list: objectName (symbol, 58 pages)
  • 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 4c0cf65f79a7db985edc349d3615d3bb52d6362e → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 4c0cf65f79a7db985edc349d3615d3bb52d6362e

⚠️ 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 4c0cf65f79a7db985edc349d3615d3bb52d6362e → 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 3557594 · 2026-11-16T06:46Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 3557594b65debd8755e4e2c90385d781706f5540
Local-runs: none
Scope: packages/mcp/src/action-confirmation-elicitation.ts, packages/mcp/src/index.ts, packages/mcp/src/mcp-http-tools.ts, packages/mcp/src/mcp-action-confirmation-handoff-33690.test.ts, packages/runtime/src/action-dispatch.ts, packages/runtime/src/action-execution.ts, packages/runtime/src/domains/mcp.ts, packages/runtime/src/action-confirmation-handoff-33690.test.ts + packages/spec/src/contracts/ai-service.ts, packages/mcp/src/mcp-server-runtime.ts, packages/objectql/src/record-title.ts, docs/adr/0011-actions-as-ai-tools.md (read in the cited code, not reviewed)

The face is semantic, not a narrowing (Clause-②: no, Metadata-protocol: semantic); the four sections are judged as the brief sets them. Inputs: card #33712 with all five comments, the PR body and file list, the net diff against merge base 4bd3f240, and the check-runs on the head (every run success or skipped, none failed or pending). The SDK source is not in this checkout, so SDK behaviour is taken from the PR's pins that CI ran green on this head, not from a read of the SDK.

① Derived judgments

  • Accept-set of a declared-gated run_action / resume_run call, stdio door, client advertised form-mode elicitation: right. It moves from the hand-off (pending_confirmation) to one in-client question. accept falls through to the ordinary dispatch once; decline, cancel, timed_out are refused 428 ACTION_CONFIRMATION_REQUIRED with declined / cancelled / timed_out, through the existing confirmationRefusalOf. These reasons are already members of the closed tuple on main; nothing is added to the spec.
  • Order (contract rule 2): right. admitResolvedAction runs every gate, then the subject load; confirmAdmittedAction asks the caller-scope verdict (refuseDeniedSubjectBeforeHandOff) and only then the elicitor. On resume_run the elicit branch sits after steps 1 to 3 and after refuseUnresumableAdmittedRun (steps 4 and 5). One call site per door, so the person is asked at most once per call.
  • The caller's confirm (rule 5): right. The elicit branch is reached only through aiDoorConfirmation, which does not take the request; elicitActionConfirmation takes the elicitor and the subject and nothing else. No path reads the member.
  • AI service account (rule 6): right. Refused in admitResolvedAction before the subject load, and in resumeAdmissionRefusal before the elicit branch. Pinned on both tools.
  • Non-capable client and the Streamable HTTP door: right for call answers. The tool calls the bridge with exactly two arguments when actionConfirmationElicitorFor answers undefined, and confirmationHandOff then carries no elicitConfirmation key, so the 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 path is taken unchanged. handleHttpRequest still builds a fresh server per POST with enableJsonResponse: true; the capable-client HTTP pin is green. Not byte-identical: the run_action and resume_run tool descriptions each gain one sentence, for every client on both doors. That is a declared change and the sentence is conditional ("when your client supports elicitation and this connection can carry it"), so it is true on HTTP.
  • Fail direction: right. An unreadable result, an error answer, a thrown elicitor, an aborted call and a closed connection all read as cancel; nothing in the branch can turn a failure into a run. An answer after the bound cannot run anything: the awaited promise has already settled as timed_out and the refusal has been returned.
  • Public surface: right. @objectstack/mcp gains three value exports and four types; McpActionBridge.runAction / resumeRun gain an optional third parameter, which no existing implementer has to supply.
  • Invocation row: right. An elicited refusal returns the refused shape and writes no row, as a hand-off writes none; an accepted call writes the row every admitted call writes.

② Semver level

Clause-②: no holds: nothing an author or consumer could do before is refused now on a path that was not already a non-run (the hand-off ran nothing either). Metadata-protocol: semantic holds: no key is added or removed; what ai.requiresConfirmation: true does at the stdio MCP door changes. The rule asks at least minor on each package the diff moves; the changeset gives minor to @objectstack/runtime and @objectstack/mcp, the only two moved. Match. Check Changeset is green. No migration entry and no ADR-0087 disposition is owed: the change is not breaking and removes nothing authorable. ADR-0011's confirmation note already states the elicit step, so no ADR edit is owed.

③ Boundary flags

④ Design judgment

The change makes the spec's own declared step real at the one door that can carry it, and takes nothing away at any other. It follows the contract's order and its answer table. Findings:

  1. should-fix — run_action dispatches on the admission read before the question. The contract's rule 2 is met at the moment of asking. On accept, run_action dispatches on the subject and caller-scope verdict read before the question, while resume_run in this same PR re-reads them after the answer (through continueAdmittedRun), so the two doors differ. Rule: an elicited accept should dispatch on a subject and verdict read after the answer, as resume_run does. The mechanism went to the seat privately.
  2. should-fix — the record title in the question. (a) The subject is a row a read returned; record-title.ts states that such a row's title is read with servedRecordTitle and never re-derived, and names what re-deriving with resolveRecordTitle gets wrong. The diff calls resolveRecordTitle. (b) Rule: the question names the record by the title the caller-scope read served, bounded and neutralised, and the id stays unambiguous. The mechanism went to the seat privately.
  3. nit — the bound against client timeouts. Five minutes is a defensible door bound and the contract leaves it to the door. The server sends no progress while the question is open, so a client whose own tool-call timeout is shorter ends the call first; that reads as cancelled and runs nothing, which is safe. Acceptance against a real Claude Code or Codex client is unmeasured (the card says so too). Follow-up, not a fix here.
  4. nit — pins not present. No pin sends a late accept after the bound, cancels the tool call while the question is open, or sends initialize batched with tools/call to the HTTP door. Each fails closed by construction in the code read; the batched case rests on the SDK, which was not readable here.
  5. nit — changeset prose. The Metadata-protocol: line in the changeset carries the claim's instruction to the dev ("The dev confirms the level against the diff and, if it holds, adds the PR body's Skills-docs: line."), which ships in CHANGELOG.md. The PR body carries the same parenthetical.
  6. nit — PR body, 维护者速读 line 6 still says both questions await the maintainer. Ruling 6909391261 answered them; the line is stale.
  7. Observation for the contract, not a finding on this PR. The question names the action, the object and the record, as step 3.1 lists; it does not show the call's params or a resume's values, which a hand-off does carry to the app. The person accepts without seeing them. That is the contract's text, so any change is a spec amendment.

Spoof, replay and race: the answer is read from the SDK's pending-request table for the one request the server sent on the connection it was sent on; a second or late answer finds no pending request. ADR-0011 already states what an accept proves: that the client answered. Nothing in this PR weakens or strengthens that.

No must-fix. Findings 1 and 2 earn a delta review of their fix.

Implemented-by: claude/area-A5-33712
Reviewed-by: session_01QsR2jTjrNnh6b2BkCXFugM
VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Review — PASS

Head-sha: 3557594b65debd8755e4e2c90385d781706f5540
Reviewer: review-a (S3) · 2026-11-16T06:53Z
Implemented-by: S3 area dev (session_01QsR2jTEivi2wogPpeo3xd5)
Reviewed-by: session_01QsR2jTjrNnh6b2BkCXFugM
Diff base: 4bd3f240 (the head's main parent); 9 files, +845/−19.

What holds

  • Step order (contract step 2). confirmAdmittedAction asks only after admitResolvedAction passed and after refuseDeniedSubjectBeforeHandOff, so a call refused anyway is never asked. resumeActionRun asks only after refuseUnresumableAdmittedRun (steps 4 and 5), which now returns the subject it read so the question can carry the title. Pinned: "a record the caller cannot read is refused 404 before anyone is asked".
  • Accept runs once, nothing handed off (step 4). An elicited accept returns 'accepted' and runResolvedAction falls through to the same dispatchAdmittedAction every admitted call takes; the hand-off is the else arm, never both. The next call is asked again (pinned). Resume accept continues the parked run with the call's values (pinned).
  • Refusal reasons. decline / cancel / timed_out map to declined / cancelled / timed_out through the existing confirmationRefusalOf (428, ACTION_CONFIRMATION_REQUIRED); a throwing elicitor reads cancelled. All three are members of the closed ACTION_CONFIRMATION_REFUSAL_REASONS; no new reason is minted. Rule 5 holds: the caller's confirm is not read on this branch.
  • Service account (rule 6). aiDoorConfirmation returns refuse for an AI service account at admission, so confirmationHandOff is never reached and the elicitor is never called; pinned at both doors ("refused before anyone is asked").
  • Non-capable and HTTP callers are unchanged. actionConfirmationElicitorFor returns undefined unless the client advertised form-mode elicitation on this server's initialize and extra.sendRequest exists; the tools then call the bridge with exactly the two arguments they passed before. On Streamable HTTP the per-request server never read initialize, so it hands off (pinned with a real client that did advertise it). This is the maintainer ruling Q1=A (MCP transport: server-to-client elicitation mid-call, so supporting clients confirm in place (UX upgrade over the email hold) #33712 comment 6909391261).
  • Cancel / timeout refuse, not fall back (Q2=A). Matches the same ruling and the spec text; the PR does not edit packages/spec.
  • The answer is action alone (step 3.1). The loose result schema reads action only; a form payload the SDK would reject cannot turn an accept into a failure (pinned). The abort check precedes the timeout check, so a dropped connection reads cancel, not timed_out (pinned).
  • The timeout is a door constant (ACTION_CONFIRMATION_ELICITATION_TIMEOUT_MS, five minutes), not an authorable key, as the contract asks the door to name its bound.
  • Declarations. Clause-②: no holds: no schema, contract or authorable key moves; the new exports are additive runtime/mcp API (minor on both, as the changeset says). Metadata-protocol: semantic holds: what ai.requiresConfirmation: true does at the stdio door changes, its shape does not.
  • Ablations in the PR body cover each new branch (both elicit branches, the tool's elicitor, the account refusal, the capability check), each red when removed.

Must

None.

Should

These are the contract record's findings 1 and 2, which I verified against the diff. Each earns a delta review of its fix, and I'd fix both in this PR before landing.

  1. run_action dispatches on the admission read before the question. On accept, confirmAdmittedAction returns 'accepted' and dispatchAdmittedAction receives the same admission, with its subject and caller-scope verdict, that was read before the person was asked. resume_run in this PR re-reads them after the answer. Rule: an elicited accept dispatches on a subject and verdict read after the answer, as resume_run does, with a pin. The mechanism went to the seat privately.
  2. The record title in the question. actionConfirmationElicitSubject calls resolveRecordTitle on a row a read returned; packages/objectql/src/record-title.ts says such a row's title is read with servedRecordTitle and never re-derived. Rule: the question names the record by the served title, bounded and neutralised, and the id stays unambiguous, with a pin. The mechanism went to the seat privately.
  3. Skills-docs: follow-up owed — skills/objectstack-ai/SKILL.md needs its card number before ACCEPT (the line becomes follow-up #N). 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 covers the hand-off, no_confirmation_service and service_account only; it needs widening to the elicit step and declined / cancelled / timed_out, or a sibling card.
  4. The PR body's 维护者速读 line 6 still asks the maintainer to rule on HTTP elicitation and on cancel/timeout. Both were ruled (Q1=A, Q2=A, MCP transport: server-to-client elicitation mid-call, so supporting clients confirm in place (UX upgrade over the email hold) #33712 comment 6909391261). The seat's final copy should replace it with what the maintainer has left to do.

Nits

  1. The question names the action, object and record but not the call's params (or a resume's values). That is what contract step 3.1 asks for, so it is not a defect here; whether the person should see them is a contract question for MCP transport: server-to-client elicitation mid-call, so supporting clients confirm in place (UX upgrade over the email hold) #33712.
  2. The changeset's Metadata-protocol: line carries the claim's instruction to the dev ("The dev confirms the level…"), which would ship in CHANGELOG.md; the PR body has the same parenthetical.
  3. No pin covers a late accept after the bound, a tool call cancelled mid-question, or initialize batched with tools/call on HTTP. Each fails closed in the code read.
  4. 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 collides with this PR on mcp-http-tools.ts and the *-33690 pins; whichever lands second owes a clean merge and a delta read.

Board items for the area, not this diff: the no-service message still omits "use a client that supports confirmation" (contract step 3.3) and needs a carrier card before #33712 closes; #33712's close note owes "hosted HTTP users keep the email path until #34321"; content/docs/ai/connect-mcp.mdx and content/docs/ai/actions-as-tools.mdx still teach confirm: true (predates this PR, no carrier found).

Gates

51 check runs at this head: 35 success, 16 skipped (the ui, docs, dogfood and temporal jobs the path filter leaves out, the opt-in jobs, and the queue-only and schedule-only verdicts), 0 failed or pending. Test Core 8/8, Build Core, TypeScript Type Check, Lint & Repo Gates, Check Changeset and the PR-body guards are green. The PR body records 70/70 derived dispatch gates run, all exit 0, and a clean merge-tree against origin/main.

The contract-review record for the semantic face is comment 6909611877 (PASS, the same two should-fix findings).

…s, the record id on a line of its own

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
@github-actions github-actions Bot added size/xl and removed size/l labels Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c3019504e02664d6e96c940a28dfdaebb28d0198
Local-runs: none
Scope: packages/mcp/src/action-confirmation-elicitation.ts, packages/mcp/src/index.ts, packages/mcp/src/mcp-action-confirmation-handoff-33690.test.ts, packages/runtime/src/action-dispatch.ts, packages/runtime/src/action-execution.ts, packages/runtime/src/domains/mcp.ts, packages/runtime/src/action-confirmation-handoff-33690.test.ts + packages/spec/src/contracts/ai-service.ts, packages/objectql/src/record-title.ts (read in the cited code, not reviewed)

Delta review of the record on head 3557594b. This head is the dev's 736e6595ffa1038be087b970ca8590d0a2a6776c with main merged in; review-a measured the PR's net diff at both as patch-id equal (git diff 4bd3f240 736e6595 against git diff 4c0cf65f c3019504), and this record takes that as given. The delta read is git diff 3557594b 736e6595 (commits 86f49031, ee1b4ede, 736e6595), plus dev report 6911027896 on the card. Check-runs: on 736e6595 every run is success (35) or skipped (16). On this head, at the time of this record, 14 are success, 18 skipped and 20 still in_progress (Test Core 1 to 8, Check Changeset, type check and lint families); none has failed. The gate verdicts on this head are therefore not yet all in, and this record does not stand in for them.

① Derived judgments

  • run_action after an elicited accept: right. runResolvedAction now calls admitResolvedAction a second time after the answer (every gate, the service-account step and the subject load), then subjectVerdictRefusal on that fresh subject, and dispatches on the fresh admission only. A refusal on the second read returns the refused shape: nothing runs, no invocation row. The person is still asked once; the second pass does not re-enter confirmAdmittedAction. The pre-question verdict is the same function, factored out, so the hand-off path is unchanged in behaviour.
  • resume_run after an elicited accept: right. resumeAdmissionRefusal is asked again for the admitting action, then continueAdmittedRun re-reads the subject and the screen pause as before.
  • Title source: right. actionConfirmationElicitSubject reads servedRecordTitle; resolveRecordTitle is no longer imported. A row served without its title yields no title, and the id still names the record.
  • Question text: right. One labelled line per fact in a fixed order, the record id line before the title line. Free text (label, title) has unshown characters turned to spaces, the markup set dropped, whitespace collapsed, and is cut at 80 code points; names and ids keep their characters, show an unshown character as U+FFFD, and are cut at 200. No value can start a line, so the id line is always the door's own.
  • Accept-set otherwise unchanged. The answers table, the refusal reasons, the non-capable path and the HTTP door are untouched by the delta.
  • Public surface. @objectstack/mcp gains three more value exports: confirmationQuestionText, ACTION_CONFIRMATION_QUESTION_TEXT_MAX, ACTION_CONFIRMATION_QUESTION_ID_MAX. Additive.

② Semver level

Unchanged and still matching: minor on @objectstack/runtime and @objectstack/mcp, Clause-②: no, Metadata-protocol: semantic. The three added exports are covered by minor and are named in the changeset. Check Changeset was green on 736e6595 and is still running on this head.

③ Boundary flags

④ Design judgment

  1. Should-fix 1 — fixed. The dispatch never sees the read taken before the question on run_action, and resume_run re-asks its gates as well. Both doors now agree. Pinned on run_action in both directions: a record that became unreadable during the question is refused 404 with nothing run, and a record that changed reaches the handler as it is now.
  2. Should-fix 2 — fixed. Part (a): the served title, pinned both ways (served value used; absent value not re-derived). Part (b): bounded, single-line, id first, pinned with a hostile title and a hostile id.
  3. nit — no pin on the resume_run re-gate. The one added line is read correct (same function, same arguments as the first ask), but removing it would turn no test red. A pin wants a gate verdict that flips inside the elicitor.
  4. nit — what the second read can and cannot see. Both doors re-ask the gates against the same resolved declaration and the same caller envelope the call arrived with. The subject read is fresh from the data layer; anything the envelope or the declaration snapshot carried from the start of the call is as old as the call. That is the same bound every long-running call has, now stated for this one.
  5. nit — the neutraliser's character sets are a list, not a class. A few invisible or direction-changing characters are outside it, and the id line is not whitespace-collapsed or markup-stripped. None of them can break a line or displace the id line, and all stay inside the bounds, so the rule the fix exists for holds. Detail in the private note.
  6. nit — prose. The PR body's Metadata-protocol: parenthetical (③), and the two wordings of the Skills-docs: line.

Nothing new of should-fix grade was introduced. The second admission pass is reads only and cannot run or hand off anything.

No must-fix, no should-fix. Nits alone end the round.

Implemented-by: claude/area-A5-33712
Reviewed-by: session_01QsR2jTjrNnh6b2BkCXFugM
VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM

Review — PASS (delta)

Head-sha: c3019504e02664d6e96c940a28dfdaebb28d0198
Reviewer: review-a (S3) · 2026-11-16T08:21Z
Implemented-by: S3 area dev (claude/area-A5-33712)
Reviewed-by: session_01QsR2jTjrNnh6b2BkCXFugM
Delta from: L1 6909619860 and record 6909611877 at 3557594b65debd8755e4e2c90385d781706f5540.

The head is the merge of the dev's 736e6595 with main (4c0cf65f). git diff 4bd3f240 736e6595 and git diff 4c0cf65f c3019504 have the same patch-id, so the merge moved nothing of this PR. I read the delta 3557594b..736e6595: three commits, 8 files, +242/−39.

What holds

  • Should 1 is fixed: an elicited accept dispatches on a read taken after the answer. After 'accepted', runResolvedAction calls admitResolvedAction again: every gate, then the subject load. It then asks the caller-scope verdict (subjectVerdictRefusal, now one helper shared with the pre-question check) on that fresh subject, and dispatches on the fresh admission only. A refusal at either step returns before anything runs. resume_run re-asks resumeAdmissionRefusal after the answer, and continueAdmittedRun re-reads the subject and the screen itself. Pins: a record the caller can no longer read when they answer is refused and nothing runs; a record that changed while the question was open reaches the action as it is now.
  • Should 2 is fixed: the question's title. (a) actionConfirmationElicitSubject now reads servedRecordTitle, the value the caller-scope read served, and never re-derives it. Pins: the served value as served, and a row served without its title has none. (b) The question is one fact per labelled line in a fixed order, with the record id line ahead of the title. Free text (label, title) loses control, line-separator and invisible format characters, drops markup and quote characters, collapses whitespace, and is capped at 80. An id or name is kept character for character except that an unshown character becomes U+FFFD, capped at 200, so no value can start a line of its own. Pins: a hostile title, an id with unshown characters, and a title with nothing readable left.
  • Nit 4 is pinned: a late accept after the bound reads timed_out, a cancelled tool call reads cancel, and initialize batched with a tool call on Streamable HTTP is refused by the transport before any tool runs.
  • Nit 5 is fixed: the changeset's Metadata-protocol: parenthetical no longer carries the dev instruction.
  • The other Shoulds are met outside the diff: the PR body reads Skills-docs: follow-up #34210 (widened to the in-client question and the three refusals), and 速读 line 6 cites ruling 6909391261. Board items: MCP action doors: the no-confirmation-service refusal should tell an elicitation-less stdio client to use a client that supports confirmation #34325 carries the no-service sentence, 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 takes the two content/docs pages, and the MCP transport: server-to-client elicitation mid-call, so supporting clients confirm in place (UX upgrade over the email hold) #33712 close note goes on at landing.
  • Declarations are unchanged: Clause-②: no, Metadata-protocol: semantic, and minor on runtime and mcp. The new exports (confirmationQuestionText and the two bounds) are additive.

Must / Should

None.

Nits

  1. The changeset body still says Skills-docs: follow-up owed — skills/objectstack-ai/SKILL.md …, which ships in CHANGELOG.md; the PR body has #34210. Optional to align.
  2. The free-text pass drops _, #, * and the like from a title, so INV_2024 reads INV2024. The id line is verbatim, so which record is meant stays exact; this is cosmetic.
  3. The resume_run re-gate after an accept has no dedicated pin, as the dev reports. It is a synchronous re-ask of the same resumeAdmissionRefusal the pre-question path pins.

Gates

At 736e6595 every check was success or skipped (35/16, per S3). At c3019504, CI was still running when I read it (Build Core, Type Check, Lint and the Test Core plan were in progress; nothing had failed). Landing waits on that run going green; the patch-id is unchanged. The CONTRACT_REVIEW_TIER delta record is comment 6911174979 (PASS, nits only).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5

席位核对

ACCEPT and landing · area S3 · 2026-11-16T08:40Z · head c3019504e02664d6e96c940a28dfdaebb28d0198

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); in-flight work under the wind-down order (2026-11-16T07:43Z).


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 16, 2026 08:41
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit d6b1c2e Nov 16, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-A5-33712 branch November 16, 2026 09:26
os-project-manager pushed a commit that referenced this pull request Nov 16, 2026
Stacks #34318's in-client elicitation onto the retired confirm member:
run_action and resume_run pass the elicitor door as main does, and their
bridge request no longer forwards the caller's confirm (the closed input
refuses it first; elicitation never read it).

Claude-Session: https://claude.ai/code/session_01FEkQ5kgF3mo9f7LXuv5hac
Co-Authored-By: Claude <noreply@anthropic.com>
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

Development

Successfully merging this pull request may close these issues.

1 participant