Repository navigation
Description
maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby
Filing gate: ③ maintainer-directed (topic child). Source: topic #37000 (phase 2 row 10); maintainer 2026-11-24 「用fable评审,并分拆第二阶段的任务」. Reviewed by an independent Fable pass before filing.
Grading: area:ai · Feature · p2 (topic) · reach: apps that mount service-knowledge · evidence: read.
维护者速读
- 做什么:检索可以按记录返回。同一份制度命中多个片段时合成一条,取最高分;也可以按某个字段分组(比如按制度),返回「哪几份制度」。
- 记录在建索引之后改过内容的,不返回旧片段。
- 谁受益:制度问询先找到「哪几份制度」,再把全文交给模型;BrightRule 可以删掉自己写的去重。
- 需要你做的:无。
What
KnowledgeSearchOptions(packages/spec/src/contracts/knowledge-service.ts):granularity?: 'chunk' | 'record'(defaultchunk, today's behaviour) andgroupBy?: string. Return type staysKnowledgeHit[].knowledge-service.tssearch(): in record mode keep the best hit per group;topKcounts groups; builds on service-knowledge: search returns a short page after the permission filter instead of refilling #36993's refill after the permission filter, with a stated refill cap.groupBymust be one of the source'smetadataFields; a source without it answers no hits for that search (never ungrouped); the group value is returned in the hit'smetadata. File and http sources group bydocumentId.- The permission re-read stays
id+ the display field (resolveDisplayField, shared with service-knowledge: a knowledge hit's title is read from a hard-codedtitlefield #36994), as the asking user, in the same query. - Freshness, a separate query only for the hits that would be returned (at most topK records): one system-context read per object of the source's content and metadata fields with
{ $and: [where, { id: { $in } }] }. A record that no longer matcheswhere, or whose recomputed docHash differs from the hit's, is dropped. Repair is in process, not awaited, in system context, single-flight per (source, record) through service-knowledge: record-change sync ignores the sourcewhere, and a restored record never re-enters the index #36991's path, at most once per record per process lifetime until its hash matches; it never throws into the search. It moves to the queue with row 15. The hit carries the stored hash (KnowledgeHit.docHash?, per ADR: knowledge platform boundary — the platform owns document assembly, sync and reconcile, structural split and record-level return;knowledge_sourcebecomes a governed type #37001). - When a chunk has
headingPath(service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098), the hit carries it (KnowledgeHit.headingPath?, per ADR: knowledge platform boundary — the platform owns document assembly, sync and reconcile, structural split and record-level return;knowledge_sourcebecomes a governed type #37001).
Acceptance
- One record with 3 matching chunks → 1 hit, the highest score.
topK: 5→ 5 records when that many exist within the refill cap (cap stated); fewer otherwise, logged.- A record deleted, unreadable, or out of
whereafter indexing → absent; content changed → no stale snippet, one repair. groupBy: 'policy'; agroupByfield missing from one source; system identity; several sources mixed; a file source.- Container run per AGENTS.md.
Out of scope
- New
search_knowledgetool arguments over MCP / in-app (epic row 12). - Grouping inside the adapter (in ADR: knowledge platform boundary — the platform owns document assembly, sync and reconcile, structural split and record-level return;
knowledge_sourcebecomes a governed type #37001's list). - The scope filter (row 11).
Blocked-by: #37001, #36993 (same function; record mode builds on its refill), #37098, #37096 (docHash). Coordinates with #36994: both use resolveDisplayField; #36994 sets the title at index time, this card reads it live in the permission re-read.
Parent: #37000. Reader: domain:server lane (spec edits per spec.md).
Dedupe: granularity 227 (open: none on knowledge besides #37000) · groupBy knowledge 25 (open 3: #37000, unrelated skills and seat posts).
Activity
objectstack-fleet commentedon Nov 24, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
Triage: first touch 2026-11-24T20:37Z
pm:blockedanddomain:serveradded. The card has no state yet, and itsBlocked-by:cards (ADR: knowledge platform boundary — the platform owns document assembly, sync and reconcile, structural split and record-level return;knowledge_sourcebecomes a governed type #37001, service-knowledge: search returns a short page after the permission filter instead of refilling #36993, service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098, service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096) are still open.knowledge_sourcebecomes a governed type #37001). Triage's unlock scan moves the card when every blocker closes.objectstack-fleet commentedon Nov 25, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
Triage: unblocked 2026-11-25T17:37Z
pm:blocked→pm:queue. Its blockers service-knowledge: search returns a short page after the permission filter instead of refilling #36993, service-knowledge: a knowledge hit's title is read from a hard-codedtitlefield #36994, ADR: knowledge platform boundary — the platform owns document assembly, sync and reconcile, structural split and record-level return;knowledge_sourcebecomes a governed type #37001, service-knowledge: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096 and service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098 are all closed.objectstack-fleet commentedon Nov 25, 2026
repo:cloud#1 · os-warren · session_01JQwxbW5anP6GDaVi5LKi2U
Claim: PM loop round 2 (epic #37000 owner seat, card thread)
Session:
session_01JQwxbW5anP6GDaVi5LKi2UThread session:
session_01JQwxbZmvWffL8FZzRX8ZSbAccount:
os-warrenBranch:
claude/project-thread-oc6nsuWorktree:
objectstack(the card thread's own checkout)Domain:
domain:serverSeat:
repo:cloud#1File surface:
packages/services/service-knowledge/**,packages/spec/src/contracts/knowledge-service.tsandpackages/spec/src/contracts/knowledge-adapter.ts(the search options and hit shape only),packages/plugins/knowledge-memory/**(the reference adapter's hash and heading path; widened at review, PR #37335),content/docs/**knowledge pages,.changeset/(stop on breach; explain in the report)Container & model:
M,mode:thread,model: default (dispatch-gates --tier: no path-derived mandate; floor sonnet · default opus · ceiling fable),effort: highClause-②: yes
Metadata-protocol: added (revised at build: the gate reads KnowledgeHit.docHash and headingPath in packages/spec/authorable-surface/ai.json as added authorable keys)
Responsibility:
n/a — not a defect cardThread-read: 7169793093
Premise: holds (Blocked-by #37001, #36993 (PR #37301), #37098, #37096 all closed; read 17:45Z)
Serial constraints cleared:
#37100 (this seat, branch claude/project-thread-vcp8s3) changes KnowledgeService.search for K7 rule 5 in the same file; overlap-check before each push, the second to land merges main. #37308 (row 11, blocked on the ADR note PR #37329) adds scope to the same search path later. #36994's display-field title (PR #37301) is read live here per the card.Ownership: maintainer 2026-11-25 13:49Z, 「#4 只负责在手任务,你接手专题剩余任务」; unlocked by triage 17:41Z. Clause-② yes: granularity and groupBy widen the published search options and owe a contract review at the ceiling tier before the queue.
objectstack-fleet commentedon Nov 25, 2026
repo:cloud#1 · os-warren · session_01JQwxbZmvWffL8FZzRX8ZSb
os-dev-report
{ "issue": 37103, "status": "done", "branch": "claude/project-thread-oc6nsu", "pr": "https://github.com/objectstack-ai/objectstack/pull/37335", "session": "session_01JQwxbZmvWffL8FZzRX8ZSb", "premise_still_valid": true, "summary": "KnowledgeSearchOptions gains granularity ('chunk' default, unchanged) and groupBy; KnowledgeHit gains docHash? and headingPath?. Under record granularity search() answers one best hit per record (or per groupBy value, merged across sources; file/http per document), widens the #36993 refill to every source and caller (cap topK x 20 passages per source), reads the display field live in the one permission re-read, and checks each hit about to be answered against its record (system read of where AND id in, projected): deleted, out of where or recomputed docHash differs => dropped, next moves up (max 3 rounds), background single-flight repair through syncRecord. knowledge-memory returns docHash and headingPath; the contract suite pins both plus a record-level freshness case through a real service.", "tests": "at 9652c238: service-knowledge vitest 292/292 (11 files); knowledge-memory 37/37; knowledge-ragflow 10/10; typecheck exit 0 on service-knowledge and knowledge-memory. Ablation via scripts/ablation-replace.mjs (restored, git diff HEAD empty): hash compare -> false turns 2 freshness cases red; grouping map read disabled turns 3 grouping cases red.", "gates": "local: spec check:generated 13/14 green, check:docs stale -> --fix -> green; eslint changed .ts exit 0; check:doc-authoring, check:durability-log-level, check:startup-registry-verdict, check:adr-anchors, check:adr-0087-registration, check:pm-skill-id-lint, check-nul-bytes exit 0. dispatch-gates --commands derived 117 commands; the rest declared to CI (PR check-runs in_progress at report time).", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "mcp_calls": "4 — issue_read x2, get_session, subscribe_pr_activity (no write tool)", "api_writes": "2 — relay pr_create (POST /pulls + assignees leg), this os-dev-report comment", "open_questions": [], "security_findings": "none", "out_of_scope_findings": ["carrier: #37100 — knowledge-pgvector now owes docHash and headingPath on hits under the contract suite; told to that thread"] }objectstack-fleet commentedon Nov 25, 2026
repo:cloud#1 · os-warren · session_01JQwxbW5anP6GDaVi5LKi2U
ACCEPT → PR #37335 comment 7171310022 (round 2: L1 ACCEPT + contract review PASS at head f5c87f7; round 1 REWORK 7170913599). Not governed; CI all green at that head; readied and auto-merge armed.
Merge origin/main into claude/project-thread-vcp8s3 (#37103 landed): …