Repository navigation
Commit 0c1b2ff
docs(adr): ADR-0161 dated note on item 12, a mounted knowledge service is enabled by configuration (#38401)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XDXvJPPtrTGfdDYhWWpihq5)_
Fixes #38368
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:用户无感;只在知识平台的架构决策记录里加一条带日期的注记,写明知识服务挂上不等于启用:私有部署配齐嵌入参数和存储才启用,没配齐时所有知识源都留着、管理员列得出,但不建索引、不同步、不能搜,也不能保存或移入应用包。
-
为什么做:属于知识平台专题;您定的规则(同一套元数据,私有部署看参数配没配,云端不管)和您随后裁定的四处细节,现有条文都没写,随后的实现要有据可依。
- 出错会怎样:只改一份文档,运行行为不变;条文若写错,碰到的是随后照它做实现的人,可以直接撤回。
- 要你做什么:审阅并合并这份注记(受管面,由您批准合并)。
## What changes
One file,
`docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md`,
22 lines added and none removed against `main`, in three places:
- **Header.** A third `**Amended**` line, dated 2026-11-28, beside the
two that are there. It names both sources of the note: the maintainer's
words of 2026-11-28 and the four points he ruled on 2026-11-29. The
status line is left as it is.
- **K4.** A cross-reference appended to the existing cross-reference
block, in the shape of the one dated 2026-11-26. It says which two texts
of K4 are read with the new note (clause 3, "A real consumer", and
"Source admission at save") and closes with "No sentence of this record
is changed."
- **K8.** A third dated note after the two notes under the table, read
with item 12:
- item 12 is unchanged, and mounted is not enabled; the maintainer's six
sentences of 2026-11-28 are quoted verbatim, untranslated and in order;
- **Enabled**: at `kernel:bootstrapped` an embedder is available and the
deployment's store is mounted, which means its adapter is registered;
read once per boot;
- **Not enabled: held, not served**: sources are loaded and listed to
administrators, and not built, synced, reconciled or searched; no tool
definition is handed out; a direct search is refused with a coded
refusal and never answered empty; the state is said once in the boot's
log;
- **Enabling is an egress decision** (K5); the boot that first finds
both halves runs K7's boot pass;
- **The switch** is the existing setting `ai.embedder_provider`, default
`none`;
- the three ◆ choices ruled on 2026-11-28 by 「以上都同意」, each quoted in the
card's words: an author's save, the log line, a service the host mounts;
- the four ◆ points ruled on 2026-11-29 by the maintainer's choice of
the decision card's option 「全按推荐(1A 2A 3A 4A)」, each under the number
the ruling record gives it (comment 7248214179 on the card):
- point 1: the package move-in of a package-less source is an author's
save, refused while the service is not enabled, and no door value is
added;
- point 2: the state is the whole service's, so every source of a
runtime-mounted service is held, whichever store it names; an
application whose store embeds on its own mounts the knowledge service
itself;
- point 3: the service registers no lifecycle reap guard and calls no
store, so a retention sweep deletes its rows on time; an entry left in a
store that holds an earlier index joins the known gap, and K3 item 3 is
read with the note as the promise of an enabled service;
- point 4: the refusal of an author's save names the half that is
missing;
- **A known gap**, **Alternatives not taken**, and **Cloud is out of
scope**;
- the closing paragraph: no contract member, no settings key, no
capability token; `main` has no such state until the implementation card
#38369 lands; "The table is left as written; read item 12 with this
note."
The K8 table and every earlier sentence of the record are untouched. No
file outside `docs/adr/` changes.
**Read first, by risk** (one file, three bullets of the K8 note):
1. **Point 2, the state is the whole service's.** It is the one bullet
that declares a narrowing: on `main` a source on an application's store
that reads no embedder is built and searched under a runtime-mounted
service, and under this note it is held. The bullet says so and says it
is a named part of the narrowing #38369 declares.
2. **Point 3, no reap guard and no store call.** It is read against K3
item 3 ("an index entry never outlives its row") and the header's
"Leaves unchanged" list. The bullet states the reading and changes
neither sentence.
3. **Point 4, the refusal names the half that is missing.** The store
sentence, "mount the deployment's knowledge store, restart, then save",
is this area's English. The ruling record says it was not put to the
maintainer word for word and is the delta review's to read.
## Tests
No package is touched, so there is no build closure to build and no
package test to run. A record is prose: nothing here is ablated. The
checks that read the changed file are listed under Verification.
## Acceptance notes
**The card's acceptance.**
- The note sits under K8 and ends with the line "The table is left as
written; read item 12 with this note".
- K4 carries a cross-reference.
- The three ◆ choices of 2026-11-28 are recorded as ruled, each in the
card's words inside quotation marks, and are unchanged by the second
commit.
- `git diff origin/main...HEAD --stat` reads one file, 22 insertions.
**The contract review's findings on the first head (comment 7247818861
on this pull request), and the ruling that answers them.**
- The open choice of the first report, move-in: ruled, point 1. The two
sentences that said the note did not decide it are replaced.
- S1, a source on a store the application registered: ruled, point 2.
- S2, the lifecycle reap guard: ruled, point 3, and one sentence added
to **A known gap**.
- S3, the save remedy when the store is the missing half: ruled, point
4, and "the boot that first finds an embedder" now reads "the boot that
first finds both, an embedder and the deployment's store".
- N1, applied: the K4 cross-reference says "listed to administrators".
- N2, applied: the log-line bullet says the rule is about this state
alone, and that a declared capability whose provider cannot be built
still fails the boot, as before.
- N3, not applied in the record: the Consequences sentence on index
state, "The service keeps none of its own", is an earlier sentence and
is left as written. It reads against the per-source sync state row that
landed with pull request #38307. It stays a follow-up for a later
revision of the record.
- N4, applied: **Enabled** says the store is mounted when its adapter is
registered, and that whether a registered store can open its database is
outside the note, which declares no boot probe of it.
**What the note says about code, read on `main`.** The files the note
cites are byte-identical at `ff69bcabb2`, where they were first read,
and at `3579cf136d`, which this branch has merged. Every anchor is a
`path#symbol` or a file, as the record's anchor check requires.
- The knowledge plugin provides its embedder from a
`kernel:bootstrapped` hook: it keeps one another plugin registered, else
builds one from the saved settings, else registers a stand-in whose
every use is refused
(`packages/services/service-knowledge/src/knowledge-service-plugin.ts#provideEmbedder`).
`embedder_provider` defaults to `none`, and a saved default counts as
not configured.
- The settings description of that key reads "Read when the server
starts: a saved change to any embedder setting takes effect after the
next restart."
(`packages/services/service-settings/src/manifests/ai.manifest.ts#aiEmbedderSettingsSpecifiers`).
- Ruling D's three save doors ask `authoredKnowledgeSourceRefusal`: the
REST `PUT /meta/:type/:name`, the dispatcher's same route, and the MCP
draft save. The package duplicate door is `POST
/packages/:id/duplicate`, through `refuseDuplicatedKnowledgeSources`,
with the predicate's `duplicate` door. `POST /packages/:id/move-in` asks
the same predicate with the default door, `save`.
- A scheduled reconcile exists: `scheduleReconcile` registers a daily
job on the job service by default, and an option turns it off. A
reconcile walk removes the documents of rows that were deleted, for a
store that lists its documents.
- Composition is decided from the stack and the process environment
before the kernel starts; the settings service reads saved values only
once its data engine is bound at `kernel:ready`; the embedder settings
section is contributed by the knowledge service itself
(`contributeKnowledgeSettings`). Both halves of the first alternative
hold.
- For point 2: the service core never reads the embedder service, and
the in-memory store plugin reads none, so on `main` a source on such a
store builds and is searched with no embedder saved.
- For point 3: the reap guard's work is a store call
(`packages/services/service-knowledge/src/knowledge-reap-guard.ts`), and
a failed call keeps the row.
- For N2: under `os serve` a declared capability whose provider cannot
be provided is a hard boot error, and a capability the stack's items
mount is read as declared
(`packages/core/src/capability-composition.ts`).
- K9 rule 1, K7 rule 5, K8 rule 2, K5, K1, K3 item 3 and ADR-0078 §4
each say what the note cites them for.
**Places where the note's wording departs from the card's, each on a
reading of `main` or of the ruling record.**
1. Card point 9 gives the reason "(the service keeps no state of its
own)". That no longer holds: a per-source sync state row landed on
`main` after the card's evidence commit (pull request #38307;
`packages/services/service-knowledge/src/knowledge-sync-state.ts`). The
gap itself stands, for a different reason, and the note states that one:
the row holds a source's last build and its failed syncs, and a change
that was never attempted is neither.
2. Card point 4 says the enabling boot "builds every held source and
names each". Read literally that contradicts point 9, since a store that
already holds a current index is not rebuilt. The note says the boot
runs K7's boot pass over every held source and names each one it builds,
and that a source held since it was first loaded is built whole.
3. Ruling D's item 5 cites the capability file by line number. The
record's anchor check refuses line anchors, so the note cites the same
place as
`packages/spec/src/kernel/platform-capabilities.ts#PLATFORM_CAPABILITY_TOKENS`
and quotes the comment's words, "Requested, never always-on".
4. The note keeps its date, 2026-11-28, the day of the maintainer's
words and of the first three choices. The four later points carry their
own date, 2026-11-29, in the header line, in the note's first paragraph
and in each bullet's title.
**Noted, not filed, and not changed here.**
- The stdio MCP bridge reads the knowledge service in its `start()`,
before `kernel:bootstrapped`, the event at which the note says the state
is read. The implementation card #38369 has to make `search_knowledge`
absent on that transport too; the note states the outcome and leaves the
mechanism to that card.
- The Consequences sentence named under N3 above.
## Verification
**Two-minute check.** Open the Files changed tab: one file, 22 lines
added, none removed. The K8 note carries four bullets whose titles begin
"◆ Ruled 2026-11-29 (point", and its last line ends with "The table is
left as written; read item 12 with this note."
<details>
<summary>Local checks on head 83e9252 (the 21 commands derived for this
diff)</summary>
Derived with `node scripts/pm/dispatch-gates.mjs --commands` and
reconciled with `--ran`:
`✓ dispatch-gates --ran: 21 derived famil(ies) accounted for — 21 run, 0
NOT-MEASURED`
Each exit code was captured before any pipe.
| Command | Exit |
| --- | --- |
| `node scripts/check-adr-links.mjs` | 0 |
| `node scripts/check-adr-links.mjs --self-test` | 0 |
| `node scripts/check-closing-keyword-parity.mjs` | 0 |
| `node scripts/check-closing-keyword-parity.mjs --self-test` | 0 |
| `node scripts/check-comment-mask-corpus.mjs` | 0 |
| `node scripts/ci/plan-test-core-shards.mjs --self-test` | 0 |
| `pnpm --filter @objectstack/lint run check:doc-formula-expressions` |
0 |
| `pnpm check:adr-anchors` | 0 |
| `pnpm check:adr-index` | 0 |
| `pnpm check:adr-symbol-anchors` | 0 |
| `pnpm check:ci-filter-parity` | 0 |
| `pnpm check:closed-ceremony-text` | 0 |
| `pnpm check:cross-package-test-inputs` | 0 |
| `pnpm check:doc-authoring` | 0 |
| `pnpm check:driver-memory-census` | 0 |
| `pnpm check:gitlink-declared` | 0 |
| `pnpm check:nul-bytes` | 0 |
| `pnpm check:pm-governed-merges` | 0 |
| `pnpm check:pm-prior-rulings` | 0 |
| `pnpm check:refd-timer-probe` | 0 |
| `pnpm check:watch-hint-literal` | 0 |
Verdict lines the checks print:
- `check-adr-links: 1268 relative link destination(s) under docs/adr/
resolve`
- `check-adr-symbol-anchors: 4538 anchors across 164 records resolve`,
with 0 line anchors surviving
- `adr-index --report: OK — docs/adr/README.md is current, every record
parsed`
- `check-nul-bytes: OK`, no raw ASCII control bytes
The repo-wide scans and the full check farm are left to CI.
</details>
<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oQLfL8thb6wtUHnTb -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5df10ec commit 0c1b2ff
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| 224 | + | |
| 225 | + | |
223 | 226 | | |
224 | 227 | | |
225 | 228 | | |
| |||
347 | 350 | | |
348 | 351 | | |
349 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
350 | 372 | | |
351 | 373 | | |
352 | 374 | | |
| |||
0 commit comments