|
| 1 | +--- |
| 2 | +"@objectstack/platform-objects": patch |
| 3 | +"@objectstack/lint": patch |
| 4 | +"@objectstack/mcp": patch |
| 5 | +--- |
| 6 | + |
| 7 | +fix(ai): author the CANONICAL agent id everywhere the platform teaches one — Studio's pin, the MCP prompt example, and the lint's value roster (#14461) |
| 8 | + |
| 9 | +`skills/objectstack-ai` tells authors that `data_chat` and `metadata_assistant` |
| 10 | +"are **not** vocabulary — always write `ask` / `build`". The platform then |
| 11 | +taught the opposite from every live example it ships. Nothing was broken at |
| 12 | +runtime; what was wrong is what an author copies. |
| 13 | + |
| 14 | +**Studio's pin.** `studio.app.ts` was the repo's ONLY `app.defaultAgent` usage, |
| 15 | +and it spelled the alias: |
| 16 | + |
| 17 | +``` |
| 18 | +- defaultAgent: 'metadata_assistant', |
| 19 | ++ defaultAgent: 'build', |
| 20 | +``` |
| 21 | + |
| 22 | +The triage card left this undecidable — if the cloud plugin registered the |
| 23 | +agent under the legacy id, re-pinning would be a behaviour change in a |
| 24 | +consumer this repo cannot see. Measured instead of assumed, at `cloud` |
| 25 | +`main@3856fbf7`: `service-ai-studio/src/agents/metadata-assistant-agent.ts:12,40` |
| 26 | +ships the record as `name: BUILD_AGENT_NAME` = `'build'`, and `plugin.ts:58` |
| 27 | +registers `metadata_assistant` as a **one-way, resolution-only** legacy alias. |
| 28 | +The canonical id *is* `build`; the old pin reached it by detour. |
| 29 | + |
| 30 | +Nor is the re-pin cosmetic. Alias resolution depends on an in-memory |
| 31 | +`registerAgentAlias` call having run at plugin init, and cloud carries two |
| 32 | +defensive docblocks about that registration silently no-op'ing for real under |
| 33 | +bundle load ordering (`service-ai-studio/src/plugin.ts:44-57`, |
| 34 | +`service-ai/src/agent-runtime.ts:30-41` — "a missed alias must never hide a |
| 35 | +real platform agent like `build`"). The canonical id never touches the alias |
| 36 | +table, so this drops a load-order dependency from the platform's own flagship |
| 37 | +authoring surface. On the UI side nothing moves: `objectui`'s |
| 38 | +`AGENT_ALIAS_GROUPS` is bidirectional and canonical-first, and |
| 39 | +`SURFACE_DEFAULT['studio-build']` was already `'build'`. |
| 40 | + |
| 41 | +**The MCP prompt example.** `mcp-server-runtime.ts`'s `agent_prompt` argument |
| 42 | +described itself as `'Name of the agent to load (e.g. "data_chat", |
| 43 | +"metadata_assistant")'` — two retired aliases, neither canonical id present. |
| 44 | +That string is served to every MCP client asking what to pass, so the one |
| 45 | +surface that suggests a spelling to an LLM suggested the two the catalogue |
| 46 | +forbids. Now `(e.g. "ask", "build")`. |
| 47 | + |
| 48 | +**The lint's value roster.** `validate-ai-agent-authoring`'s `defaultAgent` |
| 49 | +**value** limb reused the four-name `PLATFORM_AGENT_NAMES` set, so it |
| 50 | +deliberately passed `metadata_assistant` — the gate that exists to make |
| 51 | +authoring mistakes loud waved through the exact spelling the catalogue bans, |
| 52 | +which is the silent-tolerance shape ADR-0078 exists to close, committed by the |
| 53 | +gate itself. The two limbs now read different tables, because they ask |
| 54 | +different questions: |
| 55 | + |
| 56 | +- **declaration limb** — unchanged, still all four names. Declaring |
| 57 | + `metadata_assistant` shadows the `build` record through the alias exactly as |
| 58 | + declaring `build` does. |
| 59 | +- **value limb** — canonical `ask` / `build` only. A legacy alias gets its own |
| 60 | + rule id `default-agent-legacy-alias` (exported) and its own wording, because |
| 61 | + an alias **resolves** (the app gets the agent it meant — a spelling defect) |
| 62 | + while an unknown name does **not** (the pin is inert). Describing the alias |
| 63 | + as "no effect" would send an author hunting a bug that is not there. |
| 64 | + |
| 65 | +Both of the #6041 ruling's operative decisions are kept intact: still |
| 66 | +`warning` tier, still no Zod enum narrowing. `defaultAgent: 'metadata_assistant'` |
| 67 | +keeps parsing, building, and resolving — the only change is that authoring it |
| 68 | +now says so. |
| 69 | + |
| 70 | +Not breaking: nothing an author can write was removed, and both aliases stay |
| 71 | +resolvable for old bookmarks and persisted `agent_id`s, which is the only job |
| 72 | +ADR-0063 §2 ever gave them. |
0 commit comments