@@ -10,11 +10,10 @@ import stack from '../objectstack.config';
1010 * validate` and `build` check that each name is a well-formed snake_case
1111 * string and stop there — nothing resolves it against a tool that exists.
1212 * At runtime an unresolved name is dropped silently, so the model is handed
13- * instructions ("call `search_knowledge` for the policy context") describing
14- * a capability it does not have, and improvises. Every instance of this bug
15- * shipped green: issue #493 counted eleven fictional tools across six
16- * skills, #512 removed ten of them, and `search_knowledge` survived in
17- * `customer_360` because nothing in CI could see it.
13+ * instructions ("call `triage_case` first") describing a capability it does
14+ * not have, and improvises. Every instance of this bug shipped green: issue
15+ * #493 counted eleven such references across six skills and #512 removed
16+ * ten, none of which any check could see.
1817 *
1918 * Note the trap in "just define the missing tool": per `ToolSchema`, AI tool
2019 * metadata is a READ-ONLY PROJECTION for Studio discovery — it has no
@@ -39,40 +38,65 @@ const flowNames = new Set(flows.map((f) => f.name));
3938const action = ( name : string ) => actions . find ( ( a ) => a . name === name ) ;
4039
4140/**
42- * Tools the AI runtime provides — the only names a skill may reference
41+ * Tools the platform provides — the only names a skill may reference
4342 * without anything in this repo defining them.
4443 *
45- * The runtime that serves them ships in the closed cloud package
46- * (`@objectstack/service-ai`, ADR-0025 §2), so the open-edition
47- * `node_modules` this repo installs cannot be read for the authoritative
48- * list. What IS verifiable locally is the MCP bridge in
49- * `@objectstack/mcp@16.1.0`, which registers the same registry's data +
50- * metadata tools: `list_objects`, `describe_object`, `query_records`,
51- * `get_record`, `aggregate_data`, `create_record`, `update_record`,
52- * `delete_record`, `list_actions`, `run_action`, `validate_expression`.
44+ * TRANSCRIBED VERBATIM from `PLATFORM_PROVIDED_TOOL_NAMES` in
45+ * `@objectstack/spec@17.0.0-rc.0` (`dist/system`), which the upstream
46+ * `ai-skill-tool-unresolved` rule resolves against. On the 17.0 upgrade,
47+ * DELETE this literal and import the real thing:
5348 *
54- * This list is the READ subset of that surface plus `visualize_data`.
55- * Deliberately excluded: the write tools (`create_record` /
56- * `update_record` / `delete_record`). HotCRM's state changes go through
57- * Actions so that validation, sharing rules and audit match the UI path —
58- * a skill reaching for raw record writes is a design regression, and this
59- * list is where that gets caught.
49+ * import { PLATFORM_PROVIDED_TOOL_NAMES } from '@objectstack/spec/system';
6050 *
61- * Adding a name here is a claim that the platform serves it. Make that
62- * claim deliberately: an entry that is merely aspirational reintroduces
63- * exactly the bug this file exists to prevent.
51+ * The transcription is a stopgap for 16.1.0, which exposes no such
52+ * registry — and a hand-copied list is exactly the drift risk this file
53+ * exists to catch, one level up. Do not extend it from memory: an entry
54+ * that is merely aspirational reintroduces the bug.
55+ *
56+ * The first pass of this file guessed the list from what the
57+ * `@objectstack/mcp@16.1.0` bridge happens to register, and got it wrong
58+ * in both directions. It omitted `search_knowledge` — a real platform
59+ * tool, documented in 16.1.0's own
60+ * `spec/src/ai/knowledge-source.zod.ts:114` — and so would have failed a
61+ * legitimate reference. It also reasoned about `create_record` /
62+ * `update_record` / `delete_record` as tools to deliberately exclude;
63+ * they are MCP-bridge tools and are not in the platform registry at all,
64+ * so there was nothing to exclude.
6465 */
6566const PLATFORM_TOOLS = new Set ( [
66- 'list_objects' ,
67- 'describe_object' ,
68- 'query_records' ,
69- 'get_record' ,
67+ // Data / analytics — the 'ask' surface these skills bind to.
7068 'aggregate_data' ,
71- // Charting tool served by the cloud AI runtime's analytics tier. Not in
72- // the open-edition bundle (nothing AI-runtime is), verified against the
73- // upstream reference-integrity rule when `revenue_forecasting` adopted it
74- // in #512.
69+ 'get_record' ,
70+ 'query_data' ,
71+ 'query_records' ,
72+ 'search_knowledge' ,
7573 'visualize_data' ,
74+ // Metadata authoring — the 'build' surface. In the registry, so a
75+ // reference resolves; no HotCRM skill has business with them.
76+ 'add_field' ,
77+ 'apply_blueprint' ,
78+ 'apply_edit' ,
79+ 'create_metadata' ,
80+ 'create_object' ,
81+ 'create_package' ,
82+ 'create_seed' ,
83+ 'delete_field' ,
84+ 'describe_metadata' ,
85+ 'describe_object' ,
86+ 'get_active_package' ,
87+ 'get_metadata_schema' ,
88+ 'get_package' ,
89+ 'list_metadata' ,
90+ 'list_objects' ,
91+ 'list_packages' ,
92+ 'modify_field' ,
93+ 'propose_blueprint' ,
94+ 'set_active_package' ,
95+ 'suggest_builder' ,
96+ 'todo_write' ,
97+ 'update_metadata' ,
98+ 'validate_expression' ,
99+ 'verify_build' ,
76100] ) ;
77101
78102/** `action_<name>` — the tool the runtime materialises from an Action (ADR-0011). */
0 commit comments