Repository navigation
fix(spec): affinity places bound stated as one entry's, pins for its equalities; documentBy TSDoc - #39362
Conversation
…e stated equalities are pinned The jsdoc of KNOWLEDGE_AFFINITY_MAX_PLACES and the refusal of `places` said the bound keeps a match from becoming "matches first" and is one whole answer's worth. Entries add (ADR-0161: "Several entries add"), so the bound is one entry's: the text now says so and that it equals the largest topK of search_knowledge. A spec case parses two boosts on one field at the bound; a service-knowledge case orders them as a 40-place lift. service-knowledge pins KNOWLEDGE_AFFINITY_MAX_PLACES against SEARCH_KNOWLEDGE_MAX_TOP_K, elementsOf against valueInIds (the scope term's comparison), and the `user` fact against resolveCallerIdentity (N7); NO_AFFINITY_FACTS' jsdoc drops "a resolve that failed" (N7). The second-object-read pin's knowledge-source-admission row credits the reader, not the save-door refusal, with keeping the reads to sys_user and sys_business_unit (N6). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CX9S5Mze44k2K5NhHq
…d source is judged The sentence said the parent-link rule "does not judge it yet"; os validate and the publish gate now judge such a source (knowledge-source-document-by-not-parent-link). TSDoc only. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CX9S5Mze44k2K5NhHq
📓 Docs Drift CheckThis PR changes 2 package(s): 9 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 185 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 9e1e9d38a521c020043adff91fef2e28cddc15ca && git checkout 9e1e9d38a521c020043adff91fef2e28cddc15ca
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 779ff419cff5f92ff056e6911abd74eb0b24d697 d4d6fa6d4db9e3329fb20122c0de218454d94483 && git checkout -B drift-repro 779ff419cff5f92ff056e6911abd74eb0b24d697 && git merge --no-ff d4d6fa6d4db9e3329fb20122c0de218454d94483
node scripts/docs-audit/affected-docs.mjs --json 779ff419cff5f92ff056e6911abd74eb0b24d697
|
|
repo:objectstack@os-bill · os-bill · session_01Utp6Ca9e4VPD1hqPeRgzEb Contract-review-claim: session_01Utp6Ca9e4VPD1hqPeRgzEb · head 65b680c · 2026-12-03T15:04Z |
|
repo:objectstack@os-bill · os-bill · session_01Utp6Ca9e4VPD1hqPeRgzEb Contract reviewServed-tier: Read: cards #38615 and #38858 (bodies and all six comments), the PR body, its eight files and the net diff, and the check-runs on this head. Code on ① Derived judgments
② Semver levelTwo changesets, both
③ Boundary flags
④ Design judgment
The affinity hunks hold against the code they cite.
No must-fix. S1 (should-fix) — the new
Nits, numbered past the card's N1 to N7 so the ids do not collide:
The
Implemented-by: VERDICT: PASS |
…sources; nearest takes business_unit only Contract review 7382786931 S1: os validate and the publish gate read stack.knowledgeSources only, so they judge a packaged source and never a source registered in code. The TSDoc and its changeset now say so. N8: the KNOWLEDGE_AFFINITY_MAX_PLACES jsdoc says a nearest entry takes caller 'business_unit' only. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CX9S5Mze44k2K5NhHq
|
repo:objectstack@os-bill · os-bill · session_01Utp6Ca9e4VPD1hqPeRgzEb Contract-review-claim: session_01Utp6Ca9e4VPD1hqPeRgzEb · head d4d6fa6 · 2026-12-03T15:16Z |
|
repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd Contract reviewServed-tier: Delta read of ① Derived judgments
② Semver levelUnchanged from the earlier record: ③ Boundary flags
④ Design judgmentThe delta makes the published TSDoc say what the three doors do: save, the validator with the publish gate, and registration in code. An author who registers a source in code now reads that the parent-link rule does not reach it, which is the fact they need before a record-level search groups by whatever the field holds. No design choice is added, and the earlier record's judgment of the reword route is unchanged. No must-fix. No should-fix.
Check-runs on this head when read: 38 runs, 11 success, 12 skipped, 15 in progress, 0 failed. The head is not green yet, so the landing check ② of the reference is still owed to the seat. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd 席位核对ACCEPT and landing · 2026-12-03T15:51Z · head
|
Requested by Bill · project thread
Fixes #38615
Fixes #38858
What changes
Two commits, one per card.
#38615 (affinity review follow-ups N1, N2, N6, N7)
KNOWLEDGE_AFFINITY_MAX_PLACES' jsdoc, theplacesjsdoc, theaffinityjsdoc and theplacesmax refusal now say the bound is one entry's and equals the largesttopKofsearch_knowledge; entries add, so a hit matching twoboostentries (two on one field included) passes their sum. No bound or refusal is added: ADR-0161's "Several entries add" stands, so no ADR note is owed. Cases: the spec parses two boosts on one field at 20 each; service-knowledge orders them as a 40-place lift (fifth place on a 45-unit list, against 25th for one entry).affinity-pins-38615.test.tspinsKNOWLEDGE_AFFINITY_MAX_PLACES === SEARCH_KNOWLEDGE_MAX_TOP_K, andelementsOf(affinity) againstvalueInIds(scope term, which callsscalarInIds) over a table of value shapes. Both helpers become module exports (not package exports).userfact ofresolveAffinityFactsagainstresolveCallerIdentity(...).user?.idfor every shape ofuserId.NO_AFFINITY_FACTS' jsdoc drops "or a resolve that failed".knowledge-source-admission.tsCALLERS row ofsecond-object-read-exposure.pin.test.tsnow credits the reader (it never follows an entry's field) with keeping reads tosys_userandsys_business_unitfor every source; the target refusal only covers sources saved through that door.#38858. The
documentByTSDoc saysos validateand the publish gate judge a code-registered or package-installed source (knowledge-source-document-by-not-parent-link), in place of "does not judge it yet". TSDoc only.Why
Contract-review nits carried from PR #38606 (7257817094, 7259099085), and a stale TSDoc sentence noted on PR #38855.
Verification
packages/spec:vitest run src/ai/knowledge-source.test.ts53/53,tsc --noEmitclean.packages/services/service-knowledge: full suite 33 files / 907 tests green before the pin file was extended; after: the pin file 4/4,affinity-38503+knowledge-search-scopegreen;tsc --noEmitclean.packages/core:second-object-read-exposure.pin.test.ts4/4.gen:schema+gen:docsleave the tree unchanged (no generated output moves).check:test-source-aliasOK, eslint clean on the changed files,overlap-checkclean against main.Clause-②: no
Metadata-protocol: none
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request. (Two cards folded on one file per the claim, one commit each.)packages/spectouched: its generated artifacts are regenerated and committed. (Regenerated; nothing moved.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code