You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6ec3a73
Browse filesBrowse the repository at this point in the historyBrowse files
docs(skills): JSON forms in the sections served to MCP clients, and a check that pins their headings (#35131)
Fixes#34771
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:托管 MCP 门按标题读取的 24 个技能章节里,8 个章节的示例改为 JSON(或 JSON 与 TypeScript
并列),其余 16 个是纯文字和表格、对两类客户端读法一致;新增一份 24 行清单和一个检查,标题被改名、删除或重复时 CI 变红,章节里的每个
JSON 块都要通过 spec 的 schema。
- 为什么改:通过 MCP 搭建的客户端写的是 JSON,却只能看到带 import 的 TypeScript
示例;而这些标题一旦改名,托管产品启动即失败,本仓此前没有任何检查知道哪些标题被读取(#34691 S3 = A)。
- 风险与回滚:只动文档、一个检查脚本、一行 CI 步骤和 token 棘轮的 7 行;风险在 `notify` 与审批流两个示例从
TypeScript 改成 JSON 后措辞是否仍准确。回滚 = revert 本 PR,无数据或运行时影响。
- 先看:①
`skills/objectstack-automation/references/state-machines-and-approvals.md`
的审批流 JSON(整块替换,最大的一处);② `skills/objectstack-automation/SKILL.md` 的
`notify` 节(原注释改成了块下的键说明列表);③ `scripts/check-skills-token-ratchet.mjs` 的
5 行上调。
- 两分钟验证:`pnpm --filter @objectstack/spec run
check:skill-served-sections`,预期末行 `24 served section(s) ... (6 json, 2
json+ts, 16 neutral); 10 JSON fence(s) parse and pass their spec
validators`。
- 需要你做的:审阅并合并(`skills/**` 与 workflow 属 Tier H 受管面)。
## What changes
**JSON forms.** The 24 sections are the ones listed in #34771 comment
6967385705. Each section's chosen form:
| # | File | Heading | Form | What changed |
|:--|:--|:--|:--|:--|
| 1 | `objectstack-data/rules/naming.md` | Critical Rules | neutral |
item 2 no longer says "TypeScript" (the rule holds for JSON keys too);
item 6 untouched |
| 2 | `objectstack-data/SKILL.md` | Object Definition | json | new: one
object as JSON, with the TypeScript wrapper named in one line |
| 3 | `objectstack-data/SKILL.md` | Field Type Selection | neutral | the
`expression` envelope is named beside the TypeScript tag |
| 4 | `objectstack-data/SKILL.md` | Relationship Patterns | neutral |
untouched (a table) |
| 5 | `objectstack-data/SKILL.md` | Validation Patterns | neutral |
untouched (prose) |
| 6 | `objectstack-data/rules/validation.md` | State Machine Validation
| json | the rule is JSON; its two comments became one sentence |
| 7 | `objectstack-data/rules/relationships.md` | Roll-up Summaries |
json | the `summary` field and the permission set are JSON;
commented-out alternatives became a sentence and a second field entry |
| 8 | `objectstack-data/references/seeds.md` | Seed best practices |
neutral | the `defineSeed()` row says it is the TypeScript form |
| 9 | `objectstack-data/rules/lifecycle.md` | Save Notice | neutral |
untouched (prose) |
| 10 | `objectstack-ui/SKILL.md` | List Views | neutral | untouched
(prose) |
| 11 | `objectstack-ui/SKILL.md` | Actions | json | the write-button
action is one JSON object; the inline fragment it replaces left the
paragraph |
| 12 | `objectstack-ui/rules/list-views.md` | Adding a board, calendar,
gallery or gantt beside the list | neutral | untouched (prose) |
| 13 | `objectstack-automation/SKILL.md` | Data Operations | neutral |
untouched (a table) |
| 14 | `objectstack-automation/SKILL.md` | External Integration |
neutral | untouched (a table) |
| 15 | `objectstack-automation/SKILL.md` | `notify` | json | the node is
JSON; the block's comments are a key list under it |
| 16 | `objectstack-automation/SKILL.md` | Failure routing & `runAs` |
neutral | untouched (prose) |
| 17 | `objectstack-automation/SKILL.md` | Filter operands
(`config.filter`) | neutral | untouched (prose) |
| 18 | `objectstack-automation/SKILL.md` | Valid-but-silently-wrong
(passes build, fails at runtime) | json+ts | the two nodes of item 3 are
a JSON array; the function registration stays TypeScript and says it has
no JSON form |
| 19 | `objectstack-automation/SKILL.md` | Integrations are declared,
not coded | neutral | untouched (prose) |
| 20 | `objectstack-automation/references/examples-flows.md` |
Time-relative triggers — scheduled per-record date sweep | json+ts | the
TypeScript flow stays; its start node is added as JSON; the window
filter is JSON |
| 21 |
`objectstack-automation/references/state-machines-and-approvals.md` |
Approvals (Flow Nodes) | json | the whole flow is JSON; the block's
comments are three list items above it |
| 22 |
`objectstack-automation/references/state-machines-and-approvals.md` |
Approver Types | neutral | untouched (a table) |
| 23 |
`objectstack-automation/references/state-machines-and-approvals.md` |
Node Config (`ApprovalNodeConfigSchema`) | neutral | untouched (a table)
|
| 24 |
`objectstack-automation/references/state-machines-and-approvals.md` |
Approval Best Practices | neutral | untouched (prose) |
"neutral" means the section holds prose and tables and no fenced
TypeScript; inline key fragments in prose (`{ type: 'boolean',
defaultValue: false }`) are left as they are.
**The two sections the hosted door serves with passages replaced** are
rows 20 and 24 (read from the hosted table,
`packages/service-ai-studio/src/skills/published-refs.ts` in the cloud
repository). Both replaced passages are byte for byte as on `main` and
occur exactly once in their sections; no line containing `runAs:
'system'` is added, removed or changed anywhere in this diff. That is
why row 20 keeps its TypeScript flow, and why its JSON is the start node
alone: a whole-flow JSON would have to declare the identity that the
replaced variant tells its reader not to declare.
**The pin.** `packages/spec/scripts/skill-served-sections.json` lists
the 24 sections (file, heading, the numbered item where the door reads
one, form, and the validator of each JSON block in document order).
`packages/spec/scripts/check-skill-served-sections.ts` applies the
hosted door's rule line for line: the heading text must occur exactly
once in its file outside code fences, and the section runs to the next
heading of the same or a higher level. It also parses every JSON block
in a listed section and validates it against the spec schema for its
kind (a flow node also against its node type's config contract), and
fails when a section carries a JSON block the list does not declare, or
a TypeScript block its declared form does not allow. It runs in
`lint.yml` beside `check:skill-refs`, as `pnpm --filter
@objectstack/spec check:skill-served-sections`, self-test first.
**Token ratchet.** Raise path: ruling record 6513306068 on #27847,
letter B (「A:先削重复,余额按实测提高」). Paid down first in each file, then five
rows moved by the measured remainder and two rows re-locked lower:
| File | Bytes before -> after | Row before -> after | Cut first |
|:--|:--|:--|:--|
| `objectstack-automation/SKILL.md` | 27988 -> 28199 | 6992 -> 7045 |
the block's import line, type annotation and check marker |
| `objectstack-automation/references/examples-flows.md` | 5957 -> 6170 |
1494 -> 1543 | two clauses restating the paragraph and block above them
|
| `objectstack-automation/references/state-machines-and-approvals.md` |
23652 -> 23744 | 5916 -> 5936 | the import line, the `defineFlow`
wrapper and the check marker |
| `objectstack-data/SKILL.md` | 26678 -> 26859 | 6665 -> 6710 | the
sentence restating the `sharingModel` row; the `namespace` row's wrapper
clause and example |
| `objectstack-ui/SKILL.md` | 8974 -> 9128 | 2239 -> 2277 | the inline
`type` / `body` fragment the JSON block replaces |
| `objectstack-data/rules/relationships.md` | 16884 -> 16811 | 4221 ->
4203 | (shrank) |
| `objectstack-data/references/seeds.md` | 6985 -> 6984 | 1747 -> 1746 |
(shrank) |
Skills readings, lines: the nine changed files, before -> after: 468 ->
478, 138 -> 145, 412 -> 392, 472 -> 478, 175 -> 175, 25 -> 25, 409 ->
411, 330 -> 331, 164 -> 169 (in the order `git diff --numstat` prints
them); net across `skills/**` +11 (169 added, 158 removed). All
`SKILL.md` files together: 4596 -> 4617 lines. Tokens, by the ratchet's
own count: authored 191485 -> 191677, whole bundle 263501 -> 263693.
## Tests
- `pnpm --filter @objectstack/spec run check:skill-served-sections`:
self-test 33 cases in 8 batteries, then `24 served section(s) ... 10
JSON fence(s) parse and pass their spec validators`.
- Ablation, one run: `### List Views` renamed to `### List views` in
`skills/objectstack-ui/SKILL.md` through `scripts/ablation-replace.mjs`
(anchor 1 -> 0, blob changed); the gate exits 1 with `found 0 (renamed
or removed)`; restored, blob equals `HEAD` and `git diff HEAD` is empty;
the gate is green again.
- `pnpm --filter @objectstack/spec run check:skill-examples`: `345 prose
examples type-check across 3 surface(s)` (two marked TypeScript blocks
left with the conversion; the JSON that replaces them is validated by
the new check instead).
- `pnpm --filter @objectstack/spec typecheck`: exit 0 (covers
`scripts/`).
## Acceptance notes
- The new JSON for item 3 of Valid-but-silently-wrong gives each node a
`label`: the TypeScript fragment it replaces had none, and the flow node
schema requires one.
- The check does not judge the two replaced passages themselves; those
strings belong to the hosted table.
- #35087 (draft) conflicts with this branch in
`scripts/check-skills-token-ratchet.mjs` (`overlap-check`); whichever
lands second re-measures its row. #35100 and #35002 merge cleanly.
## Verification
Head `84cede3db5` (merged with `origin/main` `958ee03594`).
<details><summary>Local gate subset</summary>
`node scripts/pm/dispatch-gates.mjs --commands` derived 133 families;
all were run on this head and reconciled: `dispatch-gates --ran: 133
derived famil(ies) accounted for — 133 run, 0 NOT-MEASURED`. Among them
`check-skills-token-ratchet` and its self-test (104 cases),
`check:skill-docs`, `check:skill-refs`, `check:skill-links`,
`check:skill-compatibility`, `check:doc-authoring`,
`check:pm-dispatch-gates`, `bare-root-worklist --self-test`.
`check-governed-merges --branch HEAD`: Tier H, as expected for
`skills/**` and a new workflow step. `test:repo` and the full farm are
left to CI.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbWDsbbJizuYnDwBxT8)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
docs(skills): the sections served to MCP clients show their examples as JSON, and a check pins their headings
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
A client that builds through MCP writes JSON, and the sections of `objectstack-data`, `objectstack-ui` and `objectstack-automation` that the hosted MCP door serves showed their examples in TypeScript. Those sections now give each example as JSON, with one line on how a TypeScript project wraps the same literal:
11
+
12
+
-`objectstack-data`: the object in Object Definition, the `state_machine` rule in State Machine Validation, and the `summary` field and the permission set in Roll-up Summaries. Field Type Selection names the `{ dialect: 'cel', source }` envelope beside the TypeScript tag.
13
+
-`objectstack-ui`: the write-button action in Actions.
14
+
-`objectstack-automation`: the `notify` node (its key notes are a list under the block), the `script` and `update_record` pair in Valid-but-silently-wrong, the whole approval flow in Approvals (Flow Nodes), and the start node and window filter of the time-relative trigger, beside its TypeScript flow.
15
+
16
+
The other served sections are prose and tables and read the same to both kinds of client; three of them drop a TypeScript-only phrase.
17
+
18
+
Every JSON block in a served section is parsed and validated against the spec schema for its kind in CI, and a renamed, removed or duplicated heading of a served section now fails there.
// above. The audit half is unchanged and is still the bulk of what it reports.
214
214
{check: 'check:empty-state',why: 'audits empty-state coverage — no artifact'},
215
215
{check: 'check:skill-examples',why: 'validates skill examples parse — no artifact'},
216
+
{check: 'check:skill-served-sections',why: 'audits the skill sections the hosted MCP door serves (headings, JSON examples) against a hand-kept list — no artifact'},
216
217
// #13086 — the YAML half of the surface `check:skill-examples` covers for
217
218
// TypeScript: tagged ```yaml blocks in skills/ + content/docs/ are safeParsed
218
219
// against the live spec schemas. Reads src/ through tsx (no dist), writes
"about": "The sections of the published skills that the hosted MCP door serves by exact heading text. Read by check-skill-served-sections.ts, whose header states the matching rule. The hosted table is the cloud repository's packages/service-ai-studio/src/skills/published-refs.ts; when that table moves, its owner updates this list by pull request.",
3
+
"forms": {
4
+
"json": "the item's example is a JSON block; a one-line note says how TypeScript wraps the same literal",
5
+
"json+ts": "a JSON block beside a TypeScript block that carries what JSON cannot (a function, or lines the hosted door replaces)",
6
+
"neutral": "prose and tables only: no fenced TypeScript to translate"
{ "file": "skills/objectstack-ui/rules/list-views.md", "heading": "Adding a board, calendar, gallery or gantt beside the list", "form": "neutral", "json": [] },
0 commit comments