Uh oh!
There was an error while loading. Please reload this page.
docs(ai): correct the agent.knowledge row to a retirement - #10768
Merged
Conversation
The "shape of an agent" field table documented `knowledge` as live RAG access and noted only that its nested `topics` alias was removed, pointing the reader at `os migrate meta --from 16` to "rewrite it". But the whole key is retired: `packages/spec/src/ai/agent.zod.ts` declares `knowledge: retiredKey(...)`, so it types as `never` and any value reaching the runtime is rejected at parse. The page already carried the correct prescription 64 lines further down, in the Sales Assistant example. This rewrites the row from the tombstone's own words so the two agree: the key is gone (#3896 audit close-out), it is not a rename, restrict retrieval at the knowledge-service / source level, and describe intended grounding in `instructions`. No migration command is offered, because none moves a `knowledge` block forward - the tombstone's `os migrate meta --from 16` only LISTS edits to apply by hand, matching how the sibling `tools` row is documented. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt
os-zhuang
marked this pull request as ready for review
August 21, 2026 10:57
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes#10730
The defect
The "shape of an agent" field table in
content/docs/ai/agents.mdxdocumentedknowledgeas live RAG access, noting only that a nested alias had been removed —and handed the reader a migration command for a key that no longer exists.
But
packages/spec/src/ai/agent.zod.tsdeclaresknowledge: retiredKey(...). The wholekey is retired: it types as
never(so writing it failstsc) and any value that reachesthe runtime is rejected at parse. The row taught a key that cannot be written.
This is the more dangerous of the two rows on this table, because the key read as a
security control and was not one: declaring
sources/indexeson an agent neverscoped retrieval —
search_knowledgetakessourceIdsfrom the LLM's own tool-callarguments, not from the agent record. An author who believed they had scoped retrieval
here scoped nothing.
The page already contradicted itself, 64 lines apart
The Sales Assistant example further down the same file already carried the correct rule:
So the prescription did not have to be invented — only moved into the row, in the row's
own register. The two now agree.
Before
After
Written from the tombstone's own words, following the shape of the sibling
toolsrow(PR #10732), which rewrote from its tombstone, offered no migration command, and carried
the reason the key is gone so the row reads as a prescription rather than a neutral
"this moved".
Two judgment calls, flagged for review
1. No migration command is offered. The tombstone does name one, verbatim:
That sentence is the identical boilerplate carried by the
toolstombstone, and itdescribes a lister, not a rewriter — there is no key a
knowledgeblock moves to. Therow it replaces claimed the command "rewrites it", which is the false half. I omitted the
command rather than restate it, for two reasons: the sibling
toolsrow omits it too, andan asymmetry between two adjacent rows whose tombstones carry the same sentence would imply
knowledgehas a migration path thattoolslacks. Happy to add it back framed as alister if the reviewer prefers.
2. The
topics/ #3855 fact is dropped. It remains historically true, and theprotocol-17
agent-knowledge-topics-to-sourcesconversion does remain in the chain (perthe header comment in
agent.zod.ts, it rewrites historical sources and importsnothing from the removed schema). But for an author, a nested alias of a key that cannot be
written at all is unreachable information — and leading with the alias is exactly what made
the old row imply the parent was live. The conversion-chain fact stays recorded where it
belongs, in
agent.zod.tsand the ADR-0087 registries, not in the authoring field table.Note the two issue numbers are distinct and both real: #3855 is the
topicsaliasremoval, #3896 is the
knowledgekey's own removal. The old row cited only the first.Verification
Gate union re-run on the final commit
934022ee4a; the set was derived withnode scripts/pm/dispatch-gates.mjs(no paths) rather than assumed — it returned 13families for this path, not the 4 predicted. All green:
check:cross-package-test-inputs·check:doc-anchors·check:doc-authoring·check:doc-formula-expressions·check:docs-audit-scope·check:docs-redirects·check:published-readme-links·check:role-word·check:empty-state·check:liveness·check:strictness-ledger·check:variant-docs·check-cross-package-test-inputs.mjs· pluscheck:nul-bytes.The mutation was confirmed on disk by anchor count in both directions (old row 1 → 0, new
row 0 → 1; file line count unchanged at 391), since a markdown table row is exactly where a
zero-match edit reads as a clean no-op.
check:skill-exampleswas not run: the nearest{/* os:check */}fence on this page isat line 247, below this hunk at line 211 and outside it. Verified for this hunk rather than
inherited from the sibling PR.
Docs-only, publishes nothing ⇒ no changeset;
skip-changesetlabel applied.Generated by Claude Code