Repository navigation
Commit 98bda0a
docs(skills): objectstack-ai teaches the knowledge source split key and names the keys retired beside it (#37334)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8JhskFY4nvqZftyd6QBC3Sa)_
Fixes #37292
Clause-②: no
Metadata-protocol: none
Skills-docs: this PR is the skills-docs half (`skills/objectstack-ai`);
PR #37287 shipped the `split` key and named this card
## 维护者速读
- 用户能看到什么变化:用 AI 搭建知识源时,AI
读到的技能说明现在会教「切片设置」怎么写:普通文字按段落和句子切,带标题的手册按章节切,短记录整篇一段;并说明「切片重叠」设置和单段附加信息已经下线、写了会被拒。只有文字变化。
- 为什么做:属于知识检索平台化专题,补上切片功能合并后欠下的技能说明,后面重写知识源一节的卡要在它之后做。
- 出错会怎样:最坏是说明写得不准,AI 写出的设置仍会被校验拦住;撤回即恢复旧文字。
- 要你做什么:受治理的技能文件,需要你批准后合并。
## What changes
`skills/objectstack-ai/SKILL.md`, *Knowledge Sources (RAG)*:
- The `object` row of the source table gains `split?`, and a new passage
replaces the closing note that said chunking is not platform metadata
(PR #37287 made that false). It teaches `split: { strategy, maxChars?,
minChars? }` on object sources only: `recursive` (default) for prose,
`markdown` for documents with headings (each passage embedded with its
heading path), `whole` for short records only, because a document over
the embedder's input budget is removed from the index and reported,
never truncated. `maxChars` overrides the **Target chunk size** setting
(`knowledge.chunk_target`, else 800), the embedder's input limit can
lower it, and `whole` ignores it; `minChars` defaults to 200. Changing
`split` re-splits a document only when it next changes.
- The key applies to an adapter that declares `capabilities.chunks`
(`memory`); `ragflow` does not, receives whole documents, and `split`
has no effect on it.
- Names the two keys retired beside it, both refused when written: the
`knowledge.chunk_overlap` setting (`400 UNKNOWN_KEY`; passages never
overlap) and `KnowledgeChunk.metadata` (parse error; a passage takes its
document's `metadata`).
- Top-K, score thresholds and rerankers: not source metadata; they
belong to the adapter or application code.
Paid for by deleting restatement in the same file; the token ceiling is
unchanged (6801, the file measures 6800). Deleted: the pitfall "Indexing
everything" (the `object` row's Hygiene column says it); the "Skills are
your entry point" paragraph (the frontmatter, the `tools` row and
*Platform agents* say it); the incident sentence after
`ai-skill-tool-unresolved`; the sentence on what `os validate` confirms;
the *App AI Blueprint* registration-row clause repeating three facts
stated in their own sections; four clauses repeating the sentence beside
them (*Tool metadata*, *Platform agents*, *Wiring*, *Actions as AI
Tools*).
`evals/skills-tools-knowledge.json`:
- New case 9: a Markdown handbook source on the in-memory adapter, split
by section at 600 characters, with a request for overlapping passages.
Expected: `split: { strategy: 'markdown', maxChars: 600 }` and the
overlap declined. Assertions: must contain `split`, `strategy`,
`markdown`, `maxChars`; must not contain `chunkSize`, `chunkOverlap`,
`overlap: 100`.
- Case 3 (RAGFlow): `expected_output` no longer says chunking is adapter
config; it writes no `split`, since that adapter receives whole
documents.
Changeset `.changeset/37292-skill-knowledge-split.md`:
`@objectstack/skills` patch.
Out of scope, left for their cards: the `contentFields` / `id` / `'*'` /
`embedding` / `vectorStore` / `file` / `http` / `adapterConfig` teaching
and the example block (#37310, row 5b, after #37306), and the `ragflow`
mentions (#37004).
## Why
PR #37287 (#37098) added the source's `split` key and retired
`KnowledgeChunk.metadata` and `knowledge.chunk_overlap`. The skill an AI
reads to author a knowledge source did not mention any of them and still
said chunking is not platform metadata, so an agent would never set
`split` and could still write the overlap setting.
## Verification
Every claim in the new passage rests on:
`packages/spec/src/ai/knowledge-source.zod.ts` (`KnowledgeSplitSchema`,
`ObjectKnowledgeSourceSchema.split`),
`packages/spec/src/ai/knowledge-document.zod.ts` (the
`KnowledgeChunk.metadata` tombstone),
`content/docs/protocol/knowledge.mdx` §3.5 and the adapter-contract
paragraph above it, `.changeset/37098-knowledge-splitter.md` (the
`chunk_overlap` refusal),
`packages/plugins/knowledge-memory/src/index.ts:46` (`capabilities = {
chunks: true }`; `knowledge-ragflow` declares none).
Skills size readings (`node scripts/check-skills-token-ratchet.mjs`,
tokens = ceil(utf8 bytes / 4)):
| | main | this PR |
|---|---|---|
| `skills/objectstack-ai/SKILL.md` lines | 467 | 474 |
| `skills/objectstack-ai/SKILL.md` tokens (ceiling 6801) | 6801 | 6800 |
| All `skills/*/SKILL.md` lines | 4941 | 4948 |
| Bundle total tokens (whole shipped tree) | 297002 | 297305 |
The bundle grows by 303 tokens, all in the unratcheted eval fixture
(2140 to 2444); ratcheted authored text drops by 1.
<details><summary>Local gates at 6fb18c1</summary>
`node scripts/pm/dispatch-gates.mjs --commands` derived 49 commands. 41
ran locally, all exit 0, including `check-skills-token-ratchet` (gate
and `--self-test`), `@objectstack/spec check:skill-docs`,
`check:skill-links`, `check:skill-identifier-liveness`,
`check:skill-compatibility`, `check:skill-frame-sync`,
`check:doc-authoring`, `check:nul-bytes`, `check-empty-changeset`,
`check-changeset-no-major`, `check-adr-0087-registration`,
`check:pm-governed-merges`.
NOT MEASURED locally, left to CI: `@objectstack/lint
check:doc-formula-expressions` (exit 3, prerequisite: needs
`@objectstack/formula` and `@objectstack/lint` built; nothing measured),
and seven families that read built `dist/` output (`check:dts-closure`,
`check:dual-build-cjs-loads`, `check:lean-entry-closure`,
`check:published-files`, `check:sourcemap-no-sources-content`,
`check:driver-memory-census`, `check:corpus-claim-drift`). The diff
touches no package source.
</details>
No ablation: the change is docs and an eval fixture; no tested behaviour
moved.
Two-minute check: read *Knowledge Sources (RAG)* in
`skills/objectstack-ai/SKILL.md` and compare the *Splitting* passage
with `content/docs/protocol/knowledge.mdx` §3.5.
## Acceptance notes
- Authored by a Fable subagent from a first draft in this session, per
the claim's tier; the seat's L1 and the contract review read the final
diff.
- None filed.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (repo-wide lint is CI's
run; the diff touches only Markdown and JSON)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01JQwxbYY43RED8SphBLGpAy
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbYY43RED8SphBLGpAy)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8fe4eaf commit 98bda0a
3 files changed
Lines changed: 69 additions & 27 deletions
File tree
- .changeset
- skills/objectstack-ai
- evals
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 39 | | |
44 | 40 | | |
45 | 41 | | |
| |||
85 | 81 | | |
86 | 82 | | |
87 | 83 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 84 | + | |
91 | 85 | | |
92 | 86 | | |
93 | 87 | | |
| |||
149 | 143 | | |
150 | 144 | | |
151 | 145 | | |
152 | | - | |
| 146 | + | |
153 | 147 | | |
154 | 148 | | |
155 | 149 | | |
| |||
243 | 237 | | |
244 | 238 | | |
245 | 239 | | |
246 | | - | |
247 | | - | |
| 240 | + | |
248 | 241 | | |
249 | 242 | | |
250 | 243 | | |
| |||
260 | 253 | | |
261 | 254 | | |
262 | 255 | | |
263 | | - | |
| 256 | + | |
264 | 257 | | |
265 | 258 | | |
266 | 259 | | |
| |||
283 | 276 | | |
284 | 277 | | |
285 | 278 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
290 | 304 | | |
291 | 305 | | |
292 | 306 | | |
293 | 307 | | |
294 | 308 | | |
295 | | - | |
296 | | - | |
| 309 | + | |
297 | 310 | | |
298 | 311 | | |
299 | 312 | | |
| |||
362 | 375 | | |
363 | 376 | | |
364 | 377 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | 378 | | |
370 | 379 | | |
371 | 380 | | |
| |||
375 | 384 | | |
376 | 385 | | |
377 | 386 | | |
378 | | - | |
| 387 | + | |
379 | 388 | | |
380 | 389 | | |
381 | 390 | | |
| |||
387 | 396 | | |
388 | 397 | | |
389 | 398 | | |
390 | | - | |
391 | | - | |
| 399 | + | |
392 | 400 | | |
393 | 401 | | |
394 | 402 | | |
| |||
451 | 459 | | |
452 | 460 | | |
453 | 461 | | |
454 | | - | |
455 | | - | |
| 462 | + | |
456 | 463 | | |
457 | 464 | | |
458 | 465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
0 commit comments