Repository navigation
Description
repo:objectstack#5 · os-project-manager · session_01FEkQ5mzSTSPADAvwapnhxr
Filing gate: ① ruled. Ruling-ref: 7251603512 on #38412 (maintainer 「A 精简:排序加带出」, option A-lean; analysis 7251063339). Built to the ADR-0161 dated note of 2026-11-29 (PR #38511, merged; card #38502), K1 "What follows from the two lists". Body rewritten by the seat after the note landed and both blockers (#38502, #38363) merged.
Grading: area:ai · Feature · p3, dispatched in the topic's order · reach: every app with a knowledge source · contract-tier review (a new authorable key, built to the note).
Part of #38346.
Related: #38515 (ruled D 「D 全员可读,应用不用授权」, record 7252551540: every internal member reads its organization's business units by default, so a plain member's chain is whole once that build card lands).
维护者速读
- 做什么:知识源可以声明「和提问人相关的内容排前面」:按提问人本人或所在单位链加权(
boost,带places),或在单位层级里就近优先(nearest)。只按位置调整,不改分数,不筛掉任何命中。 - 为什么:[Decision] knowledge_source: a declarative
retrievalblock — rank hits by the asker's relation to a declared field, by recency, and expand a hit along declared structure #38412 裁定 A 精简的核心一片,按 docs(adr): ADR-0161 dated note, a knowledge source declares how its hits are ordered for the caller and what a hit brings #38511 落地的注记做;「告诉模型是谁在问」(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)已落地。 - 影响:只在知识源声明了
affinity时生效;没声明的源回答和今天逐字节相同。验收要实测三组对照,没明显好处就先回来找您,再决定做不做「带出关联记录」那一片(knowledge_source: a hit brings one declared lookup hop (expand.follow, #38412 ruling) #38505)。 - 要你做的:无,除非实测结果不达标。
What
Build source.affinity exactly as the note fixes it (the note's bullets "◆ The keys, on the object arm", "affinity", "◆ The caller facts are a closed list of two", "◆ By position, never by score", "Refused when it is written"):
- The key, on the object arm, with its first reader (K4, K10 rule 1): a list of
{ field, caller, mode, places? };modeisboostornearestonly; at most onenearestper source; several entries add. - Set the upper bound of
placesand state it on the key (the note fixes no number and leaves it to this card). Give the reason for the number in the PR body (for example, a bound tied to the refill bound or the tool'stopK), and refuse a larger value at write time with a sentence that names the fix. - Caller facts: the closed list
userandbusiness_unit(primary unit, then each parent to the root), read from the 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 resolver's one answer, at most once per search and only when a searched source declares an entry that reads it; never a tool argument, asearchoption, or a client or model value. Settle with 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 resolver where it lives so the knowledge service can call it (the note's slice line). - Ordering by position only, per source, judged on the hit standing for each unit;
nearesttiers; inside a tier key = number − sum of matchedplaces, ties to the larger sum then the earlier number; each hit keeps its adapter'sscore; no count reported; inside the existing refill bound. - Every refusal in the note's "Refused when it is written" line that concerns
affinity, each with a sentence naming the fix (filteranswered that narrowing is the search scope and visibility is sharing).
Acceptance
- Measured on one question set whose right answer depends on the asker, three arms, at least three runs each: (1) no identity, (2) the model told 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), (3) the model told plus a declared
nearest. The record carries the review tier, effort and each run's score. Run arm 3 for a plain member only after the Security model: should every plain member read their own primary business-unit chain by default (asker identity for #38503's arm 2)? #38515 build card has landed; until then use a member who already reads the units, and say so. - If arm 3 does not beat arm 2 beyond the run-to-run range, the result goes back to the maintainer (via the seat) before knowledge_source: a hit brings one declared lookup hop (expand.follow, #38412 ruling) #38505 is built.
- No
filterbehaviour: a hit outside the asker's unit is ordered later, never dropped. A source not declaringaffinityanswers byte-for-byte as before; tests pin the tie rules, theplacesbound and each refusal. - The docs sentences this code makes untrue are rewritten in the same PR, never ahead of it (K2).
Not in scope: expand.window (#38504); expand.follow (#38505); filter mode; date decay; other caller facts (active organization, positions, teams); any opt-out argument on the tool.
Dedupe: knowledge_source affinity nearest boost 0 open.
Activity
objectstack-fleet commentedon Nov 29, 2026
triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t
Triage: lands in
packages/spec/src/ai/knowledge-source.zod.ts(theaffinitykey, in the shape #38502's note fixes) andpackages/services/service-knowledge(re-order inside the refill bound), with the caller-fact resolver from #38363 and a three-arm measurement record · area:ai · domain:server (+ domain:spec for the key; Seam) · Feature · p3 · pm:blocked (Blocked-by: #38502and#38363, in the body) · size L. Rationale: a slice named by the maintainer's #38412 ruling (record 7251603512, 「A 精简:排序加带出」), with its blockers and acceptance. So it is pre-authorised execution, and the key's shape is decided in the Tier H note #38502. Both blockers are unmerged. The card carried no pm state, a half state this touch resolves. If arm 3 does not beat arm 2, the result goes back to the maintainer before #38505.Recorded 2026-11-29T06:54Z.
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz
2026-11-29T12:43Z · Claim of PR 1 (spec, core, service, docs). The
os validatehalf of the target refusal is PR 2:packages/lint/src/validate-knowledge-source.tsis held by #38537 PR 2 (claim 7255895735), which queues after #35143 (packages/lint/**).Claim: PM loop round 3 · PR 1 of 2 (affinity: order hits by the asker's relation to a declared field, boost and nearest)
Session:
session_01QsR2jTsdScTh3o2fSjbxSzThread session:
session_01QsR2jSArETHHmJzkH5368WAccount:
zhuangjianguoBranch:
claude/project-thread-ku5ipyWorktree:
objectstack-issue-38503Domain:
domain:serverSeat:
repo:objectstack#1Area:
o1-knowFile surface (PR 1):
packages/spec/src/ai/knowledge-source.zod.ts,packages/spec/src/ai/knowledge-source.test.ts,packages/spec/src/ai/knowledge-source.metadata-form.ts(+.metadata-form.test.ts),packages/spec/src/contracts/knowledge-service.ts(jsdoc); the regeneratedpackages/spec/authorable-surface/ai.json,packages/spec/dropped-refinements.baseline.json,packages/spec/liveness/knowledge_source.json,packages/spec/liveness/state-counts/knowledge_source.md,content/docs/references/ai/knowledge-source.mdx,packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts,packages/platform-objects/src/apps/translations/*.source-hashes.generated.tsand the count pin inobject-lifecycle-panel-echo-decisions.test.ts;packages/core/src/caller-identity.ts(new; the #38363 resolver moves here) + its test,packages/core/src/index.ts;packages/runtime/src/domains/mcp.ts(imports and re-exports the resolver; behaviour unchanged);packages/services/service-knowledge/src/knowledge-affinity.ts(new),packages/services/service-knowledge/src/__tests__/affinity-38503.test.ts(new),packages/services/service-knowledge/src/knowledge-service.ts,packages/services/service-knowledge/src/knowledge-source-admission.ts,packages/services/service-knowledge/src/testing.tsif needed;content/docs/ai/knowledge-rag.mdx,content/docs/protocol/knowledge.mdx;.changeset/38503-knowledge-affinity.md. Notpackages/lint/**(PR 2), notskills/**(Skills-docs: follow-up owed forskills/objectstack-ai/SKILL.md) (stop on breach; explain in the report)Container & model: M, mode:thread, model: default (spec/contract cards build at default tier; a CONTRACT_REVIEW_TIER L2 follows), effort: high; the arm measurement uses the maintainer-supplied AI gateway key from the environment (never printed), else NOT MEASURED with the reason
Clause-②: yes — a new published key on
knowledge_sourceMetadata-protocol: added
Responsibility:
n/a — not a defect cardThread-read: 7252145063
Premise: holds (rulings: #38412 decision and the ADR-0161 dated note of #38502 fix the key's shape; #38564 merged at 2026-11-29T12:14Z)
Serial constraints cleared: check-handover --inflight at 2026-11-29T12:40Z names #38529 (read-only measurement, no file), #37087 and #36496 (they regenerate the same translation generated files: regenerated outputs, resolved by the os-regen merge order), and the lint holders #38537 / #35143 / #37766 (lint left to PR 2); #38369 PR 2 (claim of this round) shares
knowledge-service.tsand the two docs pages and goes first (p2): this branch merges main after it lands, and runsoverlap-check.mjsbefore each push. #38504 (expand siblings) waits for this PR.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz
2026-11-29T12:55Z · Claim amendment to 7256019231: the maintainer ruled at 2026-11-29T12:54:37Z that the AI gateway key is only for generating embeddings; any LLM-dependent arm is NOT MEASURED; nothing else changes.
Claim: PM loop round 3 (amendment of 7256019231)
Session:
session_01QsR2jTsdScTh3o2fSjbxSzThread session:
session_01QsR2jSArETHHmJzkH5368WAccount:
zhuangjianguoBranch:
claude/project-thread-ku5ipyWorktree:
objectstack-issue-38503Domain:
domain:serverSeat:
repo:objectstack#1Area:
o1-knowFile surface (PR 1):
packages/spec/src/ai/knowledge-source.zod.ts,packages/spec/src/ai/knowledge-source.test.ts,packages/spec/src/ai/knowledge-source.metadata-form.ts(+.metadata-form.test.ts),packages/spec/src/contracts/knowledge-service.ts(jsdoc); the regeneratedpackages/spec/authorable-surface/ai.json,packages/spec/dropped-refinements.baseline.json,packages/spec/liveness/knowledge_source.json,packages/spec/liveness/state-counts/knowledge_source.md,content/docs/references/ai/knowledge-source.mdx,packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts,packages/platform-objects/src/apps/translations/*.source-hashes.generated.tsand the count pin inobject-lifecycle-panel-echo-decisions.test.ts;packages/core/src/caller-identity.ts(new; the #38363 resolver moves here) + its test,packages/core/src/index.ts;packages/runtime/src/domains/mcp.ts(imports and re-exports the resolver; behaviour unchanged);packages/services/service-knowledge/src/knowledge-affinity.ts(new),packages/services/service-knowledge/src/__tests__/affinity-38503.test.ts(new),packages/services/service-knowledge/src/knowledge-service.ts,packages/services/service-knowledge/src/knowledge-source-admission.ts,packages/services/service-knowledge/src/testing.tsif needed;content/docs/ai/knowledge-rag.mdx,content/docs/protocol/knowledge.mdx;.changeset/38503-knowledge-affinity.md. Notpackages/lint/**(PR 2), notskills/**(Skills-docs: follow-up owed forskills/objectstack-ai/SKILL.md) (stop on breach; explain in the report)Container & model: M, mode:thread, model: default (spec/contract cards build at default tier; a CONTRACT_REVIEW_TIER L2 follows), effort: high; the maintainer-supplied AI gateway key (from the environment, never printed) is used for embeddings only — no chat or LLM calls (maintainer ruling 「api key 只是给你生成向量用的」); any arm needing a live LLM is NOT MEASURED by ruling
Clause-②: yes — a new published key on
knowledge_sourceMetadata-protocol: added
Responsibility:
n/a — not a defect cardThread-read: 7252145063
Premise: holds (rulings: #38412 decision and the ADR-0161 dated note of #38502 fix the key's shape; #38564 merged at 2026-11-29T12:14Z)
Serial constraints cleared: check-handover --inflight at 2026-11-29T12:40Z names #38529 (read-only measurement, no file), #37087 and #36496 (they regenerate the same translation generated files: regenerated outputs, resolved by the os-regen merge order), and the lint holders #38537 / #35143 / #37766 (lint left to PR 2); #38369 PR 2 (claim of this round) shares
knowledge-service.tsand the two docs pages and goes first (p2): this branch merges main after it lands, and runsoverlap-check.mjsbefore each push. #38504 (expand siblings) waits for this PR.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz
2026-11-29T14:38Z · Claim amendment to 7256166933: admits one docs page that the census gate reds once the caller-identity resolver moves to core; nothing else changes.
Claim: PM loop round 3 (amendment of 7256166933)
Session:
session_01QsR2jTsdScTh3o2fSjbxSzThread session:
session_01QsR2jSArETHHmJzkH5368WAccount:
zhuangjianguoBranch:
claude/project-thread-ku5ipyWorktree:
objectstack-issue-38503Domain:
domain:serverSeat:
repo:objectstack#1Area:
o1-knowFile surface (PR 1):
packages/spec/src/ai/knowledge-source.zod.ts,packages/spec/src/ai/knowledge-source.test.ts,packages/spec/src/ai/knowledge-source.metadata-form.ts(+.metadata-form.test.ts),packages/spec/src/contracts/knowledge-service.ts(jsdoc); the regeneratedpackages/spec/authorable-surface/ai.json,packages/spec/dropped-refinements.baseline.json,packages/spec/liveness/knowledge_source.json,packages/spec/liveness/state-counts/knowledge_source.md,content/docs/references/ai/knowledge-source.mdx,packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts,packages/platform-objects/src/apps/translations/*.source-hashes.generated.tsand the count pin inobject-lifecycle-panel-echo-decisions.test.ts;packages/core/src/caller-identity.ts(new; the #38363 resolver moves here) + its test,packages/core/src/index.ts;packages/runtime/src/domains/mcp.ts(imports and re-exports the resolver; behaviour unchanged);packages/services/service-knowledge/src/knowledge-affinity.ts(new),packages/services/service-knowledge/src/__tests__/affinity-38503.test.ts(new),packages/services/service-knowledge/src/knowledge-service.ts,packages/services/service-knowledge/src/knowledge-source-admission.ts,packages/services/service-knowledge/src/testing.tsif needed;content/docs/ai/knowledge-rag.mdx,content/docs/protocol/knowledge.mdx;.changeset/38503-knowledge-affinity.md. Notpackages/lint/**(PR 2), notskills/**(Skills-docs: follow-up owed forskills/objectstack-ai/SKILL.md) (stop on breach; explain in the report)Container & model: M, mode:thread, model: default (spec/contract cards build at default tier; a CONTRACT_REVIEW_TIER L2 follows), effort: high; the maintainer-supplied AI gateway key (from the environment, never printed) is used for embeddings only — no chat or LLM calls (maintainer ruling 「api key 只是给你生成向量用的」); any arm needing a live LLM is NOT MEASURED by ruling
Clause-②: yes — a new published key on
knowledge_sourceMetadata-protocol: added
Responsibility:
n/a — not a defect cardThread-read: 7252145063
Premise: holds (rulings: #38412 decision and the ADR-0161 dated note of #38502 fix the key's shape; #38564 merged at 2026-11-29T12:14Z)
Serial constraints cleared: check-handover --inflight at 2026-11-29T12:40Z names #38529 (read-only measurement, no file), #37087 and #36496 (they regenerate the same translation generated files: regenerated outputs, resolved by the os-regen merge order), and the lint holders #38537 / #35143 / #37766 (lint left to PR 2); #38369 PR 2 (claim of this round) shares
knowledge-service.tsand the two docs pages and goes first (p2): this branch merges main after it lands, and runsoverlap-check.mjsbefore each push. #38504 (expand siblings) waits for this PR.File surface: File surface (PR 1):
packages/spec/src/ai/knowledge-source.zod.ts,packages/spec/src/ai/knowledge-source.test.ts,packages/spec/src/ai/knowledge-source.metadata-form.ts(+.metadata-form.test.ts),packages/spec/src/contracts/knowledge-service.ts(jsdoc); the regeneratedpackages/spec/authorable-surface/ai.json,packages/spec/dropped-refinements.baseline.json,packages/spec/liveness/knowledge_source.json,packages/spec/liveness/state-counts/knowledge_source.md,content/docs/references/ai/knowledge-source.mdx,packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts,packages/platform-objects/src/apps/translations/*.source-hashes.generated.tsand the count pin inobject-lifecycle-panel-echo-decisions.test.ts;packages/core/src/caller-identity.ts(new; the #38363 resolver moves here) + its test,packages/core/src/index.ts;packages/runtime/src/domains/mcp.ts(imports and re-exports the resolver; behaviour unchanged);packages/services/service-knowledge/src/knowledge-affinity.ts(new),packages/services/service-knowledge/src/__tests__/affinity-38503.test.ts(new),packages/services/service-knowledge/src/knowledge-service.ts,packages/services/service-knowledge/src/knowledge-source-admission.ts,packages/services/service-knowledge/src/testing.tsif needed;content/docs/ai/knowledge-rag.mdx,content/docs/protocol/knowledge.mdx;.changeset/38503-knowledge-affinity.md. Notpackages/lint/**(PR 2), notskills/**(Skills-docs: follow-up owed forskills/objectstack-ai/SKILL.md) Pluscontent/docs/permissions/system-context.mdx(census row 46a, which the moved caller-identity resolver reds) (stop on breach; explain in the report)12 remaining items
objectstack-fleet commentedon Dec 1, 2026
triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ
Grade raised:
priority:p3→priority:p2· 2026-12-01T12:53Zdocs(adr): ADR-0161 dated note, a knowledge source declares how its h…
feat(mcp): get_current_user tells an MCP client's model who is signed…
feat(knowledge): a knowledge source orders its hits for the person as…
objectstack-fleet commentedon Dec 2, 2026
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS
Claim: card thread of seat repo:objectstack@os-support-ai (PR 2 of #38503; the card was returned to the queue by seat repo:objectstack#3, 7282353486, and graded p2 by triage, 7311816488)
Session:
session_01WGufzhPdWmTd47Fi2bKYZSThread session:
session_01WGufzfW9cn6HikHhefGc4QAccount:
os-support-aiBranch:
claude/project-thread-kg60zdDomain:
domain:serverSeat:
repo:objectstack@os-support-aiFile surface:
packages/lint/src/validate-knowledge-source.ts,packages/lint/src/validate-knowledge-source.affinity.test.ts(new),packages/lint/src/rule-explanations/knowledge-source.ts,packages/lint/src/rule-explanations.ts,packages/lint/src/index.ts,content/docs/protocol/knowledge.mdx,content/docs/ai/knowledge-rag.mdx(the sentence on refusing a field that does not point at the caller's object widens toos validateand the publish gate),.changeset/38503-validate-affinity-target.md. Stop on breach; explain in the report.Container & model:
M,mode:card-thread,model: TIER_DEFAULT (dispatch-gates --tier on the surface prints no MANDATORY line),effort: highClause-②: no
Metadata-protocol: none — as the #38537
documentByprecedent's changeset.Responsibility:
n/a — feature card, PR 2Premise: holds on
main363c967, narrowed from the card body. PR 1 (#38606: the key, ordering, resolver move, docs) merged 2026-11-30 after contract review PASS 7259099085 and ACCEPT 7265045628; the three-arm comparison was run there and the maintainer ruled it needs no further comparison (seat answer 7257868078). What remains is PR 2 as 7265064924 and 7280501078 name it: anos validate/ publish-gate rule that refuses an affinity entry whosefielddoes not point at the object itscallernames (sys_userorsys_business_unit), mirroring the save door's refusal text and the #38537documentByprecedent. No such lint rule exists today.Prior rulings read: 7251603512 on #38412 (A-lean); the ADR-0161 dated note of 2026-11-29 (PR #38511); seat answers 7257868078.
Serial constraints cleared:
check-handover.mjs --inflight --card=38503meets only the.changeset/*.mdglobs of #38939, #38940 and #38941, whose PRs have merged; a uniquely named changeset cannot collide. Out of scope: who may read business units (#38515).objectstack-fleet commentedon Dec 2, 2026
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfW9cn6HikHhefGc4Q
os-dev-report
PR 2 of 2 for this card is open: #39026, reported 2026-12-02T03:47Z.
{ "issue": 38503, "piece": "PR 2 of 2 (the os validate / publish-gate half; PR 1 #38606 merged)", "status": "done", "branch": "claude/project-thread-kg60zd", "pr": "https://github.com/objectstack-ai/objectstack/pull/39026", "head": "9161bc08a549769324653ae0e716e95a0150fd79", "claim": "7333581918", "session": "session_01WGufzfW9cn6HikHhefGc4Q", "premise_still_valid": true, "declarations": { "Clause-②": "no", "Metadata-protocol": "none" }, "container": { "model": "default tier (served model matches the claim)", "effort": "high" }, "summary": "New lint rule knowledge-source-affinity-field-not-caller-target (error) in validateKnowledgeSource: an affinity entry whose field does not point at sys_user (caller user, a user field included) or sys_business_unit (caller business_unit) is refused in os validate / build / lint and at the runtime publish gate, with the save door's sentence split at its fix. Same scope as the save door: only a field metadataFields lists and the object declares. os explain entry, barrel export, the two docs sentences (save only -> save, os validate, publish gate) and a lint patch changeset.", "tests": "new validate-knowledge-source.affinity.test.ts 18/18; ablation (rule admits everything) reds 9/18, restored from commit b01aa19a; pnpm --filter @objectstack/lint test at b01aa19a: 10299 passed, 5 skipped, 1 failed (covers > 60 chars) fixed in 9161bc08, that file 9/9; lint typecheck 0", "gates": "dispatch-gates --commands at 9161bc08: 96 commands, 92 exit 0; NOT MEASURED -> CI: check:dual-build-cjs-loads, check:lean-entry-closure, spec check:skill-examples (prerequisite: built output outside the lint closure), check-plugin-teardown-shape --self-test (fixture commit unreachable in shallow clone), check:query-options-erasure and check:type-check-debt (240 s local cap). PR check-runs not yet concluded.", "mcp_calls": "0", "api_writes": "2 - fleet-write relay pr_create (+ assign os-support-ai) and this report comment", "classifier_refusals": [], "open_questions": [], "security_findings": "none", "out_of_scope_findings": [], "owed": ["landing waits for #39025 (closed-ceremony-text ENOBUFS ejects new files), then a merge of main", "L1 by osa-L1-a; no contract-review face"] }