Repository navigation
fix(service-knowledge): a package duplicate the knowledge service itself refuses is told the source cannot be copied, and to duplicate the package again - #38341
Conversation
…orm knowledge service's verdict Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
…vice's own verdict for its caller Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
…s the service with its door Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 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 — 34 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 daba81a88d957df2230984cc6911b5f22f028a24 && git checkout daba81a88d957df2230984cc6911b5f22f028a24
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ad3d04f020303056224651c052109c61c18db13d 221e401b1127827ce46f6e07ef4901627127adc8 && git checkout -B drift-repro ad3d04f020303056224651c052109c61c18db13d && git merge --no-ff 221e401b1127827ce46f6e07ef4901627127adc8
node scripts/docs-audit/affected-docs.mjs --json ad3d04f020303056224651c052109c61c18db13d
|
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: The review is owed by the declaration alone ( ① Derived judgments
② Semver level
③ Boundary flags
N1: the new No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT at head Review summary
Next: Tier S. The area marks it ready and lands it once every check is green at this head. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Landing · area o1-C · head
State: ready + auto-merge; #38210 closes on merge via |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46157343305 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
…'s duplicate-door sentence Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: A delta on the declaration face, ① Derived judgments
② Semver levelThis delta adds no published surface. The changeset is unchanged: ③ Boundary flags
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT (delta) at head
Next: Tier S. The area re-queues it once every check is green at this head. #38353 was ejected only behind this PR, and needs only a re-queue. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Landing (re-queue) · area o1-C · head
The queue ejection (build 46157343305) was a semantic conflict with #38224's duplicate-door case, fixed at this head. On this head |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46164293751 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Landing (re-queue) · area o1-C · head The second ejection (queue build 46164293751, |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Landing (re-queue) · area o1-C · head The third removal was |
Fixes #38210
Clause-②: yes (widening) —
@objectstack/service-knowledge'sKnowledgeService.admitAuthoredSourcetakes an optional third inputoptions: { door?: 'save' | 'duplicate' };@objectstack/metadata-core's exported interfaceKnowledgeSourceSaveAdmitter.admitAuthoredSourcedeclares the same optionaloptionsinputMetadata-protocol: none
维护者速读
What changes
@objectstack/service-knowledge.admitAuthoredSource(item, ctx, options?)readsoptions.door. One table,AUTHORED_SOURCE_DOOR_WORDING, holds what each door's caller is told. Itssaverow is today's text, and any value other than'duplicate'reads assave. Withdoor: 'duplicate':whereandcontent/metadataFields) tell the caller to remove the field and duplicate the package again, or to have someone who may query it duplicate the package. The display-field arm says "Have someone who may query it duplicate the package.";@objectstack/metadata-core.authoredKnowledgeSourceRefusalpasses{ door }to the service'sadmitAuthoredSourceonly for a door other thansave. The/metasave and the MCP draft save still ask with(item, context)alone, so their sentences and the arguments they send are unchanged. The duplicate door's prefix (Duplicating package "ID" is refused, and nothing was copied.) is the only place that says nothing was copied.@objectstack/runtime, test-only. A new devDependency on@objectstack/service-knowledge(no cycle: service-knowledge depends on neither runtime nor anything that depends on it), plus a source alias invitest.config.tsbeside the other dev-only service aliases. The duplicate door inpackages/runtime/src/domains/packages.tsalready passeddoor: 'duplicate'and is not edited.Read first (by risk):
packages/services/service-knowledge/src/knowledge-service.ts,AUTHORED_SOURCE_DOOR_WORDING: thesaverow must reproduce today's bytes in every arm.packages/metadata-core/src/knowledge-source-save-admission.ts: the conditional third argument (a save sends two arguments, as before).packages/runtime/src/domains/packages-knowledge-source-gate.test.ts, the new top-level describe at the end: the real-kernel pins and the byte-exact save controls.Tests
All runs are at head
677ed7a5ca4(after mergingorigin/main) unless marked otherwise.runtime, real kernel (packages-knowledge-source-gate.test.ts, new top-level describe). AnObjectKernelrunsKnowledgeServicePluginover host doubles for the engine, the security service and the metadata protocol. Four arms reach the service's own verdict: the 503 transient (the schema read throws), the 403contentfield, the 403wherefield and the 403 display field.Duplicating package "pkg-a" is refused, and nothing was copied. The knowledge source "faq" cannot be copied:. It has nosave the source,save it again,Nothing was written,was not savedorthe save.nothing was copiedoccurs exactly once. It tells the caller to duplicate the package again (display field: someone who may query it duplicates the package).duplicatePackageis never called.PUT /meta/knowledge_source/faqis pinned to the full literal message, status and code. Nothing is saved.(item, ctx, { door: 'duplicate' }).service-knowledge(knowledge-source-admission.test.ts):door: 'duplicate'across eight arms (content, where, display field, gate throws, security answers neither, no identity, unmounted adapter, disabled package). Each keeps the save's status, code, object and field, has no save wording, and carries its remedy. Asked withdoor: 'save', each arm equals the no-door verdict.metadata-core(knowledge-source-save-admission.test.ts): the duplicate door hands{ door: 'duplicate' }to the service. A save, withdooromitted or'save', calls it with exactly[item, context].5f857ffe4be.knowledge-service.tswas restored to the basef19350b410blob (hash22f53d295bequals the base blob) and the runtime file was re-run. All 4 duplicate pins went red and the 4 save-door controls stayed green (Tests 4 failed | 79 passed (83)). So the save door's bytes equal the base's, and the pins depend on the door wording. Restored withgit restore --source=HEAD --staged --worktree: blob6e9f33f7c5equals HEAD, andgit status --porcelainwas empty. The suite is green again on the final head (below).Package runs at 677ed7a
pnpm --filter '@objectstack/runtime^...' build --concurrency=2: exit 0.pnpm --filter @objectstack/runtime exec vitest run --project local --maxWorkers=2overpackages-knowledge-source-gate,meta-save-capability-gate,mcp-authoring,meta-type-write-capability-parity:Test Files 4 passed (4),Tests 210 passed (210).pnpm --filter @objectstack/service-knowledge test:Test Files 19 passed (19),Tests 683 passed (683).pnpm --filter @objectstack/metadata-core test:Test Files 29 passed (29),Tests 1118 passed (1118).pnpm --filter @objectstack/service-knowledge typecheck: exit 0, test layer 0 errors.pnpm --filter @objectstack/runtime typecheck: exit 0,27 file(s) / 183 error(s) / 66 pinned signature(s) held(unchanged ledger).pnpm --filter @objectstack/metadata-core typecheck: exit 0 (at5f857ffe4be;origin/maindid not touch the package).Derived gates at 677ed7a
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 86 commands. All were run, each exit captured before any pipe.--ranprinted:86 derived famil(ies) accounted for — 84 run, 2 NOT-MEASURED.check:test-source-alias,check:cross-package-test-inputs,check:undeclared-dep-imports,check:published-files,check:dts-closure,check:workspace-manifest-cycles,check:query-options-erasure,check:nul-bytesandcheck:empty-changeset.check:dual-build-cjs-loads, reason:PREREQUISITE NOT MET, because the gate reads every package'sdist/and this worktree built only the runtime closure.check:type-check-debt, reason: its closure build waits on the shared verify lock, and the local timeout fired first.Lint & Repo Gates.Acceptance notes
runtimesuite. Only the four files that assert this gate's calls ran. CI'sTest Coreruns the rest.Verification
Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run --project local --maxWorkers=2 src/domains/packages-knowledge-source-gate.test.ts. Expected:Tests 83 passed (83), including eight cases under/packages duplicate and /meta save on a real kernel running KnowledgeServicePlugin.Generated by Claude Code