From c22bb66d37f6b9f3cb72418e5a85717ba0e0d321 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 00:24:17 +0000 Subject: [PATCH 1/2] docs(skills): a person confirms a gated MCP action; run_action and resume_run take no confirm objectstack-ai: the run_action row teaches the hand-off to the host's pending-confirmation service (pending_confirmation + pendingId) and the service_account refusal; a paragraph under the table teaches never to send confirm, the no_confirmation_service refusal and the in-client elicitation answers on the long-lived (stdio) server. objectstack-platform: a sixth requires: rule says AI-door confirmation is a service the host registers (IActionConfirmationService under 'ai.actionConfirmation'). Two restatements cut; the token row moves by the measured remainder. Three eval cases exercise the teaching. Claude-Session: https://claude.ai/code/session_01WGufzfojHHNDnXxREucdHC Co-authored-by: Claude --- ...skills-mcp-action-confirmation-hand-off.md | 14 +++++++++++ scripts/check-skills-token-ratchet.mjs | 23 ++++++++++++++++++- skills/objectstack-ai/SKILL.md | 10 +++++++- .../evals/skills-tools-knowledge.json | 20 ++++++++++++++++ skills/objectstack-platform/SKILL.md | 15 ++++++++---- .../evals/config-plugins-ops.json | 18 +++++++++++++++ 6 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 .changeset/34210-skills-mcp-action-confirmation-hand-off.md diff --git a/.changeset/34210-skills-mcp-action-confirmation-hand-off.md b/.changeset/34210-skills-mcp-action-confirmation-hand-off.md new file mode 100644 index 00000000000..13e10913d25 --- /dev/null +++ b/.changeset/34210-skills-mcp-action-confirmation-hand-off.md @@ -0,0 +1,14 @@ +--- +'@objectstack/skills': patch +--- + +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` + +Clause-②: no +Metadata-protocol: none + +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`. + +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. + +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. diff --git a/scripts/check-skills-token-ratchet.mjs b/scripts/check-skills-token-ratchet.mjs index 5914db2d453..899896cc45d 100644 --- a/scripts/check-skills-token-ratchet.mjs +++ b/scripts/check-skills-token-ratchet.mjs @@ -732,7 +732,28 @@ export const CEILINGS = new Map([ // absorbed and the ceiling moves 5997 -> 6014 (+17), the measured // remainder only. Pinned AT the measurement. // ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 20) / 4) == ceil(24055 / 4) - ['skills/objectstack-platform/SKILL.md', 6011], + // 6011 -> 6145 (card #34210, the Skills-docs follow-up the MCP action + // confirmation hand-off owed this file): a sixth `requires:` rule says the + // confirmation of an AI-door action is a service the host registers — an + // `IActionConfirmationService` under `'ai.actionConfirmation'` takes the + // hand-off (`pending_confirmation`, a `pendingId`), a host with none refuses + // 428 `no_confirmation_service`, `run_action` / `resume_run` refuse a call + // that sends `confirm`, and the `service_account` and elicited `declined` / + // `cancelled` / `timed_out` reasons point at objectstack-ai. Raise path the + // standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068, + // letter B). PAID DOWN FIRST — two restatements cut, each keeping its other + // home in the file: "Never rebuild what the platform owns." in the App / + // Platform Boundary intro (the first bullet under it, "capability belongs in + // the platform", and the third, "no hand-written predicate re-implementing a + // platform rule") and the `HonoServerPlugin` row's "(this is what `os dev` / + // `os serve` register)" (step 4 of the boot sequence lists the plugin under + // those two commands). Arithmetic in priced bytes (stamp line excluded): on + // `origin/main` the text was 24021 bytes (6006 tokens, headroom 5); the cuts + // remove 84 and the rule adds 640, so the LANDED priced text is 24577 bytes + // -> 6145 tokens: the 5 tokens of headroom are absorbed and the ceiling moves + // 6011 -> 6145 (+134), the measured remainder only. Pinned AT the measurement. + // ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 20) / 4) == ceil(24577 / 4) + ['skills/objectstack-platform/SKILL.md', 6145], // `skills/objectstack-pm-dispatch/SKILL.md` (9708) and its // `rules/dev-template.md` (1838) left this table on 2026-09-10 with the files: // the maintainer deleted the published PM skill whole (verbatim: diff --git a/skills/objectstack-ai/SKILL.md b/skills/objectstack-ai/SKILL.md index 7ebb193e082..374a088d66d 100644 --- a/skills/objectstack-ai/SKILL.md +++ b/skills/objectstack-ai/SKILL.md @@ -208,7 +208,15 @@ permissions and row-level security: | `validate_expression` | build-accurate CEL check before a formula is authored into metadata | | `create_record`, `update_record`, `delete_record` | writes; `delete_record` is refused with `ACTION_CONFIRMATION_REQUIRED` (428) unless it sends `confirm: true` — ask the human first, then retry | | `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` | -| `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 | +| `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 | + +**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. --- diff --git a/skills/objectstack-ai/evals/skills-tools-knowledge.json b/skills/objectstack-ai/evals/skills-tools-knowledge.json index 7da9edf7b98..356b1599500 100644 --- a/skills/objectstack-ai/evals/skills-tools-knowledge.json +++ b/skills/objectstack-ai/evals/skills-tools-knowledge.json @@ -60,6 +60,26 @@ "must_contain": ["pendingActions.list", "signed-in session", "refused"], "must_not_contain": ["pendingActions.approve("] } + }, + { + "id": 7, + "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.", + "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. The agent relays the message, tells the user to approve it in the app, and does 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.", + "files": [], + "assertions": { + "must_contain": ["pending_confirmation", "pendingId", "no_confirmation_service", "does not retry"], + "must_not_contain": ["recordId, confirm: true", "then retry with"] + } + }, + { + "id": 8, + "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?", + "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`. 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`.", + "files": [], + "assertions": { + "must_contain": ["elicitation", "declined", "cancelled", "timed_out", "service_account"], + "must_not_contain": ["confirm: true"] + } } ] } diff --git a/skills/objectstack-platform/SKILL.md b/skills/objectstack-platform/SKILL.md index 57470b39caa..d37bda73d88 100644 --- a/skills/objectstack-platform/SKILL.md +++ b/skills/objectstack-platform/SKILL.md @@ -136,8 +136,7 @@ That read's `contributions` lists what other packages add to the base, one entry An ObjectStack app is a **simplified implementation of business features**: author metadata under the platform's spec and check it -with the `os` commands ([Verify your work](./references/operations.md#verify-your-work)). Never rebuild -what the platform owns. +with the `os` commands ([Verify your work](./references/operations.md#verify-your-work)). - **Business features belong in the app; capability belongs in the platform.** A missing default, a wrong diagnostic, a shape the spec refuses — the fix is @@ -230,7 +229,7 @@ Two packages exist: | Package | Export | Use When | |:--------|:-------|:---------| | `@objectstack/hono` | `createHonoApp({ kernel, prefix })` | You own the server: embed ObjectStack routes in your own Hono app / deploy target. | -| `@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). | +| `@objectstack/plugin-hono-server` | `HonoServerPlugin` | ObjectStack owns the server: a kernel plugin that hosts the Hono app and opens the listening socket. | There are **no** `@objectstack/adapter-*` packages. To integrate another framework, mount the Hono app (a web-standard `fetch` handler) or call the @@ -326,7 +325,7 @@ The authoritative list is `PLATFORM_CAPABILITY_TOKENS` (`@objectstack/spec`, `kernel/platform-capabilities.ts`) — an unknown token is **rejected by `defineStack` at authoring time**, not at boot. -Five rules that change what you write: +Six rules that change what you write: - **Precedence:** `requires` › `tiers` › `--preset` › built-in default. An explicit instance in `plugins:` always shadows capability resolution. @@ -341,6 +340,14 @@ Five rules that change what you write: - **Under `--preset minimal`, pair `triggers` with `job`:** `triggers` alone arms record-change triggers; schedule and time-relative ones run on the job service, so scheduled flows stay silent. +- **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**. ### `onEnable` — where an app binds runtime code diff --git a/skills/objectstack-platform/evals/config-plugins-ops.json b/skills/objectstack-platform/evals/config-plugins-ops.json index 29f55e03cd9..a23bf812a49 100644 --- a/skills/objectstack-platform/evals/config-plugins-ops.json +++ b/skills/objectstack-platform/evals/config-plugins-ops.json @@ -377,6 +377,24 @@ "--client cursor" ] } + }, + { + "id": 23, + "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?", + "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.", + "files": [], + "assertions": { + "must_contain": [ + "IActionConfirmationService", + "ai.actionConfirmation", + "pending_confirmation", + "pendingId" + ], + "must_not_contain": [ + "confirm: true", + "requiresConfirmation: false" + ] + } } ] } From c973811845606fa75b84cc30a7c6e326c43f683c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 03:20:50 +0000 Subject: [PATCH 2/2] test(skills): the confirmation eval cases assert on tokens the skill teaches Review round on the three new eval cases: - objectstack-ai id 7 asserts 'do not retry', the skill's own words. - ids 8 and 23 narrow must_not_contain to the MCP call form, so an answer that names the host door's own member, or says a client's confirm is refused, is not failed. - id 8's expected output names the no_confirmation_service refusal over Streamable HTTP on a host with no service. Claude-Session: https://claude.ai/code/session_01WGufzfojHHNDnXxREucdHC Co-authored-by: Claude --- skills/objectstack-ai/evals/skills-tools-knowledge.json | 8 ++++---- skills/objectstack-platform/evals/config-plugins-ops.json | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/skills/objectstack-ai/evals/skills-tools-knowledge.json b/skills/objectstack-ai/evals/skills-tools-knowledge.json index 356b1599500..38c871b35f5 100644 --- a/skills/objectstack-ai/evals/skills-tools-knowledge.json +++ b/skills/objectstack-ai/evals/skills-tools-knowledge.json @@ -64,21 +64,21 @@ { "id": 7, "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.", - "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. The agent relays the message, tells the user to approve it in the app, and does 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.", + "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.", "files": [], "assertions": { - "must_contain": ["pending_confirmation", "pendingId", "no_confirmation_service", "does not retry"], + "must_contain": ["pending_confirmation", "pendingId", "no_confirmation_service", "do not retry"], "must_not_contain": ["recordId, confirm: true", "then retry with"] } }, { "id": 8, "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?", - "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`. 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`.", + "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`.", "files": [], "assertions": { "must_contain": ["elicitation", "declined", "cancelled", "timed_out", "service_account"], - "must_not_contain": ["confirm: true"] + "must_not_contain": ["recordId, confirm: true"] } } ] diff --git a/skills/objectstack-platform/evals/config-plugins-ops.json b/skills/objectstack-platform/evals/config-plugins-ops.json index a23bf812a49..637e92fe0d8 100644 --- a/skills/objectstack-platform/evals/config-plugins-ops.json +++ b/skills/objectstack-platform/evals/config-plugins-ops.json @@ -391,8 +391,7 @@ "pendingId" ], "must_not_contain": [ - "confirm: true", - "requiresConfirmation: false" + "recordId, confirm: true" ] } }