Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/38442-skill-markdown-fitting-section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@objectstack/skills': patch
---

docs(skills): `objectstack-ai` teaches that a `markdown` section that fits `maxChars` is one passage

Clause-②: no
Metadata-protocol: none

`skills/objectstack-ai` § Knowledge Sources (RAG), the **Splitting (`split`)** block now follows the splitter:

- 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.
- 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.
- 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.

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).

The same block names the `knowledge.chunk_target` setting by its settings-page label "Longest passage", the label that setting takes in this release.
22 changes: 21 additions & 1 deletion scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,27 @@ export const CEILINGS = new Map([
// 28800 -> ceil(28800 / 4) = 7200; the row moves +52, the measured remainder
// only. Pinned AT the measurement.
// ceil(($(wc -c < skills/objectstack-ai/SKILL.md) - 27) / 4) == ceil(28800 / 4)
['skills/objectstack-ai/SKILL.md', 7200],
// 7200 -> 7248 (2026-11-29, the fitting `markdown` section): the Splitting
// block taught "one section per heading" and a `minChars` merge for every
// strategy; under `markdown` a section that fits `maxChars` with its heading
// path is one passage, and `minChars` merges only in `recursive` text and in
// a section that does not fit. Its last sentence said a changed `split`
// re-splits a document only when it next changes; a changed `split` rebuilds
// the source's whole index and its searches are refused until the rebuild
// finishes, and the block now says so. Raise path the standing ruling
// 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). PAID DOWN
// FIRST, in the same block: "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" (its `400 UNKNOWN_KEY` and "parse error"
// say it); the settings label also became "Longest passage". Arithmetic in
// priced bytes (stamp line excluded), against `main`'s 28800 (the row's
// 7200, headroom 0): the file is 28827 -> 29017 bytes, so the LANDED priced
// text is 28990 -> ceil(28990 / 4) = 7248; the row moves +48, the measured
// remainder only. Pinned AT the measurement.
// ceil(($(wc -c < skills/objectstack-ai/SKILL.md) - 27) / 4) == ceil(28990 / 4)
['skills/objectstack-ai/SKILL.md', 7248],
// -12 (was 6331): the `http.server` decision-table row dropped a trailing
// clause that taught `contributes.routes` as a key that "parses but serves
// nothing". The key is retired — an authored entry is now REFUSED, carrying
Expand Down
20 changes: 11 additions & 9 deletions skills/objectstack-ai/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,24 +324,26 @@ export const supportKb: KnowledgeSource = KnowledgeSourceSchema.parse({

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

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

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

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

Expand Down
Loading