Skip to content

docs(adr-0161): a dated note under K8 — where no knowledge service is registered, the package duplicate copies each knowledge source unserved - #39354

Merged
os-zhuang merged 1 commit into
mainfrom
claude/project-thread-krwejw
Dec 3, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
claude/project-thread-krwejw

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Part of #39346. This is the first of the card's two PRs, the dated note; the code change follows in a second PR once this one is merged, and that one carries the card to its end.

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:这一份只改决策记录,用户无感;它记下「没有知识服务的自建环境里,复制带知识源的应用照常成功,副本里的知识源不生效」这条已裁的规则,代码在下一份里改。
  • 为什么做:属于「知识检索平台化」专题,是基础模板带知识源那张卡的前置;规则先写进决策记录,代码才能跟着改。
  • 出错会怎样:最坏是记录里的措辞和裁决有出入,后面的代码照着错的写;这一份只加文字,可以直接撤回。
  • 要你做什么:请批准这份决策记录的修订(受管文件,需要授权批准后由席位落地)。

What changes

One file, add-only: docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md.

  • A tenth Amended line in the header.
  • A dated note under the table of K8, placed directly below the note of 2026-11-28 on item 12, whose sentence it amends.

The note records ruling A on #38374 (record 7380897321, answering analysis 7380145720) and nothing past it:

  1. The sentence amended is the one under "◆ Ruled: an author's save" in the note of 2026-11-28: "What it answers where no knowledge service is registered, and to a caller who may not search what a source indexes, is unchanged". Only its first half changes.
  2. Where no knowledge service is registered, the package duplicate is not refused for that reason and copies each knowledge source unserved.
  3. A registered service that serves no instance in the request's environment, and one that cannot be resolved, keep their refusals. Where a service answers, its verdict is asked as before.
  4. An author's save is unchanged: ruling D of knowledge: what a knowledge_source saved at run time does on a deployment that mounted no knowledge service (split from #37306 item 4) #37983 stands, and the package move-in stays an author's save.
  5. The author-may-search gate is not asked for a duplicate on such a deployment; the capability gate is. The bound is stated in three facts: the copy lists the fields the installed source lists, nothing is built or embedded until an operator mounts the service and it is enabled, and every search asks the searcher's own gates.
  6. No notice field on the duplicate's answer; the boot's statement stays the statement.
  7. "Not in this note" names what the ruling did not decide, so the note is not read as deciding it.

The earlier note's text is left as written. The note adds no contract member, no door value, no exported input, no settings key and no capability token.

Tests

No code changes, so no test changes. The premise the card names was read on a booted kernel before the first edit, on main at 850d240b with the Starter of PR #39340 (head ca114a34) laid over the tree, on the Starter's own install-test host (no requires):

Readings
  • Today: POST /packages/com.example.starter-copy/duplicate answers 503 SERVICE_UNAVAILABLE, naming biz_articles and the stack's requires; PUT /meta/knowledge_source/x answers 503.
  • With the one branch changed (an uncommitted probe, restored afterwards): the duplicate answers 200 with knowledge_source starter_second_articles among copied; PUT /meta/knowledge_source/x still answers 503. The answer's failedCount is 3, the three seeds of the known seed defect, which the ruling says to read as "answers 200 with the source copied".
  • The probe needed no new door value, no new exported input and no touch on a save door.
  • On main alone the Starter holds no knowledge source, so the Starter itself reproduces the 503 only with PR feat(examples): the Starter help articles as a knowledge source, in the blank template too #39340's files; the refusal on main is the pin "a host with no knowledge service refuses a duplicate that copies a source 503" in packages/runtime/src/domains/packages-knowledge-source-gate.test.ts.

Acceptance notes

  • One sentence of the note is a reading of code, not of the ruling: that the boot's statement counts a copy "from the next boot" when the copy is among the published knowledge_source items. It follows from packages/objectql/src/knowledge-source-unserved.ts, which reads the published items once per boot; it was read, not run.
  • "Not in this note" says a source copied where no service was registered is not judged for its copier when a service is first mounted. That is today's behaviour for every source that arrives by a package install, stated so that the note is not read as promising a later judgement. The analysis lists it as not designed (its confidence gap d).
  • skip-changeset: docs/adr/** publishes nothing.

Verification

Read first: the new note (search the file for "Note (2026-12-03"), then the bullet "◆ Ruled: an author's save" of the note above it, then ruling record 7380897321 on #38374.

Two-minute check: git diff origin/main...HEAD --stat shows one file, 13 insertions, 0 deletions.

Local gates at b4cea7b2, the derived set for this diff (node scripts/pm/dispatch-gates.mjs --commands, 21 commands), all exit 0: check-adr-links and its self-test, check-closing-keyword-parity and its self-test, check-comment-mask-corpus, plan-test-core-shards --self-test, check:doc-formula-expressions, check:adr-anchors, check:adr-index, check:adr-symbol-anchors, check:ci-filter-parity, check:closed-ceremony-text, check:cross-package-test-inputs, check:doc-authoring, check:driver-memory-census, check:gitlink-declared, check:nul-bytes, check:pm-governed-merges, check:pm-prior-rulings, check:refd-timer-probe, check:watch-hint-literal. Everything else is CI's.

Tier H (docs/adr/**): this PR stays a draft and waits for a contract review of record and an authorized approval; the owning seat lands it.


Generated by Claude Code

… registered, the package duplicate copies each knowledge source unserved

Claude-Session: https://claude.ai/code/session_01Utp6CXDYNpike5DVnd7xXE
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Dec 3, 2026
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation labels Dec 3, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b4cea7b24c8b942f7d87748ed722b339027c5046
Local-runs: none
Scope: docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md + none
Security-touching: yes
Rule-change-verified: none

Round 1 on PR #39354 (card #39346, PR 1 of 2), written 2026-12-03T15:08Z by an isolated sub-agent of the seat. The implementing thread's conclusions were not taken as input: every statement below was read from the diff, the records and the tree.

What was read. PR #39354 (body, file list, the patch: one file, +13 −0, add-only); the ADR on the head, the header and K8 from the note of 2026-11-28 to the new note; card #39346 with its claim 7381239738 and the dev report 7382418187; on #38374 the decision analysis 7380145720, the ruling record 7380897321 and the comment after it (7381093692, the seat's serial-wait line, which changes no term); the 53 check-runs on the head, read at 2026-12-03T15:06Z: 26 success, 27 skipped, none failed, none pending. Read to judge the note and not reviewed, in the tree at 850d240b80 (the merge-base and the commit the note cites; the five cited files are byte-identical there, on the head and on main at 779ff419cf): packages/metadata-core/src/knowledge-source-save-admission.ts, packages/runtime/src/knowledge-service-lookup.ts, packages/runtime/src/domains/packages.ts (the duplicate and move-in doors, refuseKnowledgeSourcePackageWrite, refuseDuplicatedKnowledgeSources), packages/runtime/src/http-dispatcher.ts (where classifyServiceOrLoud is supplied), packages/objectql/src/knowledge-source-unserved.ts with its call in packages/objectql/src/plugin.ts, packages/metadata-protocol/src/protocol-package-commits.ts#duplicatePackage, and in packages/services/service-knowledge/src the admission verdict, the plugin's listing read and the source loader. The first consumer, the predicate change on claude/issue-39346-duplicate-no-knowledge-service-wip at de99f05b, was glanced at for agreement with the note and is not reviewed here.

Why the security line reads yes. The changed hunks teach which permission gate is asked of the caller of a package duplicate and which is not, on a deployment with no knowledge service.

① Derived judgments

The diff changes no accept-set and no public surface by itself: it is prose under docs/adr/. What it declares for the code PR, each judged against ruling record 7380897321:

  • Where no knowledge service is registered, POST /packages/:id/duplicate is not refused for that reason and copies each source unserved. Ruling term 1, as written. The note's "nothing loads, builds, embeds or searches it, and no search_knowledge tool is listed" is the state of the installed original on that deployment and holds in the tree: the loader and the tool belong to the service that is absent.
  • A registered service with no instance in the request's environment, and one that cannot be resolved, keep their refusals; a service that answers is asked its verdict. Ruling term 1, second sentence. The two refusals exist as cited (knowledgeServiceNotInScope, and the predicate's 503 on a lookup that throws).
  • An author's save is unchanged; the package move-in stays an author's save; the engine's write is not asked. Ruling term 2. Move-in asks the predicate with no door, so as a save, which is point 1 of 2026-11-29 in the note above.
  • The author-may-search gate is not asked there; the capability gate is; the bound is three facts. Ruling term 3, with the bound the ruling ordered into the note. Each fact was read. The duplicate's request carries the target id, name and namespace and nothing of a source (packages.ts, the duplicatePackage call). The capability gate is refuseKnowledgeSourcePackageWrite, which reads the caller's capabilities and the package listing and no knowledge service. The search-time gates are the header's "Leaves unchanged" line. "Mounts the knowledge service and it is enabled" is the ruling's "mounts and configures the service" in the 2026-11-28 note's own term.
  • No notice field; the boot's statement is the statement. Ruling term 4.
  • No contract member, no door value, no exported input, no settings key, no capability token. Right at this head: KnowledgeSourceSaveDoor reads 'save' | 'duplicate', and the first consumer changes one branch of one predicate and adds none of these.
  • Ruling term 5 (migration entry 19, the docs page, the docblocks, the pin) is the code PR's and is rightly absent from the note.

Nothing in the note narrows a term, and nothing is added that the ruling or the analysis it answers does not carry. The note marks no ◆ of its own: the character appears in the added lines only inside the quoted title of the earlier bullet and in the sentence "this note marks no ◆".

② Semver level

skip-changeset matches the diff: one file under docs/adr/, nothing published from any package; Check Changeset is green on the head. Metadata-protocol: none is right. The body declares Clause-②: yes (widening). This PR accepts and refuses nothing itself; the widening is the code PR's, which carries the changeset. The declaration over-states in the safe direction (it is what brought this review) and is left as it is; the precedent note PR #38401 declared no.

③ Boundary flags

The dev report (7382418187) has no open question, no classifier refusal and no security finding. Its flags, and the two sentences it asks the reviewer to read:

  • "From the next boot it counts a copy that is among them" is a code reading, not a run. Holds. announceUnservedKnowledgeSources runs once, at kernel:bootstrapped, and lists the type through the protocol's execution read; nothing calls it again while the process runs. A duplicate writes each copied item with mode: 'publish' (protocol-package-commits.ts), so the copy is a published item and the next boot's line counts it. The line names at most five items and counts the rest, so "counts" is the right verb.
  • "Not in this note": a source copied where no service was registered is not judged for its copier when a service is first mounted. Accurate as today's behaviour. The service's loader reads the published items and registers them; it asks no author and holds no record of who copied what, exactly as for a source a package install wrote. It is also inside the ruled option: the consequence line the maintainer chose reads 「配好知识服务后一起生效;这类环境不核对复制者的检索权限」. The analysis lists the opposite design as not designed (its gap d) and as option 4 not offered. So the sentence states a consequence of the ruling and promises nothing new. The other three items of that bullet (a notice field, moving the author's gates, any change to a save door) are the analysis's options 3 and 4 and the ruling's ban, named as out.
  • Status rework. The card is two PRs and this is the first; nothing is owed on this head for it.
  • Out of scope, noted and not filed: the migration README states no rule for editing a landed entry. It belongs to the code PR, whose review answers it; ruling term 5 asks the dev to say which rule applied.
  • The ruling. Record 7380897321 is written by the decision thread and records a choice on a decision card. This review read the record, not the choice itself. The PR is Tier H, so an authorized approval reads the note before it lands.
  • SQL push-down (Prime Directive 5). No finding. The patch adds no query, no id materialisation and no in-app join, and declares none.
  • Author. The PR's user.login is objectstack-fleet[bot].

Noticed for the code PR; none is owed in the note:

  1. resolveKnowledgeServiceForSave falls back to resolveServiceOrLoud for a deps with no classifyServiceOrLoud, and then answers both misses as "nothing registered". After the predicate change a scoped-factory miss on such a deps copies the source, where the note's "What still refuses the duplicate" says it is refused. The platform's dispatcher supplies the classified lookup (http-dispatcher.ts), so this reaches only a host's own deps or a test double. The code PR's docblock or a pin should say which it is (N3 below).
  2. With no service the whole of admitAuthoredSource is unasked, its adapter and reference arms included, not the permission arm alone. An installed source is in the same position, and the loader reports such a source when a service is mounted, so nothing new is given up; the code PR's texts should not read as if only the permission arm were skipped.

④ Design judgment

Against the ruling, term by term. See ①: five terms, four recorded and one rightly left to the code PR. The three quoted strings (the option, the card's question, the consequence line) are byte-equal to the ruling record. The quoted sentence of the 2026-11-28 note is byte-equal to that note, and that note is not edited: the patch is add-only and the closing line says the table and the earlier note are left as written.

Against the code it cites. Both symbol anchors resolve (knowledge-service-lookup.ts#resolveKnowledgeServiceForSave, knowledge-source-save-admission.ts#knowledgeServiceNotInScope), and check:adr-symbol-anchors is in the green set. "Until then main refuses such a duplicate 503, naming the stack's requires as the remedy" is the predicate's noKnowledgeServiceRefusal with door: 'duplicate', and the pin the PR body names exists. "An operator who later mounts the knowledge service and configures it gets both served" holds: the copy is a published, package-bound item, the loader registers it beside the original, and the enabling boot builds every held source (the 2026-11-28 note, "Enabling is an egress decision"). "The duplicate while the service is held tells its caller nothing either" holds: the answer has no notice field, and the held service does not refuse that door.

Against other records. ADR-0078 §1 forbids the silently inert and §4 keeps the runtime seam at a warning. The copy is inert and is named by the boot line from the next boot; between the duplicate and that boot nothing names the copy, though the same boot already named the original. That interval is ruling term 4, chosen with the notice field named as the alternative, so it is ruled and not a finding. ADR-0070 D4 (duplicate clones a base) is served by the change. Ruling D of #37983 is restated and left standing. Nothing in AGENTS.md is touched: the PR is a draft that stops for its tier's record, as Prime Directive 14 asks for docs/adr/**.

The header line. A tenth Amended line, after nine, in the shape of the others: date, card link, ordinal, where the note stands, what it amends, who decided and by which record, what it does not add, and the closing "The status line above is left as it is." It says the note amends one sentence of the earlier note, which is exact.

First consumer and execution plan. The first consumer is the code PR of the same card, written and waiting on this merge; it changes the one branch the note describes. The order (note first, Tier H, then code) is the ruling's.

Findings.

N1 (nit) — In "The sentence amended", the unchanged second half is glossed as "the service judges each source the duplicate would copy for the caller". A registered service with no admitAuthoredSource (one a host mounts itself) judges nothing and the duplicate goes on, as the predicate's docblock says. The next bullet has the exact condition ("Where a service answers, its verdict"). Nothing is changed by the gloss.

N2 (nit) — "the first answer of the door's lookup" for "nothing is registered". The lookup's docblock lists the resolved instance first; nothing-registered is the first of its two misses. The clause after the colon states the fact exactly.

N3 (nit, for the code PR) — the fallback lookup named in ③, item 1. The note is right for the platform's dispatcher; the code PR states or pins what a deps without the classified lookup answers.

No must-fix and no should-fix. The note is the reviewed file, so a fix to N1 or N2 would move the head; they are left as accepted deviations. N3 rides the code PR's review.

Implemented-by: session_01Utp6CXDYNpike5DVnd7xXE
Reviewed-by: session_01Utp6CaQsbKBMQtm6Tpsamd

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd

维护者速读

席位核对

ACCEPT · head b4cea7b24c8b942f7d87748ed722b339027c5046 · repo:objectstack@os-bill

  1. Shape: 1 file, +13/−0, docs/adr/0161-…md: a tenth Amended header line and a dated note under K8, below the 2026-11-28 note it amends. Within claim 7381239738 (PR 1 of 2; no Fixes line, the card stays open for PR 2).
  2. Premise measured: per dev report 7382418187, on a booted kernel, duplicate answered 503 before the change and 200 with the one predicate branch changed (PR 2's branch); no fork.
  3. Gates:
    • Check-runs at this head: 26 success, 27 skipped, 0 failed.
    • Contract review at CONTRACT_REVIEW_TIER: PASS 7382637091 at this head, no must-fix, no should-fix, nits N1–N3.
  4. Accepted deviations: N1 and N2 (glosses in the note whose next clause states the exact condition). Clause-②: yes (widening) over-states in the safe direction for a note-only PR; left as is.
  5. Out of scope: N3 goes to PR 2, which must state or pin how a deps without classifyServiceOrLoud answers a scoped-factory miss. The card thread is told.
  6. Landing: governed, Tier H (an ADR change that is not an add-only note). Review is requested from os-zhuang, and the seat lands after approval. PR 2 opens after this merges; knowledge: on a host with no knowledge service, the package duplicate copies each knowledge source unserved (ADR-0161 K8 dated note, then the predicate change) #39346 closes on PR 2.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd

Review request: 2026-12-03T15:10Z · os-zhuang, please approve at head b4cea7b24c8b942f7d87748ed722b339027c5046. Seat ACCEPT 7382690051 above; contract review PASS 7382637091 at this head. Governed as an ADR change (ADR-0161 note recording ruling 7380897321 on #38374). The seat lands it after approval.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 3, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-zhuang December 3, 2026 15:11
@os-zhuang
os-zhuang marked this pull request as ready for review December 3, 2026 15:14
@os-zhuang
os-zhuang added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 8157fd7 Dec 3, 2026
61 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-krwejw branch December 3, 2026 15:35
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 3, 2026
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/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants