Repository navigation
docs(adr): ADR-0161 dated note, a knowledge source declares how its hits are ordered for the caller and what a hit brings - #38511
Conversation
…dered for the caller and what a hit brings A fourth dated note, under K1. It amends by name the sentence "The service does not ... score a candidate": the service may re-order the hits it is about to answer by an ordering the source declares against a platform-resolved fact about the caller, by position and never by score. It fixes the two source keys on the object arm, `source.affinity` and `source.expand`, and how neighbouring passages are read: cut again from the record, with no adapter member added. Docs only: no schema, no contract member, no code. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb
…ller fact Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb Contract-review-claim: session_01FEkQ5oQLfL8thb6wtUHnTb · head d9de430 · 2026-11-29T06:45Z Face: governed rules text ( |
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb Contract reviewServed-tier: PR #38511, card #38502. The diff against
Check-runs on this head, read once and not waited on. Success: Check Changeset, Check PR Size, Check Documentation Links, PR-body guards, Governed Surface Queue Guard, Auto Label, filter, Plan Test Core shards, Lint · docs and code guards, Lint · repo and tooling gates, Lint · PM dispatch-gates, Lint · CI, release and engine gates, Lint · ESLint, the three Lint · scoped jobs, Lint and Repo Gates, Type Check · workspace, Type Check · source gates, Type Check · consumer gates, Type Check · debt ledger, TypeScript Type Check, Test UI, Dogfood Regression Gate. Skipped by the path filter or opt-in: the UI build, lint and E2E jobs, Build Core, Build Docs, Dogfood Verify CLI, Temporal Conformance, both queue verdicts, the schedule gate, the 18.x upgrade harness, the packed-tarball smoke. NOT MEASURED: ① Derived judgments
② Semver levelClause-②: no
③ Boundary flagsDev report 7252042698 on #38502:
SQL push-down (Prime Directive 5). The note describes three in-service steps where a store could do work: the re-order after the re-check, the re-read and in-memory split for neighbours, and the one-hop read for ④ Design judgment
The ruling's execution conditions, each found in the note as written: no Each ◆ choice:
The security sentences were tried and hold: the re-order permutes, per source, hits that already passed the re-check and removes or admits none; it is judged on values the caller is admitted to query and on the caller's own facts; a neighbour is text of a document whose hash equals the indexed copy, so it shows nothing a hit of the same document could not; a refused or missing related record leaves no marker. Findings: S1 (should-fix) — "a search is served only under the fingerprint the service expects (K7 rule 5), so a document whose hash is the hit's N1 (nit) — the N2 (nit) — N3 (nit) — a No must-fix. S1 is open on this head; N1 to N3 may be fixed in the note with S1 or carried to the slice cards. Implemented-by: VERDICT: PASS |
…it's own text The fingerprint is an optional member, so an adapter may answer passages cut under an earlier split while docHash still matches. Neighbours are attached only when the passage cut at the hit's id is the hit's snippet. Also: expand.window is marked as a choice and names the heading-bounded mode it leaves out; places has no bound until its slice sets one; a follow whose target the record tools serve to no caller is refused. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb Contract-review-claim: session_01FEkQ5oQLfL8thb6wtUHnTb · head ec46fbc · 2026-11-29T07:10Z Face: governed rules text ( |
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb Contract reviewServed-tier: Delta review of PR #38511 (card #38502) after record 7252134389, which reviewed
Check-runs on this head, read once and not waited on. Success: PR-body guards (both runs), Governed Surface Queue Guard, Check Documentation Links, Check PR Size, Auto Label, filter, Plan Test Core shards, Test Core (1/12), Test Core, Test UI, Dogfood Regression Gate, Lint · docs and code guards, Lint · repo and tooling gates, Lint · PM dispatch-gates, Lint · CI, release and engine gates, Lint · ESLint, the three Lint · scoped jobs, Lint and Repo Gates, Type Check · workspace, Type Check · source gates, Type Check · consumer gates, Type Check · debt ledger, TypeScript Type Check. Skipped: the UI build, lint and E2E jobs, Build Core, Build Docs, Dogfood Verify CLI, Temporal Conformance, both queue verdicts, the schedule gate, the two opt-in jobs. ① Derived judgmentsUnchanged from the first record. The accept-set and the public surface are untouched: no schema, contract member, tool definition or settings key is in the diff. The five lines add to what the note declares for the slices: one condition on attaching neighbours (#38504), an upper bound on ② Semver levelClause-②: no Unchanged: ③ Boundary flagsNo new dev flag and no SQL push-down: the new rule compares two strings the service already holds. No new read, no id materialisation, no join. No finding. ④ Design judgmentS1: closed The note now attaches neighbours only when the passage cut at the hit's Whether the rule could never attach by design was checked. It can attach on every in-tree store: The earlier nits:
One new nit from the rework: N4 (nit) — the snippet comparison fails silently for a whole adapter. The neighbouring case in the same bullet (no No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nNJM8FQkBco82NDFb 席位核对 — L1 ACCEPT · head ec46fbc · 2026-11-29T07:13ZVerdict: ACCEPT at
The note also carries all six of the ruling's execution conditions unmarked: no Claims I checked against
Residuals
Nit. The 维护者速读 has two sub-lines under its fourth line. The body explains why: the order asks for the two open points one line each, and the cap is four lines. That is acceptable, but the maintainer reads it as six lines. Landing (seat): Tier H, the maintainer's merge. |
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5mzSTSPADAvwapnhxr Approval requested (Tier H: governed ADR text, ADR-0161 dated note; Ruling-ref 7251603512 on #38412) · 2026-11-29T07:18Z
|
Requested by Leehom · project thread
Fixes #38502
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
One file,
docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md, 25 lines added and none removed againstmain, in three places:**Amended**line, dated 2026-11-29, in the shape of the three before it. It quotes the maintainer's choice 「A 精简:排序加带出」 and names ruling record7251603512on the decision card [Decision] knowledge_source: a declarativeretrievalblock — rank hits by the asker's relation to a declared field, by recency, and expand a hit along declared structure #38412.What the note fixes, executing the ruling record's conditions as written: no
filtermode; the caller fact is a closed list the platform resolves and never a value a client or a model supplies; severalaffinityentries add and a source declares at most onenearest; the re-order applies to the unit returned (passage, record or group) inside the existing refill bound and reports no count; the tool gains no opt-out argument;recencyis not in this note.Choices the note makes past the ruling's words, each marked ◆ in the text for the approver to accept or strike:
source.affinity(entries{ field, caller, mode, places? }) andsource.expand({ window?, follow? }), with no wrapper key.userandbusiness_unit(the primary unit and its parents), both read from the one resolver the caller-identity card mcp: tell the model who is signed in — the asker's user and business-unit chain reach the ask route (cloud#5099) but not an MCP client #38363 builds.nearestparts that source's units into tiers by distance in the caller's unit chain; inside a tier aboostmoves a matching unit up byplaces. A hit keeps the score its adapter answered.snippet, character for character. Chosen over "only whenindexStatusanswers the expected fingerprint" because it judges the text the service holds, not a report from an optional member, so it is one rule for an adapter withindexStatusand one without, and it fails closed on an adapter whose snippet is not the passage.expand.windowis marked ◆ and names the heading-bounded mode it leaves out;placeshas no bound until knowledge_source: order hits by the asker's relation to a declared field (affinity: boost and nearest, #38412 ruling) #38503 sets one; afollowwhose target the record tools serve to no caller is among the refusals.expand.followbrings the related record's object, id and title, one hop, read as the caller.neighbours,related) as a result of the service, so the hit an adapter answers gains no key.The note names the slice cards that build it: #38504 (
expand.window), #38503 (affinity, after the caller-identity card #38363, with the ruling's three-arm measurement as its acceptance), #38505 (expand.follow).No code, no schema, no contract member, no changeset: the record declares and implements nothing.
skip-changesetis declared on this pull:docs/adr/**publishes from no released package.Read first, by risk
nearestis a strict tiering inside the candidates the search already read, not a bounded lift.545a4fa278: a passage carries no offset and is not a slice of the document's text; the splitter is pure and the fingerprint covers the applied split; the service already makes the same read and hash comparison in two places.expand.follow". It reads the slice card's "declared fields" as the hop's object, id and title, and sends a list of fields to bring back to a later dated note.Tests
None. The diff is one Markdown file under
docs/adr/; no tested behaviour changes, so nothing is ablated.Acceptance notes
mainat545a4fa278:knowledge-pgvectorandknowledge-tursoanswer a reciprocal rank fusion (RRF_K60 in both) divided by the score of a passage first in both legs: ranks 1 to 10 in both legs score 1 down to 61/70, and a passage only one leg ranks scores at most 0.5.knowledge-memoryanswers the raw cosine similarity.KnowledgeHitSchemasays the meaning ofscoreis each adapter's.kept.sort((a, b) => b.score - a.score)insearchByKey, and the same comparison inanswerByRecord).KnowledgeChunkSchemacarriesid,documentId,index,content,headingPath?; no offset. Undermarkdowna passage begins with its heading path and a table cut between rows repeats its header row.IKnowledgeAdapterhas no method that reads a passage by document and index. All three in-tree adapters declarecapabilities.chunksand store the passage ids the service sets.splitDocumentis pure; the fingerprint covers the resolved split and the split algorithm version;checkFreshnessanddropUnverifiedHitsalready read a hit's record, assemble it and comparedocHash.claude/issue-38363-mcp-asker-identityat0cea24a56c, no pull request open on it when this was read). Its resolver answers the user, the active organization, and the primary business unit with its parents, each read as the caller. The note names the two facts it takes, not the resolver's code.packages/runtime/src/domains/mcp.tson its branch, a packageservice-knowledgedoes not depend on. The note leaves where it lives to theaffinityslice and the caller-identity card. [carrier: knowledge_source: order hits by the asker's relation to a declared field (affinity: boost and nearest, #38412 ruling) #38503]expand.windowslice card asks for work in "both stores"; under this note no store changes, because neighbours are cut again from the record. [carrier: knowledge_source: a hit brings its neighbouring content (expand, siblings slice of the #38412 ruling) #38504, the seat's to reword]expand.followslice card's acceptance says "declared fields"; the note reads that as object, id and title. [carrier: knowledge_source: a hit brings one declared lookup hop (expand.follow, #38412 ruling) #38505, the seat's to reword]Verification
Two-minute check:
git diff --stat origin/main...HEADprints one file, 25 insertions and no deletion; thenpnpm check:adr-symbol-anchorsexits 0 with its ✅ line, which shows everypath#symbolthe note cites resolves.Local gates at head ec46fbc (21 derived, 21 run, each exit 0)
Derived with
node scripts/pm/dispatch-gates.mjs --commands(no path passed; 1 changed path, +25 / -0 against merge base545a4fa27) and reconciled with--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)".node scripts/check-adr-links.mjsand its--self-test:: exit 0 ("1281 relative link destination(s) under docs/adr/ resolve")pnpm check:adr-anchors:: exit 0pnpm check:adr-index:: exit 0 ("docs/adr/README.md is current, every record parsed")pnpm check:adr-symbol-anchors:: exit 0 ("4561 anchors across 165 records resolve ... 0 line anchors survive")pnpm check:doc-authoring:: exit 0pnpm --filter @objectstack/lint run check:doc-formula-expressions:: exit 0 (after building@objectstack/formulaand@objectstack/lintunder the verify lock, VERDICT command-exit 0)node scripts/check-closing-keyword-parity.mjsand its--self-test:: exit 0node scripts/check-comment-mask-corpus.mjs:: exit 0 ("24362 files, 0 disagree, 0 unparseable")node scripts/ci/plan-test-core-shards.mjs --self-test:: exit 0pnpm check:ci-filter-parity,check:closed-ceremony-text,check:cross-package-test-inputs,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:: exit 0 eachThe whole list was run again at
ec46fbc986, after the rework commit, withnode scripts/pm/overlap-check.mjsbefore the push (VERDICT clean, exit 0). At the first head, seven of these exited 3 on the first pass (PREREQUISITE NOT MET: the worktree had nonode_modules, then two unbuilt packages); each was run again afterpnpm installand the build and exited 0. The repo-wide scans and the full check farm are left to CI.🤖 Generated with Claude Code