Repository navigation
fix(knowledge): on a deployment with no knowledge service, duplicating a package copies its knowledge sources unserved - #39383
objectstack-fleet[bot] wants to merge 2 commits into
Conversation
…e duplicate copies each knowledge source unserved Claude-Session: https://claude.ai/code/session_01Utp6CXDYNpike5DVnd7xXE Co-authored-by: Claude <noreply@anthropic.com>
…, and that the service's whole verdict goes unasked with no service Claude-Session: https://claude.ai/code/session_01Utp6CXDYNpike5DVnd7xXE Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 1 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 — 190 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 6ec46bb33e8fb89bc86361385b43d91bb18b27af && git checkout 6ec46bb33e8fb89bc86361385b43d91bb18b27af
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8157fd7127a659e2147524f3f8e4bd3bccd6eeee d39f7c28b985d085c0b958af07498d57d6275fe9 && git checkout -B drift-repro 8157fd7127a659e2147524f3f8e4bd3bccd6eeee && git merge --no-ff d39f7c28b985d085c0b958af07498d57d6275fe9
node scripts/docs-audit/affected-docs.mjs --json 8157fd7127a659e2147524f3f8e4bd3bccd6eeee
|
Requested by Bill · project thread
Fixes #39346
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
The second of the card's two PRs. The dated note it builds is ADR-0161 K8's note of 2026-12-03 (PR #39354), on ruling 7380897321 on #38374.
packages/metadata-core/src/knowledge-source-save-admission.ts:authoredKnowledgeSourceRefusalanswersundefinedfordoor: 'duplicate'whenresolveKnowledgeServiceanswers nothing. One branch.noKnowledgeServiceRefusalloses itsdoorparameter and its duplicate wording, which nothing reaches any more. No door value added, no exported input added, signature unchanged.packages/runtime/src/domains/packages.ts,packages/runtime/src/knowledge-service-lookup.ts: docblocks only.packages/spec/src/migrations/entries/semantic/19.knowledge-source-save-refused-without-knowledge-service.ts: the package duplicate leaves the entry'ssurface;reasonsays a duplicate copies a source unserved.content/docs/protocol/knowledge.mdx: the paragraph "A deployment with no knowledge service saves no source" no longer says a duplicate is refused, and a new paragraph says what a duplicate does there.@objectstack/metadata-core,@objectstack/runtime,@objectstack/spec, patch.Unchanged, and pinned as unchanged: the save doors and the package move-in on a no-service deployment (503), the capability gate at the duplicate, the scoped-factory miss and the unresolvable service at the duplicate (503).
Tests
packages/metadata-core/src/knowledge-source-save-admission.test.ts:door: 'duplicate'with no service answersundefined; the same item atdoor: 'save'is still refused 503.packages/runtime/src/domains/packages-knowledge-source-gate.test.ts: the pin "a host with no knowledge service refuses a duplicate" is flipped. On a no-service host the duplicate answers 200 and the writer runs once; amanage_metadata-only caller is still refused 403;PUT /meta/knowledge_source/faqandPOST /packages/pkg-a/move-inare still refused 503SERVICE_UNAVAILABLEand neither writer runs.Runs at d39f7c2 (the two commits on main at 8157fd7), and the ablation
pnpm --filter @objectstack/metadata-core exec vitest run --maxWorkers=2 src/knowledge-source-save-admission.test.ts: 12 passed.pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/packages-knowledge-source-gate.test.ts: 89 passed.pnpm --filter @objectstack/metadata-core test: 31 files, 1163 passed (before the move onto the new main, at de99f05; the later commit is comments, docs and the changeset).typecheckof metadata-core and runtime: exit 0.pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/migrations: 255 passed, 2 todo.check:generated: exit 0.scripts/ablation-replace.mjswith the fix committed first: the branch put back toreturn noKnowledgeServiceRefusal(input.item), metadata-core rebuilt,ablation-dist-preflightfound the marker indist/. Both pins went red: 1 failed of 12, and 1 failed of 89 (the flipped pin). Restored, blob equal to HEAD, rebuilt, preflight--absentpassed, both green again.pnpm --filter @objectstack/runtime test:: the package suite did not finish inside the container's 10-minute foreground cap; it is CI'sTest Core.The card's premise on a booted kernel
Read before the first edit, on
mainat850d240bwith the Starter of PR #39340 (headca114a34) laid over the tree, on the Starter's install-test host (norequires), with a scratch test that was never committed.POST /packages/com.example.starter-copy/duplicateanswers 503SERVICE_UNAVAILABLE, namingbiz_articles;PUT /meta/knowledge_source/xanswers 503.knowledge_source starter_second_articlesamongcopied; thePUTstill answers 503.failedCountis 3, the three seeds of the seed defect package duplicate: every seed of the installed Starter is refused "Unrecognized key(s) on this seed: name", so the copy answers success:false #39341, which the ruling says to read as "answers 200 with the source copied".mainalone the Starter holds no knowledge source, so this reading needs PR feat(examples): the Starter help articles as a knowledge source, in the blank template too #39340's files; PR feat(examples): the Starter help articles as a knowledge source, in the blank template too #39340 gains the case as a kept test.Acceptance notes
packages/spec/src/migrations/entries/README.mdand ADR-0087 state no rule that forbids editing a landed entry's text, and the registration gate (check-adr-0087-registration) judges added entries only. Entry 19 sits in the current protocol major, and the upgrade guide andspec-changesare generated from the registry at publish. So the entry is edited in place under the same id: itssurfacestops naming a refusal the runtime no longer gives. A new entry was not added, because nothing new is refused or required.check:upgrade-guideandcheck:spec-changespass.admitAuthoredSourceare the service's too. The texts say so.classifyServiceOrLoud):resolveKnowledgeServiceForSavethen answers both misses as "nothing registered", so on such a deps a scoped registration with no instance for the environment now copies at the duplicate. The platform's dispatcher supplies the classified lookup, and the scoped refusal at the duplicate stays pinned through it. Stated in the lookup's docblock and the changeset.packages/runtimeis in the changeset for its docblocks only; no runtime code path changes there.check-plugin-teardown-shape --self-test(a shallow clone cannot reach its pinned fixture commit) andcheck:dual-build-cjs-loads(needs a whole-workspace build). Both are CI's.check:skill-examplesrefused first for a missingclient-reactbuild and passed after it.Verification
Read first: the branch in
authoredKnowledgeSourceRefusal(search for "the dated note of 2026-12-03" inknowledge-source-save-admission.ts), then the flipped pin inpackages-knowledge-source-gate.test.ts, then entry 19'ssurface.Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/packages-knowledge-source-gate.test.tsprints 89 passed.Local gates: the 121 commands
node scripts/pm/dispatch-gates.mjs --commandsderived for the diff. 118 exit 0;check:skill-examplesexit 0 on re-run; two not measured as above.Claim: comment 7383707710 on #39346 names this PR's branch,
claude/project-thread-krwejw. The first claim (7381239738) named the backup branch the PR 2 commits waited on while PR 1 held this branch.Generated by Claude Code