Repository navigation
Todo
Labels
area:aiAI-native — agent / tool / skill metadata, and the MCP surface an agent drivesdomain:serverDomain lane — seat card indexed by label:pm:seatpm:dispatchedDispatched to a dev agent by /pm-dispatchpriority:p1High: required for production / M2
Description
maintainer · os-bob · session_012dn2Abw1d1dVAyngaACxQF
Filing gate: ③ maintainer-directed (topic child). Source: topic #38536. Key words (maintainer, 2026-11-29, this session): 「立新的专题卡,用 fable 分拆任务,然后立刻交给5号座位优先派发」.
Grading: area:ai · Feature · p1 (topic's grade, the maintainer's 「优先派发」) · reach: apps that index child records of a parent (BrightRule: ~60k clauses under ~2k policies) · evidence: read from the code on main 63acc6c.
维护者速读
- 做什么:知识源加
source.documentBy(指向父记录的字段,须在metadataFields里),并在同一 PR 落它的第一个读者:granularity: 'record'且没给groupBy时,默认按它聚合。 - 不改索引内容:不进指纹、不进 recipe 哈希,不触发重建。
Scope
- Spec:
documentBy?: stringonObjectKnowledgeSourceSchema(packages/spec/src/ai/knowledge-source.zod.ts:136-212, strictObject). Parse refuses a value that is not a member ofmetadataFields, with a message naming the fix. - Save /
os validate: refuse a field that is not a single-valued parent link. Reuse the parent-link rule ofknowledge-search-scope.ts(parentLinksOf,:138-166, private today; export it):lookup/master_detailonly (:47), never a credential-class orinternalfield (:143-148), nevermultiple: true(:223). Wire it intopackages/lint/src/validate-knowledge-source.tsand the save-time admission. - Reader (same PR, ADR-0049): in
search(), whenbyRecordandgroupBy === undefined(knowledge-service.ts:2510,:2533-2535), key each hit by its own source'sdocumentByvalue.- A null or empty parent value falls back to the per-record key (
recordKeyOf,:4871).groupKeyOftoday answersundefinedfor null (:2611-2612); do not let those records vanish. - The default key includes the source id, so two sources never merge on equal parent ids (the explicit
groupBykey isvalue:<json>with no source,:2613; leave that path as it is, includingsourcesGroupableBy,:2593). hitOf(knowledge-tools.ts:539) setsgroupValuefor the default grouping too.
- A null or empty parent value falls back to the per-record key (
- Fingerprint:
documentBystays out of the fingerprint (knowledge-index-fingerprint.ts:17-19) and the recipe hash (:116-121). - Regenerate the JSON schema and the liveness ledger; changeset notes that
granularity: 'record'returns one hit per parent for a source that declaresdocumentBy.
Acceptance
- Parse refuses
documentByabsent frommetadataFields. - Save refuses a text field, a
userfield, aninternallookup and amultiplelookup, each with a message naming the fix. - 6 records under 2 parents plus 1 null-parent record,
granularity: 'record',topK: 10→ 3 hits. - Explicit
groupBy: 'clause_hash'output is unchanged; a source withoutdocumentByis unchanged. - The pinned hashes in
__tests__/index-fingerprint.test.tsare unchanged.
Reader
repo:objectstack#5. File roots: packages/spec/src/ai/, packages/services/service-knowledge/src/, packages/lint/src/validate-knowledge-source.ts. Size M. Blocked-by: none.
Dedupe: documentBy 0 · knowledge document unit count 105 (none on this).
Generated by Claude Code
Metadata
Metadata
Assignees
Labels
area:aiAI-native — agent / tool / skill metadata, and the MCP surface an agent drivesdomain:serverDomain lane — seat card indexed by label:pm:seatpm:dispatchedDispatched to a dev agent by /pm-dispatchpriority:p1High: required for production / M2
Activity
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb
Claim: PM loop round 1 · 2026-11-29T08:27Z
Session:
session_01FEkQ5oQLfL8thb6wtUHnTbAccount:
os-project-managerBranch:
claude/issue-38537-knowledge-document-byWorktree:
objectstack-issue-38537Domain:
domain:serverSeat:
repo:objectstack#5Area:
o5-ai37000File surface:
packages/spec/src/ai/knowledge-source.zod.tsandpackages/spec/src/ai/knowledge-source.test.ts;packages/spec/src/ai/knowledge-source.metadata-form.tsand its test only if the form-coverage gate refuses the key without them (then #38538's form half folds in, said in the PR);packages/spec/liveness/knowledge_source.jsonand the generated outputs the spec build writes for this key;packages/services/service-knowledge/src/knowledge-service.ts(record-search grouping insearch()and the key helpers only),packages/services/service-knowledge/src/knowledge-tools.ts(hitOfgroupValueonly),packages/services/service-knowledge/src/knowledge-search-scope.ts(export the parent-link rule only),packages/services/service-knowledge/src/knowledge-source-admission.ts(the save-time refusal only), their tests underpackages/services/service-knowledge/src/__tests__/(newdocument-by-38537.test.tsplusknowledge-search-scope.test.tsandknowledge-source-admission.test.ts;index-fingerprint.test.tsread, never edited); one changeset.changeset/38537-knowledge-document-by.md(stop on breach; explain in the report). Not in it:packages/lint/**(held by #35143, seat 6, until the seat releases it; theos validaterule is this card's PR 2, claimed by amendment then), docs,skills/**, thesearch_knowledgedescription (#38538). PR 1 isPart of #38537; PR 2 (lint) carriesFixes #38537.Container & model: M, mode:subagent, model: default (dispatch-gates --tier at 430a311, "Model tier — no path-derived mandate"), effort: high (M)
Clause-②: yes (widening)
Metadata-protocol: none
Responsibility: new feature, topic #38536 (maintainer-directed, seat post 7252899468); no producer.
Thread-read: none
Premise: holds at 430a311 —
ObjectKnowledgeSourceSchemahas nodocumentBy; record search with nogroupBykeys each hit per record (knowledge-service.tsbyRecordpath);parentLinksOfinknowledge-search-scope.tsis private. Read from main, line numbers per the card body (63acc6c).Serial constraints cleared:
check-handover --inflight at 430a3119d3 (08:27Z): one meet left, #38413 (claim 7253083650) on knowledge-service.ts, shared by the seat's ruling (seat thread 08:22Z: parallel, its sync path vs this card's search grouping, overlap-check before every push, the later merges main); #38528 re-claimed narrow (7253110162); no packages/lint path, so #36496 and #35143 do not meet; #38369 parked pm:blocked Blocked-by #38537 (7253072512)Pre-claim lane:
packages/services/service-knowledge/**⇒ domain:server (file ownership only); topic #38536 routed to this area by the seat, ahead of the rest of #37000/#38346.Pre-claim deps: none.
Prior rulings read: maintainer's topic order (seat post 7252899468, 「立新的专题卡,用 fable 分拆任务,然后立刻交给5号座位优先派发」); ADR-0161 dated notes (K1, K4: a key lands with its first reader; K8).
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb
os-dev-report
{ "issue": 38537, "status": "done", "branch": "claude/issue-38537-knowledge-document-by", "pr": "https://github.com/objectstack-ai/objectstack/pull/38564", "session": "session_01FEkQ5oQLfL8thb6wtUHnTb", "premise_still_valid": true, "summary": "PR 1 of 2 (Part of #38537; the os validate rule in packages/lint is PR 2). Adds source.documentBy to ObjectKnowledgeSourceSchema with a parse refinement refusing a value not in metadataFields; exports the parent-link rule from knowledge-search-scope.ts (parentLinkRule, plus documentUnitOf = rule + not multiple; parentLinksOf now calls it, scope unchanged) and wires a 400 VALIDATION_ERROR save refusal into admitAuthoredSource; record search with no groupBy keys each hit parent:SOURCE#VALUE from the hit's own stored metadata[documentBy] (no record read), falling back to the per-record key for an absent/null/empty parent, and hitOf sets groupValue for that default grouping. Form-coverage gate refused the key without a form row, so the single field-ref picker is added and #38538's form half is folded in. File surface beyond the claim's list, each forced by a Zone 1 line and declared in the PR: knowledge-service.ts admitAuthoredSource (the save-time admission lives there; knowledge-source-admission.ts only builds the sentence), packages/spec/dropped-refinements.baseline.json (the spec build refuses an unledgered refinement), and the platform-objects metadata-form translation bundles plus the catalog positive-control count in object-lifecycle-panel-echo-decisions.test.ts (forced by the form row; ja-JP/es-ES/zh-CN authored). PR assignee os-project-manager set by pr_create; card assignee untouched.", "tests": "At a92874657e unless noted. service-knowledge: pnpm --filter @objectstack/service-knowledge test -> Test Files 23 passed (23), Tests 788 passed (788); typecheck exit 0. spec: pnpm --filter @objectstack/spec test (at 494c378d5e) -> 912 passed / 1 failed (dropped-refinements header totals), fixed, scripts/dropped-refinements.test.ts 30/30; spec typecheck exit 0. platform-objects: test -> 130/130 files, 2218/2218 tests; typecheck exit 0. New/changed pins: document-by-38537.test.ts 16 tests (3-hit acceptance, empty/absent parent, two sources, explicit groupBy:'clause_hash' identical with/without documentBy, no-documentBy source unchanged, chunk unchanged, groupValue, fingerprint+recipe hash equal, save refusals text/user/internal/multiple each 400 VALIDATION_ERROR naming field and fix, lookup/master_detail admitted); knowledge-source.test.ts 4 documentBy parse pins; knowledge-search-scope.test.ts 5 parentLinkRule/documentUnitOf pins; form test row pin. index-fingerprint.test.ts not edited, green. Ablation via scripts/ablation-replace.mjs (no build needed: subjects imported from src): reader reverted to recordKeyOf -> document-by-38537.test.ts 4 failed / 12 passed (incl. the 3-hit test), restored blob c98a03680da8 == HEAD; parse refinement removed -> knowledge-source.test.ts 2 failed / 35 passed, restored blob 211cb6dc13af == HEAD (first attempt was refused by the tool before running: replacement text already occurred; re-run with a distinct replacement). Live pgvector: not run, no pgvector/turso live suite touches granularity or groupBy (grouping is in the service).", "gates": "dispatch-gates --commands at a92874657e: 120 families, re-run after the last code commit, all exit 0; node scripts/pm/dispatch-gates.mjs --ran -> '120 derived, 120 run, 0 NOT-MEASURED, 0 UNRUN' (exit 0). First run: check:skill-examples, check:dual-build-cjs-loads, check:i18n exited 3 (prerequisite builds); built and re-run exit 0; check:i18n then found the form row's bundles drifted -> regenerated in the PR. check:i18n, check:i18n-stale-fill, check:nul-bytes re-run on a92874657e exit 0. spec check:generated: 2 stale (reference page, liveness counts) -> --fix, re-check green. overlap-check: clean vs main and #38509; VERDICT overlap exit 1 for textual conflicts with open drafts #38550 (dropped-refinements ledger + catalog positive control) and #38497 (positive control) on hand-maintained counters; second lander re-applies. Not run locally: check:i18n-coverage (not derived; needs example builds). CI check-runs on #38564: NOT MEASURED, reason: report delivered at the end of local verification, CI not awaited per dispatch contract.", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "mcp_calls": "0", "api_writes": "3 REST writes via the fleet-write relay: POST /repos/objectstack-ai/objectstack/pulls (draft #38564) and POST /repos/objectstack-ai/objectstack/issues/38564/assignees (one pr_create action, one dispatch), plus POST /repos/objectstack-ai/objectstack/issues/38537/comments (this report, post-stamped.mjs). git pushes to the branch not counted.", "open_questions": [ { "question": "The claim and dispatch fix `Metadata-protocol: none`, but AGENTS.md Post-Task Checklist step 3 and the Check Changeset table in pr-automation.yml define a new authorable key as `added` (-> minor). I copied `none` (patch) into the PR body and changeset as the os-dev rule requires. Which stands?", "options": [ "A: correct to `Metadata-protocol: added` and both changeset entries to minor (PR body line + changeset, one edit each)", "B: keep `none` / patch as claimed" ], "recommendation": "A, because `documentBy` is a new key a metadata author can write, which is the table's own example of `added`; `none` covers description text, internal types and services." }, { "question": "PR 2 (os validate in packages/lint) needs parentLinkRule/documentUnitOf, but @objectstack/lint does not depend on @objectstack/service-knowledge. Where should PR 2 read the rule from?", "options": [ "A: PR 2 adds the lint -> service-knowledge dependency and imports the exported functions", "B: PR 2 moves the pure rule to a package lint already reads (e.g. core) and service-knowledge re-imports it" ], "recommendation": "B if the dependency direction lint -> service is unwanted; the functions are pure over the object definition plus @objectstack/core collectors and spec's referenceTargetOf, so the move is mechanical. PR 2's call." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: #38538 · the TSDoc of KnowledgeSearchOptions.granularity/topK in packages/spec/src/contracts/knowledge-service.ts and the search_knowledge description still say 'record' is one hit per record; for a documentBy source it is one per parent. Noted in Acceptance notes, not edited (outside the file surface; docs half of that card).", "carrier: none · a source registered in code passes the parse (documentBy in metadataFields) but no save door, so the parent-link rule does not judge it; noted in Acceptance notes." ] }objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb
Claim amendment · 2026-11-29T10:05Z · amends claim 7253127987 on this card
Metadata-protocol: added (corrects the claim's
none:documentByis a new authorable key, which AGENTS.md and the Check Changeset table in pr-automation.yml nameadded, takingminor).File surface: adds
packages/services/service-knowledge/src/knowledge-service.tsadmitAuthoredSource(the save-time admission lives there;knowledge-source-admission.tsbuilds only the sentence),packages/spec/dropped-refinements.baseline.json(the spec build refuses an unledgered refinement),packages/spec/authorable-surface/ai.json,packages/spec/liveness/state-counts/knowledge_source.md,content/docs/references/ai/knowledge-source.mdx(generated reference page),packages/platform-objects/src/apps/translations/*.metadata-forms.generated.tsand*.source-hashes.generated.ts(forced by the form row), and the catalog positive-control count inpackages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts. The form row folds in #38538's form half (the form-coverage gate refused the key without it).Reason: dev report 7254182965 on PR #38564; each file is forced by a Zone 1 line or a gate and declared in the PR.
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb
Claim amendment · 2026-11-29T10:39Z · amends claim 7253127987 on this card
File surface: adds
packages/spec/src/contracts/knowledge-service.ts(thegranularityandgroupByTSDoc only, which still say "one hit per record" where a source'sdocumentBynow sets the unit).Reason: contract review 7254573293 on PR #38564, ③ escalation: that TSDoc and the
search_knowledgedescription (knowledge-tools.ts, already in this surface) would ship stale in the next release if left to #38538, which names neither the contract file nor a release gate and is now with seat 1. Both go into PR 1 with the S1 fix, so the release that publishesdocumentBydescribes it. check-handover --inflight on the added path: clear. #38538 keeps its docs pages, skill text and the form-help wording.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb
Claim amendment · 2026-11-29T11:09Z · amends claim 7253127987 on this card
File surface: adds the
topKTSDoc inpackages/spec/src/contracts/knowledge-service.ts(beside thegranularityandgroupByTSDoc added before) and the tool'sgranularityinput description inpackages/services/service-knowledge/src/knowledge-tools.ts.Reason: dev report on PR #38564 head e0ebb9a: both still state the old unit ("counts records", "per record") for a
documentBysource, the same staleness the previous amendment fixes. Folded in before the delta review so the release carries no stale unit text.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz
2026-11-29T12:03Z · Takeover · seat
repo:objectstack#5's accountos-project-manageris out of tokens; seat 1 continues its claim.Release: claim 7253127987 (session
session_01FEkQ5oQLfL8thb6wtUHnTb, accountos-project-manager, seatrepo:objectstack#5) — taken over, not abandoned. Provenance: who = the maintainer (Jianguo); words, verbatim: 「hotlong 和 5号座位os-project-manager没token了,他的任务你都继续处理完」; where = seat 1's project chat, 2026-11-29T11:57:54Z.Handover: branch
claude/issue-38537-knowledge-document-bylast pushed43de68d58f; PR #38564. Picked-up work is UNVERIFIED until seat 1 re-reads it at that head.Assignee:
os-project-manager→zhuangjianguoin this stroke.Claim: PM loop round 3 (takeover of 7253127987)
Session:
session_01QsR2jTsdScTh3o2fSjbxSzAccount:
zhuangjianguoBranch:
claude/issue-38537-knowledge-document-byWorktree:
objectstack-issue-38537Domain:
domain:serverSeat:
repo:objectstack#1Area:
o1-knowFile surface:
packages/spec/src/ai/knowledge-source.zod.tsandpackages/spec/src/ai/knowledge-source.test.ts;packages/spec/src/ai/knowledge-source.metadata-form.tsand its test only if the form-coverage gate refuses the key without them (then #38538's form half folds in, said in the PR);packages/spec/liveness/knowledge_source.jsonand the generated outputs the spec build writes for this key;packages/services/service-knowledge/src/knowledge-service.ts(record-search grouping insearch()and the key helpers only),packages/services/service-knowledge/src/knowledge-tools.ts(hitOfgroupValueonly),packages/services/service-knowledge/src/knowledge-search-scope.ts(export the parent-link rule only),packages/services/service-knowledge/src/knowledge-source-admission.ts(the save-time refusal only), their tests underpackages/services/service-knowledge/src/__tests__/(newdocument-by-38537.test.tsplusknowledge-search-scope.test.tsandknowledge-source-admission.test.ts;index-fingerprint.test.tsread, never edited); one changeset.changeset/38537-knowledge-document-by.md(stop on breach; explain in the report). Not in it:packages/lint/**(held by #35143, seat 6, until the seat releases it; theos validaterule is this card's PR 2, claimed by amendment then), docs,skills/**, thesearch_knowledgedescription (#38538). PR 1 isPart of #38537; PR 2 (lint) carriesFixes #38537.Container & model: M, mode:subagent, model: default (dispatch-gates --tier at 430a311, "Model tier — no path-derived mandate"), effort: high (M)
Clause-②: yes (widening)
Metadata-protocol: none
Responsibility: new feature, topic #38536 (maintainer-directed, seat post 7252899468); no producer.
Thread-read: 7254921447
Premise: holds at 430a311 —
ObjectKnowledgeSourceSchemahas nodocumentBy; record search with nogroupBykeys each hit per record (knowledge-service.tsbyRecordpath);parentLinksOfinknowledge-search-scope.tsis private. Read from main, line numbers per the card body (63acc6c).Serial constraints cleared:
check-handover --inflight at 430a3119d3 (08:27Z): one meet left, #38413 (claim 7253083650) on knowledge-service.ts, shared by the seat's ruling (seat thread 08:22Z: parallel, its sync path vs this card's search grouping, overlap-check before every push, the later merges main); #38528 re-claimed narrow (7253110162); no packages/lint path, so #36496 and #35143 do not meet; #38369 parked pm:blocked Blocked-by #38537 (7253072512)Pre-claim lane:
packages/services/service-knowledge/**⇒ domain:server (file ownership only); topic #38536 routed to this area by the seat, ahead of the rest of #37000/#38346.Pre-claim deps: none.
Prior rulings read: maintainer's topic order (seat post 7252899468, 「立新的专题卡,用 fable 分拆任务,然后立刻交给5号座位优先派发」); ADR-0161 dated notes (K1, K4: a key lands with its first reader; K8).
objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz
2026-11-29T12:32Z · Claim amendment to 7255544301: PR 1 (#38564) merged; the claim narrows to PR 2, which frees
packages/services/service-knowledge/**andpackages/spec/src/ai/knowledge-source*for the topic's next cards.Claim: PM loop round 3 (amendment of 7255544301)
Session:
session_01QsR2jTsdScTh3o2fSjbxSzAccount:
zhuangjianguoBranch: none yet — PR 2 is not started; a card thread is named in a later amendment
Worktree:
objectstack-issue-38537Domain:
domain:serverSeat:
repo:objectstack#1Area:
o1-knowFile surface (PR 2):
packages/lint/src/validate-knowledge-source.tsand its tests, theos validatewiring of that rule, one changeset.changeset/38537-*.md(PR 2 question A/B as in #38564's body) (stop on breach; explain in the report)Container & model: M, mode:subagent, model: default (dispatch-gates --tier at 430a311, "Model tier — no path-derived mandate"), effort: high (M)
Clause-②: yes (widening)
Metadata-protocol: none
Responsibility: new feature, topic #38536 (maintainer-directed, seat post 7252899468); no producer.
Thread-read: 7254921447
Premise: holds at 430a311 —
ObjectKnowledgeSourceSchemahas nodocumentBy; record search with nogroupBykeys each hit per record (knowledge-service.tsbyRecordpath);parentLinksOfinknowledge-search-scope.tsis private. Read from main, line numbers per the card body (63acc6c).Serial constraints cleared: PR 2 waits behind #35143 on
packages/lint/**(claim 7255708748, seat 1's own takeover); none otherPre-claim lane:
packages/services/service-knowledge/**⇒ domain:server (file ownership only); topic #38536 routed to this area by the seat, ahead of the rest of #37000/#38346.Pre-claim deps: none.
Prior rulings read: maintainer's topic order (seat post 7252899468, 「立新的专题卡,用 fable 分拆任务,然后立刻交给5号座位优先派发」); ADR-0161 dated notes (K1, K4: a key lands with its first reader; K8).