Repository navigation
Commit 082f9c2
docs(skills): a person confirms a gated MCP action;
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBHxRfV2uS8FfXKS2GKpWwxL)_
Fixes #34210
Clause-②: no
Metadata-protocol: none
Skills-docs: updated here
## 维护者速读
- 改了什么:`objectstack-ai` 技能的 MCP 工具表里,`run_action` 一行不再教「先问人,再带 `confirm:
true` 重试」,改为:声明了 `ai.requiresConfirmation: true`
的动作不会在这次调用里执行,交给本人在应用里确认,回答是 `status: 'pending_confirmation'` 加
`pendingId`;表下新增一段,教「不要发 `confirm`」、没有确认服务时的 428
`no_confirmation_service`、以及 stdio
长连接上的客户端内提问和三个拒绝原因。`objectstack-platform` 技能在 `requires:` 的规则里加第六条:AI
门的确认是宿主自己注册的服务。评测夹具加三例。
- 为什么改:运行时已经改了(调用方的 `confirm` 不再算数,并且带上它就被拒),而技能还在教旧写法。照旧文写的 agent
每次都会被拒,还会把「已交给本人」当成失败去重试。
- 风险与回滚:只动已发布技能的文字、评测夹具、一个 changeset 和 token
棘轮的一行,不动运行时与契约。`objectstack-platform/SKILL.md` 的上限按实测从 6011 提到
6145(+134),先删了同文件两处重复。回滚即 revert 本 PR。
- 先看:① `skills/objectstack-ai/SKILL.md` 的 `run_action` 行和表下新段(与
`packages/runtime/src/action-execution.ts` 的 `handOffActionConfirmation`
/ `elicitActionConfirmation` 是否一致);②
`skills/objectstack-platform/SKILL.md` 的第六条规则和两处删除是否确为重复;③
`scripts/check-skills-token-ratchet.mjs` 新加的那段算术。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期看到
`skills/objectstack-platform/SKILL.md is 6145 tokens (ceiling 6145;
headroom 0)` 且以 ✓ 收尾。
- 需要你做的:`skills/**` 属受管面,席位合同复审 PASS 后请批准本 PR 一次;若低风险技能臂读作 Tier S
则无,席位落地。
## What changes
`skills/objectstack-ai/SKILL.md`, section "MCP — the open-edition AI
path", the `list_actions`, `run_action`, `resume_run` row of the tool
table. Before, the row said:
> An action flagged `ai.requiresConfirmation` (`list_actions` reports
it) is refused with the same 428 unless the call sends `confirm: true`,
and nothing runs — ask the human first, then retry.
After:
> An action declaring `ai.requiresConfirmation: true` (`list_actions`
reports it) never runs on the call: the host's pending-confirmation
service hands it to the person the call runs as, who approves or rejects
it in the app, and the answer is `status: 'pending_confirmation'` with a
`pendingId` — a success, so relay its message and do not retry.
The service-account sentence of the same row now names the reason
(`details.reason: 'service_account'`, at every action door), and the
row's last sentence adds that a handed-off `resume_run` stays paused.
One paragraph is added under the table:
> **Never send `confirm` to `run_action` or `resume_run`:** a call
carrying it is refused, on every action. A host with no such service
(the open build ships none) refuses a gated call 428, `details.reason:
'no_confirmation_service'`: the person performs it in the app. On a
long-lived (stdio) server whose bridge serves these tools, a client
advertising form-mode `elicitation` is asked instead: `accept` runs it
once; decline, dismissal or five minutes unanswered refuse it
(`declined` / `cancelled` / `timed_out`). Over Streamable HTTP nobody is
asked.
The `delete_record` and `delete_records` rows are not touched: those
tools still read `confirm: true` (citation (e) below).
`skills/objectstack-platform/SKILL.md`, section "`requires:` — which
service plugins boot": "Five rules that change what you write" becomes
six. The new rule:
> **AI-door confirmation is a service you register.** `mcp`'s
`run_action` and `resume_run` never run an action declaring
`ai.requiresConfirmation: true` on the call, and refuse any call that
sends `confirm`. Register an `IActionConfirmationService` under
`'ai.actionConfirmation'` and the person gets the hand-off (`status:
'pending_confirmation'`, a `pendingId`); with none (the open build) the
call is refused 428, `details.reason: 'no_confirmation_service'`. An AI
service account is refused `service_account`; a stdio client asked
through `elicitation`, `declined` / `cancelled` / `timed_out`:
objectstack-ai → **MCP**.
This file had 5 tokens of headroom, so the rule is paid for under the
standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B).
Two restatements are cut first, each keeping its other home in the file:
- Dropped: "Never rebuild what the platform owns." at the end of the App
/ Platform Boundary intro. Still carried by the first bullet directly
under it ("Business features belong in the app; capability belongs in
the platform") and the third ("no hand-written predicate re-implementing
a platform rule").
- Dropped: "(this is what `os dev` / `os serve` register)" in the
`HonoServerPlugin` row of the HTTP Layer table. Still carried by step 4
of the Runtime Boot Sequence, which lists `HonoServerPlugin` among the
plugins the CLI registers under `os serve` / `os dev`.
Arithmetic in priced bytes (the release-stamp line excluded): 24021 on
the merge base (6006 tokens, ceiling 6011, headroom 5). The cuts remove
84 bytes and the rule adds 640, so the landed text is 24577 bytes, 6145
tokens. `scripts/check-skills-token-ratchet.mjs` moves that one row 6011
→ 6145 (+134, the measured remainder, pinned at the measurement) with
the arithmetic in its comment. The `objectstack-ai/SKILL.md` row is not
touched: 6068 → 6268 against a ceiling of 6801.
Evals, three appended cases in each file's own layout:
- `skills/objectstack-ai/evals/skills-tools-knowledge.json` id 7: an
agent that asks in chat and retries `run_action` with `confirm: true`
and is now refused. The answer drops the member, relays the
`pending_confirmation` answer and its `pendingId` without retrying, and
names the `no_confirmation_service` refusal on a host with no service.
- Same file, id 8: a stdio server whose host bridge serves the action
tools, a client that shows the question, and the same action called
under an AI service account's own key. The answer gives what `accept`
does, the three refusal reasons, that Streamable HTTP asks nobody, and
the `service_account` refusal.
- `skills/objectstack-platform/evals/config-plugins-ops.json` id 23: a
self-hosted deployment that sees every gated call refused
`no_confirmation_service` and wants its people to approve in its app.
The answer is a plugin registering an `IActionConfirmationService` under
`'ai.actionConfirmation'`, whose `submit` returns the `pendingId`.
`.changeset/34210-skills-mcp-action-confirmation-hand-off.md`:
`@objectstack/skills` patch.
Line budget. The order gave net +15 lines across the two `SKILL.md`
files, priced teaching text, with evals reported separately (ruling
record 6513306068: eval fixtures are outside the ratchet's priced
population). Readings: `objectstack-ai/SKILL.md` +8 (434 → 442),
`objectstack-platform/SKILL.md` +7 (414 → 421, eight lines added and one
removed with the first cut), together +15. Evals: +20 lines and +18
lines.
Authoring tier: `dispatch-gates --tier` answers MANDATORY
CONTRACT_REVIEW_TIER for `skills/**` (clause ①, no one-line exit). This
card thread is served at that tier (`Served-tier: CONTRACT_REVIEW_TIER`,
read from the session record), so the diff was authored in the thread
itself.
## Code citations
Each taught fact was read from code on the merge base `ec6b5fd3` before
any text was written.
<details><summary>(a) The hand-off, the pending answer and the
no-service refusal</summary>
`packages/runtime/src/action-execution.ts`, `aiDoorConfirmation` (line
3162): an action whose `ai.requiresConfirmation` is not `true` is
admitted; an AI service account is refused; every other caller is handed
off. The request is not a parameter, so the caller's `confirm` cannot be
read.
`handOffActionConfirmation` (line 3220): with no service resolved under
`ACTION_CONFIRMATION_SERVICE` it returns the refusal with reason
`'no_confirmation_service'` (line 3236), whose message ends "Perform the
action in the app instead."; with one, it calls `service.submit(handOff,
ec)` and returns `status: 'pending_confirmation'` (line 3250) with the
service's `pendingId` and a message. A service that answers no
`pendingId` throws.
`packages/spec/src/contracts/ai-service.ts`:
`ACTION_CONFIRMATION_SERVICE = 'ai.actionConfirmation'` (line 751),
`IActionConfirmationService` with its one member `submit(handOff,
context)` answering a `pendingId` (lines 775-784),
`ActionConfirmationPending` (line 732, "A success, not a refusal"). The
docblock on the service says the open-source deployment registers none.
A host registers it with
`ctx.registerService(ACTION_CONFIRMATION_SERVICE, …)` in a plugin's
`init`:
`packages/qa/dogfood/test/action-confirmation-handoff-33690.dogfood.test.ts`,
line 90.
</details>
<details><summary>(b) The refusal reasons, the status and the
service-account refusal</summary>
`packages/spec/src/contracts/ai-service.ts`,
`ACTION_CONFIRMATION_REFUSAL_REASONS` (line 684): `declined`,
`cancelled`, `timed_out`, `no_confirmation_service`, `service_account`,
a closed set carried as `details.reason`.
`packages/runtime/src/action-execution.ts`:
`ACTION_CONFIRMATION_REQUIRED_CODE = 'ACTION_CONFIRMATION_REQUIRED'`
(line 3044) and `ACTION_CONFIRMATION_REQUIRED_STATUS = 428` (line 3053).
`actionConfirmationRefusal` (line 3075) answers reason
`'service_account'` (line 3102) for an AI service account whatever the
request carries; its comment says the reason is carried "at every door".
</details>
<details><summary>(c) The in-client question and its three refusals;
which door can ask</summary>
`packages/runtime/src/action-execution.ts`, `elicitActionConfirmation`
(line 3336): `accept` answers accepted and the caller dispatches once;
`decline` is refused `'declined'` (line 3354), no answer in time
`'timed_out'` (line 3364), anything else `'cancelled'` (line 3373).
Nothing is handed off on any of them.
`packages/mcp/src/action-confirmation-elicitation.ts`:
`ACTION_CONFIRMATION_ELICITATION_TIMEOUT_MS = 5 * 60_000` (line 63);
`actionConfirmationElicitorFor` (line 188) answers no elicitor unless
the client advertised form-mode `elicitation` on this server (line 194).
The module header says the per-request Streamable HTTP server never read
the client's `initialize`, so it never elicits. The card for in-client
confirmation on the HTTP door is open and on hold, so the HTTP door
keeps the hand-off.
`packages/mcp/src/mcp-http-tools.ts`, lines 3582 and 3680: `run_action`
and `resume_run` pass the elicitor to the bridge only when one exists.
Why the skill says "whose bridge serves these tools": `wireBridgeTools`
(same file, line 2211) registers the action tools only when the bridge
implements `listActions` and `runAction` (line 2220). The stdio bridge
the plugin wires, `createStdioDataBridge`
(`packages/mcp/src/stdio-data-bridge.ts`, line 1151;
`packages/mcp/src/plugin.ts`, lines 807 and 923), returns a data bridge
with neither member. So on the plugin's own stdio transport `run_action`
is not registered, which the row already said before this change ("the
stdio bridge does not, so it serves none"). The in-client question is
reached on a long-lived server that a host gives an action-carrying
bridge (`MCPServerRuntime.bridgeDataTools`).
</details>
<details><summary>(d) A call that carries <code>confirm</code> is
refused on both tools</summary>
`packages/mcp/src/mcp-http-tools.ts`, `RETIRED_CONFIRMATION_MEMBER`
(line 2163), passed as `retired:` to the closed input of `run_action`
(line 3476) and `resume_run` (line 3634). Its docblock: the refusal is
the closed input's unknown-key refusal, it arrives before the bridge is
called, and it applies "on EVERY action, gated or not". Pinned by
`packages/mcp/src/mcp-action-confirmation-member.test.ts` ("REFUSES a
retry carrying `confirm: true` at the input: the bridge never sees it").
</details>
<details><summary>(e) The delete tools still read <code>confirm</code>,
so their rows are left alone</summary>
`packages/mcp/src/mcp-http-tools.ts`, `isDeleteConfirmed` (line 1275):
`return request[AI_ACTION_CONFIRMATION_MEMBER] === true;`, one predicate
for `delete_record` and `delete_records`, and both tools still declare
the member in their input (lines 3167 and 3270).
</details>
## Tests
No package source changes, so there is no package test to run and
nothing to ablate. The three eval cases are fixtures (measured, not
ratcheted) and are self-consistent: every `must_contain` string appears
in its case's `expected_output`, no `must_not_contain` string does, and
the ids in each file are distinct (8 and 23; checked by script).
<details><summary>Size readings, before (merge base
<code>ec6b5fd3</code>) and after</summary>
| Reading | before | after |
|:--|:--|:--|
| `objectstack-ai/SKILL.md` lines / bytes | 434 / 24291 | 442 / 25091 |
| same file, priced tokens / ceiling | 6068 / 6801 | 6268 / 6801 |
| `objectstack-platform/SKILL.md` lines / bytes | 414 / 24041 | 421 /
24597 |
| same file, priced tokens / ceiling | 6006 / 6011 | 6145 / 6145 |
| `objectstack-ai/evals/skills-tools-knowledge.json` lines / bytes (not
ratcheted) | 65 / 5372 | 85 / 8157 |
| `objectstack-platform/evals/config-plugins-ops.json` lines / bytes
(not ratcheted) | 382 / 21936 | 400 / 23617 |
| all `skills/*/SKILL.md`, lines summed | 4599 | 4614 |
| ratcheted (authored) bundle tokens / ceiling sum | 188742 / 194737 |
189081 / 194871 |
| eval fixtures tokens | 48960 | 50078 |
| bundle total tokens (whole shipped tree) | 249497 | 250954 |
Both columns are the token ratchet's own print, on the merge base and on
this branch.
</details>
## Acceptance notes
- The card says both skills "name the gate". Measured on the merge base,
`objectstack-platform/SKILL.md` named it in one place only, the
customization paragraph (an override turning `ai.requiresConfirmation`
off is refused), which stays true and is not touched. The host-side
teaching went under `requires:`, next to the rules about what a host
mounts, because `mcp` is a host default and the confirmation service is
one a host registers.
- The in-client question is taught with its real reach (citation (c)):
the plugin's own stdio transport serves no action tools, so the skill
says "a long-lived (stdio) server whose bridge serves these tools" and
does not say that any stdio client is asked. Noted, not filed.
- The `delete_record` row still says "ask the human first, then retry".
The tool's own description now also says that a request naming one
record with exactly one match is the approval
(`DELETE_NAMED_RECORD_IS_APPROVAL`,
`packages/mcp/src/mcp-http-tools.ts`). That is a different gate from
this card's, so the row is left as it is. Noted, not filed.
- The `objectstack-ai/SKILL.md` ceiling row is left at 6801 (headroom
533).
## Verification
<details><summary>Derived gates on <code>4c229cb1</code>: 67 derived, 65
run and exit 0, 2 NOT MEASURED locally</summary>
`node scripts/pm/dispatch-gates.mjs --commands` listed 67 commands for
this change set. Each ran serially with its exit code recorded before
any pipe as `CMD :: exit N`, then reconciled:
```
✓ dispatch-gates --ran: 67 derived famil(ies) accounted for — 65 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).
```
NOT MEASURED, each exit 3 "PREREQUISITE NOT MET" (they read a full
build's output, and this diff changes no package source): `pnpm
check:dual-build-cjs-loads`, `pnpm check:lean-entry-closure`. CI's `Lint
& Repo Gates` runs them on this PR.
Among the 65: `node scripts/check-skills-token-ratchet.mjs` ("57
authored bundle file(s) within their ceilings; 10 generator-owned
file(s) and 29 eval fixture(s) measured, not ratcheted") and its
`--self-test` ("104 cases pass"), which is also the edited script's own
suite (no test file names it); `pnpm --filter @objectstack/spec run
check:skill-docs` and `pnpm --filter @objectstack/lint run
check:doc-formula-expressions`, both after the spec and lint closure
build under the verify lock (`os-verify-lock: VERDICT command-exit 0`);
`check:skill-links`, `check:skill-identifier-liveness`,
`check:skill-top-level-keys`, `check:skill-compatibility`,
`check:doc-authoring`, `check:nul-bytes`,
`check:ratchet-remedy-authority`, `check-changeset-no-major`,
`check-empty-changeset`, `check-adr-0087-registration`.
</details>
<details><summary>Governed-surface reading</summary>
`node scripts/pm/check-governed-merges.mjs --branch HEAD`: `skills/**`
×4 hit the register (the changeset and the ratchet script are not on
it), landing tier H on a path list alone; the low-risk skills arm reads
NOT MEASURED until `--pr` can read the pull request. Size 100 changed
lines (+94 / −6), under the 3000 human-merge threshold. This PR stays a
draft; the seat reviews and lands.
</details>
Base: the branch was cut from `ec6b5fd3` and `origin/main` (`631d77f3`,
one commit ahead, `ui/` only) was merged in before the gates ran.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzfojHHNDnXxREucdHC)_
---------
Co-authored-by: Claude <noreply@anthropic.com>run_action and resume_run take no confirm (#34558)1 parent ea54392 commit 082f9c2
6 files changed
Lines changed: 93 additions & 6 deletions
File tree
- .changeset
- scripts
- skills
- objectstack-ai
- evals
- objectstack-platform
- evals
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | | - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
774 | 795 | | |
775 | 796 | | |
776 | 797 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
212 | 220 | | |
213 | 221 | | |
214 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
63 | 83 | | |
64 | 84 | | |
65 | 85 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
| 139 | + | |
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
| |||
230 | 229 | | |
231 | 230 | | |
232 | 231 | | |
233 | | - | |
| 232 | + | |
234 | 233 | | |
235 | 234 | | |
236 | 235 | | |
| |||
326 | 325 | | |
327 | 326 | | |
328 | 327 | | |
329 | | - | |
| 328 | + | |
330 | 329 | | |
331 | 330 | | |
332 | 331 | | |
| |||
341 | 340 | | |
342 | 341 | | |
343 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
344 | 351 | | |
345 | 352 | | |
346 | 353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
380 | 397 | | |
381 | 398 | | |
382 | 399 | | |
0 commit comments