Repository navigation
feat(knowledge)!: refuse a knowledge_source save that names an adapter the running deployment does not mount - #38060
Conversation
… the deployment does not mount Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
… both doors, its docs and migration entry Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
📓 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 — 177 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 c779266e780e496ef0eacba7ba7f8484c89e65d2 && git checkout c779266e780e496ef0eacba7ba7f8484c89e65d2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bbe4258649c1ea8492364413c0669f47140f7707 4646f87f5f5f24e6c31d6e102160aed717f49f71 && git checkout -B drift-repro bbe4258649c1ea8492364413c0669f47140f7707 && git merge --no-ff 4646f87f5f5f24e6c31d6e102160aed717f49f71
node scripts/docs-audit/affected-docs.mjs --json bbe4258649c1ea8492364413c0669f47140f7707
|
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP CI receipt · area o1-C · 2026-11-28T00:55Z · head The one failure is |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP CI receipt · area o1-C · head The one rerun of |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · 0b2a3bc · 2026-11-28T02:06Z |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: Inputs read: card #37961 (body and its three comments: triage 7227578818, claim 7227637048, dev report 7230978235), PR #38060 (body, file list, comments), the net diff from merge-base ① Derived judgments
② Semver levelClause-②: no (narrowing)
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. The narrowing against the published spec on The
The implementing file, against the contract:
Tests in the diff: the unit cases drive the real Nits (no effect on correctness or the contract):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT on merits at head Review summaryContract review. I adopt record 7232224061 at this head: PASS at the contract tier (
Entry 19 and #38013. The two PRs do not collide. Dogfood. The full battery is pinned to this head and green: 491 files passed, 3 skipped; 4148 tests passed, 68 skipped; no failures (7230978235). Dogfood shards do not run on a PR, so this run is the evidence. CI. One red check: Test UI (1/16),
Nits, optional:
Next: this is a narrowing, so it goes to the seat for the Tier H approval. The PR is still a draft. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Seat record · 2026-11-28T02:18Z · PR #38060 (Fixes #37961) · head 维护者速读
Seat opinion: land. 席位核对 — ACCEPT · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Approval request · @os-zhuang: a
One check is red and is not this PR's: |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · 4646f87 · 2026-11-28T04:33Z |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: Delta record. It follows record 7232224061 (PASS at Inputs read: card #37961 (body and its three comments: triage 7227578818, claim 7227637048, dev report 7230978235), PR #38060 (body, re-read after its ① Derived judgmentsWhat moved, each measured with git and not taken from the brief:
What main brought in between the two bases (30 commits), read against what the earlier record rests on:
Gate verdicts on this head: every check-run is success or skipped; none is red and none is pending. The dogfood shards are still skipped on a pull request. The dev's battery (7230978235) is pinned to ② Semver levelClause-②: no (narrowing)
③ Boundary flags
④ Design judgmentS1 (should-fix): closed It closed by an edit to the PR body, with the head unchanged at No must-fix, no should-fix. The contract of the diff is the one record 7232224061 judged, and every judgment of that record holds at this head for the reasons in ①: the hunks are the same, the function they sit in is byte-identical, the helpers and the four doors they rest on were not touched by main, and the entry, the changeset and the two docs hunks are unchanged. The narrowing, its semver level, the Nits: N1 to N4 of record 7232224061 are unmoved and are not restated; N2 and N3 now have a carrier, #38158. No new nit. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs @os-zhuang please re-queue this PR once · 2026-11-28T04:42Z The queue's Governed Surface Queue Guard refused it at 2026-11-28T04:21Z (run 46104730032) on one point only: no |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Correction to 7234210142 · 2026-11-28T04:43Z "The tests in that build were green" overstates it: that queue build stopped at the guard, so the full suite has not yet run on this head. The re-queue runs it, Dogfood Regression Gate included. |
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP
Fixes #37961
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #38158 —
skills/objectstack-ai/SKILL.md§ Knowledge Sources (itsadapterrow, added onmainby #38053) does not yet name this PR's save refusal of an unmounted adapter; #38158 teaches it there.content/docs/ai/knowledge-rag.mdxandcontent/docs/protocol/knowledge.mdxname the refusal here维护者速读
What changes
packages/services/service-knowledge/src/knowledge-service.ts,admitAuthoredSource): aknowledge_sourceitem whoseadapteris a string naming no adapter the running deployment has registered is refused400 VALIDATION_ERROR. The message names the source, the adapter and the mounted adapters, as a rule and its remedy: "it names adapter 'ragflow', which this deployment does not mount (mounted: memory), and a source'sadaptermust name a mounted store. Name one of 'memory' as itsadapter, or leaveadapterout, and the deployment's store holds it, or mount the 'ragflow' store and save it again." Leavingadapterout is offered only where an omitted adapter would be placed (the deployment's store is mounted, or one adapter is). The hunk sits beside the existing unplaced-source check (several adapters, none the deployment's), the other "which store holds it" refusal, and reads the registry at request time, after every store'sstart(): nothing is recorded.adapter(legal since the deployment's-store change; it is placed byadapterIdFor); a named adapter that is mounted.authoredKnowledgeSourceRefusal(@objectstack/metadata-core), unchanged:PUT /meta/knowledge_source/:nameon both transports, the MCPsave_metadata_drafttool, and the package duplicate (refuseDuplicatedKnowledgeSources), which judges each source it copies for the caller and now refuses a copy whose source names an unmounted adapter, as it already refused an unplaced one.isSystem, skipped byauthoredKnowledgeSourceRefusalbefore the knowledge service is asked); a source registered in code (registerSource,KnowledgeServicePlugin({ sources })), which registers atinit()before its store'sstart(), so "not mounted yet" is no verdict there;objectstack validate, which runs with no deployment. For those,reportUnmountedAdaptersat boot (error) and the503 SERVICE_UNAVAILABLEat index and search stay the signal.admitAuthoredSource, so the no-service refusal that feat(metadata-core)!: a knowledge source is saved only on a deployment that mounts the knowledge service #38013 adds (503) comes before this one (400). InsideadmitAuthoredSource: no identity (403), then the unplaced source (400), then this check (400), then no data engine (503), then the exposure and field gates (403/503). The code is the existingVALIDATION_ERROR, the sibling unplaced refusal's code: no new error code.content/docs/ai/knowledge-rag.mdx(the not-mounted bullet) andcontent/docs/protocol/knowledge.mdx(the "Named" binding rule and guard two, source admission at save).knowledge-source-unmounted-adapter-refused-at-save(packages/spec/src/migrations/entries/semantic/), registered by the changeset.Tests
packages/services/service-knowledge/src/__tests__/knowledge-source-admission.test.ts, in theadmitAuthoredSourcedescribe, through the realKnowledgeService: a retired (ragflow), mistyped (memroy) and empty adapter are each refusedVALIDATION_ERROR/400naming the source, the adapter andmounted: memory; the refusal comes before the field gate; the system context is admitted; with none mounted the message saysmounted: none, with two it names both; CONTROL: a mounted adapter, and an omitted one (deployment's store, two registered), are admitted. One existing fixture (new KnowledgeService({})in the fail-closed case) now registers thememoryadapter its item names, so it still reaches the no-engine503it pins.packages/qa/dogfood/test/knowledge-source-unmounted-adapter-save.dogfood.test.ts, a real booted showcase (knowledge service plusmemory) with the MCP server:PUT /meta/knowledge_sourcerefusesragflowandmemroy400 VALIDATION_ERROR, nothing stored (GET404, not registered); MCPsave_metadata_draftwith a real OAuth token (metadata:write actions:execute) refusesragflowthe same way, and no draft is stored; CONTROL: a namedmemorysource and an omitted-adapter source save at both doors.Local runs on head 0b2a3bc (all under os-verify-lock)
pnpm exec turbo run build --filter='@objectstack/dogfood^...' --concurrency=2: exit 0 (coversservice-knowledge^...).service-knowledge: vitest Test Files 18 passed (18), Tests 573 passed (573);typecheck(tsc pluscheck:test-typecheck) exit 0.metadata-core: Test Files 29 passed (29), Tests 1111 passed (1111); typecheck exit 0.mcp-authoring,meta-save-capability-gate,packages-knowledge-source-gate,meta-type-write-capability-parity: 4 files, 195 passed; restmeta-write-door-capability-enumeration,meta-type-write-capability: 2 files, 135 passed.specsrc/migrations: 5 files, 206 passed. New dogfood file: 4 passed (4).pnpm --filter @objectstack/dogfood test, no shard, no path):VERDICT command-exit 0, held the lock 2405 s; Test Files 491 passed, 3 skipped (494); Tests 4148 passed, 68 skipped (4216).Ablation: the check removed, both layers red; restored, green
Through
scripts/ablation-replace.mjs(anchor hit, restore trap) on the conditionif (typeof authoredAdapter === 'string' && ...), prefixed with an always-false string comparison carrying the markerABLATED_UNMOUNTED_CHECK.src; marker count 1 on disk): 2 failed, 43 passed (45). Red: the two refusal cases (ragflow: expected { admitted: true } to match object { admitted: false, ... }). Green: the CONTROL.service-knowledgerebuilt,ablation-dist-preflightfound the marker indist/(exit 0); dogfood file 2 failed, 2 passed (4). Red: the PUT leg (Saved knowledge_source 'ks_retired_store' ... expected 200 to be 400) and the MCP leg. Green: the booted-store check and the CONTROL.dist/and is discarded; the unit leg of that attempt is the one above.git diff HEADempty,git status --porcelainempty, rebuilt,ablation-dist-preflight --absentexit 0, unit file 45 passed, dogfood file 4 passed.Acceptance notes
knowledge-source-admission.tsforadmitAuthoredSource; on 8d34c44 that function lives inknowledge-service.ts, beside the other adapter refusals. The admission module (knowledge-source-admission.ts, the gates) is untouched, so fix(lint)!: knowledge-source review follow-ups: absent platform objects refused at publish, ai_context accepts id, search refusal names list #38038's gate-2 rewording and fix(service-knowledge)!: retire the knowledge field gate's title arm behind a per-source recipe proof #37963 do not meet this hunk; overlap-check reads clean against both.metadata-coreknowledge-source-save-admission.tsneeded no threading: the verdict carriesstatus/code/message, which the doors already pass through.503until it is saved again.Verification
Read first: (1)
knowledge-service.tsthe new hunk after the unplaced-source check inadmitAuthoredSource, andunmountedAdapterSaveText(remedy wording); (2) the dogfood file's MCP leg (token,save_metadata_draft); (3) the semantic migration entry.Two-minute check:
pnpm --filter @objectstack/service-knowledge exec vitest run --maxWorkers=2 src/__tests__/knowledge-source-admission.test.tsshows 45 passed, three of them the new unmounted-adapter cases.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 118 families, all run locally on 0b2a3bc, exit codes captured before any pipe.--ran: "118 derived famil(ies) accounted for — 115 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3)".check:skill-examples, reason: it readspackages/client-react/dist, outside the dogfood closure built here (PREREQUISITE NOT MET).check:dual-build-cjs-loads, reason: it needs a whole-treedist/build (PREREQUISITE NOT MET).check:type-check-debt, reason: its re-measure build waited on the shared verify lock while this branch's battery held it, and exited 3.check:skill-frame-freshnessexit 0;check:dev-prereqsexit 1, "38 of 110 workspace packages declare an entry point under dist/ that is not on disk" (only the dogfood closure is built in this worktree; a local reading, not a finding).check:adr-0087-registration: "1 declared-breaking changeset(s), each carrying an ADR-0087 disposition ... registered knowledge-source-unmounted-adapter-refused-at-save (new here)".overlap-checkbefore the PR: "VERDICT clean exit 0" against origin/main 27ee984 and six open PR heads (feat(knowledge-turso): an approximate vector index for a large source of one organization #38056, docs(knowledge): the 18 to 19 id row names the underscore exception and the dropSource cleanup #38050, fix(lint)!: knowledge-source review follow-ups: absent platform objects refused at publish, ai_context accepts id, search refusal names list #38038, feat(metadata-core)!: a knowledge source is saved only on a deployment that mounts the knowledge service #38013, fix(knowledge-turso)!: Test connection comes with the Turso fields it checks; the group text drops the cloud fallback #37982, fix(service-knowledge)!: retire the knowledge field gate's title arm behind a per-source recipe proof #37963).Generated by Claude Code