Skip to content

Commit 082f9c2

Browse files
docs(skills): a person confirms a gated MCP action; run_action and resume_run take no confirm (#34558)
<!-- 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>
1 parent ea54392 commit 082f9c2

6 files changed

Lines changed: 93 additions & 6 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the AI and platform skills teach that a person confirms a gated MCP action, and that `run_action` and `resume_run` take no `confirm`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
objectstack-ai's MCP tool table no longer tells an agent to ask the human and retry `run_action` with `confirm: true`. The `run_action` row now says an action declaring `ai.requiresConfirmation: true` never runs on the call: the host's pending-confirmation service hands it to the person the call runs as and the answer is `status: 'pending_confirmation'` with a `pendingId`, a success the agent relays without retrying; an AI service account's refusal carries `details.reason: 'service_account'` at every action door. A paragraph under the table adds the rest: never send `confirm` to `run_action` or `resume_run` (a call carrying it is refused, on every action); a host with no pending-confirmation service refuses a gated call 428 with `details.reason: 'no_confirmation_service'`; and on a long-lived (stdio) server whose bridge serves these tools, a client that advertised form-mode `elicitation` is asked in the client, where `accept` runs the call once and a decline, a dismissal or five minutes without an answer refuse it (`declined`, `cancelled`, `timed_out`). The `delete_record` and `delete_records` rows are unchanged: those tools still read `confirm: true`.
11+
12+
objectstack-platform gains a sixth rule under `requires:`: AI-door confirmation is a service the host registers, an `IActionConfirmationService` under `'ai.actionConfirmation'`, and the open build ships none. Two restatements were removed from that file to pay for part of the rule: "Never rebuild what the platform owns." in the App / Platform Boundary intro, which the bullets under it carry, and the `HonoServerPlugin` row's note that `os dev` and `os serve` register it, which the boot sequence lists.
13+
14+
Three eval cases cover the teaching: an agent that retried with `confirm: true`, the answers to an in-client question together with the service-account refusal, and a host that wants its people to approve these calls in its app.

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,28 @@ export const CEILINGS = new Map([
770770
// absorbed and the ceiling moves 5997 -> 6014 (+17), the measured
771771
// remainder only. Pinned AT the measurement.
772772
// ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 20) / 4) == ceil(24055 / 4)
773-
['skills/objectstack-platform/SKILL.md', 6011],
773+
// 6011 -> 6145 (card #34210, the Skills-docs follow-up the MCP action
774+
// confirmation hand-off owed this file): a sixth `requires:` rule says the
775+
// confirmation of an AI-door action is a service the host registers — an
776+
// `IActionConfirmationService` under `'ai.actionConfirmation'` takes the
777+
// hand-off (`pending_confirmation`, a `pendingId`), a host with none refuses
778+
// 428 `no_confirmation_service`, `run_action` / `resume_run` refuse a call
779+
// that sends `confirm`, and the `service_account` and elicited `declined` /
780+
// `cancelled` / `timed_out` reasons point at objectstack-ai. Raise path the
781+
// standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068,
782+
// letter B). PAID DOWN FIRST — two restatements cut, each keeping its other
783+
// home in the file: "Never rebuild what the platform owns." in the App /
784+
// Platform Boundary intro (the first bullet under it, "capability belongs in
785+
// the platform", and the third, "no hand-written predicate re-implementing a
786+
// platform rule") and the `HonoServerPlugin` row's "(this is what `os dev` /
787+
// `os serve` register)" (step 4 of the boot sequence lists the plugin under
788+
// those two commands). Arithmetic in priced bytes (stamp line excluded): on
789+
// `origin/main` the text was 24021 bytes (6006 tokens, headroom 5); the cuts
790+
// remove 84 and the rule adds 640, so the LANDED priced text is 24577 bytes
791+
// -> 6145 tokens: the 5 tokens of headroom are absorbed and the ceiling moves
792+
// 6011 -> 6145 (+134), the measured remainder only. Pinned AT the measurement.
793+
// ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 20) / 4) == ceil(24577 / 4)
794+
['skills/objectstack-platform/SKILL.md', 6145],
774795
// `skills/objectstack-pm-dispatch/SKILL.md` (9708) and its
775796
// `rules/dev-template.md` (1838) left this table on 2026-09-10 with the files:
776797
// the maintainer deleted the published PM skill whole (verbatim:

‎skills/objectstack-ai/SKILL.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,15 @@ permissions and row-level security:
208208
| `validate_expression` | build-accurate CEL check before a formula is authored into metadata |
209209
| `create_record`, `update_record`, `delete_record` | writes; `delete_record` is refused with `ACTION_CONFIRMATION_REQUIRED` (428) unless it sends `confirm: true`. A request in which the human names the record to delete, with exactly one record matching, is their approval: send `confirm: true` on that call without asking again. When the name matches more than one record, or the request does not identify one, list the candidates, ask which one, and send `confirm: true` only after the answer |
210210
| `delete_records` | up to 200 records of one object per call (fewer under a smaller `OS_DATA_MAX_PAGE_SIZE` or `OS_DATA_QUERY_ROW_BUDGET`), by `where` or `recordIds`, not both; a call without `confirm: true` is the preview (match count, sample ids) and deletes nothing — show it to the human, and send `confirm: true` only once they approve; over OAuth it needs `data:read` and `data:write` |
211-
| `list_actions`, `run_action`, `resume_run` | your AI-exposed business Actions — the same `ai.exposed` opt-in as above; registered only when the bridge implements `listActions` and `runAction` (the stdio bridge does not, so it serves none), `resume_run` only when it also implements `resumeRun`. 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. Under an AI service account's own key (an agent acting for itself, for no person) the call is refused whatever it sends and nothing runs: hand the action to a person, or its author declares `ai.requiresConfirmation: false` when it is safe unattended. `resume_run` submits a paused screen flow's form under the same gates |
211+
| `list_actions`, `run_action`, `resume_run` | your AI-exposed business Actions — the same `ai.exposed` opt-in as above; registered only when the bridge implements `listActions` and `runAction` (the stdio bridge does not, so it serves none), `resume_run` only when it also implements `resumeRun`. 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. Under an AI service account's own key (an agent acting for itself, for no person) the call is refused with the same 428, `details.reason: 'service_account'`, at every action door, and nothing runs: hand the action to a person, or its author declares `ai.requiresConfirmation: false` when it is safe unattended. `resume_run` submits a paused screen flow's form under the same gates; a handed-off run stays paused |
212+
213+
**Never send `confirm` to `run_action` or `resume_run`:** a call carrying it is
214+
refused, on every action. A host with no such service (the open build ships
215+
none) refuses a gated call 428, `details.reason: 'no_confirmation_service'`: the
216+
person performs it in the app. On a long-lived (stdio) server whose bridge serves
217+
these tools, a client advertising form-mode `elicitation` is asked instead:
218+
`accept` runs it once; decline, dismissal or five minutes unanswered refuse it
219+
(`declined` / `cancelled` / `timed_out`). Over Streamable HTTP nobody is asked.
212220

213221
---
214222

‎skills/objectstack-ai/evals/skills-tools-knowledge.json‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,26 @@
6060
"must_contain": ["pendingActions.list", "signed-in session", "refused"],
6161
"must_not_contain": ["pendingActions.approve("]
6262
}
63+
},
64+
{
65+
"id": 7,
66+
"prompt": "Our MCP agent runs the `crm_close_deal` action, which declares `ai.requiresConfirmation: true`. It asks the user in chat, then calls `run_action` again with `confirm: true`, and that call is now refused. Fix how the agent handles this action.",
67+
"expected_output": "Stop sending `confirm`: `run_action` and `resume_run` refuse any call that carries the member, on every action, because the agent cannot confirm for the person. Call `run_action({ actionName: 'crm_close_deal', recordId })` without it. Where the host registers a pending-confirmation service, the answer is `status: 'pending_confirmation'` with a `pendingId` and a message: that is a success, not an error, and nothing has run. Relay the message, tell the user to approve it in the app, and do not retry. On a host with no such service (the open-source build ships none) the call is refused 428 `ACTION_CONFIRMATION_REQUIRED` with `details.reason: 'no_confirmation_service'`, and the person performs the action in the app. The two delete tools still take the member.",
68+
"files": [],
69+
"assertions": {
70+
"must_contain": ["pending_confirmation", "pendingId", "no_confirmation_service", "do not retry"],
71+
"must_not_contain": ["recordId, confirm: true", "then retry with"]
72+
}
73+
},
74+
{
75+
"id": 8,
76+
"prompt": "Our host bridges its action tools onto the stdio MCP server. A desktop client calls `run_action` on an action declaring `ai.requiresConfirmation: true` and the user sees a question in the client. What does each answer do? And what happens when our unattended agent calls the same action under its own AI service account key?",
77+
"expected_output": "The client advertised form-mode `elicitation`, so the person is asked once in the client instead of in the app. `accept` runs the call once, and the next call is asked again. A decline, a dismissal or five minutes without an answer refuse it with 428 `ACTION_CONFIRMATION_REQUIRED` and `details.reason` `declined`, `cancelled` or `timed_out`: nothing runs, nothing is handed off, and the agent retries only when the person asks. Over Streamable HTTP nobody is asked in the client; a gated call there is handed off and answered `pending_confirmation`, or refused `no_confirmation_service` where the host has no service. The AI service account acts for no person, so its call is refused at every action door with `details.reason: 'service_account'`, and it is neither asked nor handed off: a person runs the action, or its author declares `ai.requiresConfirmation: false` when it is safe unattended. Neither caller sends `confirm`.",
78+
"files": [],
79+
"assertions": {
80+
"must_contain": ["elicitation", "declined", "cancelled", "timed_out", "service_account"],
81+
"must_not_contain": ["recordId, confirm: true"]
82+
}
6383
}
6484
]
6585
}

‎skills/objectstack-platform/SKILL.md‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ That read's `contributions` lists what other packages add to the base, one entry
136136

137137
An ObjectStack app is a **simplified implementation of business features**:
138138
author metadata under the platform's spec and check it
139-
with the `os` commands ([Verify your work](./references/operations.md#verify-your-work)). Never rebuild
140-
what the platform owns.
139+
with the `os` commands ([Verify your work](./references/operations.md#verify-your-work)).
141140

142141
- **Business features belong in the app; capability belongs in the platform.**
143142
A missing default, a wrong diagnostic, a shape the spec refuses — the fix is
@@ -230,7 +229,7 @@ Two packages exist:
230229
| Package | Export | Use When |
231230
|:--------|:-------|:---------|
232231
| `@objectstack/hono` | `createHonoApp({ kernel, prefix })` | You own the server: embed ObjectStack routes in your own Hono app / deploy target. |
233-
| `@objectstack/plugin-hono-server` | `HonoServerPlugin` | ObjectStack owns the server: a kernel plugin that hosts the Hono app and opens the listening socket (this is what `os dev` / `os serve` register). |
232+
| `@objectstack/plugin-hono-server` | `HonoServerPlugin` | ObjectStack owns the server: a kernel plugin that hosts the Hono app and opens the listening socket. |
234233

235234
There are **no** `@objectstack/adapter-*` packages. To integrate another
236235
framework, mount the Hono app (a web-standard `fetch` handler) or call the
@@ -326,7 +325,7 @@ The authoritative list is `PLATFORM_CAPABILITY_TOKENS`
326325
(`@objectstack/spec`, `kernel/platform-capabilities.ts`) — an unknown token is
327326
**rejected by `defineStack` at authoring time**, not at boot.
328327

329-
Five rules that change what you write:
328+
Six rules that change what you write:
330329

331330
- **Precedence:** `requires` › `tiers` › `--preset` › built-in default. An
332331
explicit instance in `plugins:` always shadows capability resolution.
@@ -341,6 +340,14 @@ Five rules that change what you write:
341340
- **Under `--preset minimal`, pair `triggers` with `job`:** `triggers` alone
342341
arms record-change triggers; schedule and time-relative ones run on the job
343342
service, so scheduled flows stay silent.
343+
- **AI-door confirmation is a service you register.** `mcp`'s `run_action` and
344+
`resume_run` never run an action declaring `ai.requiresConfirmation: true` on
345+
the call, and refuse any call that sends `confirm`. Register an
346+
`IActionConfirmationService` under `'ai.actionConfirmation'` and the person gets
347+
the hand-off (`status: 'pending_confirmation'`, a `pendingId`); with none (the
348+
open build) the call is refused 428, `details.reason: 'no_confirmation_service'`.
349+
An AI service account is refused `service_account`; a stdio client asked through
350+
`elicitation`, `declined` / `cancelled` / `timed_out`: objectstack-ai → **MCP**.
344351

345352
### `onEnable` — where an app binds runtime code
346353

‎skills/objectstack-platform/evals/config-plugins-ops.json‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,23 @@
377377
"--client cursor"
378378
]
379379
}
380+
},
381+
{
382+
"id": 23,
383+
"prompt": "On our self-hosted `os serve` deployment, every MCP `run_action` call on an action declaring `ai.requiresConfirmation: true` is refused 428 with `details.reason: 'no_confirmation_service'`. We want our people to approve these calls in our app. What do we build?",
384+
"expected_output": "The open build ships no pending-confirmation service, so the `mcp` door refuses a gated call instead of running it on the caller's word. Write a plugin that registers an `IActionConfirmationService` (`@objectstack/spec/contracts`) under the service name `'ai.actionConfirmation'` (the `ACTION_CONFIRMATION_SERVICE` constant): `ctx.registerService('ai.actionConfirmation', service)` in `init`. Its `submit(handOff, context)` records the call for the person it ran as, notifies them and returns `{ pendingId }`. The door then answers `status: 'pending_confirmation'` with that `pendingId`, and nothing runs until that person approves it in the app, which your service owns. Not a `confirm` sent by the client: `run_action` and `resume_run` refuse any call that carries it. An AI service account stays refused (`details.reason: 'service_account'`) and is never handed off; a stdio client that advertised `elicitation` is asked in the client instead, and its `declined`, `cancelled` or `timed_out` answer refuses the call.",
385+
"files": [],
386+
"assertions": {
387+
"must_contain": [
388+
"IActionConfirmationService",
389+
"ai.actionConfirmation",
390+
"pending_confirmation",
391+
"pendingId"
392+
],
393+
"must_not_contain": [
394+
"recordId, confirm: true"
395+
]
396+
}
380397
}
381398
]
382399
}

0 commit comments

Comments
 (0)