Skip to content

feat(service-knowledge)!: one splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key; KnowledgeChunk.metadata and knowledge.chunk_overlap retired - #37287

Merged
os-zhuang merged 18 commits into
mainfrom
claude/issue-37098-knowledge-splitter
Nov 25, 2026
Merged

os-zhuang merged 18 commits into
mainfrom
claude/issue-37098-knowledge-splitter

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Fixes #37098

Clause-②: yes (narrowing) — widens the knowledge contract (the split key, chunks, headingPath, the adapter's capabilities and embedding, IEmbedder.maxInputTokens, the reindex failed / failures) and narrows two accept sets: KnowledgeChunk.metadata is refused, and knowledge.chunk_overlap is no longer a key of the knowledge settings namespace
Metadata-protocol: narrowed
Skills-docs: follow-up #37292 — skills/objectstack-ai/SKILL.md does not yet teach split or name the two retired keys; that file is governed and outside this claim. content/docs/protocol/knowledge.mdx (new §3.5) and content/docs/ai/knowledge-rag.mdx document it here.

维护者速读

  • 用户能看到什么变化:知识检索在建索引时由平台统一把文档切成片段,长制度按章、条切开,中文按句号问号断句,不会切在「3.2 条」「400.50 元」中间,也不切开表格。
  • 为什么做:属于「知识检索平台化」专题第二阶段,让每种存储拿到的片段完全一致。
  • 出错会怎样:整篇切法下超过模型上限的文档会从检索中移除并报失败,不会被截断;设置页的「片段重叠」一项被移除(它从未生效),片段上一个从未被使用的字段也被移除,写了它的代码会收到带修复说明的报错。
  • 要你做什么:无。

What changes

  • One splitter in the service (packages/services/service-knowledge/src/split/): whole, recursive (blank line, line break, sentence end, semicolon, character; Chinese-aware sentence rule; tables and list items kept whole while they fit; short pieces merged up to minChars), and markdown (one section per heading, the heading path embedded at each passage's start and carried as headingPath).
  • The chunk channel, as ADR-0161 K8 item 5 settled it. KnowledgeDocument.chunks?, KnowledgeChunk.headingPath?, and IKnowledgeAdapter.capabilities?.chunks. An adapter that declares it gets every document with the service's passages; one that does not keeps receiving whole documents. indexDocument refuses caller-supplied chunks, as it refuses docHash.
  • The limit, per ADR-0161 K8 item 6. IKnowledgeAdapter.embedding?.maxInputTokens and IEmbedder.maxInputTokens?, read at use, never cached. embedder-openai reports its limit from the embedder-openai: an over-limit input is refused, not truncated (known-model input limits, one shared token estimate) #37093 table. A passage keeps maxChars (split.maxChars, else knowledge.chunk_target, else 800) and, when a limit is known, estimateTokens within 80% of it (the shared estimate, not forked).
  • whole over the budget is removed and reported, never truncated. reindexSource gains failed and failures (at most 20 named). The event sync logs at error with source, record id, estimate and limit. indexDocument throws.
  • The split key, ADR-0161 K8 item 10: ObjectKnowledgeSource.split?: { strategy, maxChars?, minChars? }, read by the splitter.
  • knowledge-memory drops its own chunking. It declares capabilities.chunks and indexes the service's passages as given.
  • Settings. knowledge.chunk_target gains its reader, through the settings service at use, never at boot. It is now shown for the in-memory adapter too. knowledge.chunk_overlap is retired the way the Localization format keys were: removed from the manifest and its 11 translations, version 1 to 2, a stored row kept, a write refused 400 UNKNOWN_KEY.
  • docHash keeps its recipe: the passages are derived from content and do not enter it.

BREAKING

  • KnowledgeChunk.metadata: FROM an optional record, accepted and stripped, TO a retiredKey() tombstone (a parse refusal with the prescription; tsc types it never). Nothing wrote or read it. Fix: delete the key; filter on the document's metadata. ADR-0161 K8 item 5, by seat direction 7158283273.
  • knowledge.chunk_overlap: FROM a key of the knowledge settings namespace TO no key (not shown or resolved; a write is refused 400 UNKNOWN_KEY; a stored row is kept). Nothing read it. Fix: stop writing it.

Retirement kit, per the spec-property-retirement skill, under protocol major 18 (seat ruling A):

  • the retiredKey() tombstone;
  • RETIRED_KEYS_BY_MAJOR[18] row ai/KnowledgeChunk:metadata;
  • D3 knowledge-chunk-metadata-retired and its STEP18_RATIONALE fragment;
  • the [RETIRED] line in authorable-surface/ai.json;
  • the regenerated reference;
  • the pin packages/spec/src/ai/knowledge-document.test.ts;
  • the changeset's adr-0087: registered marker.

No D2 conversion: a chunk is a runtime contract shape, never stored in stack metadata, so os migrate meta has no source to rewrite — the ActionDescriptor.isAsync disposition. The settings key follows the Localization format keys' retirement: specifier and 11 translations removed, manifest version: 2, stored rows kept.

Tests

  • split.test.ts: six golden files (Chinese regulation with 章/条, a Markdown table, a long unpunctuated run, mixed zh/en with quotes, 「3.2 条」 and 「400.50 元」, a Markdown heading tree), direct assertions of each rule, and a seeded property test. Over 500 random documents with random bounds, no passage's estimate exceeds the budget or the limit, no passage exceeds maxChars, and recursive loses no text. A whole property test runs 200 more.
  • contract-stubs.test.ts: the contract suite against two stubs. One declares no capability and is pinned to receive whole documents, never chunks. The other declares chunks and stores passages as given.
  • testing.ts: the suite gains the chunk-channel cases. With chunks, the adapter receives exactly splitDocument's passages and a hit is one of them by id and text; whole over the budget is removed and reported; caller chunks are refused. Without chunks, whole documents arrive. knowledge-memory runs it with chunks: true.
  • chunk-channel.test.ts: the event path at error; indexDocument over the budget; the bounded failures; the maxChars precedence; the descriptor read at use; and end to end, chunk_target saved after boot cuts the next write through the real settings service.
  • openai-embedder.test.ts: the reported limit. knowledge.manifest.test.ts: version 2 and chunk_overlap absent.
  • packages/spec/src/ai/knowledge-document.test.ts: the retired KnowledgeChunk.metadata is refused at parse with the prescription (also inside KnowledgeDocument.chunks), a chunk without it parses clean, and authoring it is a @ts-expect-error.

The local readings sit in the os-dev report comment on this PR.

Acceptance notes

  • KnowledgeChunk.metadata is retired here (seat direction 7158283273, option B; registered under protocol major 18 by the seat's ruling A). The claim was re-issued as Metadata-protocol: narrowed (7158315677).
  • No refinement for minChars ≤ maxChars. The published JSON Schema cannot carry it, and the baseline that declares a dropped refinement is outside this claim. A minChars above the effective maxChars reads as maxChars, documented on the key.
  • A table that does not fit is cut between rows, each piece repeating the header. A list item that does not fit is cut as a paragraph. The budget is the hard bound.
  • Re-splitting. docHash does not cover passages, so a changed split, chunk_target or limit re-splits a document only when the document itself changes. The index fingerprint (ADR-0161 K7; knowledge-pgvector: an open vector store on PostgreSQL — tables, exact search, listing, chunks #37100) rebuilds a source on a split change. The docs say so.
  • Merged with feat(service-knowledge): documents carry their organization, and search hands the adapter the caller's organizations #37256 (the organization filter) through scripts/pm/os-regen-merge.sh, keeping both sides:
    • organizationId next to chunks;
    • the organization filter before ranking, over the service's passages;
    • implements: { listDocuments, chunks, organizationIds };
    • resolveTenancyPosture next to resolveChunkTarget.
  • feat(service-knowledge): register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37265 still shares files, a declared serial constraint: whichever lands second merges main.
  • Two test pins outside the claim's literal file list moved with the ordered retirement, both deliberate tripwires on the manifest: settings-visibility-declaration.pin.test.ts (90 to 87 predicates) and knowledge.manifest.test.ts.

Verification

Read first: packages/services/service-knowledge/src/split/splitter.ts (the sentence rule, the block-aware merge, the even character cut); knowledge-service.ts prepareDocuments / writeSynced and the walk's failure branch; packages/spec/src/contracts/knowledge-adapter.ts.

Two-minute check: pnpm --filter @objectstack/service-knowledge exec vitest run src/__tests__/split.test.ts. Expect 25 passed, then open src/__tests__/fixtures/split/regulation-zh.tight.golden.json and see each 章 title leading its own chapter.


Generated by Claude Code

… embedding descriptor, reindex failures

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
…lden files and the budget property

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
…e chunks; whole over the budget is removed and reported

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
…ns, chunk_overlap retired, contract suite chunk cases and stubs

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
… read through the settings service

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
…siness words, visibility pin moved

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
…e tenant-audit census can place its delete

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
…eiver; the chunk-channel engine double holds the caller's bound

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
…Strategy (ADR-0122)

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
…em 5) — tombstone, retired-key and D3 semantic entries, step-18 rationale

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
… declarations, the ADR-0087 marker

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
…owledge-splitter

# Conflicts:
#	content/docs/protocol/knowledge.mdx
#	packages/plugins/knowledge-memory/src/__tests__/contract.test.ts
#	packages/plugins/knowledge-memory/src/index.ts
#	packages/services/service-knowledge/src/knowledge-service-plugin.ts
#	packages/services/service-knowledge/src/knowledge-service.ts
#	packages/services/service-knowledge/src/testing.ts
#	packages/spec/src/ai/knowledge-document.zod.ts
…ment reference from the merged tree

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
…d declare organizationIds, beside the merged organization cases

Claude-Session: https://claude.ai/code/session_01QSeKYoHKp8EUQtketT9S29
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:ai tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 5 package(s): @objectstack/embedder-openai, @objectstack/knowledge-memory, @objectstack/service-knowledge, @objectstack/service-settings, @objectstack/spec, touching 85 documentable anchor(s). ⚠️ 9 changed file(s) yielded no anchor (packages/spec/api-surface/ai.json, packages/spec/api-surface/contracts.json, packages/spec/authorable-surface/ai.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/agents.mdx (via maxTokens (symbol, a field of interface Bounds; a field of interface ResolvedSplit))
  • content/docs/ai/knowledge-rag.mdx (via IEmbedder (symbol, a top-level interface), KnowledgeService (symbol, a top-level class), KnowledgeServicePlugin (symbol, a top-level class), OpenAIEmbedder (symbol, a top-level class), maxChars (symbol, a field of interface Bounds; a field of interface ResolvedSplit), maxInputTokens (symbol, a field of class OpenAIEmbedder; a field of interface AdapterEmbeddingDescriptor; a field of interface IEmbedder; a field of interface ResolveSplitInput; a field of interface ServiceSetup), sourceId (symbol, a const object of class KnowledgeMemoryAdapter))
  • content/docs/api/data-api.mdx (via sourceId (symbol, a const object of class KnowledgeMemoryAdapter))
  • content/docs/automation/flows.mdx (via sourceId (symbol, a const object of class KnowledgeMemoryAdapter))
  • content/docs/getting-started/common-patterns.mdx (via maxTokens (symbol, a field of interface Bounds; a field of interface ResolvedSplit))
  • content/docs/kernel/runtime-services/sharing-service.mdx (via sourceId (symbol, a const object of class KnowledgeMemoryAdapter))
  • content/docs/protocol/knowledge.mdx (via IEmbedder (symbol, a top-level interface), IKnowledgeAdapter (symbol, a top-level interface), KnowledgeDocumentSchema (symbol, a top-level const), KnowledgeReindexResult (symbol, a top-level interface), KnowledgeService (symbol, a top-level class), KnowledgeServicePlugin (symbol, a top-level class), docHash (symbol, a field of interface ChunkRecord; a field of interface StoredDocument), indexDocument (symbol, a method of class KnowledgeService), listDocuments (symbol, a method of class KnowledgeMemoryAdapter), maxChars (symbol, a field of interface Bounds; a field of interface ResolvedSplit), maxInputTokens (symbol, a field of class OpenAIEmbedder; a field of interface AdapterEmbeddingDescriptor; a field of interface IEmbedder; a field of interface ResolveSplitInput; a field of interface ServiceSetup), minChars (symbol, a field of interface ResolvedSplit), reindexSource (symbol, a method of class KnowledgeService), runKnowledgeAdapterContract (symbol, a top-level function), sourceId (symbol, a const object of class KnowledgeMemoryAdapter), chunk_target (literal, a string literal in KnowledgeServicePlugin))

⛔ 3 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v18/18-0.mdx (via sourceId (symbol, a const object of class KnowledgeMemoryAdapter))
  • content/docs/releases/v18/18-4.mdx (via sourceId (symbol, a const object of class KnowledgeMemoryAdapter))
  • content/docs/releases/v18/18-6.mdx (via sourceId (symbol, a const object of class KnowledgeMemoryAdapter))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 9 changed file(s) yielded no anchor (packages/spec/api-surface/ai.json, packages/spec/api-surface/contracts.json, packages/spec/authorable-surface/ai.json, …) — pages documenting those are invisible to this run
  • 26 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 178 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 4ed453dc211f24114c36133cb016515f377d2d5c → packageMentionDocs.

Which tree this was computed on

This run read content/docs from a9947ebcda6f1ffccebcf1a22da3cc766dcab6e9 — the merge of head c84c242aa76ac788c77052c6a33335912f58ee17 into base 4ed453dc211f24114c36133cb016515f377d2d5c, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin a9947ebcda6f1ffccebcf1a22da3cc766dcab6e9 && git checkout a9947ebcda6f1ffccebcf1a22da3cc766dcab6e9
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4ed453dc211f24114c36133cb016515f377d2d5c c84c242aa76ac788c77052c6a33335912f58ee17 && git checkout -B drift-repro 4ed453dc211f24114c36133cb016515f377d2d5c && git merge --no-ff c84c242aa76ac788c77052c6a33335912f58ee17

node scripts/docs-audit/affected-docs.mjs --json 4ed453dc211f24114c36133cb016515f377d2d5c

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 4ed453dc211f24114c36133cb016515f377d2d5c → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYoHKp8EUQtketT9S29
os-dev-report

{
  "issue": 37098,
  "status": "done",
  "branch": "claude/issue-37098-knowledge-splitter",
  "pr": "https://github.com/objectstack-ai/objectstack/pull/37287",
  "session": "session_01QSeKYoHKp8EUQtketT9S29",
  "premise_still_valid": true,
  "summary": "Draft PR #37287 at head c84c242aa, under claim 7158315677 (Metadata-protocol: narrowed). It delivers the card's What 1–6: one service-layer splitter (whole / recursive / markdown, Chinese-aware sentence rule, tables and list items kept whole while they fit), the chunk channel and the capabilities.chunks flag (ADR-0161 K8 item 5), embedding.maxInputTokens on the adapter and IEmbedder.maxInputTokens? (K8 item 6; embedder-openai fills it), the split key (K8 item 10), whole-over-budget removed and reported (failed/failures; the event path logs at error; indexDocument throws), knowledge-memory taking the service's passages, chunk_target with a reader, and both docs pages. Per seat direction B (7158283273) and its ruling A, KnowledgeChunk.metadata is retired here with the kit under protocol major 18. knowledge.chunk_overlap is retired the Localization-format way. #37256 was merged in via os-regen-merge.sh, keeping both sides. docHash recipe unchanged.",
  "tests": "On head c84c242aa: service-knowledge 253/253 (split.test.ts with 6 golden files and a 500-document seeded budget property; contract-stubs; chunk-channel; the merged organization cases); knowledge-memory 34/34 (contract suite with listDocuments, chunks and organizationIds); embedder-openai 30/30; service-settings 1523/1523 (pre-merge head; the merge did not touch it); spec 985 files / 29934 tests (pre-merge kit head 455310944, then check:generated green after the merge); step18-rationale-merge 9/9; packages/cli test/migrate-meta-engine-guidance.test.ts 3/3. Typecheck exit 0 for spec, service-knowledge, knowledge-memory, embedder-openai and service-settings, check:test-typecheck included, so the tsc-channel @ts-expect-error pin is live. No ablation: the behaviours are new, not changed.",
  "gates": "Local, head c84c242aa: dispatch-gates --commands derived 122 families; all 122 ran, all exit 0; --ran: 122 derived, 122 run, 0 NOT-MEASURED, 0 UNRUN. The earlier four real findings stay fixed (tenant-audit census, logger receiver detach, objectql double limit, ADR-0122 parsed aliases). The two earlier NOT MEASURED (check:skill-examples, check:dual-build-cjs-loads) ran and passed once the closure was built. check-adr-0087-registration exit 0 (1 declared-breaking changeset, carrying its disposition); check-changeset-no-major exit 0; check-empty-changeset exit 0; spec check:generated: all 14 artifacts up to date. PR #37287 check-runs: 74/74 completed, none failed. Required contexts: Lint & Repo Gates success, TypeScript Type Check success, Test Core success, Build Core success, Governed Surface Queue Guard success, Type Check UI success, Test UI success, Build & E2E UI success, Live E2E UI success, Dogfood Regression Gate success, Lint UI skipped (no ui/ diff). Also success: Check Changeset, Spec property liveness, Check PR Size, PR-body guards.",
  "dogfood_battery": "c84c242aa · os-verify-lock VERDICT command-exit 0 (48m43s) · Test Files 487 passed | 3 skipped (490) · Tests 4128 passed | 68 skipped (4196) · no failures",
  "mcp_calls": "15 — mcp__github__issue_read x6, mcp__github__pull_request_read x2 (get_check_runs), mcp__claude-code-remote__send_message x7; no GitHub MCP write",
  "api_writes": "5 — post-stamped report comments 7158152761, 7160020786, 7160082130 on #37098, the relay pr_create of #37287 (run 45610900972, read-back identical, assignee os-justin, no labels), and this comment",
  "line_budget": "62 files; 2553 insertions + 233 deletions = 2786 changed lines against merge base f9fda2a4f, under 3000, so not Tier H by size",
  "files_changed": "packages/services/service-knowledge (src/split/ new; knowledge-service.ts, knowledge-service-plugin.ts, testing.ts; tests split, contract-stubs, chunk-channel new; knowledge-service.test.ts; fixtures/split/*), packages/spec (ai/knowledge-document.zod.ts and its new test, ai/knowledge-source.zod.ts, contracts/knowledge-adapter.ts, embedder.ts, knowledge-service.ts with failed?/failures? only; migrations/entries/retired-keys/18.ai__KnowledgeChunk__metadata.ts, migrations/entries/semantic/18.knowledge-chunk-metadata-retired.ts, migrations/registry.ts.template with one STEP18_RATIONALE fragment; regenerated api-surface, export-origins, declaration-map, authorable-surface, references, strictness-ledger counts), packages/plugins/knowledge-memory, packages/plugins/embedder-openai, packages/services/service-settings (knowledge.manifest.ts and its test, 11 translations, settings-visibility-declaration.pin.test.ts), content/docs/protocol/knowledge.mdx, content/docs/ai/knowledge-rag.mdx, .changeset/37098-knowledge-splitter.md",
  "deviations": [
    "Earlier WIP pushes went out without overlap-check before each (noted by the PM); every push since has run it first.",
    "No D2 MetadataConversion for KnowledgeChunk.metadata, although the relay asked for one. A chunk is a runtime contract shape, never stored in stack metadata, so a conversion has no source to walk. The kit routes such a key through the D3 semantic entry plus RETIRED_KEYS_BY_MAJOR only; precedent: ActionDescriptor.isAsync. retiredAfter is a conversion field (SemanticMigration has none), so it does not apply.",
    "The retirement kit touches files outside the claim's literal file list, on the PM's order to follow the kit: the two migrations entries, registry.ts.template and packages/spec/src/ai/knowledge-document.test.ts. Two settings manifest pins (settings-visibility-declaration.pin.test.ts, knowledge.manifest.test.ts) moved with the ordered chunk_overlap retirement.",
    "No minChars <= maxChars refinement: the published JSON Schema cannot carry it, and its baseline is outside the claim. A minChars above the effective maxChars reads as maxChars, documented on the key.",
    "The worktree /home/user/objectstack-issue-37098 is kept rather than removed: #37265 still shares files, and its merge is the next expected round."
  ],
  "open_questions": [],
  "security_findings": "withheld",
  "out_of_scope_findings": [
    "carrier: skills/objectstack-ai/SKILL.md owner · noted, not filed — the skill does not name the new split key; skills/** is governed and outside this claim",
    "carrier: #37100 · noted, not filed — docHash does not cover passages, so a changed split setting re-splits a document only when the document changes; the index fingerprint closes it, and the docs say so"
  ]
}

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c84c242aa76ac788c77052c6a33335912f58ee17
Local-runs: probe — three runs in a throwaway worktree at the head, each for a check the brief asked to be reproduced rather than read: (1) build-migration-registry.ts, to read the generated RETIRED_KEYS_BY_MAJOR[18]; (2) the pin's three parse assertions against knowledge-document.zod.ts, at head and with the retiredKey() line deleted; (3) splitter.ts against its six golden files, hand-made edge cases and a 4,000-document property run. No vitest, no build, no dogfood. Worktree removed.
Scope: packages/spec/src/ai/knowledge-document.zod.ts, packages/spec/src/ai/knowledge-source.zod.ts, packages/spec/src/contracts/embedder.ts, packages/spec/src/contracts/knowledge-adapter.ts, packages/spec/src/contracts/knowledge-service.ts, packages/spec/src/migrations/entries/retired-keys/18.ai__KnowledgeChunk__metadata.ts, packages/spec/src/migrations/entries/semantic/18.knowledge-chunk-metadata-retired.ts, packages/spec/src/migrations/registry.ts.template + packages/spec/src/ai/knowledge-document.test.ts, packages/spec/authorable-surface/ai.json, packages/services/service-knowledge/src/split/splitter.ts, packages/services/service-knowledge/src/knowledge-service.ts, packages/services/service-knowledge/src/knowledge-service-plugin.ts, packages/services/service-knowledge/src/testing.ts, packages/plugins/knowledge-memory/src/index.ts, packages/plugins/embedder-openai/src/index.ts, packages/services/service-settings/src/manifests/knowledge.manifest.ts, .changeset/37098-knowledge-splitter.md

Face: schema (record-recognisers --template --paths on the 62 changed paths returns the eight packages/spec/src files above as hits). Read outside the diff, not reviewed: .claude/skills/spec-property-retirement/SKILL.md, the ActionDescriptor.isAsync kit (protocol 17), packages/spec/src/conversions/types.ts, packages/spec/src/shared/token-estimate.ts, ADR-0161 K6 and K8, skills/objectstack-ai/SKILL.md.

① Derived judgments

  • Deviation 1 holds: no D2 conversion and no retiredAfter is owed. A conversion rewrites stored stack metadata, and KnowledgeChunk is in none:
    • stack.zod.ts, packages/spec/src/conversions/** and packages/spec/src/kernel/** name neither KnowledgeDocument nor KnowledgeChunk.
    • At the merge base no file under packages/services, packages/plugins, apps, examples or ui/packages names KnowledgeChunk or reads a document's chunks. The only chunks there is RAGFlow's own API response.
    • No adapter stores a chunk-level metadata: knowledge-memory stores the document's metadata beside each passage, and knowledge-ragflow sends whole documents.
    • ADR-0161 K6 reads the same way for the source: "No stored row carries any of them".
    • retiredAfter is declared only on MetadataConversion (conversions/types.ts), so with no conversion there is nowhere to write it. The seat's later wording ("retiredAfter the latest stable") assumed a conversion; the skill's §3 last item is the governing text: a key with no source to rewrite takes the D3 semantic entry alone.
    • The 17.action-descriptor-is-async-retired kit is the same shape: a tombstone, a retired-key row, one D3 semantic entry, no conversion.
  • Deviation 2 holds: the major-18 registration is complete.
    • Tombstone: metadata: retiredKey(...) on KnowledgeChunkSchema. The message follows the house form (the full key in backticks, "was removed in @objectstack/spec 18", why it was inert, "Delete the key.", the live mechanism). It carries no os migrate meta sentence, which is right with no conversion and matches the isAsync message.
    • Retired-key row: the entry file retired-keys/18.ai__KnowledgeChunk__metadata.ts exports 'ai/KnowledgeChunk:metadata'. registry.ts is git-ignored and generated; run at the head, the generator writes that string inside the 18: [ block of RETIRED_KEYS_BY_MAJOR (311 retired-key entries in all). Nothing is hand-typed.
    • D3: semantic/18.knowledge-chunk-metadata-retired.ts has non-empty reason and acceptanceCriteria, and the generator places it in step18. The STEP18_RATIONALE fragment has the same id, sits in id order before list-view-filterable-fields-retired, and takes order: 125, which no other fragment uses.
    • Authorable surface: "ai/KnowledgeChunk:metadata [RETIRED]" replaces the live line.
    • Pin: with the retiredKey() line deleted, both parse refusals in knowledge-document.test.ts fail ("did not throw") and the clean-parse case still passes; at head all three pass. The file was restored to blob 4fca15827da. The @ts-expect-error case and build gate (b2) go red on the same deletion by reading; neither was run.
  • Additive members. IEmbedder.maxInputTokens?, IKnowledgeAdapter.capabilities? and embedding?, AdapterCapabilities.chunks?, KnowledgeReindexResult.failed? and failures?, KnowledgeDocument.chunks?, KnowledgeChunk.headingPath? and ObjectKnowledgeSource.split? are all optional. An implementation written before this change still type-checks. The generated baselines add names and remove none.
  • knowledge.chunk_overlap has no reader left. A case-insensitive search of the head for chunk_overlap and chunkOverlap finds the changeset, the root CHANGELOG.md, ADR-0161's readings table, and three comments or assertions in service-settings. The specifier is out of the manifest, all 11 translation packs carry zero mentions, and the manifest is at version: 2.
  • The splitter, as run.
    • All six golden files reproduce byte for byte.
    • 4,000 seeded documents with bounds wider than the dev's (limits from 4 tokens, maxChars from 2, CRLF, tabs, emoji, the ideographic space, both strategies): no passage over maxChars or over the token budget, none empty, and recursive loses no text.
    • whole over the budget answers a failure with the estimate and the budget; it returns no passage. whole with no limit known checks nothing.
    • 「依照第3.2 条报销400.50 元。」 at maxChars: 14 cuts into 「依照第3.2 条报销」 and 「400.50 元。」: neither decimal is cut.
  • The service splits once. prepareDocuments is the only place splitDocument is called, and all three adapter.upsert sites (indexDocument, the reindex walk, writeSynced) go through it. An adapter without capabilities.chunks gets the documents untouched. The suite compares what the adapter received with splitDocument's output by toEqual, and a hit with a passage by id and text.
  • knowledge-memory no longer splits. chunkAndEmbed and CHUNK_TARGET are gone; embedPassages maps doc.chunks one to one. The organization filter from feat(service-knowledge): documents carry their organization, and search hands the adapter the caller's organizations #37256 still runs before the metadata filter and the ranking.
  • Check-runs on the head: 60 success, 10 skipped, 0 failed. Check Changeset, Spec property liveness, Type Check · source gates, Type Check · consumer gates, Governed Surface Queue Guard and Test Core 1 to 10 are among the successes. The dogfood shards are among the skipped, as on every PR.
  • K = 8 against main dfdebfadd58, merge base f9fda2a4f84 (the feat(service-knowledge): documents carry their organization, and search hands the adapter the caller's organizations #37256 merge). git merge-tree --write-tree is clean (tree a50f7e33ba1), and none of main's eight commits touches a path of this diff.

② Semver level

  • @objectstack/spec: minor is right for Metadata-protocol: narrowed; the skill forbids major and the BREAKING banner carries the break. Check Changeset passes.
  • patch on the four other packages matches how feat(service-knowledge): documents carry their organization, and search hands the adapter the caller's organizations #37256 shipped the same kind of change.
  • Metadata-protocol: narrowed is right: the diff adds split and narrows KnowledgeChunk.metadata, and narrowed wins.
  • The BREAKING section names both removals, each with FROM, TO and a one-line fix. The adr-0087: registered knowledge-chunk-metadata-retired marker names an entry that exists. knowledge.chunk_overlap is a settings key with no spec registry, so the BREAKING entry is its whole disposition, as the seat ruled.

③ Boundary flags

  • Dev flag, no D2 conversion and no retiredAfter: answered in ①, holds.
  • Dev flag, two test pins outside the claim's file list (settings-visibility-declaration.pin.test.ts 90 to 87, knowledge.manifest.test.ts): both are tripwires on the manifest this card edits, and the new count follows from the diff (one specifier with a predicate removed, two predicates dropped).
  • Dev flag, no minChars ≤ maxChars refinement: resolveSplit clamps minChars to maxChars, a test pins it, and the key's description says it.
  • Dev flag, docHash does not cover the passages: true in the code (chunks is set after computeDocHash), and both doc pages and the changeset say so.
  • Open question "which major": settled as major 18 by the seat; built that way.
  • SQL push-down: no new id materialisation or in-app join. The reindex deletes the failed documents of one page by id through the adapter, which is the adapter contract's own door.
  • S1 (should-fix) — the Skills-docs: line reads none in this change, and its own reason says skills/objectstack-ai/SKILL.md does not yet teach split. By the claim template that is follow-up owed, and the owed card exists: skills/objectstack-ai: teach the knowledge source split key (strategy, maxChars, minChars) that #37098 adds #37292. The line should read Skills-docs: follow-up #37292. This is the seat's rewrite of the PR body, not a dev fix, and it moves no head. skills/objectstack-ai: teach the knowledge source split key (strategy, maxChars, minChars) that #37098 adds #37292 should also cover SKILL.md lines 281 to 284, which say chunking is "NOT platform metadata": that sentence becomes false when this lands.

④ Design judgment

  • The narrowing takes away nothing an author had. KnowledgeChunk.metadata had no producer and no reader on main, so a value written there was dropped. ADR-0161 K8 item 5 says service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098 "gives it one or removes it", and the seat chose removal. The schema now refuses what it used to drop in silence.
  • K8 item 5 is built as written: chunks? on the document, the reshaped KnowledgeChunk with headingPath?, capabilities?: { chunks?: boolean }, and whole documents for an adapter that declares nothing.
  • K8 item 6 is built in part, as the ADR assigns it: embedding?: { maxInputTokens? } only. model, dimensions and variant wait for item 8's PR. The service reads the descriptor in prepareDocuments on every batch and keeps no copy.
  • K8 item 10: split sits on the object arm with strategy, maxChars? and minChars?, and the splitter reads all three.
  • Changeset and 维护者速读: each sentence checked against the code is true, apart from N6.
  • N1 — markdown can drop a heading that has no text under it. # A then # B with nothing else gives one passage, B. ## B then ## C at the end of a document gives A > C and loses B. A bodiless heading longer than half the bound is dropped whole. The no-loss property covers recursive only.
  • N2 — The character-level cut does not look at punctuation: 「他说:“不行。”然后走了。」 at maxChars: 12 is cut between 。 and ”. The sentence rule itself holds, and this is the last level the card allows.
  • N3 — KnowledgeChunkSchema.parse has no caller in the platform outside its test. The service builds chunks as typed objects, and indexDocument refuses any chunks before a parse could run. tsc is the channel that reaches an author; the parse refusal reaches only a consumer who parses.
  • N4 — KnowledgeSplitSchema is a plain z.object (the strictness ledger's ai/ count goes 112 to 113), and registerSource parses nothing. From untyped code a misspelt key is ignored and an unknown strategy string cuts as recursive, in silence. The source loader of ADR-0161 row 3 is where that closes.
  • N5 — runKnowledgeAdapterContract's implements.chunks is a new required option on a published subpath (@objectstack/service-knowledge/testing). The changeset gives the fix under "What to do" and not under BREAKING, as feat(service-knowledge): documents carry their organization, and search hands the adapter the caller's organizations #37256 did for organizationIds.
  • N6 — 速读 line 1 says tables are not cut; a table over the bound is cut between rows with the header repeated. Line 4 says nothing is asked of the maintainer, while a declared narrowing needs the maintainer's approval; the seat's hand-off carries that ask.
  • N7 — The Localization precedent pinned the REST behaviour of its retired keys (RETIRED_FORMAT_ROWS in settings-routes.test.ts). This PR adds no such pin for knowledge.chunk_overlap; the behaviour claimed is the generic undeclared-key path those pins already cover.

Implemented-by: claude/issue-37098-knowledge-splitter
Reviewed-by: session_01QSeKYpEsWWE9Y5YtSsDgqZ

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — REWORK · L1 · head c84c242aa76ac788c77052c6a33335912f58ee17 · 2026-11-25T13:00Z

  • M1 (must-fix) — the full dogfood battery reading is missing. The PR declares a (narrowing) arm, so one full run of pnpm --filter @objectstack/dogfood test pinned to this head is owed before queueing.
    • The PR body says "the local readings sit in the os-dev report comment on this PR". The PR has one comment, the docs-drift bot's.
    • The last dev report on the card (7160082130) says the battery "will be owed on the final head". No later report is on the card or the PR.
    • CI does not cover it: the dogfood shards are skipped on a PR and run only in the merge queue.
    • Fix: the dev posts the os-dev report with dogfood_battery for head c84c242aa76: the lock's VERDICT line, Test Files N/N, Tests M/M, every failure named. No code change is asked. A head that moves only by a merge of main keeps the rest of this review.
  • S1 (should-fix) — the Skills-docs: line reads none in this change, while its own reason says skills/objectstack-ai/SKILL.md does not teach split. The template's value is follow-up owed, and the card is filed: skills/objectstack-ai: teach the knowledge source split key (strategy, maxChars, minChars) that #37098 adds #37292. I rewrite the PR-body line to Skills-docs: follow-up #37292; this is not a dev fix. skills/objectstack-ai: teach the knowledge source split key (strategy, maxChars, minChars) that #37098 adds #37292 should also cover SKILL.md lines 281 to 284 ("chunking … NOT platform metadata"), which this PR makes false.
  • Card service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098 (ADR-0161 K8 items 5, 6 and 10): one splitter in service-knowledge (whole, recursive, markdown), the chunk channel, the split key, and two retirements. 62 files, +2553/−233 (2,786 lines, under 3,000).
  • Declarations read true: Clause-②: yes (narrowing), Metadata-protocol: narrowed, @objectstack/spec: minor. The changeset's BREAKING section names both removals with FROM, TO and a one-line fix, and carries adr-0087: registered knowledge-chunk-metadata-retired.
  • Deviation 1, no D2 conversion and no retiredAfter: holds. KnowledgeChunk is in no stored artifact: the stack schema and the conversion walkers do not name it, no code outside packages/spec named it at the merge base, and no adapter stores a chunk-level metadata. retiredAfter exists only on a conversion. The skill's §3 gives a key with no source to rewrite the D3 semantic entry alone, and the ActionDescriptor.isAsync kit (protocol 17) is the same shape. My earlier wording about retiredAfter assumed a conversion; it does not apply.
  • Deviation 2, the major-18 registration: complete.
    • The retiredKey() tombstone is on KnowledgeChunkSchema.metadata, with the house-form message.
    • RETIRED_KEYS_BY_MAJOR[18] holds 'ai/KnowledgeChunk:metadata'. It comes from the entry file; I ran the generator at the head and read the row in the 18: block.
    • The D3 entry knowledge-chunk-metadata-retired is in step18, and its STEP18_RATIONALE fragment sits in id order with a free order: 125.
    • authorable-surface/ai.json has the [RETIRED] row.
    • The pin goes red without the tombstone: with the retiredKey() line deleted, both parse refusals in knowledge-document.test.ts fail; at head they pass.
  • knowledge.chunk_overlap: no reader remains anywhere in the tree. The specifier and all 11 translations are gone, the manifest is version: 2, and the steps match the Localization format keys' retirement.
  • Splitter, re-run outside vitest: the six golden files reproduce byte for byte. Over 4,000 seeded documents with wider bounds than the dev's, no passage exceeds maxChars or the token budget and recursive loses no text. 「3.2 条」 and 「400.50 元」 stay whole. whole over the budget answers a failure and no passage.
  • Service: prepareDocuments is the one place that splits, and all three upsert paths use it. An adapter with capabilities.chunks receives exactly splitDocument's passages (the suite compares by toEqual); one without receives whole documents. A whole document over the budget is deleted and reported on all three paths: failed and failures on a reindex, an error log on the event sync, a throw from indexDocument.
  • knowledge-memory drops chunkAndEmbed and indexes doc.chunks one to one.
  • Contract: IEmbedder.maxInputTokens?, capabilities?, embedding?, chunks?, headingPath?, split?, failed? and failures? are all optional. The baselines only add names.
  • Overlap with feat(service-knowledge): documents carry their organization, and search hands the adapter the caller's organizations #37256 (merged, and the merge base of this head): the organization filter still runs before the metadata filter and the ranking in knowledge-memory, and organizationId sits beside chunks.
  • Overlap with feat(service-knowledge): register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37265 (open, draft, head fa818f4d407): 15 shared files. A trial merge conflicts in content/docs/ai/knowledge-rag.mdx only; the rest merge by themselves. Whichever lands second merges main and keeps:
  • Check-runs on the head: 60 success, 10 skipped, 0 failed. K = 8 against main dfdebfadd58; git merge-tree is clean and main's eight commits touch none of the 62 paths.
  • N1 — markdown can drop a heading with no text under it: # A then # B alone gives only B, and a bodiless heading at the end of a document can be lost. The no-loss property covers recursive only.
  • N2 — The character-level cut ignores punctuation: 「他说:“不行。”然后走了。」 at maxChars: 12 is cut between 。 and ”. The sentence rule itself holds.
  • N3 — KnowledgeChunkSchema.parse has no caller in the platform outside its test, so tsc is the channel that reaches an author.
  • N4 — KnowledgeSplitSchema is not strict and registerSource parses nothing: from untyped code a misspelt key or an unknown strategy reads as recursive in silence, until the row-3 loader.
  • N5 — implements.chunks is a new required option of @objectstack/service-knowledge/testing; the changeset gives its fix under "What to do", not under BREAKING (as feat(service-knowledge): documents carry their organization, and search hands the adapter the caller's organizations #37256 did for organizationIds).
  • N6 — 速读 line 1 says tables are not cut, but a table over the bound is cut between rows. Line 4 says nothing is asked of the maintainer, while the narrowing needs approval; the hand-off carries the ask.
  • N7 — No REST pin for the retired knowledge.chunk_overlap like the Localization keys' RETIRED_FORMAT_ROWS; the generic undeclared-key path those pins cover is what answers.
  • The PR is still a draft; the zone marks it ready before landing.
  • Contract review at the same head is in the ## Contract review record: PASS. Nothing in the contract is sent back; M1 is the only item between this PR and the maintainer's narrowing gate.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head c84c242aa76ac788c77052c6a33335912f58ee17 · 2026-11-25T13:04Z

  • Same-head delta over the L1 REWORK 7163174425. The head is unchanged.
  • M1, closed. The dogfood battery reading for this head is on the PR in the dev's os-dev report 7163120953, posted 2026-11-25T12:58:49Z. That is before the L1 was posted, but the L1's read had missed it. The reading: c84c242aa · os-verify-lock VERDICT command-exit 0 (48m43s) · Test Files 487 passed | 3 skipped (490) · Tests 4128 passed | 68 skipped (4196) · no failures.
  • S1, closed. The PR body's Skills-docs line now reads follow-up #37292. skills/objectstack-ai: teach the knowledge source split key (strategy, maxChars, minChars) that #37098 adds #37292 also carries skills/objectstack-ai/SKILL.md lines 281–284 (comment 7163188624).
  • Carried, still holding: contract review PASS 7163151592 at CONTRACT_REVIEW_TIER. Both deviations hold: D3-only for the runtime-only KnowledgeChunk, and the major-18 kit is complete. Check-runs are 60 success, 10 skipped, 0 failed. Merge-tree is clean. Nits as listed in 7163174425.
  • Against feat(service-knowledge): register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37265: only content/docs/ai/knowledge-rag.mdx conflicts. The second lander keeps both sections.
  • Landing. Clause-②: yes (narrowing) puts this through the maintainer gate: hand-off first. After approval the seat re-queues it. If K ≥ 15 at that point, it merges main first, and a merge-only head move keeps this ACCEPT.

No must-fix, no should-fix.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c84c242aa76ac788c77052c6a33335912f58ee17
Local-runs: none
Scope: delta — the PR body's Skills-docs: line only. No file of the diff was re-read.

Same-head delta over the contract review 7163151592. The head is unchanged: the live PR reads c84c242aa76ac788c77052c6a33335912f58ee17, 18 commits, the same as that record. Three reads, all through the API: the PR body (last updated 2026-11-25T13:05:12Z), issue #37292, and its comment 7163188624.

S1, closed

Carried, by reference

Everything else in 7163151592 stands as written and was not re-read: ① both deviations hold (D3 only for the runtime-only KnowledgeChunk; the major-18 kit is complete), ② the semver level, ③ the other boundary flags, ④ the design judgment, and the nits N1 to N7. Nothing else is reopened.

One observation, no finding: N6's second half (速读 line 4 says nothing is asked of the maintainer) still reads the same in the live body; it stays a nit, and the seat's hand-off carries the ask.

Implemented-by: claude/issue-37098-knowledge-splitter
Reviewed-by: session_01QSeKYpEsWWE9Y5YtSsDgqZ

VERDICT: PASS

No must-fix, no should-fix.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

维护者速读

  • 用户能看到什么变化:建知识索引时,平台统一把文档切成片段。长制度按章、条切开,中文按句号、问号断句,不会切在「3.2 条」「400.50 元」中间;放得下的表格保持完整。设置页的「片段重叠」一项被移除,它从未生效。
  • 为什么做:「知识检索平台化」(专题:知识检索平台化(应用写一份知识源配置就有可用的检索:开源、托管、企业版都能用) #37000)第二阶段的一项(service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098),让每种存储拿到的片段完全一致。
  • 出错会怎样:选了「整篇」切法且超过模型上限的文档,会从检索中移除并报失败,不会被截断。片段上一个从没人用过的字段 metadata 被移除,写了它的代码会收到带修复说明的报错。脚本若还在写「片段重叠」,会被拒绝(400);已存的值保留。发布说明里两处都写了破坏性改动说明和改法。
  • 要你做什么:审核并合并。它移除了一个已发布的字段和一个设置项,属于声明了收窄的改动,按 2026-11-19 的裁定要你批准。契约审核 PASS:7163320948,Head-sha c84c242aa76ac788c77052c6a33335912f58ee17。席位核对 ACCEPT:7163270475。0 个失败检查。

席位意见:通过。两处移除都没有读者,移除按 ADR-0161 K8 第 5 项和席位 7158283273 的方向做,退役登记齐全(协议 18)。开发者没有写数据迁移,是对的:片段只在运行时存在,不存进任何元数据。切分器的样例和上限属性我在评审中重跑过,全部通过。技能文档的跟进已立卡 #37292。剩 7 处小瑕疵,比如 Markdown 切法下,末尾没有正文的标题可能丢失,不影响合并。

Hand-off · 2026-11-25T13:07Z · @os-zhuang — PR #37287 (card #37098, epic #37000) needs your approval. It declares Clause-②: yes (narrowing) and Metadata-protocol: narrowed: KnowledgeChunk.metadata becomes a retiredKey() tombstone and knowledge.chunk_overlap leaves the knowledge settings namespace; neither had a reader. The 2026-11-19 narrowing ruling requires your approval before it enters the merge queue; it has not been queued. Seat ACCEPT 7163270475 and contract review PASS 7163320948 (CONTRACT_REVIEW_TIER, schema face), Head-sha c84c242aa76ac788c77052c6a33335912f58ee17; 0 failed check-runs. After your approval the seat queues it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 25, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 25, 2026 13:43
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 25, 2026
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 91138ec Nov 25, 2026
80 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-37098-knowledge-splitter branch November 25, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue protocol:ai size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key

3 participants