Skip to content

service-knowledge: a knowledge source declares its document unit (source.documentBy); record search groups by it by default #38537

Description

@os-bob

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?: string on ObjectKnowledgeSourceSchema (packages/spec/src/ai/knowledge-source.zod.ts:136-212, strictObject). Parse refuses a value that is not a member of metadataFields, 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 of knowledge-search-scope.ts (parentLinksOf, :138-166, private today; export it): lookup / master_detail only (:47), never a credential-class or internal field (:143-148), never multiple: true (:223). Wire it into packages/lint/src/validate-knowledge-source.ts and the save-time admission.
  • Reader (same PR, ADR-0049): in search(), when byRecord and groupBy === undefined (knowledge-service.ts:2510, :2533-2535), key each hit by its own source's documentBy value.
    • A null or empty parent value falls back to the per-record key (recordKeyOf, :4871). groupKeyOf today answers undefined for 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 groupBy key is value:<json> with no source, :2613; leave that path as it is, including sourcesGroupableBy, :2593).
    • hitOf (knowledge-tools.ts:539) sets groupValue for the default grouping too.
  • Fingerprint: documentBy stays 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 declares documentBy.

Acceptance

  • Parse refuses documentBy absent from metadataFields.
  • Save refuses a text field, a user field, an internal lookup and a multiple lookup, 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 without documentBy is unchanged.
  • The pinned hashes in __tests__/index-fingerprint.test.ts are 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

Activity

  1. added
    priority:p1
    area:ai
    on Nov 29, 2026
  2. added theissue type on Nov 29, 2026
  3. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb
    Claim: PM loop round 1 · 2026-11-29T08:27Z
    Session: session_01FEkQ5oQLfL8thb6wtUHnTb
    Account: os-project-manager
    Branch: claude/issue-38537-knowledge-document-by
    Worktree: objectstack-issue-38537
    Domain: domain:server
    Seat: repo:objectstack#5
    Area: o5-ai37000
    File surface: packages/spec/src/ai/knowledge-source.zod.ts and packages/spec/src/ai/knowledge-source.test.ts; packages/spec/src/ai/knowledge-source.metadata-form.ts and 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.json and the generated outputs the spec build writes for this key; packages/services/service-knowledge/src/knowledge-service.ts (record-search grouping in search() and the key helpers only), packages/services/service-knowledge/src/knowledge-tools.ts (hitOf groupValue only), 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 under packages/services/service-knowledge/src/__tests__/ (new document-by-38537.test.ts plus knowledge-search-scope.test.ts and knowledge-source-admission.test.ts; index-fingerprint.test.ts read, 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; the os validate rule is this card's PR 2, claimed by amendment then), docs, skills/**, the search_knowledge description (#38538). PR 1 is Part of #38537; PR 2 (lint) carries Fixes #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 — ObjectKnowledgeSourceSchema has no documentBy; record search with no groupBy keys each hit per record (knowledge-service.ts byRecord path); parentLinksOf in knowledge-search-scope.ts is 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).

  4. added
    domain:server
    pm:dispatched
    on Nov 29, 2026
  5. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    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."
      ]
    }
  6. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    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: documentBy is a new authorable key, which AGENTS.md and the Check Changeset table in pr-automation.yml name added, taking minor).
    File surface: adds packages/services/service-knowledge/src/knowledge-service.ts admitAuthoredSource (the save-time admission lives there; knowledge-source-admission.ts builds 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.ts and *.source-hashes.generated.ts (forced by the form row), and the catalog positive-control count in packages/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.

  7. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    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 (the granularity and groupBy TSDoc only, which still say "one hit per record" where a source's documentBy now sets the unit).
    Reason: contract review 7254573293 on PR #38564, ③ escalation: that TSDoc and the search_knowledge description (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 publishes documentBy describes it. check-handover --inflight on the added path: clear. #38538 keeps its docs pages, skill text and the form-help wording.

  8. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb
    Claim amendment · 2026-11-29T11:09Z · amends claim 7253127987 on this card
    File surface: adds the topK TSDoc in packages/spec/src/contracts/knowledge-service.ts (beside the granularity and groupBy TSDoc added before) and the tool's granularity input description in packages/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 documentBy source, the same staleness the previous amendment fixes. Folded in before the delta review so the release carries no stale unit text.

  9. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz

    2026-11-29T12:03Z · Takeover · seat repo:objectstack#5's account os-project-manager is out of tokens; seat 1 continues its claim.

    Release: claim 7253127987 (session session_01FEkQ5oQLfL8thb6wtUHnTb, account os-project-manager, seat repo: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-by last pushed 43de68d58f; PR #38564. Picked-up work is UNVERIFIED until seat 1 re-reads it at that head.
    Assignee: os-project-manager → zhuangjianguo in this stroke.

    Claim: PM loop round 3 (takeover of 7253127987)
    Session: session_01QsR2jTsdScTh3o2fSjbxSz
    Account: zhuangjianguo
    Branch: claude/issue-38537-knowledge-document-by
    Worktree: objectstack-issue-38537
    Domain: domain:server
    Seat: repo:objectstack#1
    Area: o1-know
    File surface: packages/spec/src/ai/knowledge-source.zod.ts and packages/spec/src/ai/knowledge-source.test.ts; packages/spec/src/ai/knowledge-source.metadata-form.ts and 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.json and the generated outputs the spec build writes for this key; packages/services/service-knowledge/src/knowledge-service.ts (record-search grouping in search() and the key helpers only), packages/services/service-knowledge/src/knowledge-tools.ts (hitOf groupValue only), 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 under packages/services/service-knowledge/src/__tests__/ (new document-by-38537.test.ts plus knowledge-search-scope.test.ts and knowledge-source-admission.test.ts; index-fingerprint.test.ts read, 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; the os validate rule is this card's PR 2, claimed by amendment then), docs, skills/**, the search_knowledge description (#38538). PR 1 is Part of #38537; PR 2 (lint) carries Fixes #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 — ObjectKnowledgeSourceSchema has no documentBy; record search with no groupBy keys each hit per record (knowledge-service.ts byRecord path); parentLinksOf in knowledge-search-scope.ts is 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).

  10. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    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/** and packages/spec/src/ai/knowledge-source* for the topic's next cards.

    Claim: PM loop round 3 (amendment of 7255544301)
    Session: session_01QsR2jTsdScTh3o2fSjbxSz
    Account: zhuangjianguo
    Branch: none yet — PR 2 is not started; a card thread is named in a later amendment
    Worktree: objectstack-issue-38537
    Domain: domain:server
    Seat: repo:objectstack#1
    Area: o1-know
    File surface (PR 2): packages/lint/src/validate-knowledge-source.ts and its tests, the os validate wiring 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 — ObjectKnowledgeSourceSchema has no documentBy; record search with no groupBy keys each hit per record (knowledge-service.ts byRecord path); parentLinksOf in knowledge-search-scope.ts is 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 other
    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).

  11. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

    2026-11-29T23:57Z · Takeover · seat repo:objectstack#1's account zhuangjianguo is out of tokens; seat 2 (os-warren) continues its claim. The seat does not change hands (席不过户); only the card does.

    Release: claim 7255544301, 7255895735 (session session_01QsR2jTsdScTh3o2fSjbxSz, account zhuangjianguo, seat repo:objectstack#1) — taken over, not abandoned. Provenance: who = the maintainer (Warren, os-warren); words, verbatim: 「pm:mailbox — repo:objectstack#1 · zhuangjianguo 没有token了,他的任务你全部接手」; where = os-warren's fleet project thread, 2026-11-29T23:51:50Z.
    Handover: PR 1 (#38564) merged; PR 2 (the os validate knowledge-source rule) is not started and has no branch. Picked-up work is UNVERIFIED until seat 2 re-reads it at that head.
    Assignee: zhuangjianguo → os-warren in this stroke.

    Claim: PM loop round 1 (takeover of 7255895735)
    Session: session_01JQwxbXyLoBzNYY1U8SNPFu
    Account: os-warren
    Branch: none yet — PR 2 is not started; a card thread is named in a later amendment
    Worktree: objectstack-issue-38537
    Domain: domain:server
    Seat: repo:objectstack#2
    Area: o2-S1 (seat 1's held cards, taken over)
    File surface (PR 2): packages/lint/src/validate-knowledge-source.ts and its tests, the os validate wiring 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: 7255895735
    Premise: holds at 430a311 — ObjectKnowledgeSourceSchema has no documentBy; record search with no groupBy keys each hit per record (knowledge-service.ts byRecord path); parentLinksOf in knowledge-search-scope.ts is 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 other
    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).

  12. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

    Dispatch order · #38537 PR 2 (os validate rule for source.documentBy) · zone o2-A (area:ai, knowledge first) · 2026-11-30T00:25Z

    Card #38537 is held by seat 2 (os-warren) by the takeover claim on this card. PR 1 (#38564) merged. This order is PR 2, for one card thread (mode:thread); the thread is the dev.

  13. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbWsSJprjGydwaCH1gD

    os-dev report · #38537 PR 2 (os validate rule for source.documentBy) · blocked at the premise step · 2026-11-30T00:29Z

    Stopped before any code, as the order's file-surface line requires: the rule cannot land without packages/lint/src/index.ts. No branch pushed, no PR.

    Premise (confirmed, still valid). os validate does not judge source.documentBy today: packages/lint/src/ has no occurrence of documentBy on main f5da514. validate-knowledge-source.ts judges content / metadataFields members only.

    Why it stops. Any new verdict needs its own rule id, and rule-id-barrel-exports.test.ts fails unless every exported rule-id constant is re-exported from a published barrel (index.ts, the validateKnowledgeSource block at :413-421). Leaving the constant unexported would pass that test only by hiding the id from consumers, which is the gap the test exists to close. rule-explanations.ts is not forced (an entry is optional), but the five sibling rules each have one, so the PR should add one too.

    Overlap with #38594, measured. #38594 touches index.ts at one hunk, :188 (FlowSubflowTargetOptions type export), and rule-explanations.ts at one hunk, :7180 (FLOW_SUBFLOW_UNKNOWN_EXPLANATION). This PR would touch index.ts :413-421 and rule-explanations.ts near :6410 (the knowledge-source block). The hunks are 200+ and 700+ lines apart, so a textual conflict is not expected. Whether to queue behind #38594 or lift the ⛔ for these two blocks is the seat's call.

    The A/B question from #38564. It can be settled without the maintainer. Neither A nor B fits:

    • A (lint imports @objectstack/service-knowledge): @objectstack/lint's package description says it "Depends on @objectstack/spec; never on a runtime", and service-knowledge is a runtime service.
    • B as written (move the rule to "a package lint already reads, for example @objectstack/core"): lint does not depend on @objectstack/core. Its workspace deps are formula, metadata-core, sdui-parser and spec.
    • C (recommended): build the verdict in validate-knowledge-source.ts from the same spec predicates parentLinkRule asks. Type lookup / master_detail (lint already spells this pair in 8 rule files). Withheld = isMaskedOnReadFieldType(type, managedBy) or internal === true, the exact reading this file already uses for knowledge-source-field-never-indexed and the one collectCredentialWriteResponseFields / collectInternalWriteResponseFields in core compute. Target via referenceTargetOf (@objectstack/spec/data, already imported by lint). Not multiple: true. Messages mirror documentUnitRefusalText, one per reason. No new dependency, and only the files the order names plus the barrel line. Cost: the four-part rule is spelled in two places. A parity test could live in @objectstack/runtime, @objectstack/mcp or @objectstack/cli, which depend on both packages. But documentUnitOf is not on service-knowledge's exports surface, so that test would need one more barrel line there. I would leave it out unless the seat wants it.
    {
      "issue": 38537,
      "status": "blocked",
      "branch": "claude/project-thread-l8mlq4 (local only, not pushed)",
      "pr": null,
      "session": "session_01JQwxbWsSJprjGydwaCH1gD",
      "premise_still_valid": true,
      "summary": "Premise confirmed: os validate does not judge source.documentBy on main f5da514b. Stopped before code: a new rule id must be re-exported from packages/lint/src/index.ts (rule-id-barrel-exports.test.ts), which the order puts off limits while #38594 is open. The measured overlap with #38594 is nil: index.ts :188 vs :413-421, rule-explanations.ts :7180 vs ~:6410.",
      "tests": "none run: no code written",
      "gates": "none run: no diff",
      "dogfood_battery": "n/a: no PR",
      "mcp_calls": "0",
      "api_writes": "1: POST issues/38537/comments (this report, via scripts/pm/post-stamped.mjs)",
      "open_questions": [
        { "question": "Land PR 2 now with two small blocks in index.ts and rule-explanations.ts (no shared hunk with #38594), or queue it behind #38594?", "options": ["A: lift the ban for those two blocks and build now", "B: queue behind #38594 as the order says"], "recommendation": "A: the hunks are 200+ lines apart, and the card is p1 in the knowledge topic Warren put first." },
        { "question": "How does lint get the parent-link rule (the #38564 A/B question)?", "options": ["A: depend on service-knowledge (breaks lint's never-on-a-runtime rule)", "B: move the rule to core (lint does not read core)", "C: compose it in lint from the spec predicates parentLinkRule already asks"], "recommendation": "C: no new dependency, same predicates, idiomatic in lint." }
      ],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  14. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

    2026-11-30T00:34Z · Claim amendment to 7264859550: names PR 2's card-thread branch and file surface (order 7265269178; seat ruling on the thread's report 7265317680: the two measured blocks of index.ts and rule-explanations.ts admitted, route C for the #38564 A/B question).

    Claim: PM loop round 1 (amendment of 7264859550)
    Session: session_01JQwxbXyLoBzNYY1U8SNPFu
    Thread session: session_01JQwxbWsSJprjGydwaCH1gD
    Account: os-warren
    Branch: claude/project-thread-l8mlq4
    Worktree: objectstack-issue-38537
    Domain: domain:server
    Seat: repo:objectstack#2
    Area: o2-A (area:ai)
    File surface (PR 2): packages/lint/src/validate-knowledge-source.ts, its new test packages/lint/src/validate-knowledge-source.document-by.test.ts, one line in packages/lint/src/index.ts (the knowledge block), the rule's entry and table row in packages/lint/src/rule-explanations.ts, changeset .changeset/38537-knowledge-document-by-validate.md (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate), effort: high; order 7265269178
    Clause-②: yes (widening)
    Metadata-protocol: none
    Responsibility: new feature, topic #38536 (maintainer-directed, seat post 7252899468); no producer.
    Thread-read: 7265317680
    Premise: holds at 430a311 — ObjectKnowledgeSourceSchema has no documentBy; record search with no groupBy keys each hit per record (knowledge-service.ts byRecord path); parentLinksOf in knowledge-search-scope.ts is private. Read from main, line numbers per the card body (63acc6c).
    Serial constraints cleared: packages/lint/src/index.ts and rule-explanations.ts are also changed by PR #38594 (#35143, this seat): no shared hunk (measured by the thread, report 7265317680); this PR lands after #38594 and merges main before each push once #38594 merges
    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).

  15. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbWsSJprjGydwaCH1gD

    os-dev report · #38537 PR 2 (os validate rule for source.documentBy) · draft PR #38662 · 2026-11-30T01:07Z

    The seat lifted the ⛔ for the two measured blocks of index.ts / rule-explanations.ts and accepted route C. Built on claude/project-thread-l8mlq4, head a5638acf96. Lands after #38594.

    {
      "issue": 38537,
      "status": "done",
      "branch": "claude/project-thread-l8mlq4",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38662",
      "session": "session_01JQwxbWsSJprjGydwaCH1gD",
      "premise_still_valid": true,
      "summary": "New lint rule knowledge-source-document-by-not-parent-link (error) in validate-knowledge-source.ts. It refuses a source.documentBy, listed in metadataFields, that is not a single-valued parent link. The checks run in the save door's order (declared, not withheld, lookup/master_detail, readable target, not multiple), with one message per reason worded like documentUnitRefusalText. It rides the existing validateKnowledgeSource entry, so os validate/build/lint and the runtime publish gate judge packaged and code-registered sources. Route C: the rule is composed from the spec predicates parentLinkRule asks (no new dependency). The rule id is re-exported from index.ts and explained in rule-explanations.ts. Fixes #38537 (PR 1 #38564 landed the rest).",
      "tests": "pnpm --filter @objectstack/lint test: 248/248 files, 9989 passed / 5 skipped. New file validate-knowledge-source.document-by.test.ts: 17/17. typecheck (tsc + test layer): exit 0. eslint on the 4 changed source files: exit 0. Ablation via scripts/ablation-replace.mjs, each restore verified blob == HEAD d9f63681062f: call site disabled → 9 red; multiple arm deleted → 1 red; internal half of the withheld arm removed → 1 red.",
      "gates": "dispatch-gates --commands: 70 derived. --ran: 66 run (all exit 0), 4 NOT-MEASURED (exit 3, prerequisite). Re-run by hand after fixing the prerequisite, exit 0: check-plugin-teardown-shape --self-test (unshallow), check:docs-transcript-drift (built lint), check:lean-entry-closure (built objectql). check:dual-build-cjs-loads is not measured locally (needs every dist/); CI Build Core runs it. overlap-check: VERDICT clean exit 0 against origin/main and 7 open PRs incl. #38594. CI check-runs on #38662: pending at report time.",
      "dogfood_battery": "n/a: no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0 GitHub MCP calls (subscribe_pr_activity is the session harness, not GitHub MCP)",
      "api_writes": "3 relay writes: POST issues/38537/comments (blocked report 7265317680), pr_create #38662 with assignee os-warren (fleet-write run 46332877191), POST issues/38537/comments (this report)",
      "open_questions": [
        { "question": "Clause-②/Metadata-protocol: `no`/`none` (documentBy is unreleased: its changeset is still pending, and the save door already refuses these values) or `no (narrowing)`/`narrowed` (read against main)?", "options": ["A: keep no/none, patch", "B: narrowed, minor + ADR-0087 disposition"], "recommendation": "A: no published version carries the key, so nothing a release accepted is refused. The body states the other reading for L1/L2." }
      ],
      "security_findings": "withheld",
      "out_of_scope_findings": []
    }
  16. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

    2026-11-30T07:36Z · Landed — card closed by the merge; seat label cleared.

    PR #38662 (PR 2, the os validate rule) merged at 2026-11-30T07:36Z; PR 1 #38564 landed earlier. Follow-up carried by #38538: list knowledge-source-document-by-not-parent-link in the knowledge-source rule list in skills/objectstack-ai/SKILL.md.

  17. removed
    pm:dispatched
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpriority:p1

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions