Repository navigation
feat(cli,settings): os knowledge status prints a held knowledge service's state; the embedder help text says what saving a provider sends - #38786
Conversation
…; the embedder help text says what saving a provider sends Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v Co-authored-by: Claude <noreply@anthropic.com>
…en PR) Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 3 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 — 47 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 30ed4572bebb9e708e868a7e1a3bdd2a319900a1 && git checkout 30ed4572bebb9e708e868a7e1a3bdd2a319900a1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 16aa8b97bcde4da5b3de08814f7e9ed4b8c966d0 b4b6e97de5b716d3bd41a5d53e283928047327ad && git checkout -B drift-repro 16aa8b97bcde4da5b3de08814f7e9ed4b8c966d0 && git merge --no-ff b4b6e97de5b716d3bd41a5d53e283928047327ad
node scripts/docs-audit/affected-docs.mjs --json 16aa8b97bcde4da5b3de08814f7e9ed4b8c966d0
|
|
repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v Final head for review — zone o3-K · 2026-11-30T16:02Z |
|
repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB 席位核对ACCEPT @ b4b6e97 (card #38369, PR 3a under claim amendment 2, 7281263878). The PR changes 19 files, +184/−13. The CLI
The help text. The
Docs. The Measured in a scratchpad worktree at this head, after building
Declarations:
Checks at this head (filter=all): 42 success, 17 skipped, 0 failure. |
|
repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v Landing — zone o3-K · 2026-11-30T16:11Z
L1 ACCEPT 7284266282 (L1-b) on this head; no L2 owed (not governed, |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46459284513 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v Queue kick audit — zone o3-K · 2026-11-30T16:37Z
|
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Seat ruling on the queue kick audit 7284991124 — re-enqueue once.
|
|
repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v Re-enqueue — zone o3-K · 2026-11-30T16:41Z |
…dge service is held (objectstack-ai#38796) Part of objectstack-ai#38369 (PR 3b, the server half of the card's part 3. PR 3a, objectstack-ai#38786, shipped the CLI reading and the embedder help text. Item 6, the skill, is its own governed PR.) Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:没启用知识服务(缺嵌入模型或知识存储没挂上)的私有部署上,管理员查看知识库状态时,第一行写明未启用、几个知识源被挂起、原因和怎么补,每个知识源显示「挂起」,不再误报「需要重建」;手动重建会被直接拒绝并给出补救办法。没有知识服务的部署,启动日志里的补救说明也补上了「保存嵌入模型后再重启一次」这一步。 - 为什么做:知识服务「挂载不等于启用」那张卡的最后一块代码,让管理员看得见服务为什么没生效;同时修正了上一张 PR 审核时留下的三处小问题。 - 出错会怎样:只影响状态查询和手动重建的回答,以及一行启动日志;已启用的部署和宿主自己挂载知识服务的部署回答不变。撤回这次合并即可恢复。 - 要你做什么:无。 ## What changes - **`index_status`, while the service is held** (`knowledge-build-actions.ts`): each source's index reads the new state `held` (`heldIndexReading` in `knowledge-build.ts`: not due, with one sentence), and the store is **not** asked what it holds. On `main` a held read called the store adapter's `indexStatus` once per source, through `KnowledgeService.readIndexState`, and could answer "it is built anew" for a build that nothing would run. The answer gains `enablement` (`state: 'not-enabled'`, the `reason` naming each missing half and its remedy, `embedder` / `store`, `heldSources`), and its message leads with the reason and the held count. A service a host mounts itself, and an enabled one, answer exactly as before. - **`rebuild`, while held**: the service's own refusal of the build (`heldSourcesError` in `rebuildSource`) is now answered as a refusal (`ok: false`, which the settings door answers 400): `Rebuild of source 'X' is refused: [knowledge] the knowledge service is not enabled on this deployment: ... To enable it, save an embedder provider, then restart.` Before, it was answered `ok` as "was not started". No second refusal path is added: the action reads `heldReading()` only after `rebuildSource` threw. - `KnowledgeBuildActionsService` gains `heldReading` as an **optional** member, so a caller's own service double still fits. - **Carry-overs from the PR 2 contract review** (record 7257422588, routed here by L1 record 7257956376): - N1: `knowledge-settings-contribution.test.ts`. The "no identity" assertion now passes `null`, because `undefined` hit the helper's default parameter and repeated the author's case. It asserts the held `503 SERVICE_UNAVAILABLE`, which pins that the held refusal comes ahead of the identity check. - N2: the `admitAuthoredSource` jsdoc in `knowledge-service.ts` now says that `door` also decides whether the held refusal applies. - N6: `packages/objectql/src/knowledge-source-unserved.ts`. The boot line of a deployment that holds `knowledge_source` items and runs no knowledge service now names the embedder step its save refusal already names: `Declare requires: ['knowledge'] in the stack and restart, then save an embedder provider and restart again`. This makes `knowledge-rag.mdx`'s "and the same fix" true again. - **Docs**: `content/docs/protocol/knowledge.mdx` gets the sentence that PR 3a dropped (it conflicted with objectstack-ai#38730, which has since merged), now saying what both actions answer while held. ## Tests - New `packages/services/service-knowledge/src/__tests__/held-status-38369.test.ts`. Both actions run through the settings service's action door on a kernel running the plugin as the runtime composes it: - the not-enabled `enablement` with its reason, the embedder half and the held count; - both halves at once; - a host-mounted service and an enabled one answer no `enablement` and the old message; - a held rebuild is refused with the remedy and no store call; - an enabled rebuild is not refused. - On a service with a data engine bound and a counting store, while held: the index reads `held`, not due, with no "built anew", and **0 `indexStatus` calls**. Control, enabled: the same store is asked once (`new-fingerprint`). - `knowledge-source-unserved.test.ts` pins the embedder step in the boot line. ## Acceptance notes - N2's other stale lines are in `packages/metadata-core/src/knowledge-source-save-admission.ts`: `noKnowledgeServiceRefusal`'s "the token, a restart, then the save" at :185, and the door docs at :84 and :115. That file is outside this claim's surface, so they are left for a follow-up. - The `new-fingerprint` detail "it is built anew" stays as it is for an enabled service, where it is true. While held, that reading is no longer produced. ## Verification <details><summary>Local runs at 142f3f6 (base c8b1dbb)</summary> - `pnpm --filter @objectstack/service-knowledge test`: 29 files, 879 passed. `typecheck` exit 0 (it includes `check:test-typecheck`). - `pnpm --filter @objectstack/objectql exec vitest run src/knowledge-source-unserved.test.ts`: 7 passed. `pnpm --filter @objectstack/objectql typecheck`: exit 0. - Ablation 1: with `index_status` reading the store while held (the fix reverted), "held, the store mounted: ... the store is never called" fails (1 failed / 6 passed). - Ablation 2: with the held branch disabled (`heldOf` answering `undefined`), the four held pins fail (4 failed / 3 passed). Both restored; tree clean. - `dispatch-gates --ran`: 105 derived, 102 exit 0, 3 NOT MEASURED: - `check:skill-examples`: no client-react dist; - `check:dual-build-cjs-loads`: no scenarios/studio dist; - `check:type-check-debt`: its `--re-measure` starts a whole-workspace build beyond the 10-minute cap; stopped, and CI runs it. - eslint over the changed `.ts` files: exit 0. `overlap-check` against `origin/main` 6cc2024 (with objectstack-ai#38786 merged): clean; objectstack-ai#38791 merges cleanly. </details> Two-minute check: `pnpm --filter @objectstack/service-knowledge exec vitest run src/__tests__/held-status-38369.test.ts` should report 7 passed. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Part of #38369 (PR 3a of the card's part 3: the CLI's reading of a held knowledge service and the embedder help text. The server half, the
index_statusanswer and therebuildrefusal, is PR 3b and follows after the open retrieval-mode PRs land. Item 6, the skill, is its own PR.)Clause-②: no
Metadata-protocol: none
维护者速读
What changes
os knowledge statusreads an optionalenablementfield of theindex_statusanswer (KnowledgeEnablementViewinpackages/cli/src/utils/knowledge-actions.ts). When it is present, the command printsknowledge service: not enabled — N source(s) held, none built, synced or searchedand the reason with its remedy, before the sources. The server does not send this field yet: PR 3b adds it to theindex_statusanswer. That is harmless: the field is optional and only read, and an answer without it prints exactly as today (pinned line by line).os knowledge rebuild: docblock only. Onmaina held service's rebuild already answers the service's own sentence (Rebuild of source 'X' was not started: [knowledge] the knowledge service is not enabled ... To enable it, save an embedder provider, then restart.), and the command already exits 1 with it. A new test pins that the command prints that sentence and exits 1, whether the server answers it asokwith no build or as a refusal (the shape PR 3b gives it).aiEmbedderSettingsSpecifiersinai.manifest.ts): the help text says that once a provider is saved and the server restarted, the content fields each knowledge source lists are sent to that provider for every row the source matches, and the provider bills for them. The sentence is in the English copy and in all 10 other shipped locales.content/docs/ai/knowledge-rag.mdx(theos knowledgesection) on what the two commands do while the service is held.content/docs/protocol/knowledge.mdxis left untouched: a sentence there conflicted textually with the open PR feat(studio): the knowledge source retrieval-mode picker offers the modes its store runs #38730.Tests
packages/cli/src/commands/knowledge/knowledge.test.ts: (1) an answer withenablementprints the not-enabled line and the reason first, then the sources; (2) an answer without it prints exactly the lines it printed before; (3) the existing full status case asserts noknowledge service:line; (4) a held rebuild exits 1 with the server's sentence, in both answer shapes.packages/services/service-settings/src/manifests/ai.manifest.test.ts(new top-leveldescribe): the section declaration and the English copy carry the sentence; every shipped locale's copy names the restart and the bill.Acceptance notes
Clause-②: yes (widening)stays with PR 3b, which addsenablementtoindex_status.main, with the service held and its store mounted (the no-embedder case), eachindex_statusread calls the store adapter'sindexStatusonce per source (knowledge-build-actions.ts:335→KnowledgeService.readIndexState,knowledge-service.ts:584→readIndexStateOf,knowledge-service-indexing.ts:712), and the reading can saydue: true ... it is built anewwhile nothing will build it.Verification
Local runs at b4b6e97
pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 src/commands/knowledge/knowledge.test.ts: 15 passed (12 before, plus 3 new).pnpm --filter @objectstack/cli typecheck: exit 0. The typecheck runscheck:test-typecheck, so it covers the test file too.pnpm --filter @objectstack/service-settings exec vitest run --maxWorkers=2 src/manifests/ai.manifest.test.ts src/translations/settings-translation-coverage.test.ts: 2 files, 204 passed.pnpm --filter @objectstack/service-settings typecheck: exit 0.status.tsrestored tomain, the new held-status pin fails (1 failed, 14 passed); restored afterwards, tree clean.dispatch-gates --ran: 104 derived, 101 exit 0, 3 NOT MEASURED, all for a prerequisite these paths do not touch:check:skill-examples(client-react dist),check:dual-build-cjs-loads(scenarios/studio dist) andcheck:i18n-coverage(the app-showcase config needs the service-print dist).check:i18n,check:i18n-walk-parityandcheck:nul-bytespassed with exit 0..tsfiles: exit 0.overlap-check: clean againstorigin/mainand docs(knowledge): search_knowledge says what a score means; the AI skill lists source.retrieval.mode #38732.Two-minute check:
pnpm --filter @objectstack/cli exec vitest run src/commands/knowledge/knowledge.test.ts -t "held"should report 2 passed.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v