Repository navigation
docs(adr,spec): ADR-0084's notes catch up with the knowledge_source row; the knowledge_source tombstones name the code door - #38015
Conversation
…; 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>
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # 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
|
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · head 4f67925 · 2026-11-27T16:34Z |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: 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 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 ① Derived judgments
② Semver levelChangeset Clause-②: no. Agreed: no authorable capability is taken away or added at any consumer. ③ Boundary flagsOpen 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.
Dev premise corrections, each checked:
Dev deviations:
Out-of-scope notes from the dev: (a) Security-touching is SQL push-down: the diff holds no query, no id materialisation and no in-app join. ④ Design judgment
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 Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT at head 席位核对Shape and gates. 6 files, +98/-18. Check-runs at 4f67925: 60 success, 10 expected skip, 0 failed. Governed ( Contract review. Record 7223548043 at this head: PASS at the contract tier ( The parts left to me.
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 Security-touching. The record says Follow-up for the seat. The dev's out-of-scope note has no carrier card: Landing: governed, so it goes through the seat's Tier H handoff, not area label-write --land. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Seat record · 2026-11-27T16:42Z · PR #38015 (Fixes #37740, Fixes #37741) · head 维护者速读
Seat opinion: land. 席位核对 — ACCEPT · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Approval request · governed @os-zhuang — text follow-ups of the |
…entry; it binds to the deployment's store (objectstack-ai#38026) repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Fixes objectstack-ai#37306 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: follow-up objectstack-ai#37310 — `skills/**` teaches the optional `adapter` and the item mount after this lands ## 维护者速读 - 用户能看到什么变化:应用作者写知识源时不必再指定存储,也不必在应用里声明需要知识服务;在本机开发(SQLite)、PostgreSQL 和自带存储的部署上,同一个知识源无需修改即可建索引和检索。 - 为什么做:知识库检索专题(按调用者权限过滤的知识检索)中“知识源可移植”的一行,替写知识源的应用作者和 AI 解决“换个数据库就要改知识源”的问题。 - 出错会怎样:最坏是同时注册了两个以上存储、且都不是部署自带的那个时,未写存储的知识源在保存时被明确拒绝并列出可选项;改动可直接撤回。 - 要你做什么:无(“运行中首次保存、部署未装知识服务时怎么办”已拆成单独的待裁决卡)。 ## What changes **Mechanism (the deployment's-store mark).** It is a service option, not a contract member: `KnowledgeServicePlugin` / `KnowledgeService` take `deploymentAdapter?: string`, which the runtime sets to the adapter id of the store it mounted (`resolveCapabilityArgument('knowledge', …)` answers `{ deploymentAdapter: resolveKnowledgeStore(input).store.adapterId }`, the same resolution `resolveCapabilityExtras` mounts from). `IKnowledgeAdapter` and `registerAdapter` are unchanged, so an adapter that application code registers is never the deployment's by registering. 1. **`adapter` optional** (`@objectstack/spec`, ADR-0161 K4 / K8 item 11). `KnowledgeSourceSchema.adapter` is `z.string().optional()`. Omitted, the source is held by the marked store, else the only adapter registered. Several registered and none the deployment's ⇒ refused at registration on both doors (`registerSource`, the `knowledge_source` loader) and at save (`admitAuthoredSource`), `400 VALIDATION_ERROR`, naming the choices. A source registered first and left unplaceable by adapters that came later answers the same refusal at index and search, and `reportUnmountedAdapters` names it once at boot. No adapter at all ⇒ `503 SERVICE_UNAVAILABLE`, naming the marked store. 2. **Placement is resolved where it is used** (`adapterIdFor` / `adapterFor` / `boundAdapterId`), so a code-door source registered at init finds a store plugin that registers in `start()`. Every `getAdapter(source.adapter)` call site (reindex, index state, record sync, delete, search planning, reap guard, `dropMetadataSource`) now goes through it. `index_status` reports the adapter a source is placed on. 3. **An item mounts the service** (K8 item 12). `PlatformCapabilityProvider` gains optional `mountedBy: { collection }`; the `knowledge` row of `PLATFORM_CAPABILITY_PROVIDERS` carries `{ collection: 'knowledgeSources' }`. (Review S1, record 7224273377: the earlier `type` member had no reader and repeated what the spelling map owns, so it is dropped.) `@objectstack/core` adds `stackItemCapabilities(stack)` (top level, then each package body), and `resolveServedCapabilities(…, { itemTokens })` serves them as declared tokens, reported in a new `byItems` set. `os serve` / `os dev` / `os start` and verify's `bootStack` read it and pass `database` to the argument resolver. `os migrate plan` / `apply` compose the same set: `stackItemCapabilities` is a composition step of both boots in `boot-preparation-parity.test.ts`. This answers CI's Test Core red at aba523a and the review's N3. 4. **Item 4 is split to objectstack-ai#37983 (seat ruling).** The first `knowledge_source` saved at run time on a deployment with no knowledge service behaves exactly as on main: row 3a's boot line and behaviour are unchanged. The built item-4 code is kept on `claude/area-o1C-37306-item4` (fa2b538). 5. **Docs**: `content/docs/ai/knowledge-rag.mdx`, `content/docs/protocol/knowledge.mdx`; references regenerated (`gen:docs`). What a 19.0.0-next.1 stack sees: one that ships a source without `requires: ['knowledge']` held an inert item with a boot warning. It is now indexed: the service mounts, the boot pass builds the index, and the content fields are sent to the configured embedder (ADR-0161 K5: embedding is egress). The changeset says the same. Unchanged: a named adapter that is not mounted answers `SERVICE_UNAVAILABLE` as before (objectstack-ai#37102); a host that mounts `KnowledgeServicePlugin` itself gets no store and no mark from the runtime; without a source or the token nothing is mounted. Out of scope as fenced: `skills/**` (objectstack-ai#37310), the Studio form (objectstack-ai#37309), hosted/EE mounts, objectstack-ai#37479's unmounted-adapter reporting. ### Deviations (declared) - **`@objectstack/runtime`, MCP draft door** (`packages/runtime/src/domains/mcp-authoring.ts`, `itemSaveRefusal`): a finding from the dev of card objectstack-ai#37983, carried here. The door spelled every refusal that was not a 403 as `SERVICE_UNAVAILABLE`, so the new `400 VALIDATION_ERROR` from `admitAuthoredSource` arrived over MCP as `SERVICE_UNAVAILABLE` with status 400. Now a 403 stays `PERMISSION_DENIED` and any other verdict keeps its own code, as the REST door already does. It carries a pin in `mcp-authoring.test.ts` and a `@objectstack/runtime` patch entry in the changeset. Outside the claimed file surface. - **`@objectstack/cli`, the migrate boot** (`schema-migration-plugins.ts`, `composeServedPlatform`): it reads the item tokens as `serve` does. The step pin and a behaviour pin cover it: an item-only stack composes `KnowledgeServicePlugin`, and the control does not. - **Two semantic conflicts with main**: main's new readers of the `adapter` field this change makes optional. Both now read the store a source is placed on (`boundAdapterId`), each with a pin. - The boot build pass (main's first-build pass at boot), in 205f667. - The reconcile's no-`listDocuments` check (main's scheduled reconcile), in merge 635fb18. - **Accepted overlaps (seat ruling)**: - objectstack-ai#37963: one hunk in `knowledge-service.ts`. That PR absorbs the merge after this lands. - objectstack-ai#38015: the generated `content/docs/references/ai/knowledge-source.mdx`. objectstack-ai#38015 has landed. This head merges main and regenerates the page on the merged tree (`gen:schema` + `gen:docs`). File surface beyond the claim, declared: `packages/runtime/src/domains/mcp-authoring.ts` and its test, `packages/cli/src/utils/schema-migration-plugins.ts` and its test plus `boot-preparation-parity.test.ts` (above), the `knowledgeSources` describe in `packages/spec/src/stack.zod.ts`, `service-knowledge` plugin options, `knowledge-build-actions.ts`, `knowledge-reap-guard.ts`, `packages/verify/src/required-providers.ts`, `packages/core/src/capability-providers.ts` (comments only). Read first (by risk): 1. `packages/services/service-knowledge/src/knowledge-service.ts`: `adapterIdFor` and `refuseUnplacedSource`, where the refusal and placement rules live. 2. `packages/core/src/capability-composition.ts`: `stackItemCapabilities` and the `knowledge` branch of `resolveCapabilityArgument`. 3. `packages/spec/src/kernel/platform-capabilities.ts`: the `mountedBy` row field, the public surface this adds. Two-minute verification: `pnpm --filter @objectstack/verify exec vitest run src/harness.required-providers.test.ts -t "an item, no adapter, no token"` should print one passing case: a stack with a `knowledge_source` that names no adapter and no `requires: ['knowledge']` boots `KnowledgeServicePlugin` + `KnowledgeTursoPlugin`, places the source on `turso` beside an app adapter, and finds the Chinese row for `住宿标准 报销`. ## Tests Local, under the shared verify lock, at 633041b (the last commit, af27454, adds only module-top imports to one cli test file; that file was re-run, see below). <details><summary>Suites and typecheck</summary> - `@objectstack/spec` (whole package): 909 files / 28749 passed (+1 todo). - `@objectstack/core` `capability-composition.test.ts`: 25/25. - `@objectstack/service-knowledge`: 18 files / 563 tests. - `@objectstack/verify` `harness.required-providers.test.ts`: 16/16. - `@objectstack/cli` `boot-preparation-parity.test.ts` + `schema-migration-plugins.test.ts`: 2 files / 93 tests, at 633041b and again at af27454 (cli typecheck exit 0 at both). - `@objectstack/runtime` `mcp-authoring.test.ts`: 73/73, at aba523a; runtime is unchanged since. - Typecheck exit 0: spec, core, service-knowledge, verify, cli, runtime. </details> <details><summary>Ablations (each restored; blob == HEAD, `git diff HEAD` empty)</summary> | Pin | Mutation | Result | | --- | --- | --- | | A1 | the deployment's mark in `adapterIdFor` | 2 failed | | A2 | the registration refusal | 1 failed | | A3 | the item tokens in `resolveServedCapabilities` | 1 failed | | A4 | the `knowledge` capability argument | 1 failed | | A6 | `adapter` optional, redone as `z.string().min(0)` (the first try was a no-op) | 1 failed | | A7b | `stackItemCapabilities`, core dist | verify case fails: the knowledge service is not found | | A8 | the mark argument, core dist | verify case fails: source refused, then a TypeError | | A9 | boot pass reads the named adapter | the boot pin fails | | A10 | reconcile reads the named adapter | the reconcile pin fails | | A11 | MCP door respells non-403 as `SERVICE_UNAVAILABLE` | the pin fails: `SERVICE_UNAVAILABLE` where `VALIDATION_ERROR` was expected | | A12 | the migrate boot passes no item tokens | the behaviour pin fails: `KnowledgeServicePlugin` is not composed | A5 left with item 4. </details> ## Acceptance notes - PostgreSQL (pgvector) acceptance is NOT MEASURED end to end, locally or in CI. - CI's `capability-mount.live-postgres.test.ts` names `adapter: 'pgvector'` and `requires: ['knowledge']`, so it exercises neither the omitted adapter nor the item mount (review N2). - What pins the card's PostgreSQL line is two unit pins, composed: - `resolveCapabilityArgument('knowledge', postgres)` answers `{ deploymentAdapter: 'pgvector' }`, the store `resolveCapabilityExtras` mounts for the same database (core). - A source with no adapter binds to the marked store (service-knowledge). - Follow-up: objectstack-ai#38040 drops `adapter` and `requires` from the live case. - Known gap, both boots alike: `os serve --artifact-fallback` (no config, the stack synthesized from the artifact JSON) reads items from a config that carries no `knowledgeSources`. The artifact result surfaces `requires` but no item collection, so an artifact-only stack's sources do not mount the service there. Follow-up: objectstack-ai#38039; not built here. - Item 4 and its Acceptance line moved to objectstack-ai#37983 (seat ruling). ## Verification <details><summary>Container run (os dev, scratch app; at fa2b538, items 1-3 unchanged since)</summary> The scratch app held one `knowledge_source`, with no `adapter` and no `requires`. The embedder was a local bigram fake. 1. `os dev --fresh` booted `KnowledgeServicePlugin` and `KnowledgeTursoPlugin`. 2. Three Chinese rows were POSTed (201 ×3). 3. `os knowledge rebuild kbx-kbx_policies` ended `done`: 3 rows read, 3 written. 4. `os knowledge status` showed `adapter turso`, `index: current`. 5. MCP `search_knowledge '住宿标准 报销'` ranked `差旅住宿标准` first (score 0.436). </details> <details><summary>Gates</summary> - `dispatch-gates --commands` at 633041b derives 129 families. - NOT MEASURED locally: - `check:type-check-debt`: its closure build needs the shared lock (CI ran `Type Check · debt ledger` green at aba523a). - `check:skill-examples` and `check:dual-build-cjs-loads`: they exit 3 on prerequisites outside this diff (the client-react, studio and scenarios dists are not built). - Exit 0: every other family, the ones that read built output re-run after the build. That includes `check:generated` ("All 14 generated artifacts are up to date"), `check:api-surface`, `check:dts-closure`, `check:i18n*`, `check:docs-transcript-drift` and `check:nul-bytes`. - `check:test-source-alias` failed once, on the edited cli test file. The test now pays its dynamic imports at module top, and the gate exits 0. - overlap-check at af27454 exits 1 against objectstack-ai#37963 only (accepted). Clean: origin/main, objectstack-ai#38038, objectstack-ai#38037, objectstack-ai#38033, objectstack-ai#38013, objectstack-ai#37982, objectstack-ai#37929. </details> --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP --------- Co-authored-by: Claude <noreply@anthropic.com>
Fixes #37740
Fixes #37741
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Two cards from one contract record (the review of the change that made
knowledge_sourcea 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_sourcerow 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:origin/main62dd9e1ef5holds 35 entries — the 33 of the two earlier readings and two registered on 2026-11-27,form(ui) andknowledge_source(ai);formhas no row yet, so the table has 34 rows; AI counts 5.ai_context") gains a dated note: AI holds two 高级 types, so either one draws the label.ai_context") gains a dated note: a second row has been written under item 6 since.ai_context's row (fourth, no longer last in AI) and how the same three ruled sentences placeknowledge_source.The card says "33 entries"; the registry holds 35, because
formwas 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.tsalready mirrors them. No Status line changes.#37741 — the
knowledge_sourcetombstones say what the author of a registration in code does (packages/spec)os migrate meta --from 18(id,source.contentFields,embedding,vectorStore,adapterConfig,refresh.cron, and the'*'member ofsource.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.knowledge-source-registration-governed(the entryos migrate meta --from 18prints) now states the one exception to "nothing is rebuilt": a source whose 18idbegan with an underscore. Anamemust 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 aknowledge_sourceitem it stops serving). The entry says how it is dropped:dropSource({ source })on the adapter (IKnowledgeService.getAdapter) withnameset to the old id, or in the adapter's own store where the adapter has nodropSource.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.check:generatedfound one artifact stale after the tombstone change (content/docs/references/**), and--fixrewrote one page of it:content/docs/references/ai/knowledge-source.mdx.@objectstack/specpatch.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.ts0d433e77468e,knowledge-source.test.ts56ebce2f5d4e.Through
scripts/ablation-replace.mjs: the+ CODE_DOOR_18line of one tombstone (adapterConfig) replaced by an empty-string term. Direction set before the run: that row red, every other test green.ok mutation landed: anchor 1 -> 0, blob 0d433e77468e -> 8a47142baebf;+ CODE_DOOR_18lines on disk during the run: 6 (7 before).Tests 1 failed | 31 passed (32). The one failure is the row "adapterConfigis 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.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-memoryfor the run and removed after it (git statusclean, checked by the same script). It reads the schema and the memory adapter:KnowledgeSourceSchema.safeParseof a source named_kbis refused, at pathnamealone; the same source namedkbparses._kb, then the source built underkb:old key holds ["article:1"] new key holds ["article:1"].dropSourcewith the source'snameset to_kb:old key holds [] new key holds ["article:1"].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'sdropSourceblock.Acceptance notes
Container & modelline namedocs/adr/0087-metadata-protocol-upgrade-contract.md. That file holds noknowledge_sourcetext (grep -c knowledge: 0; controlgrep -c D3: 19). The D3 entry the card means ispackages/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.nametakesROUTER_ADDRESSABLE_NAME_PATTERN(a letter first) where the 18idpattern admitted a leading underscore; every adapter keys byAdapterContext.source.name;KnowledgeService.unregisterSourceleaves the index with its adapter anddropMetadataSourceruns only for a metadata item; the scheduled reconcile that landed onmainmeanwhile walks registered sources only; the three adapters in the tree (memory, pgvector, turso) implementdropSource, which the contract leaves optional.maingained 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.idtombstone 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..changeset/37304-knowledge-source-governed-type.md) and the hand-writtencontent/docs/protocol/knowledge.mdxsay 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.datasourcerow) rewrote the same note block of ADR-0084 and landed first.mainwas merged twice: at62dd9e1ef5(one conflict, in that block: its note kept first, this PR's note after it, reworded for the table as it then stood) and at9a274e6725(clean).node scripts/pm/overlap-check.mjsbefore each push; on the final head:VERDICT clean exit 0, 0 PR heads.knowledge-source.zod.tsat theadapterline, about ten lines from this PR's nearest edits on either side. It has no open PR at this writing.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 (surface279 chars,replacement863,reason2140,acceptanceCriteria648: no match; a control string matches).Verification
Read first (by risk):
docs/adr/0084-application-builder-information-architecture.md, item 6's closing note. The risk hunk is one clause: "its schema requires one object (theobjectkey of itssource, …), 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.packages/spec/src/migrations/entries/semantic/19.knowledge-source-registration-governed.ts:replacement,reasonandacceptanceCriteriaare what an upgrading author is shown. Check the drop instruction againstpackages/spec/src/contracts/knowledge-adapter.ts(dropSourcetakes anAdapterContext).packages/spec/src/ai/knowledge-source.zod.ts:CODE_DOOR_18and its seven uses.Two-minute check:
pnpm --filter @objectstack/spec exec vitest run --project local --maxWorkers=2 src/ai/knowledge-source.test.ts— expectTests 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 bynode scripts/pm/dispatch-gates.mjs --commandswith 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.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 owncheck: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)
pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.ts(Acceptance notes).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'sdist("Runpnpm buildfirst").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".origin/mainat 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