Skip to content

docs(knowledge): the 18 to 19 id row names the underscore exception and the dropSource cleanup - #38050

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/area-o1C-38022
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/area-o1C-38022

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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

Fixes #38022

Clause-②: no
Metadata-protocol: none

维护者速读

  • 升级到 19 的运维读升级表时,会看到「以下划线开头的知识源 id 要改名并清理旧索引」这一例外,不再被告知「索引原样找回」。
  • 为 AI 知识库(epic 37000)的 18 到 19 升级文档补上一处与升级条目不一致的说法。
  • 只改文档与报错文案,不影响运行行为,可直接撤回。
  • 无。

What changes

  • content/docs/protocol/knowledge.mdx: the id row of the 18 to 19 table names the underscore exception (name refuses it, the source is rebuilt under a new name) and the dropSource cleanup, in the words of the upgrade entry knowledge-source-registration-governed. It states the memory adapter holds nothing across a restart. The row does not touch adapter, which feat(knowledge): a knowledge source needs no adapter and no requires entry; it binds to the deployment's store #38026 made optional (rows and prose near it re-read on current main; no contradiction).
  • N1: the upgrade entry's reason says the adapter keeps the old index only where its store outlives the process (Turso, pgvector); the memory adapter holds nothing across a restart.
  • N2: the id tombstone in knowledge-source.zod.ts says the entry's manual notices still apply after os migrate meta --from 18; the reference page content/docs/references/ai/knowledge-source.mdx carries the same sentence.
  • .changeset/37304-knowledge-source-governed-type.md is not edited: it sits in .changeset/pre/ (consumed by pre mode). A new patch changeset covers the spec string change.

Tests

NOT MEASURED: knowledge-source.test.ts and retired-key-migrate-sentence.test.ts (the tombstone still ends with the migrate sentence and still begins with its pinned prefix), because the verify lock was never acquired in 4 attempts over about 36 minutes (holder was a dogfood run; VERDICT queue-timeout exit 99).

Acceptance notes

  • NOT MEASURED: pnpm gen:docs regeneration (needs the spec build, same lock). The reference page was edited by one exact-string substitution mirroring the zod edit; CI check:generated is the judge.
Verification

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP

…nd the dropSource cleanup

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
@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

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 1 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/protocol/knowledge.mdx (via KnowledgeSourceSchema (symbol, a top-level const))
What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • 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 e3bdc748841f8ec72aedc3d795227273f25c6baa → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 415e75b690a42a360fb9938722477c59ede89ef8 — the merge of head 4d6fd4dca1237a18ddd20d54a996feb5681ac34b into base e3bdc748841f8ec72aedc3d795227273f25c6baa, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 415e75b690a42a360fb9938722477c59ede89ef8 && git checkout 415e75b690a42a360fb9938722477c59ede89ef8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e3bdc748841f8ec72aedc3d795227273f25c6baa 4d6fd4dca1237a18ddd20d54a996feb5681ac34b && git checkout -B drift-repro e3bdc748841f8ec72aedc3d795227273f25c6baa && git merge --no-ff 4d6fd4dca1237a18ddd20d54a996feb5681ac34b

node scripts/docs-audit/affected-docs.mjs --json e3bdc748841f8ec72aedc3d795227273f25c6baa

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs e3bdc748841f8ec72aedc3d795227273f25c6baa → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · 4d6fd4d · 2026-11-28T07:31Z

@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: 4d6fd4dca1237a18ddd20d54a996feb5681ac34b
Local-runs: none
Scope: packages/spec/src/ai/knowledge-source.zod.ts, packages/spec/src/migrations/entries/semantic/19.knowledge-source-registration-governed.ts + none

Inputs read: card #38022 (body, amendment 7223636019, triage 7224179983, claim 7227517864, dev report 7228315278), PR #38050 (body, 5 files), the net diff of the head against merge base e3bdc748841f8ec72aedc3d795227273f25c6baa, and the check-runs on the head: 60 success, 10 skipped, 0 failed. Nothing was built, run or re-run; the generated-page point below was settled by reading the generator and comparing text.

① Derived judgments

  • Accept-set: unchanged, and that is right. knowledge_source.id stays retiredKey(...), which is z.never().optional(); only the guidance string grows. No key, value or requirement moves on KnowledgeSourceSchema.
  • Public surface that does move, all of it text: (a) the refusal message a parse prints for knowledge_source.id; (b) the [REMOVED] description of that key in the emitted JSON schema, and from it the id row of content/docs/references/ai/knowledge-source.mdx; (c) the reason of the upgrade entry knowledge-source-registration-governed, which os migrate meta --from 18 prints as a semantic notice. Each is right: an added qualification, nothing withdrawn.
  • The entry's id, surface, replacement, acceptanceCriteria and conversionIds are byte-identical to the merge base. Only reason changes.
  • No export, type or committed baseline moves: the diff carries no api-surface/, authorable-surface/, export-origins/ or manifest file, and the gates that would red on a stale one are green on this head.
  • The generated page, judged as asked. content/docs/references/ai/knowledge-source.mdx was edited by hand, and its bytes equal what the generator emits. Read: retiredKey (packages/spec/src/shared/retired-key.ts:194) describes the key as [REMOVED] plus the guidance; renderProperties (packages/spec/scripts/lib/schema-section.ts:539-546) writes the row as key, type, required cell and the description passed through escapeMdxDescription, then backslash and pipe escaping. The new sentence holds no brace, angle bracket, pipe or backslash outside a code span, so the escape is the identity on it. Concatenating the head's string literals (the id block, CODE_DOOR_18, MIGRATE_18) under that rule gives a 972-character row equal, character for character, to line 54 of the page at the head. The gate that checks it is check:docs (build-docs.ts --check), step check-generated-reference-docs-are-in-sync of the unfiltered job Type Check · source gates in .github/workflows/lint.yml, rolled up by that job's Lane verdict step; that check-run concluded success on this head. The hand edit is therefore indistinguishable from a regeneration.

② Semver level

  • .changeset/knowledge-id-underscore-exception.md: @objectstack/spec patch. It matches what the diff publishes: prose in a published package, no change to what an author can write. Metadata-protocol: none takes patch (AGENTS.md, Post-Task Checklist 3).
  • Clause-②: no — stated on the PR body and in the changeset body, with no arm, and correct: nothing is widened or narrowed.
  • The repo is in pre mode (.changeset/pre.json, tag next), so the patch folds into the next 19.0.0-next release. Check Changeset concluded success.
  • The landed .changeset/pre/37304-knowledge-source-governed-type.md is left alone, as the card rules: it is consumed (its text is already in packages/spec/CHANGELOG.md), not pending.

③ Boundary flags

  • open_questions: empty in the dev report. Nothing to answer.
  • Dev flag, tests not run locally (knowledge-source.test.ts, retired-key-migrate-sentence.test.ts; verify lock never acquired): answered by the head's check-runs. Test Core and its ten shards concluded success on 4d6fd4dca1237a18ddd20d54a996feb5681ac34b, which is the merge of main into the dev's commit d60a6cef7d, so the pins ran on the tree that would land. The tombstone still ends with CODE_DOOR_18 then MIGRATE_18, the order the jsdoc and the sentence test require. No local run is owed.
  • Dev flag, gen:docs and check:generated not measured: answered in ① above; the gate is green and the bytes agree with the generator as read.
  • Dev flag, check:docs-transcript-drift exit 3 locally (prerequisite missing): it runs in Type Check · workspace, which concluded success.
  • Published or pending, judged as asked. The entry file is on main and is also in a published pre-release: commit 3c53b854ac (docs(adr,spec): ADR-0084's notes catch up with the knowledge_source row; the knowledge_source tombstones name the code door #38015), which wrote the sentence this PR qualifies, is an ancestor of tag @objectstack/spec@19.0.0-next.2, and npm serves that version under dist-tag next. It is in no stable version: latest is 18.6.0, and 19.0.0 is unreleased. So the edit does change text that a pre-release tarball already carries, but not an entry of a released major: the entry belongs to protocol 19, whose line is still open. Its identity (id, surface, conversionIds, acceptance criteria) is untouched, the change qualifies one sentence of reason, and the same entry's text was already revised once inside this line (feat(spec,service-knowledge)!: knowledge_source is a governed metadata type with its loader, its registry and two authoring guards #37676 shipped it in next.1, docs(adr,spec): ADR-0084's notes catch up with the knowledge_source row; the knowledge_source tombstones name the code door #38015 rewrote it for next.2). I found no rule in ADR-0087 or the migration sources that freezes an entry's prose before its major is released. The new changeset carries the correction into the next pre-release. Accepted.
  • SQL push-down: no code path, query, id materialisation or join is added. Nothing to flag.
  • The docs-drift advisory on the PR lists content/docs/protocol/knowledge.mdx, which this PR itself rewrites.

④ Design judgment

packages/spec/src/migrations/entries/semantic/19.knowledge-source-registration-governed.ts (first item of the card amendment). The new sentence says an adapter whose store outlives the process keeps the index built under the old id, and the memory adapter holds nothing across a restart. Read against the live tree: KnowledgeMemoryAdapter keeps everything in a private Map (packages/plugins/knowledge-memory/src/index.ts, whose own doc says its index does not outlive the process); the Turso and pgvector adapters keep generation tables keyed by the source's name and drop them only in dropSource; unregisterSource leaves the index with its adapter and dropMetadataSource serves metadata items only. The sentence holds. The following sentences ("No source holds that key any more ...") still read correctly after the insertion, and the unchanged acceptance criterion ("the adapter holds nothing under the old id") stays satisfiable on every adapter, trivially on memory.

packages/spec/src/ai/knowledge-source.zod.ts (second item of the card amendment, plus the exception itself). The tombstone now says the index is found again except where the id began with an underscore, names why (name refuses it: ROUTER_ADDRESSABLE_NAME_PATTERN is /^[a-z][a-z0-9_]*$/), says the source is built again under a new name, names dropSource, and sends the reader to the entry, whose notices os migrate meta prints beside the rename (conversionIds: ['knowledge-source-id-to-name']; the CLI's word for them is "semantic notices"). It agrees with the entry sentence by sentence and no longer contradicts it. First consumer: an author whose 18 registration writes id: '_x' used to be told the index is found again and then met a refusal on name with no account of the orphaned index; the message now covers that case. Tried to break it: an adapter without dropSource (the member is optional in knowledge-adapter.ts) is covered by the entry's replacement, which the tombstone points at; the memory case is covered by the entry's new sentence.

N1 (nit) — the entry names Turso without condition among stores that outlive the process, yet the Turso store also accepts :memory: (packages/plugins/knowledge-turso/src/plugin.ts:30, README option url), where nothing survives a restart either. The governing clause ("an adapter whose store outlives the process") is the condition and prescribes nothing false. Accepted deviation.
N2 (nit) — in the tombstone, "its old index is dropped with dropSource" is passive and can be read as something the platform does, and "after the conversion" names a conversion the message has not yet introduced (the os migrate meta sentence comes two sentences later). The entry it points to states the call and who makes it. Accepted deviation, or a follow-up card.

No must-fix, no should-fix.

Outside this record's scope, for the lane seat's ACCEPT: the last sentence of the id row in content/docs/protocol/knowledge.mdx lists two subjects (an adapter without dropSource; a store that does not outlive the process) and then two outcomes in the opposite order. And, outside the diff, the summary of conversion knowledge-source-id-to-name still says no index is rebuilt, with no exception; a follow-up card could align it.

Implemented-by: claude/area-o1C-38022
Reviewed-by: session_016WV4czzx9dtSEm3jWWL9c3

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 4d6fd4dca1237a18ddd20d54a996feb5681ac34b (Fixes #38022). Full read.

Review summary

Shape and gates.

  • l1-face --pr 38050: CLEAN.
  • Check-runs: 60 success, 10 expected skip, 0 failed, 0 pending. This is the clean main-merge head, so Test Core ran on the tree that would land.
  • 5 files, +15/-5. Not governed.
  • The spec describe text and migration entry 19 make it a contract face. At-tier record 7236059621 is PASS (tier verified), with no must-fix and no should-fix.

Read against the card. Text only: the accept set is unchanged, and Clause-②: no, Metadata-protocol: none and the @objectstack/spec patch are right.

  • The id tombstone now names the underscore exception: name refuses a leading underscore, so such a source takes a new name, is built again under it, and drops its old index with dropSource. It points at the upgrade entry.
  • Migration entry 19 changes only its reason. The id, surface, replacement, acceptanceCriteria and conversionIds are byte-identical. The entry is in the published pre-release 19.0.0-next.2 and in no stable major, so the record accepts rewording it inside the pre-release line.
  • The hand-edited generated reference page equals what the generator emits from the new describe text. The record derives that byte for byte, and check:docs concluded green on this head.
  • The persistence sentence ("on an adapter whose store outlives the process ... the memory adapter holds nothing across a restart") is true of the three adapters.

Nits, optional. None needs a new head.

  • N1 (from the record): Turso also accepts :memory:, so listing it unconditionally among stores that outlive the process is slightly loose. The governing clause carries the condition.
  • N2 (from the record): the passive "is dropped with dropSource" could be read as automatic.
  • The last sentence of the id row in knowledge.mdx lists its two subjects and their two outcomes in crossed order.
  • Outside the diff, conversion knowledge-source-id-to-name still says no index is rebuilt, with no exception. That is worth a follow-up card.

Next: not governed and not Tier H, so the area lands it.

1 similar comment
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

L1 verdict (L1-a): ACCEPT at head 4d6fd4dca1237a18ddd20d54a996feb5681ac34b (Fixes #38022). Full read.

Review summary

Shape and gates.

  • l1-face --pr 38050: CLEAN.
  • Check-runs: 60 success, 10 expected skip, 0 failed, 0 pending. This is the clean main-merge head, so Test Core ran on the tree that would land.
  • 5 files, +15/-5. Not governed.
  • The spec describe text and migration entry 19 make it a contract face. At-tier record 7236059621 is PASS (tier verified), with no must-fix and no should-fix.

Read against the card. Text only: the accept set is unchanged, and Clause-②: no, Metadata-protocol: none and the @objectstack/spec patch are right.

  • The id tombstone now names the underscore exception: name refuses a leading underscore, so such a source takes a new name, is built again under it, and drops its old index with dropSource. It points at the upgrade entry.
  • Migration entry 19 changes only its reason. The id, surface, replacement, acceptanceCriteria and conversionIds are byte-identical. The entry is in the published pre-release 19.0.0-next.2 and in no stable major, so the record accepts rewording it inside the pre-release line.
  • The hand-edited generated reference page equals what the generator emits from the new describe text. The record derives that byte for byte, and check:docs concluded green on this head.
  • The persistence sentence ("on an adapter whose store outlives the process ... the memory adapter holds nothing across a restart") is true of the three adapters.

Nits, optional. None needs a new head.

  • N1 (from the record): Turso also accepts :memory:, so listing it unconditionally among stores that outlive the process is slightly loose. The governing clause carries the condition.
  • N2 (from the record): the passive "is dropped with dropSource" could be read as automatic.
  • The last sentence of the id row in knowledge.mdx lists its two subjects and their two outcomes in crossed order.
  • Outside the diff, conversion knowledge-source-id-to-name still says no index is rebuilt, with no exception. That is worth a follow-up card.

Next: not governed and not Tier H, so the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Landing · area o1-C · head 4d6fd4dca1 · 2026-11-28T07:41Z · ACCEPT → PR #38050 comment 7236095767 (L1-a); contract record 7236059621 PASS at CONTRACT_REVIEW_TIER, nothing open

Probe Reading
check-runs at 4d6fd4dca1 60 success · 10 expected skip · 0 failed · 0 pending
check-governed-merges.mjs --pr 38050 NOT governed (0 of 5 paths) · +15 / −5
landing-k.mjs --pr 38050 K = 2 < 15

State: ready + auto-merge; #38022 closes on merge via Fixes. Clause-②: no, Metadata-protocol: none, @objectstack/spec patch. The head is the area's clean merge of main e3bdc74, so Test Core ran on the tree that lands. The optional nits N1, N2 and the crossed-order sentence are accepted as deviations. The out-of-diff note on conversion knowledge-source-id-to-name goes to a follow-up card.

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

Development

Successfully merging this pull request may close these issues.

Review follow-up of PR #38015: the knowledge_source id-to-name docs name the underscore exception

2 participants