Repository navigation
Commit 70d2d48
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
- .changeset
- scripts
- skills/objectstack-ai
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
547 | | - | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
548 | 568 | | |
549 | 569 | | |
550 | 570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
328 | | - | |
| 327 | + | |
| 328 | + | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
| 334 | + | |
334 | 335 | | |
335 | | - | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
340 | 340 | | |
341 | | - | |
342 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
343 | 345 | | |
344 | | - | |
| 346 | + | |
345 | 347 | | |
346 | 348 | | |
347 | 349 | | |
| |||
0 commit comments