Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/34210-skills-mcp-action-confirmation-hand-off.md
Original file line number Diff line number Diff line change
@@ -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.
23 changes: 22 additions & 1 deletion scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,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:
Expand Down
10 changes: 9 additions & 1 deletion skills/objectstack-ai/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`. 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 |
| `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.

---

Expand Down
20 changes: 20 additions & 0 deletions skills/objectstack-ai/evals/skills-tools-knowledge.json
Original file line number Diff line number Diff line change
Expand Up @@ -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. 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", "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`, 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": ["recordId, confirm: true"]
}
}
]
}
15 changes: 11 additions & 4 deletions skills/objectstack-platform/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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

Expand Down
17 changes: 17 additions & 0 deletions skills/objectstack-platform/evals/config-plugins-ops.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,23 @@
"--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": [
"recordId, confirm: true"
]
}
}
]
}
Loading