Skip to content

fix(service-knowledge): a source naming an unmounted adapter is logged once at boot - #37951

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/area-o1C-37479
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/area-o1C-37479

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

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

Fixes #37479

Clause-②: no
Metadata-protocol: none

维护者速读

  • 运维人员看启动日志时,一个指向未挂载存储的知识源从两行告警变为一行错误,错误里写明知识源、存储名和可选的已挂载存储;用户无感。
  • 属于知识检索平台(AI 检索)史诗,替看启动日志的运维人员去掉重复噪音。
  • 出错只会让这条错误多一行或少一行,检索与建索引的行为不变,可直接撤回。
  • 无。

What changes

  • packages/services/service-knowledge/src/knowledge-service.ts buildIfDue: at boot, a source whose adapter is not mounted is skipped by the first-build pass without a line. Before, the pass read its index state, getAdapter threw the unmounted-adapter refusal, and the pass logged it at warn as "is not built at boot: what the adapter holds could not be read (...)", beside the error that reportUnmountedAdapters already prints at kernel:bootstrapped. Now the boot says it once, at error, naming the source, the adapter and the mounted adapters.
  • On reload (a knowledge_source item added while the process runs) nothing changes: no boot reading runs then, so the reload build's warn is still the one line that names the source.
  • Indexing and searching such a source still answer the coded SERVICE_UNAVAILABLE 503 (PR feat(core): requires knowledge mounts the knowledge service and one vector store #37442); not touched.

This is item 1 of the re-scope (card comment 7187970703). Item 2, a publish or os validate refusal of an adapter name no deployment can serve, is NOT in this PR: it would narrow what is accepted, and the area decides. Options are in the dev report on the card. That is why this PR says Part of and leaves the card open.

Tests

  • New pin in src/__tests__/knowledge-build.test.ts: with a data engine bound, one mounted source and one naming pgvector (not mounted), the boot pass plus the boot reading produce exactly one log line naming 'docs' across debug/info/warn/error. That line is at error and names the adapter as not mounted. The mounted source is still built (status: 'done').
  • Ablation: with the new guard line replaced by a comment, the pin goes red: expected [ [ 'warn', …(1) ], [ 'error', …(1) ] ] to have a length of 1 but got 2 (1 failed, 22 passed). With the line restored, the file is green (23 passed).
Package test and typecheck (head 13f32fc)

pnpm --filter @objectstack/service-knowledge test && pnpm --filter @objectstack/service-knowledge typecheck under the verify lock: VERDICT command-exit 0, Test Files 17 passed (17), Tests 529 passed (529). typecheck is tsc --noEmit && pnpm check:test-typecheck, so the test files are type-checked too.

Acceptance notes

  • Item 2 of re-scope 7187970703 (a publish or os validate refusal) is closed by area decision D, with no publish-time refusal added. The refusal point is boot: reportUnmountedAdapters prints a coded error naming the source and the adapter. searchWithRefusals lists such a source as refused (knowledge-service.ts near :1882), and index and search answer the coded 503 (PR feat(core): requires knowledge mounts the knowledge service and one vector store #37442 and this PR). Options A (save-time admission) and B (a ragflow tombstone) stay in the dev report on the card, for a future card.
  • The claim's file surface pointed at :372 as "the boot build pass's kept(...) line". On origin/main 73d5e34, :372 is dropMetadataSource's kept(...), which runs when a source is removed, not at boot. The second boot line comes from buildIfDue (the warn of an unreadable index reading). The fix sits there, and dropMetadataSource is not touched.
  • Public surface: no exported type, export or wire shape changes. No dependent package owes a test.

Verification

Read first: knowledge-service.ts buildIfDue (the one added guard line), then the new pin.

Two-minute check: pnpm --filter @objectstack/service-knowledge exec vitest run --maxWorkers=2 src/__tests__/knowledge-build.test.ts should show 23 passed. Delete the guard line if (trigger === 'boot' && !this.adapters.has(entry.handed.adapter)) return; and the pin fails with 2 lines (warn, error) where it expects 1.

Derived gates (local, head 13f32fc): 68 exit 0, 2 NOT MEASURED

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 70 families from the 3 changed paths. All 70 ran; --ran with recorded exit codes: "70 derived famil(ies) accounted for — 68 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".

  • NOT MEASURED: check:dual-build-cjs-loads, reason: PREREQUISITE NOT MET, it needs every package's dist/ (a whole-tree build). CI runs it.
  • NOT MEASURED: check:type-check-debt, reason: its re-measure build did not get a turn on the shared verify lock (queue-timeout 99). CI runs it.

The package-wide scans (pnpm lint and the rest of the farm) are CI's.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP

…d once at boot

The boot build pass no longer adds a warn line for a source whose adapter is
not mounted; reportUnmountedAdapters names it once at error. Pinned by a
boot-pass test counting every log line that names the source.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation 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/service-knowledge, touching 2 documentable anchor(s).

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

  • content/docs/ai/knowledge-rag.mdx (via KnowledgeService (symbol, a top-level class))
  • content/docs/protocol/knowledge.mdx (via KnowledgeService (symbol, a top-level class))
What this run could not see
  • 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 — 4 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 94b0314c80eed17bdf2d656e317125da6249d9f5 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 2f473b2d08650557a230c0956bee22a184fbe33f — the merge of head 13f32fc828a388ed7188f0ec6a5e3ed042013a71 into base 94b0314c80eed17bdf2d656e317125da6249d9f5, 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 2f473b2d08650557a230c0956bee22a184fbe33f && git checkout 2f473b2d08650557a230c0956bee22a184fbe33f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 94b0314c80eed17bdf2d656e317125da6249d9f5 13f32fc828a388ed7188f0ec6a5e3ed042013a71 && git checkout -B drift-repro 94b0314c80eed17bdf2d656e317125da6249d9f5 && git merge --no-ff 13f32fc828a388ed7188f0ec6a5e3ed042013a71

node scripts/docs-audit/affected-docs.mjs --json 94b0314c80eed17bdf2d656e317125da6249d9f5

⚠️ 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 94b0314c80eed17bdf2d656e317125da6249d9f5 → 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

L1 verdict (L1-a): ACCEPT at head 13f32fc828 (Fixes #37479). Full read · 2026-11-27T13:06Z

席位核对

Shape and gates. l1-face --pr 37951: CLEAN, 13 items, none flagged. Check-runs at 13f32fc: 39 success, 18 expected skip, 0 failed, 0 pending; mergeable_state clean. 3 files, +42/-1. Not governed. Clause-②: no · Metadata-protocol: none.

Item 1, one boot line: delivered. buildSourcesAtBoot now returns early for trigger === 'boot' when this.adapters has no entry for the source's adapter, before readIndexStateOf, so the 'unreadable' warn no longer follows. Both readers run in kernel:bootstrapped, after every store's start() has registered its adapter, so the skip and reportUnmountedAdapters read the same adapter map, and a source skipped here is always the one the error line names. Reload is untouched, so a source loaded later is still named at warn by its reload build. The new pin collects every level and asserts exactly one line naming 'docs', at error, carrying the adapter and "is not mounted". It also proves the mounted source is still built by the same pass. The ablation gives 2 lines.

Item 2, the publish-time refusal: closed by decision D, accepted. The card's Done-when leaves the refusal point to the lane and names boot as an allowed one. On this head the rest of Done-when already holds on main from #37442, with pins in knowledge-service.test.ts. The boot error line names the source, the adapter, the mounted choices and the code. searchWithRefusals lists the source as refused (SERVICE_UNAVAILABLE, :2291). Index and search answer the coded 503 (:2280). The re-scope's item 2 was a hand-off to #37304 or #37307 "whichever lands first", not a new bar, and D records why boot suffices. Options A (save-time admission) and B (the ragflow tombstone) stay in the dev report. Please file A as a follow-up card so it is not lost, since every stored adapter: 'ragflow' source lands in this path after #37004.

Changeset, sentence by sentence. Named twice before, once at error and once at warn with the quoted text: true, and it matches the code it removes. "Skips such a source without a line, so the one boot line is the error": true. "Indexing and searching ... still answer SERVICE_UNAVAILABLE": true. "A source loaded while the process runs is still named at warn by its reload build": true, because the skip is boot-only.

Body and evidence. The area's body patch (Fixes, D's acceptance line) is the area's to make under os-dev rule 3. The ablation run outside the verify lock is declared in the PR, the change is 5 lines in one package, and Test Core is green on the head, so it counts.

Landing: not governed, under 3000 lines, no narrowing. The area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Landing · area o1-C · head 13f32fc828 · 2026-11-27T13:07Z · ACCEPT → PR #37951 comment 7219082772 (L1-a)

Probe Reading
check-runs at 13f32fc828 39 success · 18 expected skip · 0 failed · 0 pending · mergeable_state clean
check-governed-merges.mjs --pr 37951 NOT governed · +42 / −1
landing-k.mjs --pr 37951 K = 2 < 15

State: ready + auto-merge; #37479 closes on merge via Fixes (item 2 closed by area decision D; option A, a save-time admission refusal, goes to a follow-up card as L1-a asked).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 13:08
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 73d0240 Nov 27, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-o1C-37479 branch November 27, 2026 13:56
os-elon-musk pushed a commit that referenced this pull request Nov 27, 2026
…pter

main's boot pass (#37951) read the source's named adapter; a source that
names none is now placed through boundAdapterId, and one that cannot be
placed is left to the reading, as an unmounted named one is.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
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 size/s tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

service-knowledge: a knowledge source that names an unregistered adapter fails silently (boot clean, search answers [], index throws a bare Error)

2 participants