Skip to content

Commit a145e24

Browse files
docs: retired agent keys are refused as unknown keys, not tombstones (eval case 5 prose, ai/agents page, agent.zod.ts comment) (#38003)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DLCo5F2y7fgbM8tstGoyyUn)_ Fixes #37967 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:对外文档「智能体」页里两个已下线字段(工具、知识库)的说明,以及一条评测题的期望答案说明、规格源码里的一句注释,改成和现在的真实行为一致:系统把这两个字段当未知字段拒绝,并指向升级指南。 - 为什么做:属于「技能文档与真实行为对齐」这条线的收尾,替照文档写智能体的作者和 AI 解决「文档说编译时报错,实际是运行时拒绝」的误导。 - 出错会怎样:只改说明文字,不影响任何判定或评测结果;如有不妥可直接撤回这次合并。 - 要你做什么:评测文件属于对外发布的技能包,合并需要你批准。 ## What changes Text only, three places. `agent.tools` and `agent.knowledge` were removed in protocol 17 and their tombstones left the shape at protocol 18. Since then the strict `AgentSchema` refuses each as an unknown key, and the refusal names https://objectstack.ai/docs/protocol-upgrade (pinned in `packages/spec/src/ai/agent.test.ts`, the `agent.tools retirement` and `knowledge` blocks). 1. `skills/objectstack-ai/evals/skills-tools-knowledge.json`, case 5, `expected_output` only. "are protocol-17 tombstones" becomes "were removed in protocol 17: the strict schema refuses each as an unknown key, naming" the guide. The prompt, `files` and `assertions` are unchanged, so the case hash does not move and no eval round is owed. No other case is touched. 2. `content/docs/ai/agents.mdx`, the `tools` and `knowledge` rows. "typed `never`, so writing it fails `tsc`, and a value that reaches the runtime is rejected at parse" becomes "the key is not on the type, and the strict schema refuses it as an unknown key, naming the upgrade guide". "Removed in protocol 17", each row's why and its replacement stay. 3. `packages/spec/src/ai/agent.zod.ts`, the comment on the removed `AIKnowledgeSchema`. It said `agent.knowledge` is "tombstoned below"; no key below declares it. Comment only. The `longTerm.store` "tombstoned below" further down is a live tombstone and is not touched. One changeset: `@objectstack/skills` patch and `@objectstack/spec` patch (the spec package ships `src/**/*.zod.ts`, so the comment is published bytes). Read first, by risk: 1. `skills/objectstack-ai/evals/skills-tools-knowledge.json`: the one changed line must stay inside case 5's `expected_output`. 2. `content/docs/ai/agents.mdx`: the two table rows. 3. `packages/spec/src/ai/agent.zod.ts`: the comment hunk near line 100. Skills readings (`skills/**` diff): the eval file is 125 lines before and 125 after (13680 bytes before, 13784 after). All `SKILL.md` files together are 4958 lines before and after; no `SKILL.md` is in the diff. The eval file is an eval fixture, which the token ratchet measures and does not ratchet. ## Tests All on head `1c2e51ffc1`. <details><summary>Spec tests that read agent.zod.ts</summary> `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2` on `src/ai/agent.test.ts`, `src/ai/agent-memory-store-retirement.test.ts`, `src/ai/agent-model-provider-retirement.test.ts`, `src/type-alias-convention.pin.test.ts`, `scripts/file-description.test.ts` and `scripts/liveness/tombstoned-row-status.test.ts`: `Test Files 6 passed (6)`, `Tests 214 passed (214)`, lock verdict `VERDICT command-exit 0`. </details> <details><summary>Case 5 byte identity</summary> A key-by-key comparison of all 12 cases against `origin/main` reports one difference: case 5, key `expected_output`. The case hash reads the prompt, the assertions, `should_trigger` and `files`, none of which changed. </details> <details><summary>Token ratchet</summary> `node scripts/check-skills-token-ratchet.mjs` exit 0: `61 authored bundle file(s) within their ceilings; 11 generator-owned file(s) and 42 eval fixture(s) measured, not ratcheted`. Ratcheted authored total `199679 / 199679 (+0)`. No ceiling line is changed. </details> <details><summary>Derived gate families (dispatch-gates --commands, 110)</summary> - 109 of 110 exited 0. Six gates first exited 3 (prerequisite not built) or 1 while their inputs were being built, and exited 0 when rerun after the build: `check:doc-formula-expressions`, `check:doc-security-posture`, `check:skill-examples`, `check:docs-transcript-drift`, `check:dts-closure`, `check:lean-entry-closure`. - NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3, `PREREQUISITE NOT MET`: it needs every package built. Not built locally for a comment-only change; CI measures it. - `dispatch-gates --ran`: `110 derived, 109 run, 1 NOT-MEASURED, 0 UNRUN`. - `node scripts/check-nul-bytes.mjs` exit 0. </details> ## Acceptance notes - The rest of the `ai/agents` page was read for the same stale claim. The code sample's comment on the removed `knowledge` block states only the removal and is true. Nothing else on the page calls either key a tombstone or typed `never`. - `test:repo` and the repo-wide lint are left to CI. ## Verification Two minutes: `git grep -n 'typed .never.\|protocol-17 tombstones' -- content/docs/ai/agents.mdx skills/objectstack-ai/evals/skills-tools-knowledge.json` prints nothing, and `pnpm --filter @objectstack/spec exec vitest run src/ai/agent.test.ts` passes, which is the behaviour the three texts now describe. --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4b2855f commit a145e24

4 files changed

Lines changed: 23 additions & 5 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/skills': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
docs: the retired agent keys are refused as unknown keys, not tombstones
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`agent.tools` and `agent.knowledge` were removed in protocol 17, and their tombstones left the shape at protocol 18. Since then the strict `AgentSchema` refuses each as an unknown key, and the refusal names https://objectstack.ai/docs/protocol-upgrade. Three texts still described the older behaviour and now say what happens today:
12+
13+
- **`@objectstack/skills`.** In the `objectstack-ai` skill's `skills-tools-knowledge` evals, case 5's `expected_output` no longer calls the two keys protocol-17 tombstones. The case's prompt and assertions are unchanged.
14+
- **`@objectstack/spec`.** The comment in `src/ai/agent.zod.ts` on the removed `AIKnowledgeSchema` no longer says `agent.knowledge` is tombstoned below it. No schema, type or export changes.
15+
16+
The `ai/agents` docs page says the same in its `tools` and `knowledge` rows: the key is not on the type, so there is no `never` member for `tsc` to refuse by name. Nothing to migrate.

‎content/docs/ai/agents.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ own `ask` / `build` records use exactly these fields):
308308
| `instructions` | System prompt / prime directives |
309309
| `model` | Model config: `model` (the model name, optional — absent means the deployment's default model), `temperature`, `maxTokens`, `topP`. There is no `provider`: it was **removed in protocol 19 (#37712)** because no runtime read it — the deployment's AI settings choose the provider, and resolve the model name among the providers they turn on |
310310
| `skills` | Skill names to attach (the primary Agent → Skill → Tool capability model) |
311-
| `tools` | **Removed in protocol 17 (#3894)** — typed `never`, so writing it fails `tsc`, and a value that reaches the runtime is rejected at parse. This is **not** a rename: there is no key the value moves to. Declare each tool on a **skill** instead — a platform tool by its registered name, or `action_<name>` for one of your own AI-exposed Actions — and attach that skill through `skills` (ADR-0064) |
312-
| `knowledge` | **Removed in protocol 17 (#3896)** — typed `never`, so writing it fails `tsc`, and a value that reaches the runtime is rejected at parse. Declaring `sources` / `indexes` here never scoped retrieval: `search_knowledge` takes `sourceIds` from the LLM's own tool-call arguments, not from the agent record, so an author who “scoped” access here scoped nothing. This is **not** a rename: there is no key the value moves to — delete the block. Restrict retrieval at the knowledge-service / source level (per-source permissions), and describe intended grounding in `instructions` so the model asks for the right sources |
311+
| `tools` | **Removed in protocol 17 (#3894)** — the key is not on the type, and the strict schema refuses it as an unknown key, naming the [upgrade guide](https://objectstack.ai/docs/protocol-upgrade). This is **not** a rename: there is no key the value moves to. Declare each tool on a **skill** instead — a platform tool by its registered name, or `action_<name>` for one of your own AI-exposed Actions — and attach that skill through `skills` (ADR-0064) |
312+
| `knowledge` | **Removed in protocol 17 (#3896)** — the key is not on the type, and the strict schema refuses it as an unknown key, naming the [upgrade guide](https://objectstack.ai/docs/protocol-upgrade). Declaring `sources` / `indexes` here never scoped retrieval: `search_knowledge` takes `sourceIds` from the LLM's own tool-call arguments, not from the agent record, so an author who “scoped” access here scoped nothing. This is **not** a rename: there is no key the value moves to — delete the block. Restrict retrieval at the knowledge-service / source level (per-source permissions), and describe intended grounding in `instructions` so the model asks for the right sources |
313313

314314
There is no `type` field and no fixed agent "type" taxonomy — behaviour comes from
315315
persona, instructions, skills, and tools. There are no `triggers` / `schedule`

‎packages/spec/src/ai/agent.zod.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ export const AIModelConfigSchema = lazySchema(() => acceptRetiredDefaultResidue(
9797

9898
/*
9999
* REMOVED — `AIKnowledgeSchema` / `AIKnowledge` (#3896 audit close-out). It
100-
* typed `agent.knowledge`, tombstoned below: the RAG path never read the
101-
* agent record, so the whole block was a grounding claim nothing enforced.
100+
* typed `agent.knowledge`, which no key below declares any more: the RAG
101+
* path never read the agent record, so the whole block was a grounding claim
102+
* nothing enforced. The key's tombstone aged out at protocol 18, so the
103+
* strict `AgentSchema` refuses it as an unknown key naming the upgrade guide.
102104
* The protocol-17 `agent-knowledge-topics-to-sources` conversion remains in
103105
* the chain (it rewrites historical SOURCES and imports nothing from here).
104106
*/

‎skills/objectstack-ai/evals/skills-tools-knowledge.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
{
4545
"id": 5,
4646
"prompt": "Create `src/ai/support-bot.agent.ts` with defineAgent({ name: 'crm_support_bot', tools: ['query_records', 'action_crm_close_case'], knowledge: ['support_kb'] }) and register it under agents. None of the project's files are in this directory: answer from what is stated here.",
47-
"expected_output": "Refuses the agent: the `agent` type is closed to third parties (a stack-authored agent is filtered out, refused by `loadAgent()` and 404s on chat), and `agent.tools` / `agent.knowledge` are protocol-17 tombstones. Re-declares the two tools in a `defineSkill` (registered under `skills`) with a `surface`, and restricts retrieval at the knowledge-source level (`aiExposed`, `where`) rather than on an agent. The in-app `ask` assistant picks the skill up by surface (`ask` or `both`) for the app the user is in, and a tool the skill names outside the allow-set is dropped with a diagnostic.",
47+
"expected_output": "Refuses the agent: the `agent` type is closed to third parties (a stack-authored agent is filtered out, refused by `loadAgent()` and 404s on chat), and `agent.tools` / `agent.knowledge` were removed in protocol 17: the strict schema refuses each as an unknown key, naming https://objectstack.ai/docs/protocol-upgrade. Re-declares the two tools in a `defineSkill` (registered under `skills`) with a `surface`, and restricts retrieval at the knowledge-source level (`aiExposed`, `where`) rather than on an agent. The in-app `ask` assistant picks the skill up by surface (`ask` or `both`) for the app the user is in, and a tool the skill names outside the allow-set is dropped with a diagnostic.",
4848
"files": [],
4949
"assertions": {
5050
"must_contain": ["defineSkill", "skills", "surface", "aiExposed"],

0 commit comments

Comments
 (0)