Repository navigation
Description
maintainer · os-project-manager · session_01FEkQ5oW6SeQkzCccNxEc83
Filing gate: ② a decision only the maintainer can make (topic child; a new authorable key needs a ruling and an ADR-0161 note before any code). Source: topic #38346. Key words (maintainer, 2026-11-29, this session): 「检索按提问人单位加权,每种知识的要求不同吧,你的评估不能只考虑当前的规章制度,要考虑客户可能开发的各种元数据应用」「相关任务都加入知识专题」.
Grading: area:ai · Feature · p3 (dispatched in the topic's order after the ruling, not by grade) · reach: every app whose right answer depends on who asks or on how fresh the record is · evidence: measured in one evaluation with the asker simulated in the prompt (below); the rest read from the code on main 3511432.
Blocked-by: #38363
维护者速读
- 问题:同一个问题,不同的人问,应该排在前面的内容不一样(本单位的制度先于集团的;自己的客户纪要先于别人的;本产品线的工单知识先于其它线),而且每种知识的规则不同。现在检索对所有人按同一个顺序排,模型只能反问「你是哪个单位的」。
- 选项:A 在知识源上加一段声明式的「检索排序」配置,写明哪个字段和提问人的哪种身份相关、怎么用(加权、只留相关的、就近优先)、按哪个日期字段衰减、命中后带出哪些相邻或关联内容;不写就完全不加权。B 不加平台能力,把提问人身份告诉模型,由各应用在技能说明里教模型自己加过滤条件。
- 推荐:待决策线程按四轴写(本卡给证据、形状和四类应用的适配表)。
- 不定会怎样:每个应用各自在提示词里写一套「按单位找」的规则,效果随模型波动,换一种知识就要重写。
The question
May a knowledge_source declare, per source, how its hits are ordered for the person asking, and what a hit brings with it? If yes, in which shape, and as ranking only.
Evidence
- In a policy Q&A evaluation (1,923 documents / 67,379 passages, libSQL store, 132 questions; a small model answering over MCP, a separate model grading blind; one run), putting the asker's unit chain in front of the model moved the whole set from 86.7% to 92.4%, the questions whose answer depends on the asker's unit from 59.4% to 93.8%, and the turns that ended in a clarifying question from 41 to 2. That measures "the model knows who asks" (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), with the model then doing the narrowing itself. It is the upper-bound signal for this card, not a measurement of platform-side ranking.
- What the platform has today:
search_knowledgeacceptsquery,sourceIds,topK,scope,granularity,groupBy(packages/services/service-knowledge/src/knowledge-tools.ts:321). The service contract already has a metadata-equalityfilter(packages/spec/src/contracts/knowledge-service.ts:62-63, run in both legs by both stores) that the tool does not expose. The search already over-reads and refills after the permission re-check (SEARCH_REFILL_FACTOR = 20,knowledge-service.ts:4402). The adapter contract carries "no rerank toggles" (packages/spec/src/contracts/knowledge-adapter.ts:18-19, ADR-0161 K8 rule 4), so ordering by declared fields belongs to the service, over the indexedmetadataFieldsvalues, not to adapters. - Identity vocabulary that already exists for predicates:
current_user.positions, the pre-resolved membership sets (rlsMembership,packages/spec/src/kernel/execution-context.zod.ts:569-585), and the declarative membership keys of Spec design: declarative membership keys for RLS (current_user.<key> from a lookup on records whose user field is the current user) #25234 (ruled, closed).
Proposed shape (option A; for the decision thread to confirm or reshape)
retrieval: {
affinity: [{ field, asker, mode, weight }],
recency: { field, halfLifeDays },
expand: { siblingsBy, window, follow },
}affinity[].field: one of the source'smetadataFields(refused at publish otherwise).affinity[].asker: a CLOSED vocabulary resolved by the platform from the caller's execution context, the same way row-level predicates readcurrent_user.*:userId|positions|businessUnitChain|teams|organization. ⛔ Never a value the client or the model supplies.affinity[].mode:boost(matching hits rank higher byweight),filter(only matching hits; the service passes it as the existingfilter/ scope),nearest(for a hierarchy: the asker's own unit first, then each ancestor in order, then the rest).recency: an exponential decay on a declared date field of the source'smetadataFields.expand: what a hit brings with it, each part re-checked as the caller:siblingsBy+window: the neighbouring passages of the same document or heading path (this is row 2-3 of Topic: knowledge splitting and retrieval for any content, phases 0–2 (no lost text, one passage per unit, passages that carry their context, hits a model can use) #38346, absorbed here if the ruling takes option A; otherwise it stays a row).follow: a declared lookup or master-detail field of the indexed object, ONE hop: the related record's display fields, read at query time under the caller's row- and field-level permissions and never stored in the index, and optionally that record's own best passages when it is indexed by a source the caller may search. This covers "supersedes", "references", "forwarded from", contract ↔ amendment, and the parent of a child-record passage (the residue of search_knowledge: hits do not return the source's metadataFields, so a child-record passage needs an extra read to find its parent #38291: a hit'smetadatacarries the parent's id, not its name). The object model is already a typed, permissioned graph; no separate graph store or graph extraction is proposed.
- Omitted block: today's behaviour, byte for byte. A public FAQ source declares nothing.
- Ranking only. It runs over the candidates that survived the permission re-check, inside the existing refill cap; it never widens what a caller may read, and
filtercan only narrow. The count of hits removed stays unreported, as today. - Each key lands with its reader in the same PR (ADR-0049);
affinitywaits for 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's identity resolution,recencyandexpand.siblingsBydo not.
The same four keys across unrelated apps
| App | affinity |
recency |
expand |
|---|---|---|---|
| CRM visit notes | owner ↔ userId, boost; territory ↔ teams, filter |
activity_date, 90 days |
follow: account |
| Support knowledge base | product_line ↔ teams, boost; the public FAQ source declares nothing |
reviewed_at, 365 days |
siblingsBy: heading |
| Contracts | signing_entity ↔ businessUnitChain, filter |
effective_date |
follow: amends (contract ↔ amendment) |
| Policies | owning_unit ↔ businessUnitChain, nearest (own unit before the group) |
none | follow: supersedes, siblingsBy: heading |
No row needs code in the app, and no key names a policy concept.
Options
- A: the declarative block above, in slices: (1)
recencyandexpand.siblingsBy, no identity needed; (2)affinity, after 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; (3)expand.follow. One ADR-0161 dated note first. - B: no platform ranking. 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 tells the model who asks;
search_knowledgeexposes the existingfilterovermetadataFields; each app's skill text teaches the model to narrow. Cheaper; depends on the model following instructions, and has no "nearest in the hierarchy" or decay. - C: A's
expandonly (it is hit shape, already on the topic as row 2-3), with ranking left to B until a second app asks.
Decision owed
Analysis (four axes, facets block, prior-rulings line, workload precedents) is owed by a decision thread. Not dispatched before a ruling is recorded here. Open points for that thread: whether filter mode is allowed at all given that sharing already decides visibility (a source-declared filter is a relevance narrowing, and must not be read as access control); the combination rule when several affinity entries match; how granularity: 'record' and groupBy interact with a re-rank; whether the tool gains an explicit opt-out for a caller who wants the unweighted order.
Reader
The decision thread, then repo:objectstack#5 (the seat holding #38346).
Related, not children: #38291 (hit metadataFields, landed as PR #38353), #25234 (declarative membership keys for row-level security, the precedent for a platform-resolved asker vocabulary), #37001 (ADR-0161, the knowledge platform boundary), #37000 (knowledge platform topic), objectstack-ai/brightrule#88 (the evaluation tooling).
Dedupe (open and closed): knowledge rerank 3 (none on declared ranking) · knowledge_source retrieval ranking asker 0 · knowledge recency boost 0 · search_knowledge neighbour passages 2 (#38346 row 2-3 only) · search_knowledge filter metadata argument 13 (all closed; none exposes filter on the tool) · knowledge graph 68 (none on knowledge retrieval; no graph card is filed, by the reasoning under follow).
Activity
objectstack-fleet commentedon Nov 29, 2026
triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t
Triage: lands in
packages/spec/src/ai/knowledge-source.zod.ts(a new authorableretrievalblock), the readers inservice-knowledge(knowledge-service.ts,knowledge-tools.ts) and an ADR-0161 dated note · area:ai · domain:spec (provisional; the readers are domain:server) · Feature · p3 · needs-user-decision (as filed) · size L. Rationale: a new authorable key with no precedent. That is a contract shape, and itsfiltermode sits beside the permission boundary, so it is on the human floor. The topic pre-authorises building, not the shape. A child of #38346, never folded or moved.Blocked-by: #38363applies only to option A slice 2. ⛔ The decision thread owes the four-facet block, thePrior rulings read:line and the recommendation before it is presented.Recorded 2026-11-29T00:50Z.
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5mr5AivC4JTuX2FB6Q
Decision analysis · 2026-11-29T05:06Z · #38412, whether a knowledge source may declare how its hits are ordered for the person asking and what a hit brings with it. Written by the decision thread opened for seat repo:objectstack#5. ⛔ Not a claim and not a ruling: the maintainer rules.
维护者速读
Background
Card #38412 (p3, Feature, area:ai, domain:spec, child of topic #38346) asks whether a
knowledge_sourcemay carry a declaredretrievalblock with three parts:affinity(a declared field against a fact about the caller: boost, filter, or nearest in a hierarchy),recency(decay on a declared date) andexpand(neighbouring passages, and one declared lookup hop). It was filed from the maintainer's words of 2026-11-29: 「检索按提问人单位加权,每种知识的要求不同吧,你的评估不能只考虑当前的规章制度,要考虑客户可能开发的各种元数据应用」. Triage (7248389675) kept it on the human floor: a new authorable key with no precedent, and afiltermode that sits beside the permission boundary. The area claims #38363 (the model is told who is signed in) next; the card'saffinitywaits on it.Governing text
filterstays as it is ... handed through, adapter-specific, and checked by nothing in the service after the adapter answers." The card's option B proposes exposing thisfilteron the tool; the typedscope, which the tool already takes, is the governed way to narrow.boostnamed as a deferred server-side knob.retrievalblock — rank hits by the asker's relation to a declared field, by recency, and expand a hit along declared structure #38412 (expand) ... it stays a row here if that ruling declines the block."retrievalkey:node scripts/pm/check-prior-rulings.mjs --card 38412 --terms retrieval,ranking,rerank,affinity,recency,boostnames nine ADR decisions, none on knowledge ranking by a declared field.Protocol statement: A (both forms) and C add an authorable key to
packages/spec/src/ai/knowledge-source.zod.ts: a widening, Clause-② yes,Metadata-protocol: added, after a dated note on ADR-0161 (Tier H). B edits no protocol.Premises, each with its re-check (read on main
d89d3e23)search_knowledgetakesquery,sourceIds,topK,scope,granularity,groupBy, and nothing that orders hits.sed -n 108,118p packages/services/service-knowledge/src/knowledge-tools.ts.grep -n "b.score - a.score" packages/services/service-knowledge/src/knowledge-service.ts(two lines).knowledge_sourcehas no ordering key.grep -n -i -E "affinity|recency|retrieval:" packages/spec/src/ai/knowledge-source.zod.tsprints nothing.grep -n "score a candidate" docs/adr/0161-*.md(one line).metadataFieldslookup is built and on the tool: PR feat(service-knowledge): search inside chosen records — the record scope, by the records a source indexes or by a parent through a listed lookup #37342 (the member and both readers) and PR feat(service-knowledge): search_knowledge takes scope, granularity and groupBy #37393 (the tool'sscopeargument), both merged. A model that knows the caller's unit ids can already pass them as a scope when the source lists the unit field.grep -n -i -E "business_?unit|unitChain" packages/spec/src/kernel/execution-context.zod.tsprints nothing;positionsand therlsMembershipbag are there. Resolving the chain on the platform is new work that 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 also needs.grep -n -E "^\s+[a-zA-Z]+\??\(" packages/spec/src/contracts/knowledge-adapter.tslists nine members, none of them a passage read. So "the neighbouring passages" is either a new member (the K8 list is closed: a dated note) or a re-split of the live record read as the caller. A design point for the note, not for this ruling.pm:queue, unclaimed as read; the area claims it next.The question
The same question should surface different content for different askers, and what "closer to the asker" means differs per kind of knowledge. Does the platform order hits by a rule the knowledge source declares, or does it tell the model who is asking and leave the narrowing to each app's prompt text?
Options, real cost, effort
expand.siblingsBy(no identity needed),affinitywithboostandnearestafter #38363, thenexpand.follow. Nofiltermode.recencyis not in the first note and returns by a dated note with its first consumer, as the record already does for shapes with no reader.recencyand thefiltermode.expandonly (a smaller note, then 1 to 2 PRs). Ordering stays with the model, as in B, until a second app asks.scope; each app's skill text says how.Business meaning
Four axes
filtergrows a second way to narrow beside the typed scope and a second thing that looks like access control beside sharing; the two-implementations rule keeps the governed one. B grows no contract and leaves one special case per app, in prose. C is the half of A that needs no identity.metadataFieldsis refused at publish. When it is wrong, the author sees a refusal. B: a prompt rule that a model skips fails silently, and the user reads a confident answer from the wrong unit's policy.filterin A-full: an AI author will reach for it as access control; the record stays readable through the record tools, so the author believes something is hidden that is not.weightand a half-life are numbers nobody can check at publish; the fewer of them the better.os-decision-facets
① Long-term fit: A-lean moves "who comes first" out of per-app prompt prose into one declared, closed-vocabulary block (shrinks the special case) at the price of amending K1's "the service does not score a candidate"; A-full also adds a second narrowing beside the typed scope and sharing; B keeps one prose rule per app and model; C is A's identity-free half.
② Real pull: measured once that knowing the asker lifts unit-dependent answers 59.4% to 93.8%, which #38363 delivers alone; the gain of platform ordering on top is not measured; zero pull on a date decay.
③ AI error surface: A-lean refuses a wrong field at publish and never trusts a client-supplied identity; B fails silently in the answer; A-full's
filterinvites use as access control.④ No spread: B adds nothing, C one sub-block, A-lean one block with two parts, A-full two more shapes with no consumer.
Prior rulings read: retrieval,ranking,rerank,affinity,recency,boost → 9 hits; ADR-0061 D2, ADR-0061 D3, ADR-0061 D4, ADR-0063 Decision §3, ADR-0063 Decision §5, ADR-0064 Decision §3, ADR-0098 Decision §3, ADR-0106 D3; thread: none; repo: objectstack-ai/objectstack
Also read, by hand: ADR-0161 K1, K8 rule 4 and the item 17 note; topic #38346; #38363; triage 7248389675. None of the nine ADR decisions answers this card: ADR-0061 is record search, the rest match on a word only.
Recommendation
A-lean. End state: two years on, an app that indexes several kinds of knowledge says on each source which declared field relates to the asker and how (own first, nearest in the hierarchy first), and what a hit carries with it. The platform resolves the asker and applies the rule after the permission re-check, the same on every door. Models are told who asks (#38363) and still narrow by scope when they want to; the two do not compete.
Not taken. A-full: its
filtermode repeats the typed scope and reads as access control, and its decay has no consumer; both can return by a dated note with a reader. C: it leaves the part the maintainer asked about, ordering by the asker, in prompt prose. B: it works only where a model follows instructions, cannot say "nearest first", and fails without anybody seeing it.Effort note: A-lean is about three PRs and a note against B's none. The ① readings are not close, so the difference does not move the letter. ② and ④ set the order instead:
expand.siblingsByfirst,affinityonly after #38363, and the decay out of the first version.Self-check: ① alone picks A-lean; ②③④ flip it: no. ② and ④ trim A-full to A-lean and order the slices; ③ removes
filter.Confidence gaps:
affinityslice should carry it as acceptance: on the same question set, three arms (no identity, the model told, the model told plus a declarednearest), at least three runs each. If the third arm does not beat the second beyond the run-to-run range, that result comes back to the maintainer beforeexpand.followis built.After the ruling
filtermode (narrowing stays the search scope, visibility stays sharing); K1's sentence amended by name; the caller fact is a closed list the platform resolves; severalaffinityentries add, and a source declares at most onenearest; the re-order applies to the unit that is returned (passage, record or group) inside the existing refill bound, and no count is reported; no opt-out argument on the tool until a consumer asks. Then one card per slice, eachBlocked-by:the note,affinityalsoBlocked-by: #38363. This card closes on the ruling record.recencyandfilterin the note; the note then has to say in words thatfilteris not access control.scope.Related: #38346 (topic), #38363 (the model is told who asks), #38291 and PR #38353 (hit metadata), #37308 and #37311 (the typed scope and its tool argument), #37001 (ADR-0161), #25234 (declared membership keys).
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5mr5AivC4JTuX2FB6Q
Ruling: letter A-lean · maintainer 「A 精简:排序加带出」 · recorded 2026-11-29T06:01Z
os-project-manager) tapped option A on the decision card at 2026-11-29T06:00:54Z. The card's question, as he read it: 「定知识检索要不要按提问人排序并带出相邻内容」. The option's label, verbatim: 「A 精简:排序加带出」. Its one-line consequence on the card, verbatim: 「平台按提问人排序(加权、本单位就近优先),命中带出相邻或关联内容;不做硬筛选,按时间衰减等有应用要再加。一份架构记录加约三个 PR。」 He added no condition.cmsg_01TenzsRopZj4jMbvjX8uz1XDhnaLQdueQRRJsU18ywLAR, decision cardcmsg_01TenzsRopZj4jMbvjX8uz1XBynL1U9JEKLJc6GVeLWrgY, option index 0. Analysis: comment 7251063339 on this card (option A-lean there).knowledge_sourcemay declare how its hits are ordered for the person asking and what a hit brings with it. The platform builds two parts: ordering by the asker's relation to a declared field (a boost, and nearest in a hierarchy), and a hit that brings its neighbouring or related content. No hard-filter mode. A decay by date is not in the first version and returns when an app asks for it. One dated note on ADR-0161 first, then about three PRs.filtermode), 「C 只做带出相邻内容」, 「B 平台不做排序」.filtermode); the note amends by name ADR-0161 K1's sentence "The service does not ... score a candidate"; the caller fact is a closed list the platform resolves, 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; no opt-out argument on the tool until a consumer asks; theaffinityslice's acceptance measures three arms on the same question set (no identity, the model told who asks, the model told plus a declarednearest), at least three runs each, and if the third does not beat the second beyond the run-to-run range that result returns to the maintainer beforeexpand.followis built.Blocked-by:the note and theaffinityslice alsoBlocked-by: #38363; the state change on this card (out of the decision box) is the seat's.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5mzSTSPADAvwapnhxr
Ruled: A-lean (7251603512, maintainer 「A 精简:排序加带出」) · cards filed · 2026-11-29T06:11Z
expandneighbouring content.Blocked-by: #38502.affinity(boost, at most onenearest).Blocked-by: #38502,#38363. Its acceptance is the three-arm measurement; a result where arm 3 does not beat arm 2 beyond the run-to-run range goes back to the maintainer before knowledge_source: a hit brings one declared lookup hop (expand.follow, #38412 ruling) #38505.expand.follow(one lookup hop).Blocked-by: #38502,#38503.filtermode, date decay (returns by a dated note with its first consumer), any opt-out argument on the tool.This card closes on the ruling; the work continues on the four cards above, all under #38346.
docs(adr): ADR-0161 dated note, a knowledge source declares how its h…