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:p2Medium: important, M3
Description
maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby
Filing gate: ③ maintainer-directed (topic child). Source: topic #37000 (phase 2 row 6); 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.
维护者速读
- 做什么:平台统一把文档切成检索片段,有三种切法:整篇、逐级切(段落→换行→句末→分号)、按 Markdown 标题切。中文按句号、问号断句,不切在半句话中间,不切开表格。
- 谁受益:长制度按章、条切开后搜得准;接受平台切分的存储,切出来的片段都一样。
- 要知道的:用「整篇」切法时,超过模型上限的文档会从检索里消失并报失败,不会被截断。
- 需要你做的:无。
What
packages/services/service-knowledge/src/split/(new), strategies:recursive: blank line → newline → sentence end (。?!and. ? !; an English.counts only before whitespace or line end, so 「3.2 条」「400.50 元」 stay whole; no split right after a closing quote or bracket) →;/;→ character. Never inside a Markdown table or list item. Adjacent short pieces merged up tominChars(default 200).markdown: by heading level; each chunk carriesheadingPath; a heading with no body joins the next chunk; the heading path counts toward length and is embedded.whole: one chunk per document.
- Limits: the service learns the embedder input limit from the adapter (a descriptor member 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, e.g.embedding?: { maxInputTokens? }), not fromEMBEDDER_SERVICE.IEmbedder.maxInputTokens?(optional) is added so an adapter can report its embedder's limit;embedder-openaifills it from embedder-openai: an over-limit input is refused, not truncated (known-model input limits, one shared token estimate) #37093's table.maxChars = min(configured, limit × 0.8 by #37093's estimate); 800 when nothing is configured or no limit is known. wholeover the limit: the document is removed from the index and reported —reindexSource's result gainsfailedand a boundedfailures: [{ documentId, reason }]; the event path logs at error with source, record id, estimate and limit. No limit known → no check. The estimate overcounts, so a whole document's usable length is about 60% of the model limit; the doc page says so.- Chunk channel, shape 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:KnowledgeDocument.chunks?uses the existingKnowledgeChunkSchema(packages/spec/src/ai/knowledge-document.zod.ts:58, today without a reader), reshaped as ADR: knowledge platform boundary — the platform owns document assembly, sync and reconcile, structural split and record-level return;knowledge_sourcebecomes a governed type #37001 decides (it hascontent, nottext; addheadingPath?) — changed, not duplicated. An adapter capability flag says whether it accepts pre-split chunks; an adapter that does not declare it keeps receiving whole documents. A document indexed directly withoutchunksis split by the service the same way. - Source key
split?: { strategy, maxChars?, minChars? }on the object source (packages/spec/src/ai/knowledge-source.zod.ts), read by the splitter here (ADR-0049). Precedence:split.maxCharsover the settings page'sknowledge.chunk_target(which gains its reader here).chunk_overlaphas no meaning in this splitter: removed from the settings page in this PR. knowledge-memorydrops its own chunking (src/index.ts:104) and takes the service's chunks.
Acceptance
- Golden files: a Chinese regulation with chapters and articles, a Markdown table, a long run with no punctuation, mixed Chinese and English, 「3.2 条」 and 「400.50 元」.
- Property test: no chunk's estimate exceeds the limit.
- The service splits once; an adapter that accepts chunks receives them unchanged (memory and a stub).
wholeover the limit → removed and reported, not truncated.- Container run per AGENTS.md.
Out of scope
- Per-chunk hashes (an adapter hashes the text it embeds; knowledge-pgvector: an open vector store on PostgreSQL — tables, exact search, listing, chunks #37100).
IEmbedder.model?and the index fingerprint (knowledge-pgvector: an open vector store on PostgreSQL — tables, exact search, listing, chunks #37100).- Overlap between chunks.
Blocked-by: #37001 (chunk channel, capability flag, adapter limit member), #37096 (same file; its suite gains the chunk cases), #37093 (limits table and estimate).
Parent: #37000. Reader: domain:server lane (spec edits per spec.md).
Dedupe: splitter knowledge 4 (open 3: #37000, #37001, a seat post) · KnowledgeChunk 0 · chunk_overlap 0.
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:p2Medium: important, M3
Activity
objectstack-fleet commentedon Nov 24, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
Triage: first touch 2026-11-24T20:34Z
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: adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one contract test suite #37096, embedder-openai: an over-limit input is refused, not truncated (known-model input limits, one shared token estimate) #37093) 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
Unlocked 2026-11-25T07:36Z. Every
Blocked-by:card is closed now. #37096 (PR #37164) landed this window, after #37001 and #37093.pm:blocked→pm:queue. Goes to seat 4 as topic #37000 phase 2.objectstack-fleet commentedon Nov 25, 2026
repo:objectstack#4 · os-justin · session_01QSeKYpRrYuqSLCvbSk9zrL
Claim: PM loop round 1
Session:
session_01QSeKYpRrYuqSLCvbSk9zrLAccount:
os-justinBranch:
claude/issue-37098-knowledge-splitterWorktree:
objectstack-issue-37098Domain:
domain:serverSeat:
repo:objectstack#4Area: a4-K
File surface:
packages/services/service-knowledge/**(newsrc/split/),packages/spec/src/ai/knowledge-document.zod.ts,packages/spec/src/ai/knowledge-source.zod.ts,packages/spec/src/contracts/knowledge-adapter.ts,packages/spec/src/contracts/embedder.ts(IEmbedder.maxInputTokens?only) and the spec artifacts they regenerate,packages/plugins/embedder-openai/**(fillingmaxInputTokens),packages/plugins/knowledge-memory/**,packages/services/service-settings/src/manifests/knowledge.manifest.tsand its translations (thechunk_targetreader,chunk_overlapremoved),content/docs/protocol/knowledge.mdx,content/docs/ai/knowledge-rag.mdx,.changeset/*(stop on breach; explain in the report)Container & model:
L,mode:cloud,model: default (dispatch-gates --repo objectstack-ai/objectstack --tier: "no path-derived mandate"; Clause-② review owed at CONTRACT_REVIEW_TIER by surface),effort: highClause-②: yes
Metadata-protocol: added
Responsibility: n/a — not a defect card
Thread-read: 7156055916
Premise: holds — on origin/main 9171bed
KnowledgeChunkSchema(knowledge-document.zod.ts) has no reader,knowledge-memorychunks internally (src/index.ts~104), no source carries asplitkey,knowledge.chunk_targetandknowledge.chunk_overlaphave no reader, andIEmbedderhas nomaxInputTokens.Serial constraints cleared: built on main. #37256 (#37097, open, waits on ADR PR #37263) also edits
knowledge-document.zod.ts(TSDoc onorganizationId),knowledge-service.tsand theknowledge-memoryadapter; #37265 (#37094, open) editsembedder-openai/src/index.ts,knowledge-service-plugin.tsand theservice-settingstranslations. Whichever lands second merges main and keeps both sides (the organization filter before ranking, the service's chunks, the batch-cap export next tomaxInputTokens). overlap-check before every push. #37099 stays behind #37094.Pre-claim lane:
domain:server; the spec files are contract surface, reviewed percontract-review.md.packages/spec/src/contracts/embedder.tssits outside this zone's knowledge lease roots and is named here for the one optional member the card requires.Pre-claim deps:
Blocked-by: #37001, #37096, #37093, all three closed.Prior rulings read: maintainer 「37098 优先,现在就派」, said in the seat repo:objectstack#4 session and relayed by the seat on 2026-11-25; it puts this card ahead of the zone's serial order. ADR-0161 K8 (chunk channel, capability flag, adapter limit member as #37001 settled; each member lands with its reader per ADR-0049). Ruling C token estimate and the known-model input limits from #37093 (PR #37171).
State:
pm:queue→pm:dispatchedin this stroke.objectstack-fleet commentedon Nov 25, 2026
repo:objectstack#4 · os-justin · session_01QSeKYoHKp8EUQtketT9S29
os-dev-report
{ "issue": 37098, "status": "blocked", "branch": "claude/issue-37098-knowledge-splitter", "pr": null, "session": "session_01QSeKYoHKp8EUQtketT9S29", "premise_still_valid": true, "summary": "Stopped before the first edit on a file-surface breach. The card's What 3 (and the dispatch ruling) gives reindexSource's result `failed` and a bounded `failures`; that type, KnowledgeReindexResult, is declared in packages/spec/src/contracts/knowledge-service.ts (line 55), which the claim's file surface does not list (it names only contracts/knowledge-adapter.ts and contracts/embedder.ts under contracts/). ADR-0161 K8 ('What counts as a member') places `failed`/`failures` on the IKnowledgeService reindex result, the same file where #37096 added `skipped`/`purged`, and a narrower return type on the KnowledgeService class alone would hide the members from every contract reader (Prime Directive #5), so there is no in-surface route. Unblock: amend the claim's file surface with `packages/spec/src/contracts/knowledge-service.ts` (two optional members on KnowledgeReindexResult only; the api-surface/export-origins snapshots it touches are already covered as regenerated spec artifacts). Every other premise holds and the rest of the surface is sufficient.", "tests": "none run: no code written.", "gates": "none run: no diff. overlap-check not run (nothing to push beyond the empty branch).", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm; no PR", "mcp_calls": "4 — mcp__github__issue_read x3 (#37098 get + get_comments, #37001 get), ToolSearch schema load; no write tool", "api_writes": "1 — this report comment on #37098 via post-stamped.mjs (plus the empty-branch git push, not a REST write)", "open_questions": [ { "question": "May the claim's file surface add packages/spec/src/contracts/knowledge-service.ts for KnowledgeReindexResult.failed? and .failures? (What 3)?", "options": [ "A — amend the claim to add the file (two optional members, TSDoc, the regenerated snapshots); re-dispatch on the same branch", "B — split What 3's result members into their own card; this card lands the whole-over-limit removal with failures reported only in the log and the result message" ], "recommendation": "A, because K8 already names failed/failures as reindex-result members landing in this card, the edit is two optional fields beside #37096's skipped/purged, and B would ship a removal whose report the contract cannot carry (declared != delivered)." } ], "security_findings": "none", "out_of_scope_findings": [], "readings": { "tree": "objectstack-ai/objectstack @ 9171bed0a65ab242567f243969368ead786cd830 (origin/main, BASE)", "blockers": "#37001 closed by PR #37119 (merged, ADR-0161); #37096 landed as d7f299c0 (PR #37164); #37093 landed as 3d4f4238 (PR #37171)", "claim": "newest Claim: is comment 7158049912, Branch claude/issue-37098-knowledge-splitter — matches", "k8_shapes": "item 5: KnowledgeChunk keys id/documentId/index/content + new headingPath?; it already has `content` (no text->content rename, so no rename to measure); its `metadata` key has no producer/reader, K8 says give it one or remove it; flag capabilities?.chunks. item 6: adapter descriptor embedding? (this card reads only maxInputTokens; model/dimensions/variant land with item 8) + IEmbedder.maxInputTokens?. item 10: source.split? { strategy whole|recursive|markdown, maxChars?, minChars? } on the object arm beside contentFields.", "settings": "chunk_target and chunk_overlap appear only in service-settings knowledge.manifest.ts (lines 105-112) and its 11 translation files; zero readers repo-wide.", "branch_state": "origin/claude/issue-37098-knowledge-splitter pushed empty at BASE; worktree /home/user/objectstack-issue-37098 kept, clean, installed, for the re-dispatch" } }Generated by Claude Code
objectstack-fleet commentedon Nov 25, 2026
repo:objectstack#4 · os-justin · session_01QSeKYpRrYuqSLCvbSk9zrL
Claim: PM loop round 1
Session:
session_01QSeKYpRrYuqSLCvbSk9zrLAccount:
os-justinBranch:
claude/issue-37098-knowledge-splitterWorktree:
objectstack-issue-37098Domain:
domain:serverSeat:
repo:objectstack#4Area: a4-K
File surface:
packages/services/service-knowledge/**(newsrc/split/),packages/spec/src/ai/knowledge-document.zod.ts,packages/spec/src/ai/knowledge-source.zod.ts,packages/spec/src/contracts/knowledge-adapter.ts,packages/spec/src/contracts/knowledge-service.ts(the reindex result'sfailed?andfailures?only),packages/spec/src/contracts/embedder.ts(IEmbedder.maxInputTokens?only) and the spec artifacts they regenerate,packages/plugins/embedder-openai/**(fillingmaxInputTokens),packages/plugins/knowledge-memory/**,packages/services/service-settings/src/manifests/knowledge.manifest.tsand its translations (thechunk_targetreader,chunk_overlapremoved),content/docs/protocol/knowledge.mdx,content/docs/ai/knowledge-rag.mdx,.changeset/*(stop on breach; explain in the report)Container & model:
L,mode:cloud,model: default (dispatch-gates --repo objectstack-ai/objectstack --tier: "no path-derived mandate"; Clause-② review owed at CONTRACT_REVIEW_TIER by surface),effort: highClause-②: yes
Metadata-protocol: added
Responsibility: n/a — not a defect card
Thread-read: 7158152761
Premise: holds — on origin/main 9171bed
KnowledgeChunkSchema(knowledge-document.zod.ts) has no reader,knowledge-memorychunks internally (src/index.ts~104), no source carries asplitkey,knowledge.chunk_targetandknowledge.chunk_overlaphave no reader, andIEmbedderhas nomaxInputTokens.Serial constraints cleared: built on main. #37256 (#37097, open, waits on ADR PR #37263) also edits
knowledge-document.zod.ts(TSDoc onorganizationId),knowledge-service.tsand theknowledge-memoryadapter; #37265 (#37094, open) editsembedder-openai/src/index.ts,knowledge-service-plugin.tsand theservice-settingstranslations. Whichever lands second merges main and keeps both sides (the organization filter before ranking, the service's chunks, the batch-cap export next tomaxInputTokens). overlap-check before every push. #37099 stays behind #37094.Pre-claim lane:
domain:server; the spec files are contract surface, reviewed percontract-review.md.packages/spec/src/contracts/embedder.tssits outside this zone's knowledge lease roots and is named here for the one optional member the card requires.Pre-claim deps:
Blocked-by: #37001, #37096, #37093, all three closed.Prior rulings read: maintainer 「37098 优先,现在就派」, said in the seat repo:objectstack#4 session and relayed by the seat on 2026-11-25; it puts this card ahead of the zone's serial order. ADR-0161 K8 (chunk channel, capability flag, adapter limit member as #37001 settled; each member lands with its reader per ADR-0049). Ruling C token estimate and the known-model input limits from #37093 (PR #37171).
State:
pm:dispatchedheld; this claim replaces 7158049912 with one more path onFile surface:(contracts/knowledge-service.ts, raised by the dev in 7158152761, stopped before any edit). Branch, size, tier and every other line are unchanged.objectstack-fleet commentedon Nov 25, 2026
repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Seat direction: B · 2026-11-25T09:23Z · on the contract fork zone a4-K raised:
KnowledgeChunk.metadata(authorable-surface/ai.json:247).Governing text. ADR-0161 K8 item 5 says the member "has no producer and no reader today; #37098 gives it one or removes it". The dev measured on
9171bed0: this card has no real producer, because a chunk inherits its document's metadata.Direction: B. Retire
KnowledgeChunk.metadatain this PR with the full kit:spec-property-retirementskill;retiredKey()tombstone;Why B and not the others:
knowledge.chunk_overlap, and 19.0.0 is the major that takes such removals. Retiring a dead key immediately is the startup-stage default.Effects on the PR:
Metadata-protocol: narrowed. When several kinds apply, narrowed wins over added.Clause-②: yes (narrowing).chunk_overlapandKnowledgeChunk.metadata, each with FROM → TO and the one-line fix.objectstack-fleet commentedon Nov 25, 2026
repo:objectstack#4 · os-justin · session_01QSeKYpRrYuqSLCvbSk9zrL
Claim: PM loop round 1
Session:
session_01QSeKYpRrYuqSLCvbSk9zrLAccount:
os-justinBranch:
claude/issue-37098-knowledge-splitterWorktree:
objectstack-issue-37098Domain:
domain:serverSeat:
repo:objectstack#4Area: a4-K
File surface:
packages/services/service-knowledge/**(newsrc/split/),packages/spec/src/ai/knowledge-document.zod.ts,packages/spec/src/ai/knowledge-source.zod.ts,packages/spec/src/contracts/knowledge-adapter.ts,packages/spec/src/contracts/knowledge-service.ts(the reindex result'sfailed?andfailures?only),packages/spec/src/contracts/embedder.ts(IEmbedder.maxInputTokens?only) and the spec artifacts they regenerate,packages/plugins/embedder-openai/**(fillingmaxInputTokens),packages/plugins/knowledge-memory/**,packages/services/service-settings/src/manifests/knowledge.manifest.tsand its translations (thechunk_targetreader,chunk_overlapremoved),content/docs/protocol/knowledge.mdx,content/docs/ai/knowledge-rag.mdx,.changeset/*(stop on breach; explain in the report)Container & model:
L,mode:cloud,model: default (dispatch-gates --repo objectstack-ai/objectstack --tier: "no path-derived mandate"; Clause-② review owed at CONTRACT_REVIEW_TIER by surface),effort: highClause-②: yes
Metadata-protocol: narrowed
Responsibility: n/a — not a defect card
Thread-read: 7158283273
Premise: holds — on origin/main 9171bed
KnowledgeChunkSchema(knowledge-document.zod.ts) has no reader,knowledge-memorychunks internally (src/index.ts~104), no source carries asplitkey,knowledge.chunk_targetandknowledge.chunk_overlaphave no reader, andIEmbedderhas nomaxInputTokens.Serial constraints cleared: built on main. #37256 (#37097, open, waits on ADR PR #37263) also edits
knowledge-document.zod.ts(TSDoc onorganizationId),knowledge-service.tsand theknowledge-memoryadapter; #37265 (#37094, open) editsembedder-openai/src/index.ts,knowledge-service-plugin.tsand theservice-settingstranslations. Whichever lands second merges main and keeps both sides (the organization filter before ranking, the service's chunks, the batch-cap export next tomaxInputTokens). overlap-check before every push. #37099 stays behind #37094.Pre-claim lane:
domain:server; the spec files are contract surface, reviewed percontract-review.md.packages/spec/src/contracts/embedder.tssits outside this zone's knowledge lease roots and is named here for the one optional member the card requires.Pre-claim deps:
Blocked-by: #37001, #37096, #37093, all three closed.Prior rulings read: maintainer 「37098 优先,现在就派」, said in the seat repo:objectstack#4 session and relayed by the seat on 2026-11-25; it puts this card ahead of the zone's serial order. ADR-0161 K8 (chunk channel, capability flag, adapter limit member as #37001 settled; each member lands with its reader per ADR-0049). Ruling C token estimate and the known-model input limits from #37093 (PR #37171).
State:
pm:dispatchedheld; this claim replaces 7158184950. One line changes:Metadata-protocol:becomesnarrowed, per the seat direction 7158283273 (retireKnowledgeChunk.metadatahere, per ADR-0161 K8 item 5, alongside theknowledge.chunk_overlapremoval). Branch, size, tier, file surface and every other line are unchanged.