You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7611288
Browse filesBrowse the repository at this point in the historyBrowse files
docs(skills): a gated action guards its door only; lock the field an irreversible transition changes
objectstack-ai Common Pitfalls teaches the gated script action plus a
readonly or field-permission lock on the state field, and why readonlyWhen
and a state_machine rule cannot be the door. The tool-name ladder names
MCP_FILE_TOOL_NAMES as its fourth source (here and in content/docs/ai/tools.mdx),
and the MCP prompts paragraph names mcpPrompt and the stdio exception.
state-machines-and-approvals.md points to the pitfall; restatement cut in
both files to pay for it.
Claude-Session: https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7
Co-authored-by: Claude <noreply@anthropic.com>
docs(skills): objectstack-ai teaches that an AI-gated action guards its own door only, and pairs an irreversible transition with a lock on the field it changes; the tool-name ladder names its fourth source and the MCP prompts paragraph names `mcpPrompt`
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
objectstack-ai's Common Pitfalls gains "Gating the action, not the state". `ai.requiresConfirmation` guards the action's door, and an agent can still write the same field with `update_record` or any data write. An irreversible transition is a gated `script` action, whose body writes elevated, over a field a non-system write cannot set: `readonly: true` (the value is stripped) or field permissions that leave the caller no `editable` on it (refused `403`). A declarative `operation: 'update'` action and a `flow` action under `runAs: 'user'` write as the caller, so the lock stops them too. `readonlyWhen` and a `state_machine` rule bind the elevated body as well, so neither is the door; a `state_machine` dead-end still makes the reached state final for every writer. objectstack-automation's `references/state-machines-and-approvals.md` points to it.
11
+
12
+
The resolution ladder for `skill.tools[]` names four sources: the fourth is `MCP_FILE_TOOL_NAMES`, the MCP door's file tools, resolved only for a skill MCP can offer (`mcpPrompt` not `false`).
13
+
14
+
The paragraph on which skills MCP offers as prompts names `mcpPrompt`: `false` keeps a skill for the in-product agents only, never offered over MCP on any connection whatever its binding, and the stdio transport withholds it too; absent or `true` keeps the binding rule.
1.**`stack.tools[].name`** — records your own stack declares (none by
74
+
default:*Tool metadata* below).
75
75
2.**`PLATFORM_PROVIDED_TOOL_NAMES`** — the statically-registered platform
76
76
tools, flattened from `PLATFORM_TOOLS_BY_PACKAGE` in
77
77
`packages/spec/src/system/constants/platform-tool-names.ts`: data /
@@ -81,8 +81,11 @@ A `skill.tools[]` entry resolves against the union of three sources
81
81
3.**`action_<name>`** — one tool per AI-exposed Action of your own stack
82
82
(`PLATFORM_TOOL_FAMILY_PREFIXES`). **The default path** for anything your app
83
83
does.
84
+
4.**`MCP_FILE_TOOL_NAMES`** (same file) — the MCP door's file tools, resolved
85
+
only for a skill MCP can offer (`mcpPrompt` not `false`): no in-product turn
86
+
registers them.
84
87
85
-
A name in none of the three raises **`ai-skill-tool-unresolved`** (warning,
88
+
A name none of them resolves raises **`ai-skill-tool-unresolved`** (warning,
86
89
ADR-0078 advisory-first). The rule exists because one audited app shipped 10
87
90
fictional tools across 6 skills through `validate` / `lint` clean, and became a
88
91
copilot claiming abilities it did not have.
@@ -332,11 +335,27 @@ there is **no top-level `temperature` / `maxTokens`** on an agent
332
335
there is no storage backend to choose — and neither is a gate. For a gate
333
336
that is **enforced**, use
334
337
`enableActionApproval: true` (approval queue ☁️), `ai.requiresConfirmation` on
335
-
the **action**, or `approval: 'always'` on an MCP tool binding. AI metadata
336
-
edits are already gated: they land as drafts a human must publish (ADR-0033).
338
+
the **action** (its door only, pitfall 2), or `approval: 'always'` on an MCP
339
+
tool binding. AI metadata edits are already gated: they land as drafts a
340
+
human must publish (ADR-0033).
337
341
⚠️ `requiresConfirmation` on the **tool** was REMOVED (ADR-0033 §2; retired
338
342
above). There is no `requireApprovalFor` field.
339
-
2.**Indexing everything.** A knowledge source without a `where` filter and
343
+
2.**Gating the action, not the state.**`ai.requiresConfirmation` guards the
344
+
action's own door only: an agent can still write the field it changes with
345
+
`update_record` or any data write, and the write lands. An irreversible
346
+
transition is a gated action **plus a lock on that field**: a `script`
347
+
action, whose body writes elevated (`isSystem`), over a field a non-system
348
+
write cannot set — `readonly: true` (the value is stripped,
349
+
**objectstack-data** → `readonly`) or field permissions leaving the caller
350
+
no `editable` on it (refused `403`; any set granting it wins,
351
+
**objectstack-data**`rules/security.md`). A declarative
352
+
`operation: 'update'` action, and a `flow` action under `runAs: 'user'`,
353
+
write as the caller, so the lock stops them too. `readonlyWhen` and a
354
+
`state_machine` rule bind the elevated body as well, so neither is the
355
+
door; a `state_machine` dead-end (`closed: []`) still makes the reached
356
+
state final for every writer (**objectstack-automation**
357
+
`references/state-machines-and-approvals.md`).
358
+
3.**Indexing everything.** A knowledge source without a `where` filter and
340
359
curated `contentFields` fills the index with drafts and boilerplate that
341
360
pollute retrieval. Source hygiene is the metadata's job; relevance tuning
342
361
belongs to the adapter.
@@ -351,10 +370,6 @@ there is **no top-level `temperature` / `maxTokens`** on an agent
351
370
| Knowledge source |`src/knowledge/sales-kb.ts`|`KnowledgeSourceSchema` metadata, registered at boot via `KnowledgeServicePlugin({ sources })`|
352
371
| Central registration |`defineStack({ skills: [...] })`|`agents` / `tools` / `skills` are the only AI stack collections — knowledge sources have none, agents are platform-supplied, and `tools` is not the default path |
353
372
354
-
Default for metadata apps: push business capability into **skills**, expose
355
-
business logic as **AI-exposed Actions**, wire domain knowledge through
356
-
**knowledge sources**.
357
-
358
373
---
359
374
360
375
## Platform agents — reference only ☁️
@@ -400,8 +415,12 @@ there but is read: `registerSkillPrompts` offers a skill on `prompts/list` /
400
415
`prompts/get` only when its server lists every tool the skill binds — a plain
401
416
name by that tool, a wildcard by any match, an `action_*` entry also by
402
417
`run_action`. That covers the HTTP door and any host server that calls it; the
403
-
plugin's own stdio transport lists every skill. Bind a tool no MCP family
404
-
serves (the MCP table above) and no filtering server offers the skill.
418
+
plugin's own stdio transport lists every skill except one with
419
+
`mcpPrompt: false`. That optional key is the owner's opt-out: `false` = written
420
+
for the in-product agents only, never offered over MCP on any connection,
421
+
whatever the binding; absent or `true` = the binding rule above. Bind a tool no
422
+
MCP family serves (the MCP table above) and no filtering server offers the
423
+
skill.
405
424
`visualize_data` is the only built-in that draws a chart (an inline `data-chart`
406
425
part), auto-registered **only** when an analytics service (`IAnalyticsService`)
407
426
is wired — `query_data` / `aggregate_data` return numbers, not charts.
0 commit comments