Repository navigation
Commit 9726bd8
docs(skills): objectstack-ai names the os validate rules for a knowledge_source, each with its fix (#38091)
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP
Part of #37310
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 读 AI 技能包的开发者和 AI
助手,在“知识源”一节里新看到一张清单:校验和发布时会拒收知识源的五条规则,每条都配了改法;之前这一节没有这张清单。
- 属于“AI 知识检索(RAG)元数据化”这一组工作:上一轮的规则检查已经合并,这次补上教学文字,让作者在校验报错前就知道怎么写对。
- 出错只影响文档:写错的话,作者会照着错误的改法去改,但平台照样拒收,不会有坏数据进去;改动只有文字和预算行,可以直接撤回。
- 无。
## What changes
`skills/objectstack-ai/SKILL.md` § Knowledge Sources (RAG) now lists
what `os validate` and publish report for a `knowledge_source`, by rule
id, with the fix for each. I took the wording from the rules' own
messages and hints in `packages/lint/src/validate-knowledge-source.ts`
on `main`, not from the card:
- `knowledge-source-object-unknown`: `source.object` is no object of the
stack or its packages. On the CLI it is a warning while the manifest
declares a dependency that `packages[]` does not carry. Fix: name a
defined object, or declare and install its package.
- `knowledge-source-field-unknown`: a `content` / `metadataFields`
member is no field of the object; `id` and the injected system columns
resolve. Fix: correct the spelling, or remove the member.
- `knowledge-source-object-not-searchable`: the API does not serve the
object for `search`. Fix: leave `enable.apiEnabled` on; an
`enable.apiMethods` list must grant `list`, with `enable.searchable` not
false.
- `knowledge-source-system-object-not-ai-readable`: a `sys_` object
without `enable.aiReadable: true`. Fix: index a business object.
- `knowledge-source-field-never-indexed` (warning): a credential-class
or `internal: true` member, which the index never carries. Fix: remove
it.
The section says that an error refuses the publish.
**Token ratchet.** Raise path: the standing maintainer ruling 2026-10-27
「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B).
Paid down first: four restatements in the same section.
- The `source.content` row's "credential-class and `internal` fields are
never indexed". The `-field-never-indexed` line now says it.
- Its "embedding is egress". The egress paragraph says it.
- The `name` row's "with the package, its identity". The intro says it.
- The example's `// no adapter: the deployment's store` comment. The
`adapter` row says it.
Then the row moves `6695 -> 6893` (+198), by the measured remainder
only:
- SKILL.md is 26806 -> 27596 bytes, and the priced text is 27569 bytes
(the 27-byte stamp line is excluded).
- ceil(27569 / 4) = 6893.
Changeset: `.changeset/37310-skill-knowledge-source-validate-rules.md`,
`'@objectstack/skills': patch`.
**Skill size readings (`skills/**`).**
- Changed file `skills/objectstack-ai/SKILL.md`: 471 -> 487 lines, 26806
-> 27596 bytes, 6695 -> 6893 tokens.
- Whole bundle, the sum of all 14 SKILL.md files: 4936 -> 4952 lines,
261710 -> 262500 bytes.
## Tests
All readings are at `36261634ad`.
- `os validate` on the section's example: exit 0, `"valid": true`, zero
knowledge-source findings.
- The fixture is a throwaway stack of namespace `kb`, with object
`kb_article` (`title`, `body`, `category`, `published`, `sharingModel:
'private'`) and the example's source verbatim.
- It ran from an isolated directory under `examples/app-todo`, then the
directory was deleted.
- Positive control: the same stack with `enable: { apiEnabled: false }`,
content `['title', 'bodyy', 'secret']` and a `Field.secret` member. Exit
1, with:
- `knowledge-source-object-not-searchable` (error, `source.object`);
- `knowledge-source-field-unknown` (error, `content[1]`);
- `knowledge-source-field-never-indexed` (warning, `content[2]`).
- Eval case 14 (`objectstack-ai/skills-tools-knowledge#14`, an app that
ships no source and authors one at run time), 1 rep per arm:
- with-skill **pass**: the answer leads with `requires: ['knowledge']`;
- no-skill **fail**: the model said it had nothing to go on.
## Acceptance notes
- The section names the five ids: `grep -o 'knowledge-source-[a-z-]*'
skills/objectstack-ai/SKILL.md | sort | uniq -c` gives each of the five
once.
- The example passes `os validate` with zero knowledge-source findings
(Tests).
- `Part of #37310`, not `Fixes`: the card's create seed still waits for
#37309, which is the Studio form that builds `source` from the author's
input. `knowledge_source` stays on `KNOWN_UNSEEDED` with that reason.
## Verification
<details><summary>Skill gates under the verify lock (VERDICT
command-exit 0)</summary>
- `pnpm turbo run build --filter='@objectstack/cli...' --concurrency=2`:
exit 0
- `check:skill-docs`: exit 0, "Skill docs in sync"
- `check:skill-refs`: exit 0, "10 generated files in sync with
packages/spec"
- `check:yaml-examples`: exit 0, "19 tagged YAML example(s) across 1
file(s) validate"
- `node scripts/check-skills-token-ratchet.mjs`: exit 0, "61 authored
bundle file(s) within their ceilings"
</details>
<details><summary>Local subset of the derived gate families (28, each
exit 0)</summary>
`dispatch-gates --commands --repo objectstack-ai/objectstack` derives 67
families at `36261634ad`. I ran 28 of them locally, each exit 0: the
ratchet with its self-test, `check:nul-bytes`, `check-empty-changeset`,
`check-adr-0087-registration`, `check-changeset-no-major`,
`check:doc-authoring`, `check:skill-links`,
`check:skill-identifier-liveness`, `check:skill-compatibility`,
`check:skill-frame-sync`, `check:published-files` and the rest of that
set. CI runs the full set.
</details>
**Read first.**
1. `skills/objectstack-ai/SKILL.md`, the new rule list just above the
example. Risk: a fix that departs from the rule's hint.
2. `scripts/check-skills-token-ratchet.mjs`, the `6695 -> 6893` comment.
Check its arithmetic.
**Two-minute check.** Run `node scripts/check-skills-token-ratchet.mjs |
grep objectstack-ai/SKILL`. Expect `6893 / 6893`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent d7a6d74 commit 9726bd8
3 files changed
Lines changed: 47 additions & 4 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
487 | 504 | | |
488 | 505 | | |
489 | 506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
275 | 291 | | |
276 | 292 | | |
277 | 293 | | |
278 | 294 | | |
279 | 295 | | |
280 | 296 | | |
281 | 297 | | |
282 | | - | |
| 298 | + | |
283 | 299 | | |
284 | 300 | | |
285 | 301 | | |
| |||
0 commit comments