Skip to content

docs(adr): ADR-0161 dated note — item 17, the typed scope a search hands its adapter: record ids, or a parent object through a listed lookup - #37329

Merged
os-zhuang merged 1 commit into
mainfrom
claude/project-thread-3zr6fx
Nov 25, 2026
Merged

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #37324

Clause-②: yes
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用户无感;只在「知识检索平台边界」这份决定记录里加一条带日期的说明,定下「限定范围检索」的接口形状:可以只在指定的几条记录里搜,也可以借知识源列出的查找字段,只在一份上级记录(比如一份制度)下的条款里搜。
  • 为什么做:属于「知识检索平台化」专题第三阶段,记下您刚裁的「也能指定上级对象(制度)」;记录规定适配器契约的新成员要先以带日期的说明写进记录,随后的按范围检索代码卡才能动工。
  • 出错会怎样:说明写错,后面写检索服务和存储适配器的人会照错的做,最坏是限定范围后漏掉结果(权限仍逐条按提问人重读,不会越权);有两处是记录替您定的细节请过目:一类条款若有两个字段都指向同一类制度,按制度限定时这类条款不参与检索并记日志;人员字段不算「上级」;本次只有文档,撤回合并即可。
  • 要你做什么:审后由你本人合并(受治理面,合并即批准),且要排在随后的按范围检索代码改动之前。

What changes

One file under docs/adr/: 0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md, 17 lines added and none removed against main (829a45e9). No schema, no code, no changeset.

K8 item 17 of ADR-0161 ("A typed scope filter") reads "Deferred" with no final shape, and K8 rule 3 says a shape that cannot be built as written changes by "a dated note on this record". This PR is that note. It records the maintainer's ruling on Q3, record 7168192820 on #37308: 「也能指定上级对象(制度)」. #37308 builds the member after this note merges; #37311 (row 12) adds the search_knowledge arguments.

docs/adr/** is Tier H: the maintainer merges this PR; no seat approves, merges or enqueues it.

Two additions, in the form PR #37263 used for the #37097 note:

  1. A second dated note under K8's table, after the service-knowledge: documents carry their organization, and search hands the caller's organizations to the adapter #37097 note and before "What "capabilities" became.". The table is left as written.
  2. A second Amended bullet at the end of the header list, pointing at the note. The Status: line is byte-identical, so the generated docs/adr/README.md does not change.

What the note decides. Each ◆ is a shape the note decides past the ruling's words, for the approver to accept with the record or strike:

  • ◆ The member is AdapterSearchOptions.scope?, a list of terms: { kind: 'record', ids } (the document's sourceRecordId in ids) or { kind: 'metadata', field, ids } (the document's metadata[field] in ids, or a list with an element in ids). The adapter gets resolved terms, never { object, ids }: turning an object into a field needs the object's registered definition, which is the platform's (K1).
  • ◆ Absent, present, empty, read as item 9's organizationIds: absent ranks every document as before; present filters BEFORE ranking so topK is filled from in-scope documents; an empty list ranks nothing and is never "no filter". organizationIds, scope and the opaque filter all apply.
  • How the service builds it from KnowledgeSearchOptions.scope (entries of object and ids), per source: the source's own object gives a record term; another object gives a metadata term for the metadataFields member that points at it; no such member, and the entry does not reach the source. A source no entry reaches is not searched; a file or http source answers nothing under a scope.
  • ◆ Four readings the ruling leaves open: (1) several entries reaching one source combine as a union; (2) an own-object entry is the record term only; (3) only lookup and master_detail are parent links, target read through referenceTargetOf; a user field is not one; a withheld field is not one; (4) a source that lists two or more lookups to the entry's object is not reached by it, logged once per source naming the fields.
  • What a scope does not reach: a parent two hops away. An entry that reaches no searched source answers the same empty answer a withheld source gives, so the answer never tells which it was.
  • ◆ The service's guarantee: after the adapter answers, the service drops every hit no term holds for, judging KnowledgeHit.sourceRecordId and KnowledgeHit.metadata[field], fail closed. No capability flag is added (K8 rule 5); the service logs once per adapter the first time its check drops a hit.
  • ◆ Judged on the index copy, never an access decision: the permission re-read of the live row stays the access decision. Source admission already requires every metadataFields member an index carries to be queryable by the caller, so "that field in ids" is a filter the caller could run on the object's own rows; the parent row is never read.
  • ◆ The opaque filter stays as it is, handed through and checked by nothing in the service; whether it retires is its own card.
  • The suite cases the member lands with in runKnowledgeAdapterContract, per term kind, and one through a real KnowledgeService over an adapter that ignores the member.
  • Not here: the bounds on KnowledgeSearchOptions.scope (service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308, coded refusal, ADR-0112), the tool argument (search_knowledge: the one definition gains scope, granularity and groupBy, for the MCP door and the in-app agent alike #37311), record-level return (service-knowledge: search returns records, not chunks — granularity and groupBy #37103).

One shape differs from #37324's body words. That body says the member on AdapterSearchOptions is scope: [{ object, ids }]. The note keeps [{ object, ids }] on the service option only and hands the adapter resolved terms, as #37308's item 1 and K8 item 17 itself say ("built by the service from"). The member name is scope on both interfaces, with distinct types.

Tests

No test changes: the diff is one Markdown file. The derived gate families were run at 8a64f99f, the head.

Local gates at 8a64f99: 21 derived, 21 run, all exit 0

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 21 commands from the branch's change set (1 path against merge base 829a45e9). Each was run with its output redirected to a file and its exit code read before any pipe. check:doc-formula-expressions needs @objectstack/formula and @objectstack/lint built: built first under the verify lock, VERDICT command-exit 0.

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

Reconciliation, node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran with the exit codes recorded:

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).

check:adr-symbol-anchors resolves the note's four path#symbol citations. Outside the derived set and not run locally: the governed-merges audit with workflow-only variables, CI's test-core shard planning steps, and the type-check lanes (the diff touches no TypeScript). CI carries them.

Acceptance notes

  • Two ◆ readings worth the approver's eye, each written as the note's recommendation:
    • Reading (4), two lookups to the same parent: the entry does not reach the source, logged once. The other answers were a union of the fields (answers "inside this policy" with clauses that only cite it through the other field), the first field listed (gives list order a meaning no author wrote), a key on the entry naming the field (no consumer yet), or a refusal (would differ from the withheld-source answer). No source in this tree lists a reference field in metadataFields today, so no measured consumer decides it; empty-now can open later without removing anyone's hits.
    • Reading (3), the user field: excluded as a parent link. The visible cost: Field.lookup('sys_user') is a link while Field.user() is not. Nothing scopes by user today; it returns by a dated note with its reader.
  • The opaque filter has no producer in this tree (the one non-test caller of IKnowledgeService.search, createKnowledgeTools, passes none) and gets no service guarantee. The note leaves it unchanged; whether to retire it is a question for its own card. Noted, not filed: carrier none.
  • Left to service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308's code PR, not decided here: whether the refill after the permission filter also counts hits the scope check removed; whether an empty KnowledgeSearchOptions.scope or an entry with no ids is answered empty or refused (the note fixes only that it never reads as "no scope"); the bound numbers; log levels.
  • No changeset. docs/adr/** publishes nothing; the PR carries skip-changeset.
  • No scripts/adr-anchors entry. pnpm check:adr-anchors exits 0 without one; the code PR anchors the member it lands.

Verification

Read first:

  1. The "Four readings the ruling's words leave open" bullet of the new note, readings (3) and (4): the two places the note goes furthest past the ruling.
  2. The "The service's guarantee, whatever the adapter does" bullet: fail closed on a hit without the document's metadata, and no capability flag.
  3. The "The opaque filter stays as it is" bullet.

Two-minute check: open this PR's Files tab. It shows one file under docs/adr/, +17 −0: one Amended bullet at the end of the header list, and one blockquote between the #37097 note and the paragraph that starts "What "capabilities" became.".


Generated by Claude Code

…nds its adapter (#37324)

A second dated note under the table of K8, and a second Amended bullet in
the header list. The note records the maintainer's ruling on Q3 (ruling
record 7168192820) and gives item 17 its final shape: the member is
AdapterSearchOptions.scope, a list of terms the service builds from
scope: [{ object, ids }] and the adapter applies before it ranks. No
code, no schema, no changeset. The status line is left as it is.

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

objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

repo:cloud#1 · os-warren · session_01JQwxbW5anP6GDaVi5LKi2U

维护者速读

  • 改了什么:用户无感,只在「知识检索平台边界」这份决定记录里加一条带日期的说明,把「限定范围检索」的接口定下来:可以只在指定的几条记录里搜,也可以直接给一份上级记录(比如一份制度)的 id,只在它名下的条款里搜。
  • 为什么:这是您今天裁的「也能指定上级对象(制度)」;记录规定存储适配器接口的新成员必须先写进记录,随后的按范围检索代码才能动工,这条说明不合并,后面两张代码卡都开不了工。
  • 风险:只有文档,撤回合并即可恢复;说明写错的最坏后果是限定范围后漏结果,不会越权(每条命中仍按提问人的权限重读)。有三处是记录替您定的、您的原话没有覆盖的细节:① 一次给多个范围时取并集;② 只有「查找」和「主从」两类字段算上级,人员字段不算;③ 一类条款若有两个字段都指向同一类制度,按制度限定时这类条款不参与检索、只记日志,用户看到的是「没搜到」。目前没有任何知识源是第 ③ 种情况,以后放开只会多出结果,不会减少。
  • 要你做的:审后由你本人合并(受治理面,合并即批准,也即同意上面三处);若不同意第 ③ 处,在这个 PR 上说一句想要哪种(两个字段都算 / 只认主从字段 / 让调用方点名字段),席位让作者改后再请你合。契约审核结论 PASS 在本评论下半部分,对应提交 8a64f99ffd1d0056e85a3ea9fa233a8b4a12357c。

席位意见:建议按现稿合并。作者交给适配器的是平台换算好的过滤条件(记录 id 或某个筛选字段的 id),不是卡面写的「对象 + id」原样,这与记录第 17 项原文「由服务构建」和裁决记录「过滤条件变成该字段在 ids 内」一致,是卡面措辞不准,不是改了您裁的东西。第 ③ 处是唯一有产品语义分歧的细节,席位推荐现稿的「不参与并记日志」:两个字段取并集会把「只是引用了这份制度」的别处条款算进来,答错比答空更糟;今天零用例,等第一个真实知识源出现再用一条补充说明放开。

席位核对

ACCEPT
Head-sha: 8a64f99ffd1d0056e85a3ea9fa233a8b4a12357c

  1. 形态。 l1-face.mjs --pr 37329 于 2026-11-25T17:18Z 现读:open · draft · base main;首行 Fixes #37324,不绑其他卡;Clause-②: yes · Metadata-protocol: none;Skills-docs: 不欠(kind none、无 narrowing);无 content/docs/releases/ 路径;无 changeset、无空 changeset,未触及任何已发布包,skip-changeset 由 objectstack-fleet[bot] 于 17:13:46Z 随 PR 创建挂上,席位自核 diff 为单个 docs/adr/** Markdown 文件,docs-only 成立。Fixes 判定成立:卡的三项交付(第 17 项下的带日期说明、声明规则 3 与 5 只为这一个成员修订、点名 service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308 与 search_knowledge: the one definition gains scope, granularity and groupBy, for the MCP door and the in-app agent alike #37311)与两条验收(引裁决 id 与原话、不改记录既有文字)在 diff 里逐项读到。标题与正文如实;正文 What changes 写的 merge-base 829a45e9 与 git merge-base 读数一致。
  2. 前提实测。 git diff origin/main...refs/l1/37329:1 文件,+17 −0,文件面与认领评论 7168526417 申报的唯一路径一致。裁决 7168192820(service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308)逐字比对:说明引的「也能指定上级对象(制度)」与「直接给制度 id 就只在这份制度里搜;前提是知识源把指向制度的字段列为筛选字段,没列就返回空。1 个 PR,略大。」与裁决记录一致。main 上第 17 项仍为 "Deferred",表格与 Status 行在本 diff 中零改动。说明引的代码事实席位在 head 树与 origin/main(fbb62e1c,merge-base 之后 10 个提交,含 feat(service-knowledge)!: one splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key; KnowledgeChunk.metadata and knowledge.chunk_overlap retired #37287)各读一遍,全部成立:referenceTargetOf 对 user 恒答 sys_user(REFERENCE_VALUE_TYPES 含 lookup、master_detail、user、tree);recordToDocument 把 metadataFields 的存储值原样写进 metadata 并跳过凭据类与 internal 字段;admitSourceFields 要求索引携带的每个 metadataFields 成员对调用者可查询;knowledge-memory 的 matchesFilter 在排序前过滤、命中带回文档 metadata;createKnowledgeTools 调 search 不传 filter;仓内无任何知识源把引用字段列进 metadataFields(grep metadataFields,命中仅 spec、服务与其测试)。git merge-tree origin/main refs/l1/37329 无冲突。
  3. 门禁 check-runs(head 8a64f99ffd1d0056e85a3ea9fa233a8b4a12357c,2026-11-25T17:26:39Z 读,全部 completed):49 个 check-run,26 success · 23 skipped(l1-face 于 17:18Z 判为预期 skip,0 unexpected skip)· 0 failed · 0 pending。两个 required 地板 Lint & Repo Gates 与 TypeScript Type Check 均 success;另含 Test Core、Lint · docs & code guards、Lint · repo & tooling gates、Lint · CI, release & engine gates、Lint · PM dispatch-gates、Governed Surface Queue Guard、Check Documentation Links、Check Changeset、PR-body guards,均 success。dev 报告的本地 21 族门禁只证本地子集,不替 check-runs;报告写的短 sha 8a64f99f 与 head.sha 相符。
  4. 接受的偏差。 (a) 适配器成员收到的是服务换算好的 term(record / metadata 两种),不是 ADR-0161 K8 item 17: a dated note fixes the record-scope shape — scope: [{ object, ids }] on search and the adapter filter, a parent object reached through a lookup the source lists in metadataFields #37324 卡面写的 [{ object, ids }] 原样:接受。依据是记录第 17 项原文 "built by the service from scope: [{ object, ids }]"、裁决记录 "the typed filter becomes 'that field in ids', applied before ranking"、service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308 第 3 条 "the service builds the typed filter and passes it to the adapter",以及 K1(适配器不读对象定义);卡面是席位自己的简写不准,此处当众认,更正即本条。(b) 说明内 ◆ 所标各项(成员形状、缺席/在场/空三态、四条读法、服务端兜底校验、不新增能力标志、不透明 filter 原样保留)为记录在裁决原话之外自定的形状,照 ADR-0161 Status 行的既有做法标 ◆ 交批准人随合并接受或划掉;其中读法 (4)(两个引用字段指向同一上级对象 ⇒ 该源不被此条目触及并记日志)是唯一产品语义有真实分歧的一项,已写进上方速读,由维护者合并时一并裁。(c) 说明把四件事留给 service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308 的代码 PR(权限过滤后的补取是否计入范围校验剔除的命中、服务选项为空或条目无 id 时答空还是拒绝、上限数值、日志级别):接受,四件都不是「适配器作者为了正确必须读」的成员形状(K8 "What counts as a member"),成员一侧的三态已在说明里定死。
  5. 范围外去向 + Skills-docs:。 dev 报告一条范围外发现:不透明 filter 在仓内无生产者、无服务端保证,记为 "noted, not filed · carrier: none";说明写明其去留另立卡。席位照 filing-gate.md 判断是否立卡,不在本 PR 内处理。Skills-docs: 行不欠。契约审核的五条 nit(见下)随 service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308 的派发令带给代码卡,不要求改本 PR。
  6. 落地条款。 docs/adr/** 为 governed 面,且说明教授权限行为(Security-touching: yes),不走只增 ADR 的低风险臂:Tier H,维护者本人合并,席位不批、不合、不入队。顺序:本记录置顶落 PR(贴前重读 head.sha 仍为本 head) ⇒ pr_ready ⇒ 同笔挂 pm:awaiting-merge 并交棒请审(PR 作者为 objectstack-fleet[bot],已 assign os-warren)⇒ 卡 ADR-0161 K8 item 17: a dated note fixes the record-scope shape — scope: [{ object, ids }] on search and the adapter filter, a parent object reached through a lookup the source lists in metadataFields #37324 留指针行。合并后 ADR-0161 K8 item 17: a dated note fixes the record-scope shape — scope: [{ object, ids }] on search and the adapter filter, a parent object reached through a lookup the source lists in metadataFields #37324 由 Fixes 自动关闭;service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308 的 Blocked-by: #37324 解除,其代码 PR 触 packages/spec/src/contracts/**,另欠一轮达档契约审核。

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 8a64f99ffd1d0056e85a3ea9fa233a8b4a12357c
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: yes

Face: governed rules text (docs/adr/**), so the tier is CONTRACT_REVIEW_TIER and the full ①–④ is owed. Governing text: ADR-0161 K1 (the boundary), K8 item 17 and item 9, K8 "What counts as a member", K8 rules 1, 2, 3 and 5, K9 rules 2, 3 and 6, K10 rules 2 to 4; ruling record 7168192820 on #37308 (Q3 = B); the dated-note precedent of PR #37263. Code outside the diff was read, not reviewed, at the head tree and at origin/main fbb62e1c.

① Derived judgments

  • The record's earlier text is unchanged. +17 −0. The table row of item 17, the Status line, rules 1 to 5 and the service-knowledge: documents carry their organization, and search hands the caller's organizations to the adapter #37097 note are byte-identical; the additions are one Amended header bullet and one blockquote placed after the service-knowledge: documents carry their organization, and search hands the caller's organizations to the adapter #37097 note, the form PR docs(adr): ADR-0161 dated note — the document hash covers the organization of a document that has one (K8 items 2 and 9) #37263 used. The note's last sentence says "The table is left as written; read item 17 with this note."
  • The ruling is quoted by id and in the maintainer's words, verbatim against comment 7168192820, and the sentence drawn from it ("an entry names the object a source indexes, or a parent object the source reaches through a lookup field it lists in metadataFields, and a source that lists no such field answers nothing for the entry") restates the ruling record's "What is ruled" without widening it. The two-hop limit the ruling record requires the note to state is stated.
  • One member, as rules 3 and 5 require. The note adds AdapterSearchOptions.scope? with its term type and closes the list again. KnowledgeSearchOptions.scope is an option of the service, which K8 names as "not a member ... scope in row 11", so leaving its bounds and its empty answer to service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308 is inside the record. Rule 1 (lands with its first reader and a suite case) and rule 2 (optional; nothing skipped silently) are both carried: the suite cases are named, and an adapter that ignores the member keeps working while the service drops out-of-scope hits and logs once.
  • Resolved terms, not { object, ids }, on the adapter. This is the reading the governing text already holds: item 17 says the typed form is "built by the service from scope: [{ object, ids }]"; the ruling record says "the typed filter becomes 'that field in ids', applied before ranking"; K1 says an adapter "does not read records" and the platform holds "the object's fields". Handing an adapter an object name would require it to read an object definition, which K1 forbids. ADR-0161 K8 item 17: a dated note fixes the record-scope shape — scope: [{ object, ids }] on search and the adapter filter, a parent object reached through a lookup the source lists in metadataFields #37324's body wrote the same list on both interfaces as shorthand; the note corrects the card, not the ruling. Precedent for the form: item 9's organizationIds, a filter the service computes and the adapter applies before ranking, whose absent, present and empty readings the note copies from the member's TSDoc on main.
  • Readings past the ruling's words. (1) union of several entries: the natural reading of a list whose entries already carry ids as a set; seat-reasonable. (2) an own-object entry is the record term only: seat-reasonable. (3) only lookup and master_detail are parent links, target by referenceTargetOf: the ruling record says "a lookup field", and master_detail is the spec's literal parent link; excluding user (target fixed to sys_user) and withheld fields is the narrow reading, and opening it later adds hits and removes none. (4) two reference fields to the same parent: the one reading whose alternatives differ in what a customer sees. The note takes the fail-empty arm, which follows the ruling's own 「没列就返回空」 direction, has no consumer today (no source in the tree lists a reference field in metadataFields), and can open later by a dated note without removing a hit. It is marked ◆ and surfaced to the approver in the PR body and in the seat's 速读, and the PR lands only by the maintainer's own merge, so it reaches him before it takes effect.
  • Security reading. Scope only narrows. The filter is judged on the index copy and the access decision stays the permission re-read of the live row for every hit. admitSourceFields already refuses a caller for whom any carried metadataFields member is not queryable, so "that field in ids" is a filter the caller could run on the object's own rows, and not reading the parent row opens no oracle. An entry that reaches no source and a withheld source give the same empty answer. Counts of removed hits go to logs only (K9 rule 6, K10 rule 4). The service's check fails closed on a hit that carries no value.

② Semver level

None. docs/adr/** publishes nothing; no changeset and skip-changeset are right for this repository. Metadata-protocol: none is right: no key a metadata author writes is added (the parent link is an existing metadataFields member). Clause-②: yes is right as declared: the note fixes the shape of a public contract member, and the declaration is what the claim comment carries. The member itself ships in #37308 as an optional addition to packages/spec/src/contracts/knowledge-adapter.ts with its own declaration and changeset.

③ Boundary flags

  • The dev report's open_questions is empty. Its one out-of-scope finding (the opaque filter has no producer and no service guarantee) is answered by the note itself (unchanged; its own card) and goes to the seat's filing gate.
  • The deliberate difference from the card body is answered in ① and accepted.
  • SQL push-down: the member exists so that an adapter filters before ranking in its own store ("that field in ids" pushes down as an IN on a stored column in a SQL adapter). The service's after-check runs over at most the hits one adapter call returned and materialises no id set beyond the caller's own ids. No finding.
  • Author: the PR's user.login is objectstack-fleet[bot].

④ Design judgment

The change holds against the cited code and against the acceptance scenes of #37308 (20 records, two ids, topK: 5, a full in-scope page; a stub adapter that ignores the member; an unreachable object; an unreadable scoped record). First consumer and execution plan are named: #37308 builds the member with knowledge-memory as first reader and the suite cases in one PR; #37311 adds the tool argument; #37103 is unaffected and already relies on hit metadata for its group value. No must-fix and no should-fix. Nits, none of which blocks this head; each is carried to #37308's dispatch:

  1. nit — "This note adds exactly one member" is exact for keys, but the note also makes returning the document's metadata on a hit a condition for a metadata-term hit to survive the service's check. It is disclosed under ◆ and matches main (knowledge-memory returns it; feat(service-knowledge)!: one splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key; KnowledgeChunk.metadata and knowledge.chunk_overlap retired #37287's text says every adapter stores the document's metadata), so service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308 states it on KnowledgeHit.metadata's TSDoc and pins it in the suite.
  2. nit — the note says a value "is in ids" without saying how values compare. service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308 compares ids as strings, as sourceRecordId is stringified at assembly, and pins it.
  3. nit — reading (4) lists four other answers; a fifth, "a master_detail field wins over a lookup to the same object", is not listed. It needs no place now (no consumer); it belongs in the dated note that opens reading (4) with its first reader.
  4. nit — the PR body says the note fixes that an empty KnowledgeSearchOptions.scope never reads as "no scope". The note gives this by construction ("A source no entry reaches is not searched") and not in one sentence; service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308's code PR must hold it whichever of empty answer or refusal it picks.
  5. nit — the Status line says the ◆ points are listed in "Points the rulings do not settle"; this note keeps its ◆ points in place, as an add-only note should. No change asked.

The bound on entries and ids is adapter-facing ("so that an adapter can rely on them") and lands on the member's TSDoc in #37308; that PR touches the published contract and owes its own review at this tier. If #37308 finds any shape here cannot be built as written, K8 rule 3 applies: it stops and the change is another dated note.

Implemented-by: claude/project-thread-3zr6fx
Reviewed-by: session_01JQwxbW5anP6GDaVi5LKi2U

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:cloud#1 · os-warren · session_01JQwxbW5anP6GDaVi5LKi2U

Hand-off for approval (Tier H, docs/adr/**): seat record ACCEPT and ## Contract review PASS are in comment 7169539288, both on head 8a64f99ffd1d0056e85a3ea9fa233a8b4a12357c.

  • 要你做的:批准这个 ADR 补充说明(范围检索可以指到上级记录);记录里标了三处「◆」理解请过目,其中一处(一个知识源有两个查找字段指向同一上级时不检索、只记日志)可以划掉改选别的方案。批准后席位负责落地。

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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

3 participants