Skip to content

Commit 70d2d48

Browse files
docs(skills): objectstack-ai teaches that a markdown section that fits maxChars is one passage (objectstack-ai#38466)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XDXvJPPtrTGfdDYhWWpihq5)_ Fixes objectstack-ai#38442 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用 AI 助手搭知识库的作者,会从技能说明里读到“按标题切分时,放得下的小节整节一段”,不再被引导去把合并阈值手动调到和长度上限一样;平台行为本身不变。 - 为什么做:知识切分专题的收尾,把对外发布的技能说明对齐已经上线的切分行为,也就是您对“放得下的小节整节一段做成默认”的那次裁决。 - 出错会怎样:只改说明文字;写错的话 AI 作者会按错误理解配置知识源,撤回本次改动即可恢复原文。 - 要你做的:等“知识设置项标签改名为最长段落”的那个姊妹合并请求合入之后,再合入本改动。 ## What changes `skills/objectstack-ai/SKILL.md`, the **Splitting (`split`)** block only. The words follow the splitter as merged in f19ee34 (the `split` docblock in `packages/spec/src/ai/knowledge-source.zod.ts` and `content/docs/protocol/knowledge.mdx` §3.5), ruling A on objectstack-ai#38351 (record 7247322956). - **`markdown` bullet.** Adds: "A section that fits `maxChars` with that path is one passage; one that does not is cut as `recursive` cuts." - **`minChars` sentence.** Was "Adjacent pieces shorter than `minChars` (default 200) are merged." Now: "… are merged in `recursive` text and in a `markdown` section that does not fit; a section that fits stays whole whatever `minChars` is." No step that sets `minChars` equal to `maxChars` is taught (item 6 of the ruling). No new example. - **Split-change sentence (should-fix S1 of contract review 7250515767).** Was "Changing `split` re-splits a document only when it next changes.", which is false: the resolved split is part of the index fingerprint (`content/docs/protocol/knowledge.mdx` §3.5, "A split change is a new index"). Now: "Changing `split` rebuilds the source's whole index, and its searches are refused until the rebuild finishes." - **Settings label (added by the area during the round).** "the **Target chunk size** setting" is now "the **Longest passage** setting", the label the sibling card objectstack-ai#38290 gives `knowledge.chunk_target`. ⚠ That line is true only once PR objectstack-ai#38468 (the PR of objectstack-ai#38290; it renames the label to "Longest passage (characters)") is on `main`: **this PR lands after PR objectstack-ai#38468.** On `main` today the label still reads "Target chunk size". - **Restatements cut in the same block, no fact dropped:** "For documents with headings" (the bullet's "one section per heading" says it); "once `split` is written" (the signature and the omitted-`split` clause say it); "never truncated" (the `whole` bullet's "removed from the index and reported" says it); the "and refused" of "Retired and refused" (the `400 UNKNOWN_KEY` and the parse error beside it say it). - **Ratchet row.** `scripts/check-skills-token-ratchet.mjs`, the `skills/objectstack-ai/SKILL.md` row only: 7200 to 7248, pinned at the measurement, with the arithmetic in the row's comment (commits 924f830 and 3fbae96). - **Changeset:** `.changeset/38442-skill-markdown-fitting-section.md`, `@objectstack/skills` patch. `skills/**` ships as `@objectstack/skills` (its build copies the tree into `dist/`), so the diff publishes and takes no `skip-changeset`. ### Size readings (lines, bytes, ratchet tokens) | | before (f459c86) | after (3fbae96) | delta | |---|---|---|---| | `skills/objectstack-ai/SKILL.md` | 505 lines, 28827 bytes, 7200 tokens | 507 lines, 29017 bytes, 7248 tokens | +2 lines, +190 bytes, +48 tokens | | all `skills/*/SKILL.md` | 4386 lines, 228099 bytes | 4388 lines, 228289 bytes | +2 lines, +190 bytes | | ratcheted (authored) bundle | 200891 tokens | 200939 tokens | +48 tokens | Tokens are the ratchet's own count, `ceil((bytes - 27 stamp-line bytes) / 4)`. ### The token ratchet: restatement cut first, the row raised by the measured remainder Headroom on `main` was 0 (7200 of 7200). The four cuts above pay 79 bytes; the new teaching costs 269; the remainder is +190 bytes, +48 tokens. The row moves 7200 to 7248 under the standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B), by the measured remainder only. Arithmetic in priced bytes (the 27-byte stamp line excluded): 28800 on `main`, 28990 here, `ceil(28990 / 4) = 7248`. File surface: the claim named the skill file only. The row and the changeset were added by the seat's widening record 7250198232 on the card. ## Tests Prose and one ratchet row: no behaviour changes, so no test and no ablation. Local gates on head 3fbae96, the 67 commands `dispatch-gates.mjs --commands` derives, each exit code read before any pipe: - 62 exit 0, among them `check-skills-token-ratchet.mjs` ("skills/objectstack-ai/SKILL.md 7248 / 7248 (+0)", "ratcheted (authored) 200939 / 200939 (+0)") and its `--self-test` ("111 cases pass"), `check:ratchet-remedy-authority`, `check:pm-dispatch-gates`, `check-self-test-wired.mjs`, `@objectstack/spec check:skill-docs`, `check:skill-links`, `check:skill-identifier-liveness`, `check:skill-compatibility`, `check:skill-frame-sync`, `check:pm-skill-id-lint`, `check:doc-authoring`, `check:nul-bytes`, `check:published-files`, `check-empty-changeset.mjs`, `check-changeset-no-major.mjs`, `check-adr-0087-registration.mjs`. - 5 exit 3, NOT MEASURED (each needs a whole-workspace build this diff does not owe locally; CI measures them): `@objectstack/lint check:doc-formula-expressions`, `check:dts-closure`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check:sourcemap-no-sources-content`. - `dispatch-gates.mjs --ran`: 67 derived, 67 run, 0 unrun. - The ratchet script's own suite is its `--self-test` (above). The one test file that names the script, `packages/spec/scripts/platform-catalog.test.ts`, names it in a comment and does not exercise it; not run. ## Acceptance notes - Card item 1 (the `markdown` bullet): done. Item 2 (the `minChars` sentence): done. Item 3 (no new example; duplicates cut first): done: the cuts come first and the measured remainder raises the row (section above). - "fits `maxChars`" is the card's wording. The block's next paragraph already says the embedder's input limit can lower `maxChars`, which is the token budget of the spec text; nothing the spec and the protocol page do not say is taught. - History note: commit 924f830 was first held on a no-PR backup branch and its message still says so; it was fast-forwarded onto this branch after record 7250198232. The backup branch `claude/issue-38442-skill-markdown-fitting-section-wip` could not be deleted from the dev container (403) and waits for a hand with delete rights. - The block's last sentence was outside the card's three items; it is corrected here on the contract review's S1 (record 7250515767), being in the claimed block. Its nit N1 (the heading-path prefix may be the innermost heading only) is accepted as written, no change. ## Verification - Read first: `skills/objectstack-ai/SKILL.md` lines 325-346 (the whole diff of the skill), beside `content/docs/protocol/knowledge.mdx` §3.5, the `markdown` row. Riskiest hunks: the `minChars` sentence and the split-change sentence after it (beside §3.5, "A split change is a new index"). - Two-minute check: `node scripts/check-skills-token-ratchet.mjs` exits 0 and prints "skills/objectstack-ai/SKILL.md 7248 / 7248 (+0)". 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent d89d3e2 commit 70d2d48

3 files changed

Lines changed: 50 additions & 10 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): `objectstack-ai` teaches that a `markdown` section that fits `maxChars` is one passage
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-ai` § Knowledge Sources (RAG), the **Splitting (`split`)** block now follows the splitter:
11+
12+
- The `markdown` bullet says that a section that fits `maxChars` together with its heading path is one passage, and that a section that does not fit is cut as `recursive` cuts.
13+
- The `minChars` sentence says that pieces shorter than `minChars` are merged in `recursive` text and in a `markdown` section that does not fit, and that a section that fits stays whole whatever `minChars` is. An author no longer sets `minChars` equal to `maxChars` to keep a short clause, or a table with its note, in one passage.
14+
- The block's last sentence said that a changed `split` re-splits a document only when it next changes. That was wrong. It now says that changing `split` rebuilds the source's whole index, and that the source's searches are refused until the rebuild finishes.
15+
16+
Cut in the same block, with no fact dropped: "For documents with headings" (the bullet's "one section per heading" says it), "once `split` is written" (the signature and the omitted-`split` clause say it) "never truncated" (the `whole` bullet's "removed from the index and reported" says it) and the "and refused" of "Retired and refused" (the `400 UNKNOWN_KEY` and the parse error beside it say it).
17+
18+
The same block names the `knowledge.chunk_target` setting by its settings-page label "Longest passage", the label that setting takes in this release.

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,27 @@ export const CEILINGS = new Map([
544544
// 28800 -> ceil(28800 / 4) = 7200; the row moves +52, the measured remainder
545545
// only. Pinned AT the measurement.
546546
// ceil(($(wc -c < skills/objectstack-ai/SKILL.md) - 27) / 4) == ceil(28800 / 4)
547-
['skills/objectstack-ai/SKILL.md', 7200],
547+
// 7200 -> 7248 (2026-11-29, the fitting `markdown` section): the Splitting
548+
// block taught "one section per heading" and a `minChars` merge for every
549+
// strategy; under `markdown` a section that fits `maxChars` with its heading
550+
// path is one passage, and `minChars` merges only in `recursive` text and in
551+
// a section that does not fit. Its last sentence said a changed `split`
552+
// re-splits a document only when it next changes; a changed `split` rebuilds
553+
// the source's whole index and its searches are refused until the rebuild
554+
// finishes, and the block now says so. Raise path the standing ruling
555+
// 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). PAID DOWN
556+
// FIRST, in the same block: "For documents with headings" (the bullet's "one
557+
// section per heading" says it), "once `split` is written" (the signature
558+
// and the omitted-`split` clause say it), "never truncated" (the `whole`
559+
// bullet's "removed from the index and reported" says it), and the "and
560+
// refused" of "Retired and refused" (its `400 UNKNOWN_KEY` and "parse error"
561+
// say it); the settings label also became "Longest passage". Arithmetic in
562+
// priced bytes (stamp line excluded), against `main`'s 28800 (the row's
563+
// 7200, headroom 0): the file is 28827 -> 29017 bytes, so the LANDED priced
564+
// text is 28990 -> ceil(28990 / 4) = 7248; the row moves +48, the measured
565+
// remainder only. Pinned AT the measurement.
566+
// ceil(($(wc -c < skills/objectstack-ai/SKILL.md) - 27) / 4) == ceil(28990 / 4)
567+
['skills/objectstack-ai/SKILL.md', 7248],
548568
// -12 (was 6331): the `http.server` decision-table row dropped a trailing
549569
// clause that taught `contributes.routes` as a key that "parses but serves
550570
// nothing". The key is retired — an authored entry is now REFUSED, carrying

‎skills/objectstack-ai/SKILL.md‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -324,24 +324,26 @@ export const supportKb: KnowledgeSource = KnowledgeSourceSchema.parse({
324324

325325
**Splitting (`split`).** The knowledge service cuts each document into passages
326326
for a store declaring `capabilities.chunks`; any other store receives whole
327-
documents. `split: { strategy, maxChars?, minChars? }` — `strategy` is required
328-
once `split` is written; an omitted `split` means `recursive`:
327+
documents. `split: { strategy, maxChars?, minChars? }` — `strategy` is
328+
required; an omitted `split` means `recursive`:
329329

330330
- `recursive`: cuts at blank lines, then line breaks, then sentence ends. For
331331
prose.
332332
- `markdown`: one section per heading, each passage embedded with its heading
333-
path. For documents with headings.
333+
path. A section that fits `maxChars` with that path is one passage; one that
334+
does not is cut as `recursive` cuts.
334335
- `whole`: one passage per document. For short records only: a document over
335-
the embedder's input budget is removed from the index and reported, never
336-
truncated.
336+
the embedder's input budget is removed from the index and reported.
337337

338338
`maxChars`, the longest passage in characters (`whole` ignores it), overrides
339-
the **Target chunk size** setting (`knowledge.chunk_target`, else 800); the
339+
the **Longest passage** setting (`knowledge.chunk_target`, else 800); the
340340
embedder's input limit can lower it. Adjacent pieces shorter than `minChars`
341-
(default 200) are merged. Changing `split` re-splits a document only when it
342-
next changes.
341+
(default 200) are merged in `recursive` text and in a `markdown` section that
342+
does not fit; a section that fits stays whole whatever `minChars` is. Changing
343+
`split` rebuilds the source's whole index, and its searches are refused until
344+
the rebuild finishes.
343345

344-
Retired and refused: the `knowledge.chunk_overlap` setting (`400 UNKNOWN_KEY`;
346+
Retired: the `knowledge.chunk_overlap` setting (`400 UNKNOWN_KEY`;
345347
passages never overlap) and `KnowledgeChunk.metadata` (parse error; a passage
346348
takes its document's `metadata`).
347349

0 commit comments

Comments
 (0)