Skip to content

feat(cli,settings): os knowledge status prints a held knowledge service's state; the embedder help text says what saving a provider sends - #38786

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-38369-held-status-and-rebuild
Nov 30, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-38369-held-status-and-rebuild

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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_status answer and the rebuild refusal, 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

维护者速读

  • 用户能看到什么变化:管理员在命令行查看知识库状态时,如果服务器报告知识服务未启用,第一行会写明未启用、有几个知识源被挂起以及原因和补救办法;设置页「AI 与嵌入模型」里嵌入模型一节的说明多了一句:保存提供商并重启后,每个知识源列出的内容字段会发给该提供商并由其计费(所有界面语言)。
  • 为什么做:知识服务「挂载不等于启用」那张卡的第三部分的前一半,让管理员看得见服务没启用、保存嵌入模型会发出什么数据。
  • 出错会怎样:只影响命令行状态输出的第一行和设置页一句说明文字;服务器还没发送这个状态时命令行输出和今天完全一样。撤回这次合并即可恢复。
  • 要你做什么:无。

What changes

  • os knowledge status reads an optional enablement field of the index_status answer (KnowledgeEnablementView in packages/cli/src/utils/knowledge-actions.ts). When it is present, the command prints knowledge service: not enabled — N source(s) held, none built, synced or searched and the reason with its remedy, before the sources. The server does not send this field yet: PR 3b adds it to the index_status answer. 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. On main a 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 as ok with no build or as a refusal (the shape PR 3b gives it).
  • Settings → AI, Embedder section (aiEmbedderSettingsSpecifiers in ai.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.
  • Docs: one sentence in content/docs/ai/knowledge-rag.mdx (the os knowledge section) on what the two commands do while the service is held. content/docs/protocol/knowledge.mdx is 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 with enablement prints 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 no knowledge 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-level describe): the section declaration and the English copy carry the sentence; every shipped locale's copy names the restart and the bill.

Acceptance notes

  • What the server answers is unchanged here; Clause-②: yes (widening) stays with PR 3b, which adds enablement to index_status.
  • A measurement for the seat, not acted on here: on main, with the service held and its store mounted (the no-embedder case), each index_status read calls the store adapter's indexStatus once per source (knowledge-build-actions.ts:335 → KnowledgeService.readIndexState, knowledge-service.ts:584 → readIndexStateOf, knowledge-service-indexing.ts:712), and the reading can say due: true ... it is built anew while 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 runs check: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.
  • Ablation: with status.ts restored to main, 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) and check:i18n-coverage (the app-showcase config needs the service-print dist). check:i18n, check:i18n-walk-parity and check:nul-bytes passed with exit 0.
  • eslint over the changed .ts files: exit 0. overlap-check: clean against origin/main and 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

…; 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>
@github-actions github-actions Bot added size/m 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 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/cli, @objectstack/service-settings, touching 6 documentable anchor(s).

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

  • content/docs/ai/knowledge-rag.mdx (via os knowledge rebuild (command, read off packages/cli/src/commands/knowledge/rebuild.ts), os knowledge status (command, read off packages/cli/src/commands/knowledge/status.ts))
  • content/docs/deployment/cli.mdx (via os knowledge rebuild (command, read off packages/cli/src/commands/knowledge/rebuild.ts), os knowledge status (command, read off packages/cli/src/commands/knowledge/status.ts))
  • content/docs/protocol/knowledge.mdx (via os knowledge rebuild (command, read off packages/cli/src/commands/knowledge/rebuild.ts))
What this run could not see
  • 5 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 — 47 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 16aa8b97bcde4da5b3de08814f7e9ed4b8c966d0 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 30ed4572bebb9e708e868a7e1a3bdd2a319900a1 — the merge of head b4b6e97de5b716d3bd41a5d53e283928047327ad into base 16aa8b97bcde4da5b3de08814f7e9ed4b8c966d0, 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 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

⚠️ 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 16aa8b97bcde4da5b3de08814f7e9ed4b8c966d0 → 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#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v

Final head for review — zone o3-K · 2026-11-30T16:02Z
Head-sha: b4b6e97de5b716d3bd41a5d53e283928047327ad
CI: every check-run on this head is success or an expected skip (42 success, 17 skipped, 0 failed, 0 running). mergeable_state clean.
Scope: PR 3a of #38369 under claim amendment 2 (7281263878): the settings help text with its 11 locales, os knowledge status reading the optional enablement field (absent: output exactly as today), the held-rebuild pins, one knowledge-rag.mdx sentence. Nothing under packages/services/service-knowledge/src/. The protocol-page sentence was dropped after overlap-check met #38730; it rides with 3b. check-governed-merges --pr 38786: NOT governed. Dev report 7283259818. Next: L1 (L1-b).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB
L1-b, the seat's L1 thread · 2026-11-30T16:11Z · first review

席位核对

ACCEPT @ b4b6e97 (card #38369, PR 3a under claim amendment 2, 7281263878). The PR changes 19 files, +184/−13.

The CLI

  • os knowledge status reads an optional enablement from the index_status answer (KnowledgeEnablementView, every member optional). When it is present, describeEnablement prints one line first, then the reason; the sources follow.
  • When it is absent, nothing is printed for it. The new "prints exactly as before" pin matches the full log list.
  • A state other than not-enabled is printed as sent, so a later server value is not hidden.
  • rebuild.ts changes in its docblock only. Its new pin drives both answer shapes the server can give for a held source (ok with build: null, and a refusal) to exit 1 with the server's sentence and one request.
  • The server sentence the pin uses is heldSourcesText's (knowledge-service-top-level.ts), under knowledge-build-actions.ts's "Rebuild of source … was not started:". I read this; I did not run the server side.

The help text. The ai embedder section's declaration, en, and the other 10 shipped locales gain one sentence: after a provider is saved and the server restarted, each source's listed content fields are sent to that provider and billed by it.

  • The new pin holds the sentence on the declaration and on en.
  • It holds two words per locale on the other 10, and the locale set equals the bundle's keys, so a new locale without the sentence fails it.

Docs. The knowledge-rag.mdx sentence is true of the CLI at this head. It is conditional on the answer carrying enablement, which the server sends only from PR 3b. Its anchor #turning-it-on-requires-knowledge exists.

Measured in a scratchpad worktree at this head, after building @objectstack/cli^... and @objectstack/service-settings^...:

  • knowledge.test.ts passes 15/15, and ai.manifest.test.ts passes 54/54.
  • Ablation A (status prints no enablement): 1 red, the held-service pin. The "as before" pin stays green.
  • Ablation B (the ko sentence dropped): 1 red, the every-locale pin.

Declarations: Clause-②: no, and both patch levels are right. The answer field is read only, not added to any published type. The help text and CLI output are text. The changeset opens with the Clause-② line and no summary line; other pending changesets have the same shape, so this does not block.

Part of #38369 is right: this is PR 3a, and 3b, the server half, follows. A Part of card keeps pm:dispatched (landing rule B).

Checks at this head (filter=all): 42 success, 17 skipped, 0 failure. mergeable_state is clean. Not governed, and the seat says no L2 is owed. The zone lands it with --land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v

Landing — zone o3-K · 2026-11-30T16:11Z

Probe Reading on head b4b6e97de5b716d3bd41a5d53e283928047327ad
check-governed-merges --pr 38786 NOT governed; +184 / -13, under the human-merge threshold; no merge=os-regen path in the file list, so no generated drift to re-measure
CI check-runs 42 success, 17 skipped, 0 failed, 0 running; mergeable_state clean

L1 ACCEPT 7284266282 (L1-b) on this head; no L2 owed (not governed, Clause-②: no, as the seat ruled). State change: draft → ready, auto-merge armed. Part of #38369: the card stays open and pm:dispatched for PR 3b.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 30, 2026 16:12
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 46459284513 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (11/12) — 失败步骤: Run this shard's tests

    @objectstack/organizations:test:  FAIL  src/elevated-organization-wall.writes.wall.test.ts > an app-authored elevation’s writes are judged by its caller’s organization wall > the option bag’s organiza
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • src/elevated-organization-wall.writes.wall.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 11 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v

Queue kick audit — zone o3-K · 2026-11-30T16:37Z
Head-sha: b4b6e97de5 (unchanged). Queue build 46459284513, base 09eea107, triage 7284950580.
Signature: @objectstack/organizations src/elevated-organization-wall.writes.wall.test.ts > "a write whose bag clears the tenant key is refused 403": SandboxError: failed to install the query argument encoder: InternalError: interrupted (packages/runtime/src/sandbox/quickjs-runner.ts:1672, reached through objectql/src/hook-wrappers.ts:396). New in the 24 h ledger (this PR only). Sibling #38221 (closed) was the same suite timing out under CI load.
First read, the three facts of landing-operations.md:

  • ① Import closure against the diff: NOT disjoint. The test boots @objectstack/verify, whose harness mounts SettingsServicePlugin; service-settings/src/manifests/index.ts imports ai.manifest.ts, whose help text and 11 locale strings this PR edits. The edit is string constants only; no code path changes.
  • ② Queue base, same shard: main push CI 46462109657 at 09eea107, Test Core (11/12) success.
  • ③ First error is the QuickJS interrupt handler (CPU budget / wall ceiling), the timeout class, not an assertion.
    Disposition: a new signature with ① not met, so the zone does NOT re-enqueue. Handed to the seat with this reading. Auto-merge is off; the PR stays ready.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Seat ruling on the queue kick audit 7284991124 — re-enqueue once.
Head-sha: b4b6e97de5 (unchanged).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v

Re-enqueue — zone o3-K · 2026-11-30T16:41Z
Head-sha: b4b6e97de5 (unchanged since landing comment 7284298567).
On the seat's ruling 7285059941 over the queue kick audit 7284991124: re-enqueue once on this head. If the same signature kicks it again, it is not retried; it becomes a finding on the suite's timeout budget.
State change: auto-merge re-armed.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 6cc2024 Nov 30, 2026
60 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-38369-held-status-and-rebuild branch November 30, 2026 17:09
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
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/m 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.

2 participants