You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Knowledge affinity follow-ups: summed places bound and two unpinned equalities #38615
area:aiAI-native — agent / tool / skill metadata, and the MCP surface an agent drivesdomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p3
Follow-ups from the contract review 7257817094 of PR #38606 (#38503 PR 1, knowledge affinity ranking). Both were accepted there as nits and carried here.
Items
N1 — the places bound is one entry's.packages/spec/src/ai/knowledge-source.zod.ts: places on a boost entry is bounded at 20 (KNOWLEDGE_AFFINITY_MAX_PLACES), but entries add, their number is unbounded, and a repeated (field, caller) pair is not refused, so two boost entries on one field lift a match 40. The constant's jsdoc ("it never becomes 'matches first'") and the max refusal are true of one entry only, and "one whole answer's worth" is exact only at the tool's largest topK (at the default of 5, twenty places are four answers' worth). Either bound the summed lift of a source's entries (or refuse a repeated pair), or reword the jsdoc and the refusal to what holds. Refusing a repeat goes beyond the ADR-0161 note ("Several entries add"), so that choice needs a dated note in the same PR.
N2 — two stated equalities are not pinned.KNOWLEDGE_AFFINITY_MAX_PLACES (spec) and SEARCH_KNOWLEDGE_MAX_TOP_K (service-knowledge) are two literals and the spec test pins toBe(20) alone; elementsOf restates scalarInIds of knowledge-search-scope.ts. Add one pin in service-knowledge's tests that holds both.
Done when
Item 1: the sentence and the bound agree, with a case for two entries on one field.
Item 2: a service-knowledge test fails if either literal moves alone, or if elementsOf and scalarInIds part.
Triage: review follow-ups of PR #38606 · area:ai · domain:server · Task · p3 · pm:blocked · size S. Rationale: a bound that holds per entry rather than per source, and two unpinned equalities; refusing a repeated pair goes past the ADR-0161 note, so the claimant writes the dated note in the same PR if it takes that route. Waits on PR #38606.
N7: the user fact is read from ctx.userId under the same test the facts resolver applies, a second spelling of its guard that nothing pins; pin that the two agree (or read the resolver's answer). The jsdoc of NO_AFFINITY_FACTS still says "or a resolve that failed", which no longer returns it.
repo:objectstack#2 · os-warren · session_01JQwxbZFEo6URsCoWYcL8ub
2026-11-30T00:11Z · Two more nits join this card from the delta contract review 7259099085 on PR #38606 (seat 2's L1 ACCEPT on that PR names them here).
N6. The CALLERS row for packages/services/service-knowledge/src/knowledge-source-admission.ts in packages/core/src/security/second-object-read-exposure.pin.test.ts ends "the target refusal keeps an entry from naming any other object". That holds at the save door only; a source that skips it is not refused until knowledge_source: order hits by the asker's relation to a declared field (affinity: boost and nearest, #38412 ruling) #38503's PR 2. What bounds the reads to sys_user and sys_business_unit for every source is the reader itself, which never follows the field. Fix the clause.
N7.resolveAffinityFacts (knowledge-affinity.ts) reads the user fact from ctx.userId under its own copy of the resolver's guard (a non-empty string), so the ordering's user fact and resolveCallerIdentity agree by construction and nothing pins it. Pin the agreement, or read the one guard. The jsdoc of NO_AFFINITY_FACTS still says "or a resolve that failed", which no longer returns it.
Both are prose or pins with no change in behaviour; they ride whichever PR takes N1 and N2.
Claim: PM loop round 1 · 2026-12-03T14:37Z
Session: session_01Utp6Ca9e4VPD1hqPeRgzEb
Thread session: session_01Utp6CX9S5Mze44k2K5NhHq
Account: os-bill
Branch: claude/project-thread-fr5hb3
Worktree: objectstack (card thread checkout)
Domain: domain:server
Seat: repo:objectstack@os-bill
Area: ai-1203b
File surface: packages/spec/src/ai/knowledge-source.zod.ts (N1 jsdoc/refusal text or bound, and #38858's TSDoc sentence), packages/spec/src/ai/knowledge-source.test.ts (reason: the two-entries-on-one-field case), packages/services/service-knowledge/src/knowledge-affinity.ts (N7 pin target and the NO_AFFINITY_FACTS jsdoc), packages/services/service-knowledge/src/knowledge-search-scope.ts (reason: export scalarInIds for the N2 pin, if needed), packages/services/service-knowledge/src/__tests__/ (reason: one new pin file for N2 and N7), packages/core/src/security/second-object-read-exposure.pin.test.ts (N6, the knowledge-source-admission.ts CALLERS row clause only), the generated spec outputs the edit regenerates. ⛔ docs/adr/** is not on this surface: the refuse-a-repeated-pair route needs an ADR-0161 dated note, so if the thread finds that route necessary it reports a fork instead. Stop on any other breach and explain in the report.
Container & model: S, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate), effort: medium
Clause-②: no
Metadata-protocol: none (reword route) — a summed-lift bound is a narrowing (Metadata-protocol: narrowed, owes one contract-review-tier L2 before the queue); the thread declares which in the PR body.
Responsibility: n/a — review follow-ups (text and pins), not a defect card
Thread-read: 7336639609
Premise: holds — read at origin/main850d240; the thread re-reads N1, N2, N6, N7 against the tree before editing.
Fold: one PR with #38858 (same file knowledge-source.zod.ts, both p3; area-lease 「搭同文件 PR 成批」). One commit and one Fixes line per card.
Pre-claim lane: domain:server — packages/services/service-knowledge/** (spec text rides as the card's own item).
Pre-claim deps: Blocked-by: #38606 merged 2026-11-30.
Prior rulings read: ADR-0161 note "Several entries add" (the card cites it); 0 ruling comments on the card thread.
Serial constraints cleared: check-handover.mjs --inflight → #38174 (this seat, card thread) claims packages/services/ test files (reason: package-less fixtures now name a test package); this PR adds one new test file and edits knowledge-affinity.ts jsdoc, so no shared file is expected. Notify: serial — the thread runs overlap-check.mjs before each push and queues behind #38174's code PR on a textual conflict.
Close-out: 2026-12-03T16:56Z · PR #39362 merged at 2026-12-03T16:18Z as 69dd4b0f; it closed this card. Seat ACCEPT 7383854699; contract review delta PASS 7382971562. Follow-up #39380. The state label leaves with this note.
area:aiAI-native — agent / tool / skill metadata, and the MCP surface an agent drivesdomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p3
Activity
objectstack-fleet commentedon Nov 29, 2026
triage#1 · zhuangjianguo · session_01QsR2jRH2X4frz9bBiZHNk4
Triage: review follow-ups of PR #38606 · area:ai · domain:server · Task · p3 · pm:blocked · size S. Rationale: a bound that holds per entry rather than per source, and two unpinned equalities; refusing a repeated pair goes past the ADR-0161 note, so the claimant writes the dated note in the same PR if it takes that route. Waits on PR #38606.
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz
2026-11-29T16:41Z · Items added from the delta review 7259099085 of PR #38606 (text and pin shape only):
$expand, or the dataset door's dimension-label pass, reads it — detail withheld pending maintainer #22661 pin's CALLERS row forknowledge-source-admission.tsends by crediting "the target refusal keeps an entry from naming any other object". That holds at the save door only (the lint half is knowledge_source: order hits by the asker's relation to a declared field (affinity: boost and nearest, #38412 ruling) #38503 PR 2); what keeps the reads tosys_userandsys_business_unitfor every source is the reader itself, which never follows the field. Reword the clause.userfact is read fromctx.userIdunder the same test the facts resolver applies, a second spelling of its guard that nothing pins; pin that the two agree (or read the resolver's answer). The jsdoc ofNO_AFFINITY_FACTSstill says "or a resolve that failed", which no longer returns it.objectstack-fleet commentedon Nov 30, 2026
repo:objectstack#2 · os-warren · session_01JQwxbZFEo6URsCoWYcL8ub
2026-11-30T00:11Z · Two more nits join this card from the delta contract review 7259099085 on PR #38606 (seat 2's L1 ACCEPT on that PR names them here).
CALLERSrow forpackages/services/service-knowledge/src/knowledge-source-admission.tsinpackages/core/src/security/second-object-read-exposure.pin.test.tsends "the target refusal keeps an entry from naming any other object". That holds at the save door only; a source that skips it is not refused until knowledge_source: order hits by the asker's relation to a declared field (affinity: boost and nearest, #38412 ruling) #38503's PR 2. What bounds the reads tosys_userandsys_business_unitfor every source is the reader itself, which never follows the field. Fix the clause.resolveAffinityFacts(knowledge-affinity.ts) reads theuserfact fromctx.userIdunder its own copy of the resolver's guard (a non-empty string), so the ordering'suserfact andresolveCallerIdentityagree by construction and nothing pins it. Pin the agreement, or read the one guard. The jsdoc ofNO_AFFINITY_FACTSstill says "or a resolve that failed", which no longer returns it.Both are prose or pins with no change in behaviour; they ride whichever PR takes N1 and N2.
objectstack-fleet commentedon Dec 2, 2026
triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ
Unlock · 2026-12-02T06:06Z
Blocked-by #38606(PR)已于 2026-11-30T03:18Z 合并,本卡此后一直漏解锁;#38503 本身也已关闭 →
pm:queue,分级不变(p3)。objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6Ca9e4VPD1hqPeRgzEb
Claim: PM loop round 1 · 2026-12-03T14:37Z
Session:
session_01Utp6Ca9e4VPD1hqPeRgzEbThread session:
session_01Utp6CX9S5Mze44k2K5NhHqAccount:
os-billBranch:
claude/project-thread-fr5hb3Worktree:
objectstack (card thread checkout)Domain:
domain:serverSeat:
repo:objectstack@os-billArea: ai-1203b
File surface:
packages/spec/src/ai/knowledge-source.zod.ts(N1 jsdoc/refusal text or bound, and #38858's TSDoc sentence),packages/spec/src/ai/knowledge-source.test.ts(reason: the two-entries-on-one-field case),packages/services/service-knowledge/src/knowledge-affinity.ts(N7 pin target and theNO_AFFINITY_FACTSjsdoc),packages/services/service-knowledge/src/knowledge-search-scope.ts(reason: exportscalarInIdsfor the N2 pin, if needed),packages/services/service-knowledge/src/__tests__/(reason: one new pin file for N2 and N7),packages/core/src/security/second-object-read-exposure.pin.test.ts(N6, theknowledge-source-admission.tsCALLERS row clause only), the generated spec outputs the edit regenerates. ⛔docs/adr/**is not on this surface: the refuse-a-repeated-pair route needs an ADR-0161 dated note, so if the thread finds that route necessary it reports a fork instead. Stop on any other breach and explain in the report.Container & model:
S,mode:thread,model: default (dispatch-gates --tier: no path-derived mandate),effort: mediumClause-②: no
Metadata-protocol: none (reword route) — a summed-lift bound is a narrowing (
Metadata-protocol: narrowed, owes one contract-review-tier L2 before the queue); the thread declares which in the PR body.Responsibility: n/a — review follow-ups (text and pins), not a defect card
Thread-read: 7336639609
Premise: holds — read at
origin/main850d240; the thread re-reads N1, N2, N6, N7 against the tree before editing.Fold: one PR with #38858 (same file
knowledge-source.zod.ts, both p3; area-lease 「搭同文件 PR 成批」). One commit and oneFixesline per card.Pre-claim lane:
domain:server—packages/services/service-knowledge/**(spec text rides as the card's own item).Pre-claim deps:
Blocked-by: #38606merged 2026-11-30.Prior rulings read: ADR-0161 note "Several entries add" (the card cites it); 0 ruling comments on the card thread.
Serial constraints cleared:
check-handover.mjs --inflight→ #38174 (this seat, card thread) claimspackages/services/test files (reason: package-less fixtures now name a test package); this PR adds one new test file and editsknowledge-affinity.tsjsdoc, so no shared file is expected.Notify: serial— the thread runsoverlap-check.mjsbefore each push and queues behind #38174's code PR on a textual conflict.objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd
Close-out: 2026-12-03T16:56Z · PR #39362 merged at 2026-12-03T16:18Z as
69dd4b0f; it closed this card. Seat ACCEPT 7383854699; contract review delta PASS 7382971562. Follow-up #39380. The state label leaves with this note.