Skip to content

docs(adr): ADR-0161 dated note — a knowledge source declares rerank; the knowledge service reranks after the permission re-check - #38764

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-38760-adr-0161-rerank-note
Nov 30, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/issue-38760-adr-0161-rerank-note

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #38760
Refs #38750

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用户无感;知识平台边界那份架构决策记录里追加一条 2026-11-30 的说明,写明知识源可以声明自己的检索结果要重排、用哪个重排模型由部署方配置、由知识服务在权限复核之后统一重排,不改任何代码。
  • 为什么做:这是知识检索重排专题的第一步,把你当天说的「有就用」和「开了开关,一律重排」写进决策记录,后面几步的实现才有依据。
  • 出错会怎样:说明里若有和你的裁决不一致的句子,后面做实现的人会照着错的文字去做;它只是一处文档追加,可以直接撤回,不影响任何在运行的系统。
  • 要你做什么:请你审阅并批准这条说明;它改的是受管的决策记录,你批准它,由知识服务在权限复核之后重排这一条就算正式记下,不再另开决策卡。

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 gains its sixth dated note: 28 lines added, none changed and none removed (614 lines to 642).

The note records the maintainer's rulings of 2026-11-30 on the epic for knowledge retrieval rerank. A knowledge source may declare that its searches are reranked. The deployment configures the reranker, and no source names a model. The knowledge service reranks, after the permission re-check and before the cut to topK. The adapter contract does not change.

Five insertions, in the form the five earlier notes of this record use. Line numbers are at head 6552e290.

Lines Where What is added
24 Header, after the **Amended** line of the fifth note A sixth **Amended** line, dated 2026-11-30. It names what the note amends, the maintainer's words with their times, and ruling record 7276086125.
142 to 161 K1, under "What follows from the two lists" The note itself: an opening paragraph, 16 bullets and a last paragraph.
186 K2, under "The rule for all of them" A cross-reference. Three rows of the table name rerank and are read with the note.
281 K4, in the cross-reference block that is already there A cross-reference. One more source key is declared, source.retrieval.rerank.
468 K8, under the note of 2026-11-30 A cross-reference. Rule 4 and three sentences of that note are read with the note.

Each amended place

No existing line is edited. This record's convention is add-only, so the note quotes the old sentence and states how it reads from the merge. The two sentences marked "new sentence" are the note's own wording. Every other entry in the third column is the note's reading of a text it leaves as written.

In the last column, "body 1" to "body 3" are items 1 to 3 under "Rulings" in the body of the epic, which record the maintainer's 「有就用」 (10:13Z) and 「所以还是应该按照主流系统的做法,开了开关,一律重排」 (10:37Z). "D1" to "D4" are the first four of the six decisions of the epic that he answered with 「全部同意」 (10:47Z), as ruling record 7276086125 on the epic records them.

Place, with its line on main at acf3b33e Old sentence New sentence or reading Ruling
K1, the "Rerank" row of the adapter's table (104) "Whether a second model reorders candidates, and which." Reading: neither is the adapter's. Whether: a knowledge source declares it. Which: the deployment configures the reranker, and no source names a model. The knowledge service reranks, after the permission re-check and before the cut to topK. The row keeps the adapter's own search. body 1, D1
K1, the second sentence of the list (112), as the note of 2026-11-29 left it (119) "The service does not choose a model, compute a vector, compute a score for a candidate, rerank or parse a file. It may re-order the hits it is about to answer by the ordering their source declares against a fact about the caller that the platform resolves, by position alone, and it changes the order the adapters answered in no other way." New sentence: "The service does not choose a model, compute a vector, compute a score for a candidate or parse a file. It may re-order the hits it is about to answer in two ways, and it changes the order the adapters answered in no other way: by the ordering their source declares against a fact about the caller that the platform resolves, by position alone; and by reranking them, where their source declares it and the deployment has configured a reranker, after the permission re-check and before the cut to topK." D1, body 1 and 3
The note of 2026-11-29, one sentence (119) "This is not rerank, which stays the adapter's in the table above: the service reads no passage text and calls no model to do it." Reading: the re-order by a declared ordering is still not rerank, and the service still reads no passage text and calls no model to do it. Rerank no longer "stays the adapter's". To rerank, the service hands the question and passage text to a model. D1
The title (1), the D1 key-words line (9) and TL;DR item 1 (41) Each says that adapters own rerank. Reading: the word "no longer covers whether the hits of a search are reranked, by which model, or by whom, and it covers only what an adapter does inside its own search". body 1, D1
K2, three rows (149, 153, 157) "Engines are integrated for embedding, hybrid retrieval, rerank and file parsing."; the "no rerank" of the §3.4 row; "Embedding calls, vector storage, hybrid retrieval and rerank stay the adapter's." Reading: the first stays true as a sentence, because a reranker is an engine the deployment brings, and it is the knowledge service that calls it. The §3.4 row keeps its "no rerank", because the adapter contract carries none. Of the third, the first three stay the adapter's and reranking is the service's. Each text is rewritten by the PR whose code makes the new sentence true. D1
K8, rule 4 (417), as the note of 2026-11-30 left it (422) "Which provider, which key, how to batch, rerank toggles and parser options stay in the adapter's own plugin options. Hybrid weights are declared by the knowledge source. A parameter of one search request is not configuration." New sentence: "Which provider, which key, how to batch and parser options stay in the adapter's own plugin options. Hybrid weights are declared by the knowledge source, and so is whether its searches are reranked. The reranker is the deployment's configuration, and no source names a model. A parameter of one search request is not configuration." body 1
The note of 2026-11-30 under K8, three sentences (422, 438) 「K8 第 4 条:「hybrid weights」改划给知识源声明;rerank toggles、parser options 照旧留在驱动。」; under 「永远不进知识源协议」, 「融合算法及其常数、重排、分数阈值、分词器。平台以后如果统一做重排,那是知识服务的配置。」; "Rerank, a score threshold, a tokenizer and the fusion algorithm with its constant never enter the source (section 六, above)." Reading: "Of rerank, a switch enters the source and nothing else does: no source names a reranker or a model. That switch is not an adapter's option. The fusion algorithm with its constant, a score threshold and a tokenizer still never enter the source, and parser options stay the adapter's." The sentence 「平台以后如果统一做重排,那是知识服务的配置。」 stands. body 1; these words are later than the rulings that note records (06:00Z to 07:57Z)

What the note states beside the amended readings

Each is quoted in the note from the words named here.

  • The source key. source.retrieval.rerank, an optional boolean, in the source.retrieval group the fifth note declares (body 1).
  • No reranker is configured. The search runs normally, the report marks the source with the reason no_reranker in notReranked, and saving or publishing the source shows a notice. It is never a refusal and never fewer hits (body 2; the two names are the ruling record's).
  • A reranker is configured and the source declares it. Every search is reranked. Only 0 or 1 candidate makes no call and sets no marker. At most 50 passages are sent per search (body 3).
  • A configured reranker fails or times out. The adapter order is kept, the source is marked failed, there is one attempt under a limit of 3 s, and it is not a coded refusal (D2).
  • One model and one wire format for v1 (D3). The note names neither.
  • A hosted deployment. Hosted reranking comes after row 6 of the epic shows a gain, or a hosted customer asks. Until then a hosted source that declares rerank is searched normally and marked (D4).

Left to the rows of the epic by name, under "Not in this note": the hosted recipient and its charging (D5, which is not decided); how a deployment states its reranker and what the knowledge service calls it through (rows 2 and 3); how many candidates are reranked under the ceiling of 50; how a rerank and a declared affinity follow one another; how the hits of several sources stand against each other; what notReranked looks like on the report and in the answer of search_knowledge; how the notice is shown; a per-search argument on the tool.

No file under packages/, content/, skills/ or ui/ changes, and no other ADR does. The note declares; it builds nothing.

Why

The epic puts the record before the code. Its row 1 is this note, and the first decision of ruling record 7276086125 says of it: "Accepting row 1's ADR-0161 note records it; no separate decision card." Until this note merges, the ADR gives rerank to the adapter in every place the table above lists, and rule 4 of K8 keeps "rerank toggles" in the adapter's plugin options. Row 2 of the epic brings the key with its reader, and it needs the record to say so first.

Tests

The diff touches no package, so there is no build closure to make and no package test or type-check owed. What was measured on the text itself, at head 6552e290:

  • Quotations. A script compared every quoted span of the 28 added lines with its source, read over REST or from the ADR at the base. The added text holds 16 spans in corner brackets: each is a verbatim substring of the body of the epic, of ruling record 7276086125 or 7276461244, or of the ADR at the base where it already quotes the record of the fifth note. 0 mismatches. It holds 50 spans in double quotation marks: 48 are verbatim in one of those sources, and 2 are the note's own wording, which are the two "new sentence" entries of the table above.
  • Bytes. The added lines hold no raw control byte, no HTML comment and no model identifier.
  • The reading of main the last paragraph of the note cites, taken at acf3b33e31. packages/services/service-knowledge/src/knowledge-service-search.ts#searchByKey re-checks the hits as the caller (applyPermissionFilter), orders them by a declared affinity (affinityOrderFor) and cuts them to topK, with no rerank between. Tests aside, in packages/services/service-knowledge/src and the src of knowledge-memory, knowledge-pgvector and knowledge-turso, the word rerank is on one line, which is the class note K2 lists. The control word embed is on 412 lines, so the search reads those directories.
  • Anchors. Every code citation in the note is a path with a symbol, never a line number, and check:adr-symbol-anchors reads all of them (its verdict line is below).

No ablation: the diff changes no behaviour a test pins.

Acceptance notes

Against the card's acceptance lines.

  1. "Every amended sentence agrees with the design on 专题:知识检索重排(rerank):知识源开关 + 部署配置模型,开了就一律重排 #38750 (option B) and with rulings D1 to D4." The table above gives each amended place with the ruling it rests on.
  2. "No sentence promises row 2 behaviour that the epic does not rule." The note states no pool size, no widening factor, no order between rerank and affinity, no settings key name and no shape for the reranker contract. Each of these is named under "Not in this note" and left to its row.
  3. "The Amended line is dated." Line 24, dated 2026-11-30.
  4. "The note does not change any other ADR. It adds no code." One file changes.

Five things for the approver to weigh. The note marks no ◆, because each of these rests on a text this record or the epic already has. They are the places where the wording is the note's and not a quotation.

  • a. What the "Rerank" row keeps. The note says the row keeps "the adapter's own search", and rests that on two sentences this record already has: "how candidates are found" (the "Hybrid retrieval" row) and "Changing the adapter changes how candidates are found and ranked" (Consequences).
  • b. "The declaration is not silent (ADR-0078)". A source that declares rerank where no reranker is configured is accepted and its search is answered. The note reads body 2 against ADR-0078: each such search says that its source was not reranked, and the author is told on save and on publish.
  • c. Nothing is registered in K8. The note says that the reranker's contract, client and settings (rows 2 and 3 of the epic) are not members of the adapter contract. It rests that on K8's own definition, under "What counts as a member": a member is what an adapter author must read, and no adapter reads these.
  • d. A cross-reference under K4. The card's list of places does not name K4. This record gives every new source key a cross-reference there, as the fifth note did for source.retrieval, so one was added. It changes no sentence of K4.
  • e. The K2 rows are read through a cross-reference and are not edited. Draft feat(spec): a knowledge source declares its retrieval mode; an adapter reports the modes it runs #38720 edits the K2 row at line 153 in place, with the code that makes its new sentence true. This note's sentence about that row, that it keeps its "no rerank", holds for the row as it is on main and as feat(spec): a knowledge source declares its retrieval mode; an adapter reports the modes it runs #38720 leaves it.

The names D1 to D6. This record already writes "ruling D1", "ruling D2" and "ruling D5" for rulings of its own. The note therefore writes the six decisions of the epic as #38750 D1 to #38750 D6, and says in its opening paragraph that none of them is a ruling of this record. It writes row N of #38750 for the same reason.

The card's line numbers, read on main at acf3b33e. All twelve lines the card names (1, 9, 41, 104, 112, 119, 149, 153, 157, 417, 422, 438) exist and carry the text the card expects. Two labels are exchanged: the card gives 422 for rule 4 of K8 and 417 for the note of 2026-11-30. On main, rule 4 is line 417, and line 422 is that note's bullet "Rule 4, amended", which carries 「永远不进知识源协议」. Line 438 is that note's bullet "Not in this note". No line moved.

Overlap with the open drafts on this file. node scripts/pm/overlap-check.mjs --repo=objectstack-ai/objectstack, run at 6552e2905b before the push, printed VERDICT clean exit 0. It read origin/main at acf3b33e31 and the six open heads that change this file (#38745, #38732, #38730, #38722, #38721 and #38720), and each merges cleanly with this branch. The order expected exit 1 against #38720. It is clean because the note is add-only and inserts at none of the lines #38720 changes. It was run again before this pull request opened, with origin/main at 8426fa0c89 (one commit later, which does not change this file): the same six heads, each merging cleanly, VERDICT clean exit 0. The landing order is the card's: after #38720.

Not done here. content/docs/protocol/knowledge.mdx and the class note of KnowledgeService are rewritten by the rows whose code makes their new sentences true. There is no changeset: docs/adr/ is published by no package, and the PR carries skip-changeset.

Verification

Read first, by risk. One file changes, so these are its three hunks of most risk.

  1. Line 146, the bullet "The sentence of the list, amended again". It is the one sentence that gives the knowledge service a second way to re-order hits.
  2. Line 156, the bullet "Rule 4 of K8, amended again". The new rule 4 is composed by this note from body 1.
  3. Line 150, the bullet "No reranker is configured". It holds the reading against ADR-0078 (item b above).

Two-minute check. One click: open the "Files changed" tab. Expected: one file, +28 −0, five hunks, every changed line an addition.

Landing. docs/adr/** is a governed surface. This is opened as a draft. The hand-off to the maintainer is the seat's, and the approval is the maintainer's. Nothing here requests a reviewer, marks it ready or arms auto-merge.

CI. NOT MEASURED: the check-runs of this pull request, reason: it did not exist when this body was written. The report on the card carries the one reading taken after it opened.

Gates, run locally on head 6552e290. node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 21 commands from the diff. All 21 ran in the foreground, each exit code was captured before any pipe, and all 21 are exit 0. The reconciliation:

Run reconciliation — 21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN.
✓ dispatch-gates --ran: 21 derived famil(ies) accounted for — 21 run, 0 NOT-MEASURED (a DERIVED zero — all 21 recorded an exit code and none of them is 3).
The 21 commands and their exit codes
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:adr-index :: exit 0
pnpm check:adr-symbol-anchors :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:watch-hint-literal :: exit 0
Verdict lines of the gates that read the ADR
✅ check-adr-links: 1284 relative link destination(s) under docs/adr/ resolve
✅ check-adr-symbol-anchors: 4574 anchors across 165 records resolve — 1704 symbol (1675 declaration, 29 literal), 2818 file-level, 52 cross-repo, 6 exempt, 128 continuation. [cut here: the rest of the line is a note on what the count is not]
adr-index --report: OK — docs/adr/README.md is current, every record parsed, self-test 60 assertions green. Report-only: this line never reds the step.
check-nul-bytes: OK (scanned 29002 text file(s) -- 29002 tracked, 0 untracked-not-ignored; skipped 101 binary; no raw ASCII control bytes).
✓ doc authoring guard: 24253 customer-facing string(s) across 1963 spec sources clean — no internal issue-id references (message 3603 · strictObject 5655 · tombstone 1510 · describe 12078 · functionBuilt 529 · functionDeclared 878).
One gate first read NOT MEASURED, then green

At the first head, 151609a7, pnpm --filter @objectstack/lint run check:doc-formula-expressions answered exit 3, PREREQUISITE NOT MET: two workspace packages it imports were not built in the fresh worktree. That is a run that measured nothing, not a red gate. The two packages were built under the shared verify lock, and the gate was run again (the lock's verdict line is cut after the wait):

VERDICT command-exit 0 · held the lock 23s · waited 167s (2m47s)
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0

At the final head it ran with the other 20 and answered exit 0.

Left to CI, not run locally. The repo-wide lint, the type-check lanes, the test shards, and the families dispatch-gates prints outside the derived list. The commit trailer gate ran in the pre-push hook on the pushed range and is green.

Human Minimum

  • 1. No schema and no code changes.
  • 2. No new name is declared in code. The names the note writes are the rulings'.
  • 3. No formatter ran. pnpm lint is NOT MEASURED locally: the repo-wide scan is CI's, and the diff is one Markdown file.
  • 4. One card, one branch off main at acf3b33e31, one pull request.
  • 5. Nothing publishes, so no changeset; both declaration lines are filled in above.
  • 6. packages/spec is not touched.
  • 7. No edit to content/docs/references/, to a CHANGELOG.md or to content/docs/releases/.
  • 8. Title, body and comments are in English. The maintainer's Chinese words are quoted unchanged, and the 维护者速读 section is in Chinese as the fleet's rule asks.
  • The Before Submitting list is done for what a docs-only diff reaches; pnpm lint is as item 3 says.

Generated by Claude Code

…d the knowledge service reranks after the permission re-check

A sixth dated note under K1, add-only. It records the maintainer's rulings
of 2026-11-30 on knowledge retrieval rerank: a knowledge source may declare
retrieval.rerank, the deployment configures the reranker and no source names
a model, and the knowledge service reranks after the permission re-check and
before the cut to topK. Adapters are unchanged.

The note amends by name the "Rerank" row of K1, the second sentence of the
K1 list, rule 4 of K8 and the sentences of the earlier notes that speak of
rerank; cross-references stand under K2, K4 and K8, and the header gains an
Amended line. No existing line of the record changes.

Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v
Co-authored-by: Claude <noreply@anthropic.com>
… this record's own and tighten four sentences

The note's first draft wrote the rerank card's decisions as D1 to D6, which
this record already uses for the key-words line of 2026-11-24. They are now
written with their card number, and the record's own "the epic" keeps meaning
what it meant. English renderings of the maintainer's words lose their
quotation marks, so every quoted English span is verbatim from a source or is
one of the two amended sentences. Still add-only against main.

Claude-Session: https://claude.ai/code/session_01ADHkmPDtfMCw4FJfyFfQ7v
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 Nov 30, 2026
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation labels Nov 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmPDtfMCw4FJfyFfQ7v

Final head for review — zone o3-K · 2026-11-30T12:45Z
Head-sha: 6552e2905b93650940778b59220a714fdc704c57
CI: every check-run on this head is success or an expected opt-in skip (26 success, 27 skipped, 0 failed, 0 running).
Next: L1 (L1-b), then the seat's CONTRACT_REVIEW_TIER review and the governed hand-off. The PR stays draft; it lands after #38720, rebased under the same branch name once #38720 merges.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB
L1-b, the seat's L1 thread · 2026-11-30T12:48Z · first review

席位核对

ACCEPT @ 6552e29 (card #38760, Fixes, row 1 of epic #38750). One file, docs/adr/0161-…md, +28/−0. Governed (Tier H).

  • Relation. Fixes #38760 delivers the card. The card asks for a dated note on ADR-0161 that records rerank as a source switch, the deployment's reranker and the service's rerank after the permission re-check, and that amends the listed places. This PR does that, and Refs #38750 names the epic without closing it. No closing keyword binds any other card.
  • Add-only, as the record's convention. The five earlier dated notes of ADR-0161 amend by quoting the old sentence and stating the reading from the merge. This note does the same for the title, the D1 key-words line, TL;DR item 1, the K1 row and sentence, the K2 rows and K8 rule 4. The card says "amends these places" and names no in-place edit, so add-only is a faithful reading of the card, not a deviation from it. It also leaves draft feat(spec): a knowledge source declares its retrieval mode; an adapter reports the modes it runs #38720's in-place K2 edit at :153 untouched, and the overlap check is clean against all six open heads.
  • K4 cross-reference (not in the card's list). It is justified by the record's own practice: the fifth note gave source.retrieval a K4 cross-reference. It changes no K4 sentence, and it says the key is not reserved before row 2's reader lands, which matches K4's "A key added later lands with its first reader".
  • Against the rulings, spot-checked.
  • The note's reading of main. In the non-test src of service-knowledge and the three knowledge stores, rerank appears on one line: knowledge-service.ts:120, the class note K2 lists. That is true at this head too. The K2 quotations ("Embedding calls, vector storage, hybrid retrieval and rerank stay the adapter's.") are the ADR's own "What it becomes" column at :157, not the code comment, as the note says.
  • Declarations. Clause-②: no and Metadata-protocol: none match a doc that declares and builds nothing. skip-changeset is right, since docs/adr/ publishes from no package. Dogfood is not owed.
  • Not measured by me: the dev's full quotation script, with 16 corner-bracket spans and 50 double-quoted spans, 0 mismatches. I spot-checked two spans, both verbatim.

Checks at this head (read before writing): 26 success, 27 skipped, 0 failure. mergeable_state is clean.
Governed: landing needs the seat's CONTRACT_REVIEW_TIER L2 and the maintainer's approval (the body asks Steve to approve the note, which records D1). The landing order is the card's, after #38720.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6552e2905b93650940778b59220a714fdc704c57
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

PR #38764, card #38760 (row 1 of epic #38750). One file, +28 / -0, five insertions, no existing line edited. Read: the card and its three comments, the epic body and its ruling comments (7276086125, 7276135635, 7276183954, 7276461244), the PR body, the net diff, the ADR at the base (acf3b33e31, identical to origin/main at 8426fa0c89 for this file), the one hunk of draft #38720 on this file, and the check-runs on the head.

① Derived judgments

  • Accept-set: none changes. No schema, no contract member, no code. The note declares one future source key, source.retrieval.rerank (optional boolean), and says it lands with its first reader in row 2 of 专题:知识检索重排(rerank):知识源开关 + 部署配置模型,开了就一律重排 #38750 and is not reserved before. Right: this matches K4 ("A key added later lands with its first reader") and K10 rule 1.
  • Public surface: none. IKnowledgeAdapter and AdapterSearchOptions are stated unchanged, and K8's list is stated closed. Right: by "What counts as a member" a member is what an adapter author must read; the reranker's contract, client and settings are read by the knowledge service only, and settings keys are named there as non-members.
  • Ownership moved by the text: "whether" goes from the adapter to the knowledge source, "which" to the deployment, "who" to the knowledge service. Right: this is Rulings item 1 on 专题:知识检索重排(rerank):知识源开关 + 部署配置模型,开了就一律重排 #38750 and its D1 (ruling record 7276086125).
  • Gate verdicts on the head: every check-run is completed, and each is success or skipped; none failed. Check Changeset, Check Documentation Links, Governed Surface Queue Guard, the PR-body guards, the Lint families and the Type Check families are success.

② Semver level

Nothing publishes: docs/adr/** is in no package. The PR carries skip-changeset and Check Changeset is success on the head. Clause-②: no on the PR body is correct: the diff narrows and widens no published surface.

③ Boundary flags

open_questions in the dev report (7278703276) is empty. The deviations, each answered:

  • Add-only instead of in-place edits of the title, TL;DR, K2 rows and rule 4: accepted. It is the form of the five earlier notes; see ④ (3).
  • The K4 cross-reference the card did not list: accepted and accurate; see ④ (4).
  • #38750 D1 to #38750 D6 instead of bare D1 to D6: accepted, and needed, because this record has rulings D1, D2 and D5 of its own. The note says so in its opening paragraph and in the header line.
  • Overlap check exit 0 where the order expected exit 1: confirmed on the patch of feat(spec): a knowledge source declares its retrieval mode; an adapter reports the modes it runs #38720; see ④, Overlap.
  • skip-changeset: see ②.
  • One gate first answered "prerequisite not met" locally, then exit 0: closed by the check-runs on the head, which are the gate verdicts.
  • CI not waited for by the dev: closed, the check-runs are complete and green.
  • assignees on pr_create (the order against os-dev.md), the PR footer form, the proxy variable name printed by a relay script, and the worktree cleanup: process matters outside this face. They are the seat's to settle, and none touches the ADR text.
  • Out-of-scope finding (the opening of content/docs/protocol/knowledge.mdx and the class note of KnowledgeService still give rerank to the adapter): correctly left. K2's rule rewrites each with the code that makes the new sentence true, and main reranks nothing today (read: searchByKey calls applyPermissionFilter, then affinityOrderFor, then cuts to topK; the word is on one non-test line in the four src trees the note names).

SQL push-down: not applicable. The diff holds no code, no id materialisation and no join.

Security: the hits path is not under skills/** or ui/skills/**, so no security label is asked of the seat by that clause. The line above reads yes because the changed hunks state permission and egress behaviour: the rerank stands after the permission re-check, and the question plus at most 50 passages go to the reranker the deployment configures.

④ Design judgment

(1) Is every sentence the card lists reached? Yes. The base holds the word on fifteen lines. Twelve are the card's and each is reached:

  • title (1), D1 key-words line (9), TL;DR item 1 (41): the bullet "The title, the D1 key-words line and TL;DR item 1", and the header line;
  • the "Rerank" row (104): the bullet "The 'Rerank' row";
  • the list sentence (112) as the note of 2026-11-29 left it (119): "The sentence of the list, amended again", with the full new wording;
  • "the service reads no passage text and calls no model" (119): "One sentence of the note of 2026-11-29". It keeps the sentence true of the affinity re-order and says it is not true of rerank;
  • the K2 rows (149, 153, 157): "Three rows of K2" and the cross-reference under K2;
  • rule 4 (417) as the fifth note left it (422): "Rule 4 of K8, amended again", with the full new wording, and the cross-reference under K8;
  • 「永远不进知识源协议」 and the two sentences beside it (422, 438): "Three sentences of the note of 2026-11-30 under K8".

The other three lines are not contradictions: line 22 is the fourth note's header quoting the sentence it amended, line 58 is Context describing the old texts, line 210 is rerankModel in a retired package's key list. "Why the line is here" ("The four on the right need none of those") is also read anew, which the card did not ask for and the ruling needs. No sentence that contradicts the ruling is left standing without a reading.

(2) Does the note state the ruled contract and no more? Yes. Each statement was traced to its source, and every quoted span was compared with it: all corner-bracket spans and all double-quoted spans are verbatim in the epic body, a ruling record or the ADR at the base, except the two sentences the note composes (the new list sentence and the new rule 4), which is what the note says of itself.

  • declares retrieval.rerank, boolean; model always the deployment's: Rulings item 1, quoted.
  • the service reranks after the permission re-check and before the cut to topK, adapters unchanged: D1 and the design's "Who reranks".
  • no reranker: runs, marked no_reranker in notReranked, notice on save and publish, never refused: Rulings item 2, D2 and D4 for the two names.
  • switch on and reranker configured: every search, only 0 or 1 candidate makes no call and sets no marker, at most 50 passages: Rulings item 3, quoted.
  • failure or timeout: adapter order, failed, one attempt, 3 s, not a coded refusal: D2, quoted.
  • one model and one wire format, neither named in the record: D3.
  • hosted: not promised. D4 is quoted, and D5 is said to be undecided.

Row 2 and row 3 details are not promised. Pool size under the ceiling, the order of rerank and affinity, cross-source standing, the shape of notReranked, the settings key names, the reranker contract and a per-search tool argument are each listed under "Not in this note".

(3) Is the add-only route acceptable for a reader? Yes. The sixth **Amended** line is present at line 24 and dated 2026-11-30; it names the title, the D1 key-words line and TL;DR item 1, so a reader of the top of the file meets it before the TL;DR. TL;DR item 1 links to K1, where the note stands directly under the list it amends. A reader of K2 meets the cross-reference under "The rule for all of them"; a reader of rule 4 meets the cross-reference under the fifth note. This is the same route the fifth note took for "hybrid retrieval".

(4) Is the K4 cross-reference accurate? Yes. The key, its type and its group are as ruled; "lands with its first reader ... row 2 of #38750" and "not reserved before that" agree with K4; the contrast with the mode exception is the asymmetry the epic's design writes down. One loose phrase is N2.

(5) Consistency with the rest of ADR-0161. Holds.

  • K1's test: which passages the caller may read is a fact only the platform has, and the list says an adapter "does not check permissions". The reasoning is the epic's own.
  • The affinity note: its re-order is left by position, reading no passage text and calling no model. The new list sentence keeps "compute a score for a candidate" among what the service does not do, so the affinity note's "the service computes no score" still stands.
  • K5 and the note of 2026-11-28: the reranker is named a new recipient, and configuring it the deployment's egress decision. K10 rule 3 holds: the index copy is used for ranking.
  • K9 rule 6 and K10 rule 4: notReranked names a source and a reason, never a count of removed hits.
  • ADR-0078: a declared rerank with no reranker is accepted. The note rests this on the marker and the save and publish notice. That is the ruling (「有就用」, "Never a refusal"), and it is graceful degradation that says so, not a silent no-op. The PR body puts this reading before the approver as item b, which is the right place.

Overlap with draft #38720. Its one hunk on this file replaces the K2 row at line 153 (context 150 to 156). This PR inserts at 24, after 140, after 163, in K4 and in K8, so the two merge in either order. The texts agree in either order too: #38720's row ends "still no configuration and no rerank", and the note says the §3.4 row "keeps its 'no rerank'", true of the row as it is and as #38720 leaves it. The note's "AdapterSearchOptions ... gain nothing" is a statement about this note; the member #38720 adds there is the fifth note's, already registered on main. The readings of code are pinned to acf3b33e31.

Findings.

No must-fix, no should-fix.

  • N1 (nit) — The new list sentence gives the service a second re-order, "by reranking them", without the bound the first one carries ("by position alone"), and "Not in this note" leaves cross-source standing to "the row that builds it". The epic's design settles both on this record's own precedent (per source, by position, the hit keeps its adapter score; cross-source ordering by reranker score is not in v1), but lists them as not put to the maintainer. Leaving them out is therefore correct for a note that marks no ◆. Follow-up, not a change here: the row 2 card should carry those design lines as acceptance, so the choice is reviewed there against the affinity note's (1) and (5).
  • N2 (nit) — The K4 cross-reference says "Where a reranker is configured, every search of the source is reranked." The note itself gives the two cases where a search is not: a pool of 0 or 1, and a failure or timeout. The cross-reference points to the note, so a reader is not misled on the contract. Accepted deviation.
  • N3 (nit) — The K2 cross-reference names the three rows that hold the word. The §1 row ("what is delegated is the adapter's four") holds the same position without the word and is reached only through the reading of "Adapters own four" in the TL;DR bullet. Accepted deviation.

Implemented-by: claude/issue-38760-adr-0161-rerank-note
Reviewed-by: session_01ADHkmSAjFEZHRpRq3WCj6z

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

维护者速读

Seat opinion: land as is.

席位核对

ACCEPT at head 6552e2905b93650940778b59220a714fdc704c57 · Tier H (docs/adr/**, an ADR note the low-risk arm does not take) · Part of #38750 · Closes #38760

  1. Shape: one file, ADR-0161: a sixth **Amended** line dated 2026-11-30 plus cross-references under K2, K4 and K8; +28 / -0, no existing line edited.
  2. Premise: every statement traces to the epic's Rulings items 1–3 and D1–D4 (record 7276086125); the twelve sentences the card lists each get a quoted new reading; hosted reranking is not promised.
  3. Gates: on this head, check-runs all completed, success or skipped, none failed; skip-changeset with Clause-②: no.
  4. Accepted deviations: add-only instead of in-place edits of the title, TL;DR, K2 and K8 sentences (the record's convention for its five earlier notes); a K4 cross-reference the card did not list; L2 nits N1–N3.
  5. Out of scope and where it went: the per-source, by-position, adapter-score design lines go to the row 2 card as acceptance (L2 N1); rows 2–6 stay on epic 专题:知识检索重排(rerank):知识源开关 + 部署配置模型,开了就一律重排 #38750.
  6. Landing: L1 ACCEPT 7278949690 and L2 PASS 7279030801 on this head. Overlap with feat(spec): a knowledge source declares its retrieval mode; an adapter reports the modes it runs #38720 is clean (its one hunk replaces the K2 row; this PR only inserts). Lands after os-zhuang approves, behind feat(spec): a knowledge source declares its retrieval mode; an adapter reports the modes it runs #38720.

ACCEPT → comment 7278949690 · Contract review → comment 7279030801

@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 Nov 30, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 30, 2026 12:54
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit e5f7b16 Nov 30, 2026
61 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-38760-adr-0161-rerank-note branch November 30, 2026 13:15
@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 Nov 30, 2026
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…s five records) (objectstack-ai#38774)

<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBHuLciv5hYVYUu4pypDP48J)_

Part of objectstack-ai#38438

Clause-②: no
Metadata-protocol: none

This pull request carries seven of the card's nine rows. The two
ADR-0161 rows stay on the card; see "Rows not carried".

## 维护者速读

- 用户能看到什么变化:用户无感;只在五份设计记录里补了七条带日期的说明,写明主线现在实际怎么做,原有的决定文字一个字没动。
- 为什么做:属于「每周设计记录修订」滚动清单(11 月 29
日这一周);清单每一行指出一处「记录写的和主线不一致」或「记录留给某项工作回答、那项工作已经做完」,这次把代码已在主线的七行一并补齐。
- 出错会怎样:最坏是某条说明写得不准,照着设计记录干活的人会被带偏;纯文档、只增不删,可以直接撤回,不影响任何功能。
- 要你做什么:请审这七条说明并批准一次(设计记录须由你本人批)。

## What changes

Five ADR files gain seven notes dated 2026-11-30. Every diff line is an
addition: 62 lines added, 0 removed. No original decision text is
rewritten, and no decision changes. Each note follows the note
convention its own record already uses, and each says that the passage
it is read with is left as written.

Each row's "what is true now" was read against the code on `main` before
its note was written. Where a row's wording did not match the tree, the
note says what `main` does; the last column says so and the list under
the table gives the detail.

| ADR · section | Was (the record's words) | Now (what the note records)
| Source PR | Row on the card · result |
|:---|:---|:---|:---|:---|
| ADR-0084 · amendment of 2026-11-28, item (3) | "one landing for every
door is not ruled"; the command palette's package entries, an app's
design-in-Studio entry, the empty menu's entry and Setup's doors "still
open the object list" | One landing is ruled: ruling record 7247357556
on objectstack-ai#37958, the maintainer's 「OK」, quoted with its question. Every door
lands on the package's overview, `/studio/PACKAGE/overview`.
`/studio/PACKAGE/data` stays a working address for the object list. The
review-changes deep link still opens the Changes drawer over the object
list and is read as no door, by a seat reading and not by a ruling |
objectstack-ai#38501 | Card body row and 7252442785 · **written, corrected to the
tree** (two labels, the date) |
| ADR-0084 · the note of 2026-11-29 on the `form` row (near line 219) |
"The same change takes the type off the directory's hidden types and
brings its designer" | True of card objectstack-ai#37087, loose for the change: objectstack-ai#38484
brought the designer, and objectstack-ai#38619, which wrote the row, lists the type
(off the hidden types, a place in the menu) | objectstack-ai#38484, objectstack-ai#38619 |
7258423977 · **written as an added note** (the row says "Reword") |
| ADR-0037 · TL;DR item 2 and the "What already exists" table | "the
streaming build tree (`data-build-progress` parts)", and a table row
that marks "`data-build-progress` stream parts" shipped | The
build-progress stream frame is retired. Its reader left with the build
chat frontend, its producer with the cloud build loop, and its
declaration left `@objectstack/spec/ai`. The upgrade guidance is the
migration entry `ai-build-progress-frame-retired` | objectstack-ai#38398 (reader:
objectstack-ai#37720) | 7250363289 · **written** (one sentence beyond the row) |
| ADR-0150 · the note of 2026-11-26, bullet "Reads stay the missing
name" | "Three reads at `_env` still answer `409` at this head
(`?state=draft`, `?preview=draft`, `?layers=true`), and card objectstack-ai#34261
carries their move to `404`." | The move has landed. For a name only
disabled packages hold, each of the three answers its own `404` and
names no package, on both transports. An enabled package's stored draft
that the plain read does not see keeps the `409` for the two draft reads
| objectstack-ai#38633 | 7259890438 · **written, corrected to the tree** (codes and
callers made exact) |
| ADR-0150 · D4, the engine's flow-map row | The table keys the engine's
flow map by `(package, name)` and says nothing of the status rows read
from it | Each status row carries the `packageId` of the engine slot it
reads, so `(packageId, name)` names one row. The toggle door reads back
the row of the slot it switched, and echoes the request only where the
reading cannot name that flow | objectstack-ai#38652 | 7266385586 · **written** |
| ADR-0085 · the note of 2026-11-27 | "Neither key is in the spec yet:
`ObjectSchema` is strict and refuses both until objectstack-ai#37792 lands
`pinOverview` and objectstack-ai#37802 lands `fieldTabs`." | `pinOverview` is in the
spec, an optional boolean on `ObjectSchema`; `false` means the desktop
full record page never pins. An object extension does not carry the key.
`fieldTabs` is still refused | objectstack-ai#38679 | 7271302663 · **written**, no
`fieldTabs` line |
| ADR-0146 · the note of 2026-11-24 (near line 908) | "A `.custom`
package that is not the object's pair is not applied, and the boot log
names it." | Maintainer ruling 7268226134 on objectstack-ai#36548, item 5, arm (c),
verbatim 「保存和安装都拒绝」. A non-pair `.custom` package that writes
`fieldGroups`, `relatedLists` or `actionLayout` on an object extension
is refused at the save, the restore, the draft promotion, a package
duplicate and marketplace install. Where no door can read the installed
packages, the sentence stands | objectstack-ai#38706 | 7272564306 · **written,
corrected to the tree** (statuses; the duplicate's answer corrected in
patch round 1) |

### Rows not carried

- **ADR-0161, two rows** (Consequences, "The service keeps none of its
own"; K7 components table, "Split algorithm version"). The claim for
this pull request leaves that file out, because pull request objectstack-ai#38764 was
open on the same record when the claim was written. objectstack-ai#38764 merged at
2026-11-30T13:15:16Z, while this branch was being verified, and the
prerequisites both rows name (objectstack-ai#38307, objectstack-ai#38401, objectstack-ai#38375, objectstack-ai#38452) are
merged. Pull requests objectstack-ai#38730 and objectstack-ai#38732 (card objectstack-ai#38692) are still open and
both write ADR-0161, so that record still has other writers. By the
seat's call on the card (comment 7280598106) the two rows stay on objectstack-ai#38438
behind them, and this pull request is `Part of objectstack-ai#38438`.
- **ADR-0085, a `fieldTabs` line.** Its pull request, objectstack-ai#38742, was open
and a draft when this was opened (read at 2026-11-30, head
`59220bf331`). The card says that line follows when it merges.

Every prerequisite of the seven rows is merged on `main`: objectstack-ai#38398,
objectstack-ai#38501, objectstack-ai#38484, objectstack-ai#38619, objectstack-ai#38633, objectstack-ai#38652, objectstack-ai#38679 and objectstack-ai#38706. The newest
comment on the card when this was opened is the claim, 7279134045; a row
added after it is not in this pull request.

### Where a note differs from its row

- **ADR-0084, item (3).** The row names Setup's doors "Open in Studio"
and "Customize in Studio". The labels on `main` are "Open in App Studio"
and "Customize in App Studio", and the note uses them. The proposed text
was dated 2026-11-29; the note is dated 2026-11-30, the day it was
written into the record. The note names the three Setup doors one by one
and says of the review-changes deep link what the row says: no door, by
a seat reading, not by a ruling.
- **ADR-0084, the `form` row.** The row says "Reword". The card's rule
is that a row lands as an added dated note, so the 2026-11-29 note stays
as written and a note under it says which pull request did which half.
- **ADR-0037.** One sentence goes beyond the row: Phase 2's first
invalidation source, the `buildProgress.items` diffs, was the same
signal as the chat held it, and no code under `ui/` holds it any more.
Cut it if the note should carry the row alone. The note also names the
producer's retirement in the cloud repository and what a host does that
still streams a progress part of its own.
- **ADR-0150, the reads.** The row's proposed sentence gives `404` for
`?preview=draft` and `?layers=true`. The note gives the code the tree
answers, `404 RESOURCE_NOT_FOUND`, says that these are the answers to a
caller admitted to the switch, and that a caller who is not admitted
gets the plain read's `404`. It adds two facts from the tree: a
package-less draft is withheld while a disabled package holds the name,
and the layered view answers `404` under the leak guard.
- **ADR-0150, D4.** The note spells out the three cases where the toggle
door still echoes the request. The row's proposed sentence leaves them
out.
- **ADR-0085.** The row offers a "Built by" line in the style of an
earlier note. The note carries it and also restates what `false` does
and why an object extension does not carry the key, both from the row's
own "what is true now".
- **ADR-0146.** The row gives one code for every door. The tree answers
`VALIDATION_ERROR` with status 400 at the save, the restore and the
draft promotion, and with status 422 at marketplace install, with
nothing installed. A package duplicate saves each copied row through the
save door and lists a refused row in its own `failed[]`, with the save
door's sentence and no code, storing nothing for that row. The note says
all three, and that no error code is minted.

## Patch round 1 (head `04cc5911`)

The contract review at `947b7e64` (comment 7280965486) passed with one
should-fix: the ADR-0146 note put `VALIDATION_ERROR` / 400 on the
package duplicate. Commit `04cc5911` corrects this branch's own
2026-11-30 note to the tree (`duplicatePackage` reports the refused row
in `failed[]`) and adds one sentence from item 3 of ruling 7268226134 (a
target whose owner the door does not know is not judged by role). Only
that note moves: +9 / -3 inside it, and the branch is still +62 / -0
against `main`. Dev report: card comment 7281379369. Sections below that
name `947b7e64` record the first round.

## Tests

Docs only. No package source is touched, so no package test and no type
check is owed for the change. No tested behaviour changed, so there is
no ablation.

Checked on the committed text at `947b7e64`:

- Each phrase a note quotes from its ADR is in that file as it stands on
`main`. A script compared them. One quotation, in the ADR-0085 note,
reads as the sentence renders: the record links its two card references
and the quotation does not.
- Each verbatim maintainer quotation was compared with its record on
GitHub (7247357556 and 7268226134).
- Each path a note cites exists on the tree. The one exception is
deliberate: the ADR-0037 note names
`packages/spec/src/ai/build-progress.zod.ts` to say that the module is
gone.
- Each test title a note quotes is in the test file the note names.
- A probe on the spec source: `ObjectSchema` accepts `pinOverview:
false`, refuses `pinOverview: "no"`, and refuses `fieldTabs` as an
unrecognised key; `ObjectExtensionSchema` refuses `pinOverview` as an
unrecognised key, with its guidance.
- Upstream moved four commits while this was written. The branch merges
`main` at `f576dee5`; none of the four touches one of the five files or
a path a note cites. `overlap-check` answers `VERDICT clean exit 0`
against that `main`, and no open pull request shares a file with this
branch.

Two tests read these records from disk. Both were run on `947b7e64`
under the verify lock, after building what each needs:

-
`ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts`
reads ADR-0084's type table: `Test Files 1 passed (1)`, `Tests 21 passed
(21)`.
- `packages/qa/scenarios/test/score/entry.test.ts` reads ADR-0150's D1
table: `Test Files 1 passed (1)`, `Tests 14 passed (14)`. Its first run
answered `Failed to resolve entry for package "@objectstack/types"`, a
missing build in the fresh worktree and no verdict on this change; it
passed once that package's build closure was built.

The local gate set is the `dispatch-gates --commands` derivation for
this change set, 21 commands, run on commit `947b7e64` (patch round 1
ran the same 21 on `04cc5911`, all exit 0). Each exit code was captured
before any pipe. Reconciliation: `Run reconciliation — 21 derived, 21
run, 0 NOT-MEASURED, 0 UNRUN`. The same 21 were derived and run on the
commit before the merge, with the same result.

<details><summary>ADR gates on 947b7e6 (all exit 0)</summary>

| Command | Exit | Verdict line |
|:---|:---|:---|
| `pnpm check:adr-symbol-anchors` | 0 | `check-adr-symbol-anchors: 4597
anchors across 165 records resolve`, 0 line anchors survive. On the base
commit the gate read 4570, and 4593 with this change alone; the other
four come with `main`. |
| `node scripts/check-adr-links.mjs` | 0 | `check-adr-links: 1284
relative link destination(s) under docs/adr/ resolve` |
| `node scripts/check-adr-links.mjs --self-test` | 0 | |
| `pnpm check:adr-anchors` | 0 | `check-adr-anchors: OK (135 anchored
file(s), every governing ADR still referenced` |
| `pnpm check:adr-index` | 0 | `adr-index --report: OK —
docs/adr/README.md is current, every record parsed` |
| `pnpm check:doc-authoring` | 0 | |
| `pnpm check:nul-bytes` | 0 | `check-nul-bytes: OK (scanned 29015 text
file(s)`, no raw control bytes |
| `pnpm check:closed-ceremony-text` | 0 | |
| `pnpm check:pm-governed-merges` | 0 | |
| `pnpm --filter @objectstack/lint run check:doc-formula-expressions` |
0 | run after building `@objectstack/spec`, `@objectstack/formula` and
`@objectstack/lint` under the verify lock |

</details>

<details><summary>The other derived families on 947b7e6 (all exit
0)</summary>

`node scripts/check-closing-keyword-parity.mjs` and its `--self-test`,
`node scripts/check-comment-mask-corpus.mjs`, `node
scripts/ci/plan-test-core-shards.mjs --self-test`, `pnpm
check:ci-filter-parity`, `pnpm check:cross-package-test-inputs`, `pnpm
check:driver-memory-census`, `pnpm check:gitlink-declared`, `pnpm
check:pm-prior-rulings`, `pnpm check:refd-timer-probe`, `pnpm
check:watch-hint-literal`.

Before the last push: `node scripts/check-commit-card-trailers.mjs
--range origin/main..HEAD` exit 0, two commit messages (three after
patch round 1, also exit 0), no card relation and no model identifier in
the trailer pair.

</details>

<details><summary>A local-only reading that is red for a reason outside
this change</summary>

`pnpm check:dev-prereqs` exits 1 in this worktree: "The workspace is not
built", 105 of 110 workspace packages have no build output. It judges
the machine and not the diff, CI does not run its scan, and a fresh
worktree that builds only what a docs change needs reads this way. It is
not in the derived list.

</details>

Not run locally: the repository test project behind `test:repo`, and
every package suite. CI runs them on the pull request and on the merge
group. Every other family CI runs is read from this pull request's check
runs, not re-run here.

## Acceptance notes

- **Changeset.** None, and the pull request carries `skip-changeset`.
`docs/adr/**` ships in no package.
- **Governed surface.** `docs/adr/**` lands on the maintainer's
approval. This pull request stays a draft; the seat arranges the review
at the tier this surface owes and hands it over.
- **Why "Part of".** The card says it ends when its pull request merges.
Two of its rows are not here, so merging this one must leave the card
open.
- **Seen and left alone.** These are outside the seven rows and are not
changed here.
- ADR-0037's Status line says all four phases are implemented. On this
tree the console's canvas-invalidate signal has a subscriber and no
publisher: nothing calls the bus function that emits it. It is a
candidate row for the card of this name.
- ADR-0150's D4 note of 2026-11-10 gives its own end condition, an
earlier card landing. That card ended on 2026-11-12, and the record
carries no line that says so. A possible row; not judged here.
- Comments in the chat plugin still name the retired build-progress
part, and one test fixture uses the name as an open `data-` part. Not a
record, so not a row.

## Verification

### Read first

1.
`docs/adr/0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md`,
the note of 2026-11-30 under the note of 2026-11-24. The highest-risk
hunk: it quotes a maintainer ruling, and it draws the line between the
doors that refuse and the places where the old sentence still stands.
Check the two statuses and the list of places with no door.
2. `docs/adr/0084-application-builder-information-architecture.md`, the
amendment of 2026-11-30 under the amendment of 2026-11-28. It quotes a
maintainer ruling and lists every door; check the list, and the sentence
on the review-changes deep link, which records a seat reading and says
so.
3.
`docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md`,
the first amendment note of 2026-11-30. Check the three answers, who
gets which, and the leak-guard paragraph against the tests it names.

### Two-minute check

Run `git diff --numstat origin/main...HEAD` on this branch. Expect five
rows under `docs/adr/`, each with `0` in the removed column, and 62
added lines in total (2, 4, 18, 28 and 10). Then run `pnpm
check:adr-symbol-anchors` and expect exit 0 with a line that contains
`anchors across 165 records resolve`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzhPdWmTd47Fi2bKYZS)_

<!-- signed: repo:objectstack@os-support-ai · os-support-ai ·
session_01WGufzhPdWmTd47Fi2bKYZS -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…n once, and its refusals stay ahead of the embed (objectstack-ai#38812)

<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8WwwNJsfXjR7KkaXqjQxjFx)_

Part of objectstack-ai#38676

**Update, head `a28863cef9`.** PR objectstack-ai#38809 (card objectstack-ai#38438) landed first, at
2026-12-01T03:58Z, and took the seventh and eighth `**Amended**` lines
of ADR-0161. This head merges `main` into the branch (merge commit
`a28863cef9`, no rebase): main's lines are kept as they are, this PR's
header line follows them, and its ordinal reads "a ninth dated note".
That one word is the only change to this PR's text (delta report
7300564224 on objectstack-ai#38676); the net diff against `main` is still this note
alone, +17 / -0. The gate readings and the overlap paragraph further
down are of the earlier head `f3cd7dba76`; the 21 derived gates were
re-run at `a28863cef9`, all exit 0.

This is phase 0 of the card's cause 3 and nothing else: the dated note
in ADR-0161. The card stays open for phase 1, the patch round on PR
objectstack-ai#38798, which waits for this note to merge.

Clause-②: yes (widening) — the two optional adapter-contract members the
note registers
Metadata-protocol: none

The two lines above are the claim's (comment `7296290387` on the card)
and cover both phases. This pull request changes no contract file: the
widening is what the note registers and PR objectstack-ai#38798 builds.

## 维护者速读

- 用户能看到什么变化:用户无感;只是在知识平台边界那份架构决策记录里追加一条 2026-12-01
的说明,把你当天选定的「写进约定,一次提问只转一次」和它的附带条件写成文字,不改任何代码。
-
为什么做:这是「知识检索慢」那张卡最后一项(补查时把同一个问题重复转成向量)的前置一步;平台和存储驱动之间的约定是一份封闭清单,要先在决策记录里登记这两项,已经做好的改动才能合并。
- 出错会怎样:说明里若有和你的裁决不一致的句子,接下来改代码的人会照着错的文字去做;它只是一处文档追加,可以直接撤回,不影响任何在运行的系统。
- 要你做什么:请审阅并批准这条说明;其中标了菱形记号的两处是说明自己定的写法,可以一并接受,也可以划掉。

## 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`
gains its ninth dated note: 17 lines added, none changed and none
removed (659 lines to 676 on `main` after objectstack-ai#38809). Three commits carry
it, the third being the merge of `main`, `a28863cef9`: `f00518e716`, the
note, and `f3cd7dba76`, a review pass over it (Acceptance notes).

**Ruling.** The maintainer chose option A for cause 3 on
2026-12-01T00:22Z: ruling record
[`7296268226`](objectstack-ai#38676 (comment))
on the card, given on analysis `7290428149`. He ruled by choosing an
option of a decision card, and the note quotes the card's words
unchanged: the option 「写进约定,一次提问只转一次」 and the condition
「附带条件:存储驱动原本会给出的拒绝提示(比如“需要重建索引”)要保持在前面,不能被转向量的报错盖掉。」 Nothing of the
ruling is opened again here.

Three insertions, in the form the six earlier notes of this record use.
Line numbers are at head `a28863cef9`.

| Lines | Where | What is added |
|---|---|---|
| 27 | Header, after the `**Amended**` line of the eighth note | A ninth
`**Amended**` line, dated 2026-12-01: the two members, the texts the
note is read with, the ruling record, the chosen option and the
condition. |
| 166 | K1, under the note of 2026-11-30 on rerank | A cross-reference:
the "Embedding calls" row, and "compute a vector" in the second sentence
of the list, are read with the new note. |
| 483 to 496 | K8, under "Rules for every member" | The note itself: an
opening paragraph, nine bullets and a last paragraph. |

What the note decides:

- **Two optional members, and the list stays closed beyond them** (K8
rules 3 and 5). `IKnowledgeAdapter.embedQuery?(query: string)`, which
answers a promise of a `number[]`, and
`AdapterSearchOptions.queryVector?`. No capability flag: the method's
presence is the signal.
- **The type of the second member.** A function of no arguments that
answers a promise of a read-only `number[]`. It is not the vector
itself. For one search the knowledge service makes one such function for
each adapter instance that has `embedQuery`. The first call of the
function calls that instance's `embedQuery`; every later call in that
search answers the same promise, a rejected one too. An adapter calls it
at the point of its `search` where it embeds the query today. This is
the per-search memoised provider the analysis recommends, and the one
choice the ruling record leaves to the note.
- **The three readings that M1 of contract review
[`7290045524`](objectstack-ai#38798 (comment))
left open.**
1. The adapter still embeds, with its own embedder and query prefix. The
service computes no vector: it carries one back to the instance that
made it, inside one search. The "Embedding calls" row of K1, the second
sentence of the list under it and item 15 of K8 stand as written.
2. One vector serves every source a search binds to that adapter
instance. An adapter whose query embedding depends on the source does
not implement the method.
3. A handed vector is checked by its width. The model is judged on the
index fingerprint, as K7 has it.
- **The condition, as an outcome.** An adapter's refusals are answered
as on `main`, code, status and remedy, and no question is sent to an
embedding provider for a source the adapter refuses. The ruling record's
case: a source that needs a rebuild behind a failing embedder answers
`KNOWLEDGE_REBUILD_REQUIRED` 409 with 0 embedder calls. The function
gives this by construction, because an adapter asks for the vector only
after everything it decides first.
- **What the members land with.** PR objectstack-ai#38798, after this note merges:
both members with their first readers in one PR and one case in the
contract test suite (rule 1). Each is optional (rule 2), and an adapter
without `embedQuery` is searched as before.
- **Not in the note.** A vector handed by a caller of the service or by
a tool argument, a memo an adapter keeps past one search, a source or
context argument on `embedQuery`, and a form that embeds several
questions at once.

No file under `packages/`, `content/`, `skills/` or `ui/` changes, and
no other ADR does. The note declares; it builds nothing.

## Why

K8 rule 5 of this record: "The list is closed. A member that is not in
the table needs a dated note on this record first." PR objectstack-ai#38798 built the
two members before the record named them, and its contract review is
FAIL on that point (M1). The ruling puts the record before the code:
this note first, then the patch round on objectstack-ai#38798.

## Tests

The diff touches no package, so there is no build closure to make and no
package test or type-check owed. What was measured, at head
`f3cd7dba76`:

- **The premise holds.** Read on `main` at `0fc9eab900`, the commit this
branch starts from. A refilled search still embeds the question twice:
-
`packages/services/service-knowledge/src/knowledge-service-search.ts:232`
is the first `searchRound` call and `:245` is the refill's.
- `:957`, inside `searchRound`, calls `adapter.search` once for each
source.
- `packages/plugins/knowledge-turso/src/turso-adapter.ts:741` and
`packages/plugins/knowledge-pgvector/src/pgvector-adapter.ts:657` embed
the query inside that call.
- No line under `packages/`, `content/` or `docs/` names `embedQuery` or
`queryVector` (`git grep` exit 1).
- `origin/main` has since moved one commit, to `d97aaaea9a` (objectstack-ai#38802: one
skill file, one ratchet script and a changeset). It changes none of the
files read here, so each reading holds there too, and this branch merges
with it cleanly. The branch was not merged with it.
- **Quotations.** A script compared every quoted span of the added lines
with its source, read over REST or from the ADR at the base. 9 spans in
corner brackets: each is a verbatim substring of ruling record
`7296268226`. 27 spans in double quotation marks: each is verbatim in
that record, in analysis `7290428149`, in review `7290045524` or in the
ADR at the base. 0 mismatches. (The nested title "What "capabilities"
became" counts as two spans.)
- **Bytes.** The added lines hold no raw control byte, no HTML comment
and no model identifier.
- **What an adapter decides ahead of its embed**, the list in the note's
bullet on the condition, read in both stores on `main` at `0fc9eab900`:
an empty organization set, a scope with no ids and a `topK` of zero
answer no hits; the store and the embedder are present and the store is
ready; the source has an active generation; that generation holds the
searched fingerprint and the embedder's width, or the refusal is
`KNOWLEDGE_REBUILD_REQUIRED` (409, with its remedy); the mode is one the
adapter runs; and `keyword` never embeds. Each is ahead of the embed in
`turso-adapter.ts` (lines 699 to 741) and in `pgvector-adapter.ts`
(lines 581 to 657).
- **PR objectstack-ai#38798 as it stands**, read at head `4561e81d0e`: `queryVector`
is the vector itself there, a read-only `number[]`, and `embedQuery` has
the signature the note writes.
- **Anchors.** Every code citation in the note is a path with a symbol,
never a line number, and `check:adr-symbol-anchors` reads all of them
(its verdict line is below).

No ablation: the diff changes no behaviour a test pins.

## Acceptance notes

**The committed note took the function, not a plain array.** A plain
array has to exist before `search` is called, so the service would have
to embed ahead of every decision the adapter makes. A refused source
would then cost an embedding call, and a failing embedder would answer
in place of the adapter's own refusal. That is the shape review
`7290045524` graded S2, and it cannot meet the condition. The function
can, and the note names it as the means it takes.

**The review pass, commit `f3cd7dba76`.** Two sentences of the note
changed; nothing it decides moved.

1. The opening said that every statement without a diamond is the ruling
record's, the analysis's, what follows from the means, or a reading of
`main`. Some rest on review `7290045524`, on this record's own rules, on
PR objectstack-ai#38798 at its head or on the body of the card. The sentence now lists
them.
2. The signature of `embedQuery` is the one PR objectstack-ai#38798 declares at head
`4561e81d0e`. The bullet on the two members now says so.

**Two things are marked with a diamond, for the approver to accept with
the note or strike.**

- a. The means, and with it the member's type. Three points go with it
and are the note's wording: the name `queryVector` is kept though the
member is now a function; the service hands the function on every
`search` call of that search and does not judge whether a call will
embed; and a rejected promise is shared like a fulfilled one, so one
failed embedding call refuses each source that asked for the vector in
that search.
- b. One sentence added to the third reading: a caller that reaches an
adapter's `search` directly and hands the member answers for the
function, and the adapter does not verify it.

**Wording that is the note's and not a quotation**, each resting on a
text named beside it:

- The suite case is the one review `7290045524` asks for under S1,
rewritten with the function in the vector's place.
- "The condition has its own pin in each of the two stores": the ruling
record says "a pin". Each store orders its own decisions ahead of its
embed, so the note asks for the case in each.
- The English beside the card's Chinese words is a reading aid. The
Chinese is quoted unchanged.

**Overlap with an open draft on this file.** `node
scripts/pm/overlap-check.mjs --repo=objectstack-ai/objectstack`, run at
`f3cd7dba76` against `origin/main` at `d97aaaea9a`, printed `VERDICT
overlap exit 1`: `origin/main` merges cleanly, and draft objectstack-ai#38809 (the
weekly ADR revisions, second part, opened 2026-12-01T00:50Z by another
seat's thread) conflicts with this branch in this file. Both insert
header lines after line 24, and both call their first line "a seventh
dated note" (objectstack-ai#38809 adds a seventh under K7 and an eighth under
Consequences). Its two notes and this one touch no common passage.
Whichever lands second merges `main`, keeps both sets of header lines
and corrects its ordinals. Which lands first is the seats' to settle; it
is put as a question in the report on the card.

**What the note asks of PR objectstack-ai#38798, none of it done here.**

- `queryVector` changes type there, from the vector to the function, and
the service stops calling `embedQuery` ahead of `search`.
- One case in the contract test suite, and a pin in each of the two
stores for the ruling record's case.
- The docblocks cite the note and no longer say that the knowledge
service embeds.

**Text of ADR-0161 that the note is read beside. Listed for the seat,
not changed.**

- "What "capabilities" became" lists the methods whose absence is the
capability signal (listing, dropping, status, the start and end of a
build). `embedQuery` joins them by this note; the paragraph is left as
written.
- The K2 row for §3.4 of the protocol page says what the contract
carries. Its last column gives the rewrite to "each card that adds a
member", so objectstack-ai#38798 rewrites it with its code.

**Not done here.** No changeset: `docs/adr/` is published by no package.
The two earlier note pull requests on this record, objectstack-ai#38714 and objectstack-ai#38764,
each carry the `skip-changeset` label, hung in the stroke that opened
them. This one is opened with no label, as its dispatch order says, so
that label is owed by the seat, and `Check Changeset` has no exemption
until it is hung.

## Verification

**Read first, by risk.** One file changes, so these are its three places
of most risk.

1. Line 476, the bullet marked with a diamond, "The means, and with it
the member's type". It is the one decision the note makes, and it sets
what the patch round on PR objectstack-ai#38798 must build.
2. Line 480, the bullet "The condition, as an outcome". It states the
maintainer's condition and what holds when the embedding call itself
fails.
3. Line 479, the last two sentences of "The third reading": the note's
own sentence on a caller that reaches an adapter directly.

**Two-minute check.** One click: open the "Files changed" tab. Expected:
one file, +17 −0, three hunks, every changed line an addition.

**Landing.** `docs/adr/**` is a governed surface. This is opened as a
draft. The hand-off is the seat's and the approval is the maintainer's.
Nothing here requests a reviewer, marks it ready or arms auto-merge.

**CI.** NOT MEASURED: the check-runs of this pull request, reason: it
did not exist when this body was written. The report on the card carries
the reading taken after it opened.

**Gates, run locally on head `f3cd7dba76`.** `node
scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 21 commands from the diff. All 21
ran in the foreground, each exit code was captured before any pipe, and
all 21 are exit 0. The reconciliation:

```text
Run reconciliation — 21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN.
✓ dispatch-gates --ran: 21 derived famil(ies) accounted for — 21 run, 0 NOT-MEASURED (a DERIVED zero — all 21 recorded an exit code and none of them is 3).
```

<details>
<summary>The 21 commands and their exit codes</summary>

```text
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:adr-index :: exit 0
pnpm check:adr-symbol-anchors :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:watch-hint-literal :: exit 0
```

</details>

<details>
<summary>Verdict lines of the gates that read the ADR</summary>

```text
✅ check-adr-links: 1284 relative link destination(s) under docs/adr/ resolve
✅ check-adr-symbol-anchors: 4608 anchors across 165 records resolve — 1727 symbol (1698 declaration, 29 literal), 2829 file-level, 52 cross-repo, 6 exempt, 132 continuation. [cut here: the rest of the line is a note on what the count is not]
adr-index --report: OK — docs/adr/README.md is current, every record parsed, self-test 60 assertions green. Report-only: this line never reds the step.
check-nul-bytes: OK (scanned 29077 text file(s) -- 29077 tracked, 0 untracked-not-ignored; skipped 101 binary; no raw ASCII control bytes).
✓ check-closed-ceremony-text: 6688 shipped file(s) read; none says the ownership ceremony is closed.
✓ comment-mask corpus sweep [scripts/js-comment-mask.mjs]: 24511 files, 0 disagree, 0 unparseable, 211.2s (comparator self-test: 26 cases pass).
```

</details>

<details>
<summary>One gate first read NOT MEASURED, then green</summary>

`pnpm --filter @objectstack/lint run check:doc-formula-expressions`
first answered exit 3, PREREQUISITE NOT MET: two workspace packages it
imports were not built in this worktree. That is a run that measured
nothing, not a red gate. The two packages were built under the shared
verify lock, with the command the gate printed, and the gate was run
again at the same head:

```text
os-verify-lock: VERDICT command-exit 0 · held the lock 100s (1m40s) · waited 0s
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
```

</details>

**Left to CI, not run locally.** The repo-wide lint, the type-check
lanes, the test shards, and the families `dispatch-gates` prints outside
the derived list. The commit trailer gate ran in the pre-push hook on
the pushed range and is green.

## Human Minimum

- [x] 1. No schema and no code changes.
- [x] 2. No new name is declared in code. The two member names are the
ones PR objectstack-ai#38798 and the analysis use.
- [x] 3. No formatter ran. `pnpm lint` is NOT MEASURED locally: the
repo-wide scan is CI's, and the diff is one Markdown file.
- [x] 4. One card, one branch off `main` at `0fc9eab900`, one pull
request for this phase.
- [x] 5. Nothing publishes, so no changeset; both declaration lines are
filled in above.
- [x] 6. `packages/spec` is not touched.
- [x] 7. No edit to `content/docs/references/`, to a `CHANGELOG.md` or
to `content/docs/releases/`.
- [x] 8. Title, body and comments are in English. The card's Chinese
words are quoted unchanged, and the 维护者速读 section is in Chinese as the
fleet's rule asks.
- [x] The *Before Submitting* list is done for what a docs-only diff
reaches; `pnpm lint` is as item 3 says.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01JQwxbXfgA45f3y5YpDPT5h

<!-- signed: repo:objectstack#2 · os-warren ·
session_01JQwxbXfgA45f3y5YpDPT5h -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

ADR-0161: dated note — a knowledge source declares rerank; the knowledge service reranks after the permission re-check (#38750 row 1)

3 participants