Skip to content

docs(spec,ai): agent.zod.ts stops saying the absorbed topics-to-sources conversion is in the chain; agents page names the excess-property tsc error - #38031

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/area-o1B-38012
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/area-o1B-38012

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Fixes #38012

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:读规格源码和对外文档的作者看到的说法与实际一致;运行行为无任何变化。
  • 为什么做:智能体规格清理的收尾,修正上一轮审核记下的两处小说法(源码注释里一个早已并入删除的转换被说成「仍在链上」,文档补半句编译期报错说明)。
  • 出错会怎样:只改一段注释和文档表格两格,出错也只是措辞不准,可随时直接撤回。
  • 要你做什么:无。

What changes

  • packages/spec/src/ai/agent.zod.ts, the note where AIKnowledgeSchema used to live. It said the protocol-17 agent-knowledge-topics-to-sources conversion "remains in the chain". It does not: the rename was absorbed before release into the removal of the whole agent.knowledge block (the ABSORBED note at conversions/entries/17/sharing-rule-access-level-full-to-edit.ts:17), no registry or entry module carries the id, and retired-after.census.json has no row for it. The sentence now says exactly that. Comment only: no schema, type or export changes.
  • content/docs/ai/agents.mdx, the tools and knowledge rows. Each gains a half-clause: a defineAgent({ … }) literal that sets the removed key fails tsc as an excess property (TS2353), beside the existing parse refusal. defineAgent takes z.input of the strict AgentSchema, a closed object type. The old by-name never refusal is not claimed.
  • One changeset, @objectstack/spec patch (spec publishes src/**/*.zod.ts), carrying both declaration lines.

Tests

All readings at head c5a5d51901, worktree from origin/main 8b47659e8e.

Type check of the new docs claim (throwaway probe against the rebuilt spec dist)

A scratch file outside the repo, compiled with tsc 6.0.3 (--ignoreConfig --noEmit --strict --module nodenext --moduleResolution nodenext --skipLibCheck) against packages/spec/dist/index.js after pnpm --filter @objectstack/spec build (VERDICT command-exit 0):

  • control defineAgent({ name, label, role, instructions }): no diagnostic;
  • the same literal plus tools: [...]: error TS2353: Object literal may only specify known properties, and 'tools' does not exist in type ...;
  • the same literal plus knowledge: { topics: [...] }: error TS2353: ... and 'knowledge' does not exist in type ....

No existing type test pins this. The probe file was not committed.

Spec tests and typecheck (under the verify lock)
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 over src/ai/agent.test.ts, agent-lifecycle-retirement.test.ts, agent-memory-store-retirement.test.ts, agent-model-provider-retirement.test.ts, src/conversions/retired-after.census.test.ts: Test Files 5 passed (5), Tests 122 passed (122); VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec typecheck: VERDICT command-exit 0.
Derived gates (dispatch-gates --commands, 105 commands)
  • 99 exit 0 on the first pass, including check:docs, check:doc-authoring, check:doc-anchors, check:issue-citations, check:nul-bytes and check-affected-docs.
  • 3 exited 3 (PREREQUISITE NOT MET, unbuilt workspace packages) and are green after building @objectstack/lint and @objectstack/formula with their dependencies: check:doc-formula-expressions, check:doc-security-posture, check:docs-transcript-drift.
  • 3 NOT MEASURED locally (they need the whole workspace built), left to CI: check:skill-examples (client SDK dist), check:dual-build-cjs-loads, check:lean-entry-closure.
  • --ran reconciliation: 105 derived, 105 run, 0 UNRUN.

Acceptance notes

  • No ablation: no tested behaviour changed (a comment, two docs cells and a changeset).
  • Not a narrowing and no ! in the title, so the full dogfood battery is not owed.

Verification

Read first (by risk): content/docs/ai/agents.mdx (the two table rows: the only claim a reader acts on), then packages/spec/src/ai/agent.zod.ts (the rewritten note).

Two-minute check: git grep -n "agent-knowledge-topics-to-sources" -- packages/spec/src shows three hits, all comments (the ABSORBED note, the protocol-18 note that cites it, and this note), and no id: line, which is what the rewritten sentence says.


Generated by Claude Code

…s conversion is not in the chain

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie
…oved tools and knowledge keys; spec patch changeset

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cxBECSPtHxQMZDHSie
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation protocol:ai tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️ 1 changed file(s) yielded no anchor (packages/spec/src/ai/agent.zod.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/src/ai/agent.zod.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 3df181b20b29dc67b2f77c4c80cb1068b5c55a23 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie

Final head for review: c5a5d51901f69e7e5047295faab4e2ad5902da12 · 2026-11-27T18:24Z · area o1-B. Card #38012 (N1/N2 of contract record 7222359751 on PR #38003). 3 files, +16/-4, comment and docs prose only. packages/spec/src/ai/agent.zod.ts: the AIKnowledgeSchema note no longer says agent-knowledge-topics-to-sources remains in the chain; it now says that rename was absorbed before release into the removal of the whole block (citing the ABSORBED note in conversions/entries/17/sharing-rule-access-level-full-to-edit.ts), so no registry or entry module carries the id and retired-after.census.json has no row for it. content/docs/ai/agents.mdx: the tools and knowledge rows add that a defineAgent({ … }) literal setting the key fails tsc as an excess property, before the existing parse-time refusal; the dev's tsc probe gave TS2353 for both keys (dev report 7224881775). Patch changeset, Clause-②: no, Metadata-protocol: none. Check-runs on this head: 60 success, 10 skipped, 0 failed. Not governed; L1 requested from seat 1's L1 thread, the area lands on ACCEPT.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · head c5a5d51 · 2026-11-27T18:25Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c5a5d51901f69e7e5047295faab4e2ad5902da12
Local-runs: none
Scope: packages/spec/src/ai/agent.zod.ts + content/docs/ai/agents.mdx
Security-touching: no

First record on PR #38031 for card #38012 (the follow-up to N1 and N2 of record 7222359751 on PR #38003). Read: the card body and its three comments (triage 7223000822, claim 7224432682, dev report 7224881775); the PR title, body, its 3-file list and its comments (docs-drift 7224891493, head comment 7225468412, review claim 7225491125); the net diff against the merge base 8b47659e (+16/-4); the 70 check-runs on the head (60 success, 10 skipped, none failed). Nothing was checked out, built, run or re-run; git objects were read in place.

Security-touching: no. The words this PR adds teach a compile-time refusal and a fact about the conversion chain. The knowledge row's sentence about retrieval scoping is main's text, unchanged by the hunk. The seat decides the label.

① Derived judgments

  • packages/spec/src/ai/agent.zod.ts: one hunk, 2 lines for 6, wholly inside the block comment at :98-110. No schema, type, export or accept set changes. Right.
  • content/docs/ai/agents.mdx: two table rows, one clause added to each (the tools row and the knowledge row at :311-312). Docs prose; no other cell or sentence moves. Right.
  • .changeset/38012-agent-knowledge-absorbed-conversion-note.md: new. Right, see ②.
  • The file surface the claim declared (the docblock, the two rows, one changeset) is the whole diff.

② Semver level

@objectstack/spec patch: right. The package's files list publishes src/**/*.zod.ts (packages/spec/package.json:261), so the comment is published bytes, and a comment is a patch. The docs page belongs to no package and needs no entry. Check Changeset is green on the head.

Clause-②: no. Correct on the PR body and in the changeset: no accept set moves. Metadata-protocol: none is correct.

The changeset, sentence by sentence against the tree:

  • "the note where AIKnowledgeSchema used to live no longer says the protocol-17 agent-knowledge-topics-to-sources conversion is still in the chain": true, the hunk.
  • "That rename was absorbed before release into the removal of the whole agent.knowledge block": true, by the ABSORBED note at conversions/entries/17/sharing-rule-access-level-full-to-edit.ts:17-24.
  • "no registry or entry module carries the id": true. Across the head the id appears in four places only: this changeset, the rewritten docblock, the ABSORBED note, and the comment at conversions/entries/18/connector-resilience-keys-removed.ts:31 that cites it as a precedent. All four are prose; no id: line carries it.
  • "retired-after.census.json has no row for it": true. The census has no occurrence of the id (its only agent-knowledge rows are agent-knowledge-removed).
  • "Comment only: no schema, type or export changes": true, see ①.

③ Boundary flags

  • Dev report 7224881775: open_questions empty; security_findings none; out_of_scope_findings empty.
  • Dev narrowing, three gates not measured locally (check:skill-examples, check:dual-build-cjs-loads, check:lean-entry-closure): answered by the head's check-runs, none failed.
  • The dev's one probe (TS2353 for tools and for knowledge, a clean control literal, against the rebuilt spec dist) is the dev's evidence, not a committed test. It is not re-run here; ④ reaches the same result from the types.
  • The card marked the docs half-clause optional ("if it does not read well in the table, leave it out"). It was added; it reads cleanly in both rows.
  • Docs-drift comment 7224891493 reports no anchor for agent.zod.ts: expected for a comment-only hunk; the page that documents these keys is in this diff.
  • SQL push-down: not applicable. No query, id materialisation or join in the diff.

④ Design judgment

packages/spec/src/ai/agent.zod.ts, the rewritten sentence at :104-109, clause by clause against the head:

  • "No conversion for the block's old topics spelling is in the chain": true. No entry module under conversions/ and no registry line declares the id or any other topics rewrite for agent.knowledge.
  • "the protocol-17 agent-knowledge-topics-to-sources rename was absorbed before release into the removal of the whole block": true to the cited note, which says the rename "lived inside the same unreleased major that now REMOVES the whole agent.knowledge block" and was "Folded pre-release".
  • "(the ABSORBED note in conversions/entries/17/sharing-rule-access-level-full-to-edit.ts)": the file exists at that path under packages/spec/src/ and the note is at :16-24.
  • "so no registry or entry module carries that id and retired-after.census.json has no row for it": true, as under ②.
  • The four sentences above it in the docblock are PR docs: retired agent keys are refused as unknown keys, not tombstones (eval case 5 prose, ai/agents page, agent.zod.ts comment) #38003's text, unchanged, and were judged true in record 7222359751.
  • The hunk is inside a block comment; no code line moves. TypeScript Type Check, Type Check · source gates and Test Core are green on the head.

Tried to break it: the new sentence could be read as saying a removal conversion is still in the chain. It does not say so. It says the rename was absorbed into the removal, which is the history the cited note records, and it makes no claim about where the removal entry lives today.

content/docs/ai/agents.mdx, the added clause in each row, "the key is not on the type, so a defineAgent({ … }) literal that sets it fails tsc as an excess property, and the strict schema refuses it at parse as an unknown key":

  • defineAgent (agent.zod.ts:649) is not generic. Its one parameter is typed as the z.input of AgentSchema directly, so an object literal passed inline is a fresh literal checked against that exact type; nothing widens it first.
  • AgentSchema (:345) is lazySchema over strictObject. lazySchema (shared/lazy-schema.ts:34) returns its factory's type unchanged. strictObject (shared/strict-object.ts:541) returns closedObject(z.object(shape, …).strict()), and closedObject returns its argument's type unchanged. The input type is therefore a closed object type with no index signature and no catchall. The spread MetadataProtectionFields adds the one named key _lock.
  • The shape declares neither tools nor knowledge. lifecycle and memory.longTerm.store are the keys still held as retiredKey() members; these two are not. So the literal fails on the excess-property rule (TS2353), which is what the rows say, and the rows do not claim the old by-name never refusal.
  • The clause is scoped to "a defineAgent({ … }) literal", which is exactly where the check applies. A value arriving through a variable, a spread or JSON is not claimed, and the parse refusal the row keeps covers those.
  • "the strict schema refuses it at parse as an unknown key, naming the upgrade guide": true for both keys (agent.test.ts:101-114 and :232-242). The added words "at parse" are accurate.
  • Each row's removal line, why-sentence and replacement are main's text, unchanged.

Observation, outside the diff and not graded: the ABSORBED note the docblock cites says "(agent-knowledge-removed below)", and on the head no entry module under packages/spec/src declares that id either; it survives only in that comment and in the census rows. The sentence this PR writes does not depend on it. Read, not reviewed; a follow-up card if the owning area wants the note tidied.

No must-fix, no should-fix.

Implemented-by: claude/area-o1B-38012
Reviewed-by: session_016WV4czzx9dtSEm3jWWL9c3 (isolated sub-agent)

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

L1 verdict (L1-a): ACCEPT at head c5a5d51901f69e7e5047295faab4e2ad5902da12 (Fixes #38012). Full read · 2026-11-27T18:29Z

席位核对

Shape and gates. 3 files, +16/-4: a jsdoc comment, two docs rows and a @objectstack/spec patch changeset. Check-runs at c5a5d51: 60 success, 10 expected skip, 0 failed. Mergeable state is clean. Not governed. Clause-②: no · Metadata-protocol: none. l1-face is CLEAN.

Contract review. The comment change in packages/spec/src/ai/agent.zod.ts is a published-schema path, so a contract review was owed. Record 7225536594 at this head: PASS at the contract tier (verify-review-tier PASS), No must-fix, no should-fix. I adopt it.

What I read myself. This closes N1 and N2 of record 7222359751 (#38003).

  • N1. The docblock now says the agent-knowledge-topics-to-sources rename was absorbed before release. I confirmed the ABSORBED note at conversions/entries/17/sharing-rule-access-level-full-to-edit.ts:17, and the id appears only in prose: no id: line in any registry or entry, and no census row.
  • N2. Both agents.mdx rows add the tsc excess-property clause. defineAgent is non-generic over AgentSchema's closed input, so an inline literal is checked fresh. That agrees with the dev's TS2353 probe.
  • Changeset. Patch is right, since spec publishes src/**/*.zod.ts. Every sentence is true.

Follow-up, optional. The ABSORBED note says "(agent-knowledge-removed below)", but no entry module at this head declares that id; it survives only in that comment and the census rows. This is outside the diff and the new sentence does not depend on it. It could be a small card for the owning area.

Landing: not governed, so the area lands it after ACCEPT.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4cxBECSPtHxQMZDHSie

Landing by area o1-B · 2026-11-27T18:30Z · head c5a5d51901f69e7e5047295faab4e2ad5902da12 · ACCEPT 7225546641 (L1-a) + contract PASS 7225536594 at this head; not governed, not a narrowing

probe reading
check-governed-merges.mjs --pr 38031 NOT governed; 20 changed lines ≤ 3000
landing-k.mjs --pr 38031 OK, K = 2 < 15; counted as a label PR by path (agent.zod.ts), but the hunk is a block comment, so no display label moves; no locale pack, no shared book moved
check-runs at this head 60 success, 10 skipped, 0 failed

Optional observation from both records, outside this diff and not filed: the ABSORBED note in packages/spec/src/conversions/entries/17/sharing-rule-access-level-full-to-edit.ts cites agent-knowledge-removed as "below", and no entry module at this head declares that id. It is left for the next prose touch on that file.
State: ready + auto-merge now; #38012 closes on merge via Fixes, pm:dispatched cleared then.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 18:31
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 6e2a8f2 Nov 27, 2026
71 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-o1B-38012 branch November 27, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:ai size/s tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants