Repository navigation
feat(service-knowledge)!: an author's knowledge source save is refused while the knowledge service is not enabled - #38599
Conversation
…d while the knowledge service is not enabled
A knowledge service the runtime composed and that the boot read as not
enabled (no embedder, or the deployment's store not mounted) holds every
source. An author's save of a source there is now refused 503
SERVICE_UNAVAILABLE by the service's own verdict, ahead of every gate,
naming the half that is missing and the ruled remedy ("save an embedder
provider, restart, then save"; "mount the deployment's knowledge store,
restart, then save"; both). Every door that saves one answers it: the
/meta save on both transports, the MCP draft save and the package
move-in of a package-less source. The package duplicate is not refused
for it, and the engine's own write is admitted.
On a deployment with no knowledge service, the save's refusal also says
to save an embedder provider and restart again; the duplicate's sentence
is unchanged.
Claude-Session: https://claude.ai/code/session_01QsR2jREKp1JAmqK54ADBYS
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jREKp1JAmqK54ADBYS Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 15 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 6 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 181 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 585a3f2d614de0e97c4f8a8041081d554a4e9ab3 && git checkout 585a3f2d614de0e97c4f8a8041081d554a4e9ab3
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 75108ea6df94b13b57ec010aeb77012ec211ebb3 1ec1c93f1340b34cc4270a8f4dd8e85070833289 && git checkout -B drift-repro 75108ea6df94b13b57ec010aeb77012ec211ebb3 && git merge --no-ff 1ec1c93f1340b34cc4270a8f4dd8e85070833289
node scripts/docs-audit/affected-docs.mjs --json 75108ea6df94b13b57ec010aeb77012ec211ebb3
|
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Contract-review-claim: session_01QsR2jSyQBDMyRnrrWKy7WS · head 1ec1c93 · 2026-11-29T14:11Z Seat 1's review thread R1 starts an isolated contract-review sub-agent at |
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Contract reviewServed-tier: First contract review of PR #38599 (part 2 of 3 of card #38369), one full round. Read: the card body and all 11 of its comments; the PR body and its 12-file list; the net diff against merge base 696d02f at this head, every hunk; the ADR-0161 K8 dated note on item 12 in the tree at the head ( ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. The
The refusal sentences, against the ruled words (the save door, source
The pins, against the card's acceptance line ("The three save doors refuse with the stated remedy and write nothing; the duplicate door copies the package") and the amendment ("pin each half", the move-in pin). The service test boots the plugin on a kernel and pins the embedder half, the store half, both, the key-less provider, the duplicate, the engine's write, zero store calls and two controls. packages-knowledge-source-gate.test.ts pins, on a real kernel running the plugin as the runtime composes it, the dispatcher save (embedder half), the move-in with the save's remedy and Tried to break it. A door value forged by a caller: the door is set by server code only. A save between Nits, none with an effect on correctness or on the contract; each is left for a follow-up or as an accepted deviation, since a fix outside the prose faces moves the head:
Not reviewed, as the brief scopes it: the changeset beyond ②, and the two docs pages. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS The brief the isolated reviewer was handed for contract-review record 7257422588, as it stood (2026-11-29T14:36Z). The reviewer ran at BriefContract review brief — PR #38599 @
|
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS 维护者速读
席位意见:建议批准。提示文字有一处和卡片原话不同:卡片写「加上保存嵌入模型」,实现写成「重启、保存嵌入模型、再重启」,因为嵌入模型的设置项要等知识服务挂上之后才存在。席位和复审都对着代码核实过,实现的写法才做得到。 席位核对 — ACCEPT · L1 · seat repo:objectstack#1, review thread R1 · Head-sha
|
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS Tier H approval request · 2026-11-29T15:16Z This pull request declares a narrowing ( |
Requested by Jianguo · project thread
Part of #38369 (part 2 of 3; part 3, items 4–5, follows from
mainafter this merges)Clause-②: no (narrowing) — a save door that answered 200 while the service was held now refuses with 503 naming each missing half; no key added
Metadata-protocol: narrowed
Skills-docs: follow-up #38475
维护者速读
What changes
Authority: the ADR-0161 K8 dated note on item 12 (◆ "an author's save", ◆ points 1 and 4), ruling record 7248214179 (amendment 7248231750, points 1 and 4) and build note 3 of 7248592159. Card items covered: item 3.
packages/services/service-knowledge/src/knowledge-service.ts,KnowledgeService.admitAuthoredSource). While the boot read a runtime-composed service as not enabled (heldReading()set by PR 1), an author's save is refused503with codeSERVICE_UNAVAILABLE, ahead of the identity check and every gate, and nothing is written. The sentence names each half that is missing and the ruled remedy (point 4): no embedder → "save an embedder provider, restart, then save" (as "…, restart, then save the source."); the deployment's store not mounted → it says so, that the boot's log names the reason, and "mount the deployment's knowledge store, restart, then save"; both → both, in one remedy. A provider saved without its key carries that cause in the parenthesis beside the ruled words (build note 3). The engine's own write (isSystem) is admitted, so a shipped source still installs and is held. The package duplicate (door: 'duplicate') is not refused for it, as the note rules.PUT /meta/:type/:nameon both transports and the MCP draft save askauthoredKnowledgeSourceRefusal, which forwards the service's verdict;POST /packages/:id/move-inof a package-less source already asks it with the save door (point 1), so it is refused with the save's remedy. No door value is added.packages/metadata-core/src/knowledge-source-save-admission.ts, card item 3's "gains 'and save an embedder provider'"). The save door's sentence now reads "… restart the server, save an embedder provider and restart again, then save the source again: the service is mounted when the server starts, never while it runs, and the one the stack requires serves only once an embedder is configured." The provider is saved after the first restart because theai.embedder_*keys are contributed by the knowledge service itself (the note's "Alternatives not taken"), so the card's literal "and save an embedder provider" beside the token would name a step that cannot be done before the restart. The duplicate door's sentence is unchanged (the note: "What it answers where no knowledge service is registered … is unchanged").packages/spec/src/migrations/entries/semantic/19.knowledge-source-save-refused-while-knowledge-service-not-enabled.ts(notice only, no D2 conversion: the fix is the deployment's configuration). The changeset carriesregisteredwith that id.content/docs/ai/knowledge-rag.mdx(a "saved only while the service is enabled" bullet, and the no-service fix gains the embedder step);content/docs/protocol/knowledge.mdx(a "A service that is not enabled saves no source either" paragraph after the no-service one, which gains the embedder step).Tests
packages/services/service-knowledge/src/__tests__/knowledge-settings-contribution.test.ts, new describe inside PR 1's runtime-composed describe, booted onLiteKernel(6 cases): no embedder (503, the ruled words, no store half; system admitted; zero store calls); the duplicate door not refused for the held state; a provider saved without its key (cause plus ruled words); store not mounted (store half only, no embedder words); both halves; controls (enabled through a host embedder, and a host-mounted plugin: never refused for a held state).packages/runtime/src/domains/packages-knowledge-source-gate.test.ts, new describe on a realObjectKernelrunningKnowledgeServicePlugin({ runtimeComposed })with no embedder (5 cases): the boot reads it held;PUT /meta/knowledge_source/faqrefused 503 with the remedy,saveMetaItemnever called;POST /packages/pkg-a/move-inof the loose source refused with the save's remedy,moveIntoPackagenever called, the engine's move goes on;POST /packages/pkg-a/duplicatecopies; control: host-mounted plugin, the same save and move-in go on.packages/runtime/src/domains/meta-save-capability-gate.test.ts: the dispatcher PUT on a kernel registering a realKnowledgeServicesettled held on the store half (store sentence, no embedder words, nothing saved).packages/runtime/src/domains/mcp-authoring.test.ts:save_metadata_draftwith a realKnowledgeServicesettled held on the embedder half (503, the ruled words, nothing written).packages/rest/src/meta-write-door-capability-enumeration.test.ts: REST answers the service's held 503 verdict as sent (this package does not depend on@objectstack/service-knowledge; the sentence itself is pinned at the service and the runtime doors).packages/metadata-core/src/knowledge-source-save-admission.test.ts: the save door's no-service sentence orders "restart the server, save an embedder provider and restart again, then save the source again"; the duplicate's names no embedder.Acceptance notes
kernel:readyandkernel:bootstrappedthe reading is pending; a save that arrived then would not be refused for the held state (it is judged by the other gates, and the source is then held like any other). The save doors are served after the boot completes, so this is noted, not built.Verification
Code head
83d6c45081(the next commit,1ec1c93f, only copies the claim's Clause-② line into the changeset). Shared container; every build and test ran throughscripts/pm/os-verify-lock.sh. Branch offorigin/main696d02f5;mainhas gained three commits since (#38584, #38582, #38574), none touching a package this diff touches, so it is not merged in.83d6c45081: closure build (--filter '@objectstack/dogfood^...' --filter '@objectstack/cli...' --filter '@objectstack/lint...' --filter '@objectstack/client-react...') VERDICT command-exit 0;pnpm --filter @objectstack/dogfood testVERDICT command-exit 0 · Test Files 495 passed, 3 skipped (498) · Tests 4187 passed, 68 skipped (4255) · 0 failed.@objectstack/service-knowledgepnpm test: Test Files 24 passed, Tests 812 passed.@objectstack/metadata-corepnpm test: Test Files 29 passed, Tests 1118 passed.packages-knowledge-source-gate,meta-save-capability-gate,mcp-authoring): 3 files, 191 passed. RESTmeta-write-door-capability-enumeration: 82 passed.typecheckexit 0 for@objectstack/spec(afterbuild, which regenerates the migration registry with the new entry),service-knowledge,metadata-core,runtimeandrest. ESLint over every changed.tsfile: exit 0.Ablation
At
83d6c45081: the held guard inadmitAuthoredSourcewas edited toif (false && this.held && options?.door !== 'duplicate').knowledge-settings-contribution.test.ts: 5 failed / 48 passed (the five held-save cases; the controls stayed green). Restored withgit restore --source=HEAD --staged --worktree;git status --porcelainempty.Gates
dispatch-gates --ranat83d6c45081: 122 derived families accounted for, 121 run with exit 0, 1 NOT MEASURED:check:dual-build-cjs-loadsexits 3 (prerequisite: dist of packages outside this closure); CI runs it.pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.tsandcheck:skill-examplesfirst exited on a missingcreate-objectstack/client-reactdist, and passed (exit 0) after the closure build. Among the run:check-adr-0087-registration(1 declared-breaking changeset,registered knowledge-source-save-refused-while-knowledge-service-not-enabled, new here),check-changeset-no-major,check-empty-changeset, speccheck:upgrade-guide,check:spec-changes,check:api-surface,check:docs,check:doc-authoring,check-affected-docs,check:adr-anchors,check:error-status-conformance,check:type-check-debt,check:nul-bytes. PR body gated before opening:check-changeset-no-major,check-adr-0087-registration,check-closing-keyword-parity,check-partof-closing-keywordexit 0.overlap-checkbefore each push: VERDICT clean againstorigin/main.CI check-runs: not yet read (PR just opened).
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jREKp1JAmqK54ADBYS