Skip to content

docs(adr,spec): ADR-0084's notes catch up with the knowledge_source row; the knowledge_source tombstones name the code door - #38015

Merged
os-zhuang merged 6 commits into
mainfrom
claude/area-o1C-37740
Nov 27, 2026
Merged

os-zhuang merged 6 commits into
mainfrom
claude/area-o1C-37740

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37740
Fixes #37741

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:从旧版升级、在代码里注册知识源的开发者,碰到旧写法的报错时,提示会先说明“直接改代码里那处注册”,再提迁移命令;旧名字以下划线开头的知识源改名后会留下一份旧索引,升级说明现在写明它为什么留下、怎么删。应用搭建菜单的架构决策记录(ADR-0084)里,几处统计和说明补上了表里已有的“知识源”一行,菜单本身不变。
  • 为什么做:知识平台专题里“知识源成为受管元数据类型”那次合并,审核留下两条小尾巴:升级提示指向一个对代码注册不起作用的命令,架构记录的说明没跟上表格。这次替升级的开发者和读记录的人补齐。
  • 出错会怎样:只改提示文字和文档,不改任何行为、数据和菜单;文字写错最多是提示不准,直接撤回即可。
  • 要你做什么:这个 PR 改了受管文档(架构决策记录 ADR-0084 的几处说明),审核通过后请你批准合并。

What changes

Two cards from one contract record (the review of the change that made knowledge_source a governed type): its nit N2 is #37740, its nit N5 is #37741. Text only: no schema shape, no behaviour, no menu row.

#37740 — ADR-0084's notes read true for the table as it stands (governed, docs/adr/**)

The table has held a knowledge_source row since that change (AI, order 5, 高级). The prose around the table still described it without that row. Five places, each amended in the record's own dated form, struck text kept:

  1. The note under the table gains one dated paragraph: the registry read again at origin/main 62dd9e1ef5 holds 35 entries — the 33 of the two earlier readings and two registered on 2026-11-27, form (ui) and knowledge_source (ai); form has no row yet, so the table has 34 rows; AI counts 5.
  2. The fold sentence ("its label is drawn again inside the fold only where a package holds an ai_context") gains a dated note: AI holds two 高级 types, so either one draws the label.
  3. The 2026-11-25 amendment's table row ("One row is new: ai_context") gains a dated note: a second row has been written under item 6 since.
  4. Item 6: the heading names both types (the old heading struck, not deleted), and the item ends with a dated note that says what changed for ai_context's row (fourth, no longer last in AI) and how the same three ruled sentences place knowledge_source.
  5. The sentence that introduces the table ("(33 at the 2026-11-25 reading, in the note under the table)") now also points at the 2026-11-27 reading. This fifth place is not in the card's list of four; it is the same stale count one paragraph up, so it is brought along here rather than left to contradict the note it points at. The claim's file surface names four places: it wants this one added.

The card says "33 entries"; the registry holds 35, because form was registered the same day (hidden from Studio's directory, no row). The note says 35 and says why the table has 34 rows.

Nothing is decided: the row, its order and its tier were written by the earlier change under item 6, and studioMenuPlacement.ts already mirrors them. No Status line changes.

#37741 — the knowledge_source tombstones say what the author of a registration in code does (packages/spec)

  • The prescriptions. Each retired-key prescription that ends with os migrate meta --from 18 (id, source.contentFields, embedding, vectorStore, adapterConfig, refresh.cron, and the '*' member of source.content) now first says: a source registered in code (KnowledgeServicePlugin({ sources }), registerSource) is in no stack collection, so the command lists no edit for it, and the edit is made in the registration itself. One constant, CODE_DOOR_18, placed before the migrate sentence, which stays the last sentence of its prescription (the house pin). The prescription for a retired source kind (file, http) is unchanged: it sends nobody to the command.
  • The ADR-0087 D3 entry knowledge-source-registration-governed (the entry os migrate meta --from 18 prints) now states the one exception to "nothing is rebuilt": a source whose 18 id began with an underscore. A name must start with a letter, so that source is renamed; an adapter keys what it holds by the source's name, so the renamed source is built from nothing under its new name and the adapter keeps the index it built under the old id; the service never drops that index (it drops one only for a knowledge_source item it stops serving). The entry says how it is dropped: dropSource({ source }) on the adapter (IKnowledgeService.getAdapter) with name set to the old id, or in the adapter's own store where the adapter has no dropSource.
  • Pins. knowledge-source.test.ts: each of the six tombstones and the '*' message must name both spellings of the code door and "in the registration itself", each before the sentence that names the command.
  • Generated. check:generated found one artifact stale after the tombstone change (content/docs/references/**), and --fix rewrote one page of it: content/docs/references/ai/knowledge-source.mdx.
  • Changeset. @objectstack/spec patch.

Tests

All on head 4f6792529c, in one hold of the shared verify lock (VERDICT command-exit 0), unless a line says otherwise.

  • pnpm --filter @objectstack/spec build — exit 0.
  • pnpm --filter @objectstack/spec check:generated — exit 0: "All 14 generated artifacts are up to date".
  • pnpm --filter @objectstack/spec test — exit 0: Test Files 909 passed (909), Tests 28748 passed | 1 todo (28749).
  • pnpm --filter @objectstack/spec typecheck — exit 0.
  • pnpm --filter @object-ui/app-shell exec vitest run --root ../.. --maxWorkers=2 packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts — exit 0: Tests 19 passed (19). This is the test that parses the ADR's table rows; no row changes here.
Ablation (one): the new pin goes red when one tombstone loses the code-door sentence

Run on df045b9f8b. The two files it involves have the same blobs on the final head: knowledge-source.zod.ts 0d433e77468e, knowledge-source.test.ts 56ebce2f5d4e.

Through scripts/ablation-replace.mjs: the + CODE_DOOR_18 line of one tombstone (adapterConfig) replaced by an empty-string term. Direction set before the run: that row red, every other test green.

  • landed: ok mutation landed: anchor 1 -> 0, blob 0d433e77468e -> 8a47142baebf; + CODE_DOOR_18 lines on disk during the run: 6 (7 before).
  • result: exit 1, Tests 1 failed | 31 passed (32). The one failure is the row "adapterConfig is refused at its own path with its prescription, the code door and the migrate sentence": AssertionError: `KnowledgeServicePlugin({ sources })` is named: expected -1 to be greater than -1.
  • restored: ok restored: blob == HEAD (0d433e77468e) and `git diff HEAD` is empty; 7 lines again. The full suite above ran after it.

The first attempt measured nothing and is void: its replacement text was a prefix of the anchor, so the tool refused it ("the replacement count moved 1 -> 1, a rise of 0, not the declared 1") and restored without running the test. The replacement was changed and the ablation run once more.

Probe (one-off, not committed): an underscore-led id leaves its index behind, and dropSource removes it

A test file placed in packages/plugins/knowledge-memory for the run and removed after it (git status clean, checked by the same script). It reads the schema and the memory adapter:

  • KnowledgeSourceSchema.safeParse of a source named _kb is refused, at path name alone; the same source named kb parses.
  • an index built under _kb, then the source built under kb: old key holds ["article:1"] new key holds ["article:1"].
  • dropSource with the source's name set to _kb: old key holds [] new key holds ["article:1"].
  • exit 0, Tests 1 passed (1).

Two earlier attempts measured nothing and are void: the first imported the service and stopped on a workspace package that was not built; the second read a field the listing does not have.

The service's half is pinned by landed tests and was not run again here: "unregisterSource removes a source registered in code and keeps its index" (service-knowledge, knowledge-source-registry.test.ts) and the adapter contract suite's dropSource block.

Acceptance notes

  • "The ADR-0087 D3 entry" is a registry entry, not text in ADR-0087. The claim's file surface and its Container & model line name docs/adr/0087-metadata-protocol-upgrade-contract.md. That file holds no knowledge_source text (grep -c knowledge: 0; control grep -c D3: 19). The D3 entry the card means is packages/spec/src/migrations/entries/semantic/19.knowledge-source-registration-governed.ts, which is what this PR edits. ADR-0087 is not touched; the PR is governed through ADR-0084 alone.
  • The underscore fact was read in code before it was written, then run once (the probe above). The readers: name takes ROUTER_ADDRESSABLE_NAME_PATTERN (a letter first) where the 18 id pattern admitted a leading underscore; every adapter keys by AdapterContext.source.name; KnowledgeService.unregisterSource leaves the index with its adapter and dropMetadataSource runs only for a metadata item; the scheduled reconcile that landed on main meanwhile walks registered sources only; the three adapters in the tree (memory, pgvector, turso) implement dropSource, which the contract leaves optional.
  • The entry does not list what starts the build of the renamed source. main gained a third moment (the scheduled reconcile) while this branch was open, so the sentence says what the build costs instead: every record the source covers is read, and on an adapter that embeds the content fields of each are sent to the embedding provider again.
  • Not changed, on purpose: the id tombstone still says "the value is unchanged, so the source's index is found again and is not rebuilt". That holds for every id that is a legal name; for an underscore-led id the parse refuses the value next, with the name grammar's own message, and the D3 entry carries the rest. The card asks for the exception in the entry, not in the tombstone.
  • Seen, not changed here, no card: the changeset of the earlier change (.changeset/37304-knowledge-source-governed-type.md) and the hand-written content/docs/protocol/knowledge.mdx say the index is found again, without the underscore exception. Both are right for an id that is a legal name. An edit to a landed changeset is a deliberate correction with its own declaration, so it is left for the seat to place.
  • Neighbour feat(studio): the Studio menu draws no datasource row, and ADR-0084 writes it as a no-row entry #37945 (the datasource row) rewrote the same note block of ADR-0084 and landed first. main was merged twice: at 62dd9e1ef5 (one conflict, in that block: its note kept first, this PR's note after it, reworded for the table as it then stood) and at 9a274e6725 (clean). node scripts/pm/overlap-check.mjs before each push; on the final head: VERDICT clean exit 0, 0 PR heads.
  • Neighbour knowledge_source: adapter becomes optional (the deployment's store), and a knowledge_source item mounts the knowledge service #37306 edits knowledge-source.zod.ts at the adapter line, about ten lines from this PR's nearest edits on either side. It has no open PR at this writing.
  • Not measured locally, declared: pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.ts, which the derivation names. It spawns the CLI and needs its 71-package dependency closure built; CI runs it. What it pins for this diff was read directly: the entry's four printed fields hold no tracker id (surface 279 chars, replacement 863, reason 2140, acceptanceCriteria 648: no match; a control string matches).

Verification

Read first (by risk):

  1. docs/adr/0084-application-builder-information-architecture.md, item 6's closing note. The risk hunk is one clause: "its schema requires one object (the object key of its source, …), so the first test of the rule sorts it 高级". It applies the record's own rule ("Its schema does not require one object") to a type the ruling did not name. The row's tier does not rest on it: the two sentences that follow place the type without it. If the seat reads that clause as more than carrying out, it can be struck and the note still stands.
  2. packages/spec/src/migrations/entries/semantic/19.knowledge-source-registration-governed.ts: replacement, reason and acceptanceCriteria are what an upgrading author is shown. Check the drop instruction against packages/spec/src/contracts/knowledge-adapter.ts (dropSource takes an AdapterContext).
  3. packages/spec/src/ai/knowledge-source.zod.ts: CODE_DOOR_18 and its seven uses.

Two-minute check: pnpm --filter @objectstack/spec exec vitest run --project local --maxWorkers=2 src/ai/knowledge-source.test.ts — expect Tests 32 passed (32); six of them are the rows titled "… with its prescription, the code door and the migrate sentence".

Local gates, on head 4f6792529c. Derived by node scripts/pm/dispatch-gates.mjs --commands with no paths; each command run as printed, its exit code recorded before any pipe; reconciled by --ran:

Run reconciliation — 116 derived, 111 run, 4 NOT-MEASURED, 1 UNRUN. · ✗ dispatch-gates --ran: 1 of 116 derived famil(ies) UNRUN.

  • 111 run: exit 0, every one. Among them the families this diff moves: check:adr-index, check:adr-anchors, check:adr-symbol-anchors, node scripts/check-adr-links.mjs, check:keyed-text-bounds, check:spec-docblock-symbol-anchors, check:issue-citations, check:nul-bytes, check:role-word, check:closed-ceremony-text, node scripts/check-adr-0087-registration.mjs --base origin/main, node scripts/check-empty-changeset.mjs --base origin/main, node scripts/check-changeset-no-major.mjs --base origin/main, and the spec's own check:generated, check:docs, check:api-surface, check:authorable-surface, check:liveness, check:upgrade-guide, check:spec-changes.
  • node scripts/adr-index.mjs --check: exit 0, "adr-index: OK — docs/adr/README.md is current and every record parsed." No index regeneration was needed.
The five not measured here, each with its reason (none is a finding; CI runs all five)
  • UNRUN (1), declared to CI: pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.ts (Acceptance notes).
  • NOT MEASURED (4), each exit 3, PREREQUISITE NOT MET:
    • pnpm --filter @objectstack/spec run check:skill-examples: its client-SDK surface reads the declarations of @objectstack/client-react, a 48-package build closure that is not built here. This diff adds or changes no fenced example.
    • pnpm check:dual-build-cjs-loads: reads every package's dist ("Run pnpm build first").
    • pnpm check:lean-entry-closure: loads the built entries of @objectstack/objectql (a 14-package closure).
    • pnpm check:type-check-debt: its re-measure builds every package under the shared verify lock. It got no turn on the first run (VERDICT queue-timeout (exit 99)), and the second was withdrawn while still queued: a whole-workspace build is out of proportion to a text-only diff. Its structural half printed "OK — 132/135 workspace packages type-checked (plus the root), 0 in the DEBT ledger".
  • The derivation printed that the tree was 8 commits behind origin/main at that moment, and that none of the commits it could see touched what the answer derives from.

CI: no check-run existed when this body was written; the PR's own check-runs are the verdict for every family CI runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP

…; knowledge_source tombstones name the code door

ADR-0084: a dated note under the type-to-group table reads the registry
again (35 entries, 34 rows, AI 5), the fold sentence and the 2026-11-25
amendment-table row are marked for the second AI row, and item 6 is headed
for both types it places. No row, order or tier changes.

knowledge_source: each prescription that names `os migrate meta` first says
what the author of a registration in code does, and the D3 entry
knowledge-source-registration-governed states what a source whose 18 id
began with an underscore leaves behind and how it is dropped. Text only.

Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com>
… for the tombstone text

`check:generated` found one artifact stale after the tombstone change,
content/docs/references/**, and `--fix` rewrote one page of it:
content/docs/references/ai/knowledge-source.mdx. The changeset is a patch
on @objectstack/spec: text only, no schema shape.

Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com>
main carries the datasource-row change to ADR-0084 (its own dated note
under the type-to-group table, at the spot this branch's note was written).
Resolved by keeping that note first and this branch's note after it. This
branch's note is reworded for the table as it now stands: the registry is
read again at origin/main 62dd9e1 (35 entries, 34 rows, unchanged
counts), and its last sentence names the datasource row as the one row
rewritten since the 2026-11-26 note.

Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com>
…bed again on the rebuild

The entry said the build under the new name sends the content fields to
the embedding provider for every record. That holds for an adapter that
embeds (pgvector, turso); the memory adapter reports no embedding and
sends nothing. The sentence now says "on an adapter that embeds".

Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com>
main moved the knowledge service (a scheduled reconcile) and packages/spec
(the ask-question envelope) since the last merge. No conflict; none of this
branch's files is touched by it. Merged so the upgrade entry's text is read
against the service it will land beside.

Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com>
…tarts the build

The entry said the renamed source is built "at the next boot or by
`os knowledge rebuild` where `buildAtBoot` is `false`". main now has a
third moment, the scheduled reconcile, which builds a source the adapter
holds nothing for exactly as the boot pass does. The entry's point is what
the build costs, not what starts it, so the sentence says that: every
record the source covers is read, and on an adapter that embeds the content
fields of each are sent to the embedding provider again.

Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:ai tests 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

This PR changes 1 package(s): @objectstack/spec, touching 5 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
  • 2 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 4af32b99db078cef6b9cbda8f2f4a77632b75f49 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 124c275a339603027b7130f1986eb75275f4643d — the merge of head 4f6792529c3a86ae2e44e249fa4c8bada27956fe into base 4af32b99db078cef6b9cbda8f2f4a77632b75f49, 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 124c275a339603027b7130f1986eb75275f4643d && git checkout 124c275a339603027b7130f1986eb75275f4643d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4af32b99db078cef6b9cbda8f2f4a77632b75f49 4f6792529c3a86ae2e44e249fa4c8bada27956fe && git checkout -B drift-repro 4af32b99db078cef6b9cbda8f2f4a77632b75f49 && git merge --no-ff 4f6792529c3a86ae2e44e249fa4c8bada27956fe

node scripts/docs-audit/affected-docs.mjs --json 4af32b99db078cef6b9cbda8f2f4a77632b75f49

⚠️ 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 4af32b99db078cef6b9cbda8f2f4a77632b75f49 → 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 · head 4f67925 · 2026-11-27T16:34Z

@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: 4f6792529c3a86ae2e44e249fa4c8bada27956fe
Local-runs: none
Scope: packages/spec/src/ai/knowledge-source.zod.ts, packages/spec/src/migrations/entries/semantic/19.knowledge-source-registration-governed.ts, docs/adr/0084-application-builder-information-architecture.md + packages/spec/src/ai/knowledge-source.test.ts
Security-touching: yes

Inputs read: card #37740 (body, triage, claim, dev report) and folded card #37741 (body, triage, claim); PR #38015 body and file list; the net diff against main (6 files, 98 insertions, 18 deletions); the 70 check-runs on this head. Remainder of the diff, left to the lane seat: .changeset/37741-knowledge-source-code-door-prescription.md (read for ② only) and the generated content/docs/references/ai/knowledge-source.mdx.

Check-runs on the head: 70, all completed; 0 failed; 60 success, 10 skipped (the opt-in and placeholder rows: Lint UI, Temporal Conformance, the Dogfood matrix placeholder, Dogfood Verify CLI, UI Published Artifacts, Borrowed queue verdict, Queue verdict, 18.x upgrade harness, Packed-tarball smoke, Schedule gate). Test Core 1 to 10, Type Check (workspace, source gates, consumer gates, debt ledger), Lint (ESLint, docs and code guards, repo and tooling gates, CI release and engine gates, PM dispatch-gates), Spec property liveness, Check Changeset, Build Docs, Check Documentation Links and Governed Surface Queue Guard are all success. The one family the dev left to CI (the CLI spawn test migrate-meta-engine-guidance.test.ts) sits in Test Core, which is green.

① Derived judgments

  • Accept set of KnowledgeSourceSchema, ObjectKnowledgeSourceSchema, KnowledgeRefreshPolicySchema: unchanged. Every hunk in knowledge-source.zod.ts is a string term (+ CODE_DOOR_18) inside an existing retiredKey(...) message or the existing '*' regex message. Nothing that parsed is refused and nothing refused now parses. Right.
  • Public surface: CODE_DOOR_18 is a module-private const (no export), so no export is added; the api-surface and authorable-surface gates ran green in CI. What is published and does change is text: seven refusal messages (six tombstones and the '*' member), the generated reference page that copies them, and three fields of the semantic entry knowledge-source-registration-governed (replacement, reason, acceptanceCriteria) that os migrate meta --from 18 prints. Right, and declared as such.
  • Count of uses, read at the head: CODE_DOOR_18 occurs 8 times in the file (1 definition, 7 uses); the 7 uses are refresh.cron, source.contentFields, the '*' member, id, adapterConfig, embedding, vectorStore. Each stands directly before the migrate sentence (MIGRATE_18 six times, the '*' member's own sentence once), which stays last. The file / http prescription is untouched and names no command to run. Right.
  • Migration chain: no conversion, no conversionIds, no relevantWhen is added or changed; the entry keeps conversionIds: ['knowledge-source-id-to-name'] and carries no relevantWhen, so it is printed on every --from 18 run that crosses hop 19, whatever the stack holds. Metadata-protocol: none is right.
  • ADR-0084: no table row, no Order or Tier cell, no Status line and no heading anchor changes; studioMenuPlacement.ts at the head already lists ai_context then knowledge_source, both advanced (lines 121 and 122), and its test is in the green UI shards. Right.

② Semver level

Changeset .changeset/37741-knowledge-source-code-door-prescription.md: @objectstack/spec patch, Clause-②: no, Metadata-protocol: none. Matches the diff: message text and upgrade-entry text only, no shape, no accept-set move, no narrowing. The ADR-0084 edits publish nothing and need no bump. The Check Changeset run is green.

Clause-②: no. Agreed: no authorable capability is taken away or added at any consumer.

③ Boundary flags

Open question (item 6's closing note, the clause "its schema requires one object ... so the first test of the rule sorts it 高级"): A is the true one; keep the clause.

  • Against the ADR text. The rule's first test reads "It has no parent object. Its schema does not require one object." and the section ends "The rule sorts the next type; the table records what was ruled." Applying test 1 to a type registered after the ruling is therefore what the record itself prescribes, and item 6 already does exactly that for ai_context. The note says "the same three sentences place it"; the three are the first test, "高级 holds every type the ruling does not list as 常用" and "a type with no row is drawn at the end of its group". Option B would leave two sentences under a lead-in that says three, so B is not a one-clause strike without a second edit.
  • Against the code. KnowledgeSourceSchema.source is required and is ObjectKnowledgeSourceSchema; its object key is a required z.string(); kind has one live value, object (file and http are retired values). So every knowledge_source names exactly one object. The clause is a checkable fact and the parenthesis says honestly where the key sits (inside source, not at the root as for ai_context).
  • It places nothing: the row, its order and its tier were written by PR feat(spec,service-knowledge)!: knowledge_source is a governed metadata type with its loader, its registry and two authoring guards #37676 and are mirrored in studioMenuPlacement.ts; the two sentences that follow place the type without it. No escalation needed.

Dev premise corrections, each checked:

Dev deviations:

  • Fifth place in ADR-0084 (the count pointer in the sentence that introduces the table): accepted; leaving it would contradict the note it points at. See N3 for its form.
  • Entry file in place of docs/adr/0087, the regenerated reference page, the changeset: accepted, all three follow from the card.
  • Two wording commits on the entry ("on an adapter that embeds"; the list of what starts the build removed): both make the text truer; accepted.
  • Footer, tier-line and trailer deviations are process matters for the seat, not contract.

Out-of-scope notes from the dev: (a) .changeset/37304-knowledge-source-governed-type.md and content/docs/protocol/knowledge.mdx say the index is found again with no underscore exception. Outside this review's scope and true for every id that is a legal name; a follow-up card is the right carrier and the dev filed none, so the seat should place one or accept it by name. (b) "field carries no order and no tier because it draws no row" does not mention datasource: still true as written, a lag in a neighbour's sentence, not this card's.

Security-touching is yes on a conservative reading of one sentence only: the entry's reason now says that the renamed source's content fields "are sent to the embedding provider again", which is a statement about data leaving the deployment. No changed hunk teaches permission, sharing, credential, token or authentication behaviour, and the sentence restates what a first build already does for the same fields and the same provider. The seat may read that as not security-teaching; nothing else in the diff comes near.

SQL push-down: the diff holds no query, no id materialisation and no in-app join.

④ Design judgment

packages/spec/src/ai/knowledge-source.zod.ts (against card #37741 and the code it cites)

  • The code door named in the seven prescriptions exists in both spellings: KnowledgeServicePluginOptions.sources (knowledge-service-plugin.ts:331, registered at boot at :568) and registerSource (IKnowledgeService, contracts/knowledge-service.ts:178; KnowledgeService.registerSource, knowledge-service.ts:271). The service's own refusal text uses the same two spellings (knowledge-source-registry.ts DOOR_TEXT.code).
  • "is in no stack collection, so os migrate meta lists no edit for it": true. The three 19 conversions (knowledge-source-id-to-name, knowledge-source-content-fields-to-content, knowledge-source-inert-keys-removed) all walk mapCollection(stack, 'knowledgeSources', ...) and nothing else; a plugin option or a registerSource call is never visited.
  • The jsdoc's "every source written against 18 is such a registration": true. At tag @objectstack/spec@18.6.0 the stack schema has no knowledgeSources key (the 18 source file itself says defineStack({ knowledgeSources }) is refused); the key first exists in stack.zod.ts on 19.
  • What the migrate sentence promises is what the command does for a stack that holds sources: id to name and contentFields to content are renames, embedding, vectorStore, adapterConfig and refresh.cron are lossless deletes, and a '*' member is kept and reported as a TODO, which is what the '*' message's own sentence says. --from and --write are real flags of os migrate meta.
  • Break attempts that did not break it: a mixed app (sources in the stack and in code) reads both sentences correctly; the file / http prescription correctly stays without the sentence; the test pins position (each of the three phrases before the command sentence) and the dev's ablation shows the pin goes red for one tombstone.

packages/spec/src/migrations/entries/semantic/19.knowledge-source-registration-governed.ts (sentence by sentence against the live code)

  • "A name starts with a letter" / "an id could start with an underscore": the 18 pattern was ^[a-z_][a-z0-9_]*$, ROUTER_ADDRESSABLE_NAME_PATTERN is ^[a-z][a-z0-9_]*$. The leading underscore is the only spelling newly refused, so "one source is the exception" is exact, not a sample.
  • "an adapter keys everything it holds for a source by the source's name": true in all three adapters at the head (ctx.source.name in memory, pgvector, turso) and in the contract (AdapterContext.source.name is the index key). In 18 the same adapters keyed by ctx.source.id, so the old key is the old id.
  • "built from nothing under its new name": true, the new key has no generation in any adapter.
  • "the service drops the index of a knowledge_source item it stops serving and never that of a registration in code": true. dropMetadataSource returns early unless entry.door === 'metadata', its one caller is the metadata loader, and unregisterSource only forgets the entry ("The index it built stays with its adapter"). No other code in the service, the CLI or the runtime calls dropSource.
  • "nothing searches that index or keeps it in step with the records": true; search, event sync, the reap guard and the scheduled reconcile all walk registered sources.
  • "call dropSource({ source }) on that adapter (IKnowledgeService.getAdapter), where source is the source with its name set to the old id": works on every adapter in the tree. getAdapter is on the contract (:173); dropSource takes an AdapterContext whose only required member is source; memory deletes the key, pgvector retires and sweeps by source_id, and turso's SAFE_SOURCE_ID (^[a-z_][a-z0-9_]*$) admits the underscore-led id and also drops the legacy table of the cloud-repo releases. The contract says a drop for a source the adapter holds nothing for is not an error, so an unneeded call is harmless.
  • "An adapter without dropSource keeps that index until it is removed in the adapter's own store": matches the contract (the member is optional).
  • The acceptance criterion added for the underscore case is checkable through indexStatus and does not contradict the general one before it.
  • Card acceptance ("states the underscore-led id's stale index and how it is dropped"): met.

docs/adr/0084-application-builder-information-architecture.md (against the registry, the table and its first consumer)

packages/spec/src/ai/knowledge-source.test.ts (implementing file): the pin agrees with the contract, sentence by sentence: both spellings of the door and "in the registration itself", each before the command sentence, on the six tombstone rows and the '*' row; the existing endsWith(MIGRATE) pin still holds the house rule.

No must-fix, no should-fix.

N1 — The entry says without condition "The adapter also keeps the index it built under the old id". Of the adapters in the tree, only knowledge-memory was published in 18 (the pgvector and turso packages start at 19.0.0-next.0), and its store is process memory, which the restart of an upgrade empties. The sentence holds for a persistent store (a custom adapter, the turso tables of the cloud-repo releases, a pgvector index built on a 19 prerelease). The prescribed call is a harmless no-op where nothing is held, so nothing is wrong in effect; a half-clause ("where its store outlives the process") would make it exact. Prose in a spec file: leave as an accepted deviation or a follow-up card.
N2 — The code-door sentence tells the author of a registration that os migrate meta "lists no edit for it", while the only place the underscore case and its dropSource instruction are printed is that command's manual notices (this entry has no relevantWhen, so it prints for such an app too). The id tombstone beside it still says, without condition, "the value is unchanged, so the source's index is found again and is not rebuilt". An author with an underscore-led id therefore meets the tombstone, then the name grammar's refusal, and is pointed at the stale index only if they run the command anyway. The card placed the exception in the entry, not the tombstone, so this is as ruled; a follow-up could add "its manual notices still apply" to the sentence.
N3 — The fifth place (the pointer in the sentence that introduces the table) is edited in place, with no date and no card on it, where the other four are dated notes. It is a pointer and the note it points at carries the date and the card, so the reader loses nothing; noted because the record's form elsewhere is add-only.
N4 — An 18 id of the exact shape _p + 16 hex characters + _ + a name would equal the index key the service spells for a package's source, and a drop under that old id would then name a live index. Not reachable in practice (a 64-bit match on a hand-written id); recorded only because the entry tells the author to pass the old id verbatim.

Implemented-by: claude/area-o1C-37740
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 4f6792529c3a86ae2e44e249fa4c8bada27956fe (Fixes #37740, Fixes #37741, folded). Full read · 2026-11-27T16:41Z

席位核对

Shape and gates. 6 files, +98/-18. Check-runs at 4f67925: 60 success, 10 expected skip, 0 failed. Governed (docs/adr/**), plus the published schema text in knowledge-source.zod.ts and the migration entry. Clause-②: no · Metadata-protocol: none. l1-face flags one item, keywords-other-cards, for Fixes #37741. That close is intended: the card was folded here, and the PR delivers both of #37741's parts, the seven tombstones and the D3 upgrade entry.

Contract review. Record 7223548043 at this head: PASS at the contract tier (verify-review-tier PASS), four nits, nothing graded. I adopt it.

The parts left to me.

  • Changeset. @objectstack/spec at patch is right: text only, and every input that parsed before still parses. Each sentence matches the zod messages and the entry.
  • content/docs/references/ai/knowledge-source.mdx. Regenerated output. The eight rows changed (cron and contentFields appear twice) carry the code-door sentence in the same place as the source messages.
  • knowledge-source.test.ts. expectCodeDoorBeforeCommand pins the order (door before command) on all six key tombstones and on the '*' member, and the header comment says so. The dev's ablation reds it.

Open question (1): A, keep the clause. The record rules it in ③. Item 6's lead-in says three sentences place the type, so dropping the clause would leave two and is not a one-clause edit. The clause restates the first test, which the schema's required object key meets. (2) The 35-entry count is confirmed at both 62dd9e1 and the head. (3) The spawn test the dev left to CI runs in Test Core, which is green.

Security-touching. The record says yes, conservatively, for one sentence: a renamed source's content fields are sent to the embedding provider again. No hunk teaches permission, sharing, credential or authentication behaviour. The seat adopting the record decides on the label.

Follow-up for the seat. The dev's out-of-scope note has no carrier card: .changeset/37304-knowledge-source-governed-type.md and content/docs/protocol/knowledge.mdx do not mention the underscore exception. File one small card, or accept it by name. Record nits N1 to N4 are accepted as they stand.

Landing: governed, so it goes through the seat's Tier H handoff, not area label-write --land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Seat record · 2026-11-27T16:42Z · PR #38015 (Fixes #37740, Fixes #37741) · head 4f6792529c3a86ae2e44e249fa4c8bada27956fe · governed docs/adr/** — Tier H

维护者速读

  • 做什么:知识源变成受管元数据类型(knowledge_source: admit the governed metadata type with its loader — registry, stack collection, ADR-0087 renames and retirements, the two authoring guards, one name per source #37304 已合并)之后的两处文字补齐:ADR-0084 的几条说明跟上 knowledge_source 这一行;knowledge_source 的退役字段提示和升级说明写明「代码注册」这条路,并说明一种特殊情况:旧 id 以下划线开头的知识源改名后,旧索引要手动清掉,给出具体调用。
  • 风险:6 个文件 +98/−18,都是 ADR、规格说明文字、升级说明和对应测试;不改 schema 接受范围,不改运行时行为。
  • 要你做什么:审批人批准即可,契约审核 PASS 评论 7223548043,Head-sha 4f6792529c3a86ae2e44e249fa4c8bada27956fe;批准后座位自主落地。
  • 不批会怎样:从旧版升级、用代码注册知识源的作者看不到该怎么处理,下划线开头的 id 会留下一份没人清的旧索引。

Seat opinion: land.

席位核对 — ACCEPT · repo:objectstack#1 · head 4f6792529c

  1. Shape. Draft, base main, 6 files (+98/−18): docs/adr/0084-application-builder-information-architecture.md (dated notes), packages/spec/src/ai/knowledge-source.zod.ts (tombstone prose) + knowledge-source.test.ts, the semantic migration entry 19.knowledge-source-registration-governed.ts (its reason and manual notice), content/docs/references/ai/knowledge-source.mdx, new .changeset/37741-knowledge-source-code-door-prescription.md. Body: Clause-②: no, Metadata-protocol: none. check-governed-merges.mjs --pr 38015: docs/adr/** ⇒ Tier H.
  2. Premise measured. Per the record: the only spelling newly refused is the leading underscore (18 pattern ^[a-z_][a-z0-9_]*$ vs ROUTER_ADDRESSABLE_NAME_PATTERN ^[a-z][a-z0-9_]*$), so "one source is the exception" is exact; the prescribed dropSource({ source }) through IKnowledgeService.getAdapter works on every adapter in the tree and is a no-op where nothing is held. Card acceptance for both cards met.
  3. Gates (check-runs at this head). 60 success, 10 skipped, 0 failed; mergeable clean.
  4. Accepted deviations. N3 (the pointer in the table's intro edited in place, its note dated) and N4 (a 64-bit collision of a hand-written _p… id with a package index key; not reachable in practice): accepted as recorded.
  5. Out of scope → where it went. The underscore-id exception missing from .changeset/37304-knowledge-source-governed-type.md and content/docs/protocol/knowledge.mdx, with N1 (the "adapter also keeps the index" sentence holds only where the store outlives the process) and N2 (the id tombstone could say the entry's manual notices still apply) → one card review follow-ups of PR #38015 filed by area o1-C. Skills-docs: none (no skill teaches the code door's underscore case). Security-touching: yes on the record, conservatively, for one sentence restating that a renamed source's content is sent to the embedding provider again (what a first build already does); no permission, sharing, credential or auth hunk. Tier H path either way.
  6. Landing terms. L1 ACCEPT 7223565918 + contract review PASS 7223548043 (CONTRACT_REVIEW_TIER, same head, nothing graded) ⇒ ②③ in one --handoff stroke. After an authorised APPROVED, seat 1 lands it (maintainer's seat-thread line 2026-11-26T13:33Z 「审批人批准后的 Tier H PR 你可以自主落地」). A head move other than a clean main merge withdraws the hand-off.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Approval request · governed docs/adr/** (Tier H) · PR #38015 (Fixes #37740, Fixes #37741) · head 4f6792529c3a86ae2e44e249fa4c8bada27956fe

@os-zhuang — text follow-ups of the knowledge_source governed type (#37304): ADR-0084's dated notes catch up with the knowledge_source row, and the type's tombstones and its protocol-19 semantic migration entry name the code-registration door and the one exception (an underscore-led 18 id, whose old index the author drops with dropSource). No accept-set or runtime change. Records on this head: L1 ACCEPT 7223565918, contract review PASS 7223548043 (CONTRACT_REVIEW_TIER), seat record ACCEPT above. Every check is green or expected-skip. An APPROVED review on this head lets seat repo:objectstack#1 ready and land it; nothing else is asked.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 27, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 27, 2026 16:48
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 3c53b85 Nov 27, 2026
76 checks passed
@os-zhuang
os-zhuang deleted the claude/area-o1C-37740 branch November 27, 2026 17:18
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 27, 2026
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/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

3 participants