Skip to content
Merged
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/34771-skills-json-forms-served-sections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@objectstack/skills': patch
---

docs(skills): the sections served to MCP clients show their examples as JSON, and a check pins their headings

Clause-②: no
Metadata-protocol: none

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:

- `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.
- `objectstack-ui`: the write-button action in Actions.
- `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.

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.

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.
10 changes: 10 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5336,6 +5336,16 @@ jobs:
continue-on-error: true
run: pnpm --filter @objectstack/spec check:skill-refs

# Rationale: `packages/spec/scripts/check-skill-served-sections.ts` header.
# The hosted MCP door reads 24 sections of the published skills by exact
# heading text; a rename, removal or duplicate fails that product at
# start. Also holds every JSON example in those sections to the spec.
# Reads packages/spec/src via tsx and needs no build, as its neighbours.
- name: Check the skill sections served to MCP clients keep their headings and valid JSON
id: check-the-skill-sections-served-to-mcp-clients
continue-on-error: true
run: pnpm --filter @objectstack/spec check:skill-served-sections

# Rationale: `scripts/check-skill-frame-sync.mjs` header (#5130, #5451, #5799).
- name: Check the decision frame is in sync across its four copies
id: check-the-decision-frame-is-in-sync-across
Expand Down
1 change: 1 addition & 0 deletions packages/spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@
"check:strictness-ledger": "tsx scripts/check-strictness-ledger.mts",
"gen:react-blocks": "tsx scripts/build-react-blocks-contract.ts",
"check:react-blocks": "tsx scripts/build-react-blocks-contract.ts --check",
"check:skill-served-sections": "tsx scripts/check-skill-served-sections.ts --self-test && tsx scripts/check-skill-served-sections.ts",
"check:skill-examples": "tsx scripts/check-skill-examples.ts --self-test && tsx scripts/check-skill-examples.ts",
"check:yaml-examples": "tsx scripts/check-yaml-examples.ts --self-test && tsx scripts/check-yaml-examples.ts",
"check:template-manifests": "tsx scripts/check-template-manifests.ts --self-test && tsx scripts/check-template-manifests.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/spec/scripts/check-generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ const NO_GENERATOR: ReadonlyArray<{ check: string; why: string }> = [
// above. The audit half is unchanged and is still the bulk of what it reports.
{ check: 'check:empty-state', why: 'audits empty-state coverage — no artifact' },
{ check: 'check:skill-examples', why: 'validates skill examples parse — no artifact' },
{ 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' },
// #13086 — the YAML half of the surface `check:skill-examples` covers for
// TypeScript: tagged ```yaml blocks in skills/ + content/docs/ are safeParsed
// against the live spec schemas. Reads src/ through tsx (no dist), writes
Expand Down
426 changes: 426 additions & 0 deletions packages/spec/scripts/check-skill-served-sections.ts

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions packages/spec/scripts/skill-served-sections.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"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.",
"forms": {
"json": "the item's example is a JSON block; a one-line note says how TypeScript wraps the same literal",
"json+ts": "a JSON block beside a TypeScript block that carries what JSON cannot (a function, or lines the hosted door replaces)",
"neutral": "prose and tables only: no fenced TypeScript to translate"
},
"sections": [
{ "file": "skills/objectstack-data/rules/naming.md", "heading": "Critical Rules", "item": 6, "form": "neutral", "json": [] },
{ "file": "skills/objectstack-data/SKILL.md", "heading": "Object Definition", "form": "json", "json": ["Object"] },
{ "file": "skills/objectstack-data/SKILL.md", "heading": "Field Type Selection", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-data/SKILL.md", "heading": "Relationship Patterns", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-data/SKILL.md", "heading": "Validation Patterns", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-data/rules/validation.md", "heading": "State Machine Validation", "form": "json", "json": ["ValidationRule"] },
{ "file": "skills/objectstack-data/rules/relationships.md", "heading": "Roll-up Summaries", "form": "json", "json": ["Field", "PermissionSet"] },
{ "file": "skills/objectstack-data/references/seeds.md", "heading": "Seed best practices", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-data/rules/lifecycle.md", "heading": "Save Notice", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-ui/SKILL.md", "heading": "List Views", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-ui/SKILL.md", "heading": "Actions", "form": "json", "json": ["Action"] },
{ "file": "skills/objectstack-ui/rules/list-views.md", "heading": "Adding a board, calendar, gallery or gantt beside the list", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-automation/SKILL.md", "heading": "Data Operations", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-automation/SKILL.md", "heading": "External Integration", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-automation/SKILL.md", "heading": "`notify`", "form": "json", "json": ["FlowNode"] },
{ "file": "skills/objectstack-automation/SKILL.md", "heading": "Failure routing & `runAs`", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-automation/SKILL.md", "heading": "Filter operands (`config.filter`)", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-automation/SKILL.md", "heading": "Valid-but-silently-wrong (passes build, fails at runtime)", "form": "json+ts", "json": ["FlowNodeList"] },
{ "file": "skills/objectstack-automation/SKILL.md", "heading": "Integrations are declared, not coded", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-automation/references/examples-flows.md", "heading": "Time-relative triggers — scheduled per-record date sweep", "form": "json+ts", "json": ["FlowNode", "FlowFilter"] },
{ "file": "skills/objectstack-automation/references/state-machines-and-approvals.md", "heading": "Approvals (Flow Nodes)", "form": "json", "json": ["Flow"] },
{ "file": "skills/objectstack-automation/references/state-machines-and-approvals.md", "heading": "Approver Types", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-automation/references/state-machines-and-approvals.md", "heading": "Node Config (`ApprovalNodeConfigSchema`)", "form": "neutral", "json": [] },
{ "file": "skills/objectstack-automation/references/state-machines-and-approvals.md", "heading": "Approval Best Practices", "form": "neutral", "json": [] }
]
}
56 changes: 49 additions & 7 deletions scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,16 @@ export const CEILINGS = new Map([
// ceil(27968 / 4) = 6992; the ceiling moves +89, the measured addition only.
// Pinned AT the measurement.
// ceil(($(wc -c < skills/objectstack-automation/SKILL.md) - 20) / 4) == ceil(27968 / 4)
['skills/objectstack-automation/SKILL.md', 6992],
// 6992 -> 7045 (#34771): the JSON forms #34691 S3 = A orders into the sections the
// hosted MCP door serves. `### \`notify\`` trades its TypeScript block for the node
// as JSON plus a key list carrying the block's comments; item 3 of `## Valid-but-
// silently-wrong` shows its two nodes as a JSON array (each now with the `label` the
// schema requires) and says the function registration has no JSON form. Raise path:
// ruling record 6513306068, letter B, 「A:先削重复,余额按实测提高」. Paid down first: the block's import line, type annotation and check marker
// went with it. The file is 27988 -> 28199 bytes (27968 -> 28179 priced); the row
// moves +53, the measured remainder, pinned AT the measurement.
// ceil(($(wc -c < skills/objectstack-automation/SKILL.md) - 20) / 4) == ceil(28179 / 4)
['skills/objectstack-automation/SKILL.md', 7045],
// 13783 -> 13892 (2026-08-31 app-repo-principles raise, see the block above).
// The invariant-vs-transition-gate choice, placed in the field-conditional-rule
// bullet list where the tool is actually picked. Both wrong picks are silent:
Expand Down Expand Up @@ -700,7 +709,15 @@ export const CEILINGS = new Map([
// public skills … The private corpus's rules of that kind move there". The
// raise path is the standing 2026-10-27 ruling, verbatim and untranslated:
// 「A:先削重复,余额按实测提高」 (ruling record 6513306068).
['skills/objectstack-data/SKILL.md', 6665],
// 6665 -> 6710 (#34771): `### Object Definition` gains the object as JSON and
// `### Field Type Selection` names the `expression` envelope beside the TypeScript
// tag (#34691 S3 = A). Raise path: ruling record 6513306068, letter B, 「A:先削重复,余额按实测提高」. Paid down first, in the same section: the
// sentence restating the `sharingModel` row (omitted resolves to `private`, the
// publish door refuses first) and the `namespace` row's `ObjectSchema.create()`
// clause and `name` example, which the JSON now shows. 26678 -> 26859 bytes (26658
// -> 26839 priced); the row moves +45, the measured remainder, pinned AT it.
// ceil(($(wc -c < skills/objectstack-data/SKILL.md) - 20) / 4) == ceil(26839 / 4)
['skills/objectstack-data/SKILL.md', 6710],
// 5997 -> 6008 (the formula skills follow-ups of PRs #34443 and #34447): the
// `label(record.f)` row teaches a multi-select (`multiple: true`) reading each
// selected label in stored order, joined with `, `, and the built-ins line
Expand Down Expand Up @@ -937,7 +954,12 @@ export const CEILINGS = new Map([
// (15684 priced) -> 8974 (8954 priced) -> 2239 tokens; the ceiling follows the file down
// to the measurement, the ratchet's ordinary direction.
// ceil(($(wc -c < skills/objectstack-ui/SKILL.md) - 20) / 4) == ceil(8954 / 4)
['skills/objectstack-ui/SKILL.md', 2239],
// 2239 -> 2277 (#34771): `## Actions` shows the write-button action as one JSON
// object (#34691 S3 = A); the inline `type` / `body` fragment it replaces left the
// paragraph. Raise path: ruling record 6513306068, letter B, 「A:先削重复,余额按实测提高」. 8974 -> 9128 bytes (8954 -> 9108 priced); the row
// moves +38, the measured remainder, pinned AT the measurement.
// ceil(($(wc -c < skills/objectstack-ui/SKILL.md) - 20) / 4) == ceil(9108 / 4)
['skills/objectstack-ui/SKILL.md', 2277],
// 8333 -> 6193: RE-LOCK at the landed count after the #19715 split (decision
// batch #213 item 1, maintainer 「1 2 4 同意」): the worked R1, the report
// template and the v17-canonical shapes block moved VERBATIM into
Expand Down Expand Up @@ -1125,7 +1147,11 @@ export const CEILINGS = new Map([
// assignment per pair", "On the PARENT object", the second "On the CHILD object's FK
// field", the contact example's "independent lifecycle"). 16916 -> 16884 bytes ->
// ceil(16884 / 4) = 4221; the row follows the measurement down.
['skills/objectstack-data/rules/relationships.md', 4221],
// 4221 -> 4203 (#34771): RE-LOCK at the landed count. `## Roll-up Summaries` gives
// the summary field and the permission set as JSON; the commented-out alternatives
// became a sentence and a second field entry. 16884 -> 16811 bytes.
// ceil($(wc -c < skills/objectstack-data/rules/relationships.md) / 4) == ceil(16811 / 4)
['skills/objectstack-data/rules/relationships.md', 4203],
// NEW FILE (#14296 item 1 = A, condition (b)): the entry's Security & Access
// Control block moved here whole. Pinned at its landed count — no headroom,
// because a split that arrives with budget is a raise wearing a new path.
Expand Down Expand Up @@ -1518,7 +1544,15 @@ export const CEILINGS = new Map([
// measurement. Same authority as the SKILL.md row above: cloud#3659 letter A
// (ruling comment 6682024726) orders the text in; the raise path is the
// standing 2026-10-27 ruling (record 6513306068), quoted in the PR body.
['skills/objectstack-automation/references/examples-flows.md', 1494],
// 1494 -> 1543 (#34771): the time-relative section gains its start node as JSON
// beside the TypeScript flow, whose `type` / `runAs` lines the hosted door replaces
// and which therefore stay byte for byte, and its window filter becomes JSON
// (#34691 S3 = A). Raise path: ruling record 6513306068, letter B, 「A:先削重复,余额按实测提高」. Paid down first: two clauses restating the
// paragraph and the block above them (the daily sweep never missing a threshold;
// each bound being a CEL envelope). 5957 -> 6170 bytes; the row moves +49, the
// measured remainder, pinned AT the measurement.
// ceil($(wc -c < skills/objectstack-automation/references/examples-flows.md) / 4) == ceil(6170 / 4)
['skills/objectstack-automation/references/examples-flows.md', 1543],
// NEW FILE (card #27223): one recipe per integration archetype — OpenAPI with
// a static key, remote MCP with a static header, plain REST, the vendor
// callback, a hand-written document for a spec-less vendor — plus the two
Expand Down Expand Up @@ -1646,7 +1680,13 @@ export const CEILINGS = new Map([
// 23661 bytes -> ceil(23661 / 4) = 5916; the ceiling moves +91, the measured
// remainder only. Pinned AT the measurement.
// ceil($(wc -c < skills/objectstack-automation/references/state-machines-and-approvals.md) / 4) == ceil(23661 / 4)
['skills/objectstack-automation/references/state-machines-and-approvals.md', 5916],
// 5916 -> 5936 (#34771): `### Approvals (Flow Nodes)` gives its flow as JSON, with
// the block's comments as three list items above it (#34691 S3 = A). Raise path:
// ruling record 6513306068, letter B, 「A:先削重复,余额按实测提高」. Paid down first: the import line, the `defineFlow` wrapper and the check
// marker went with the TypeScript block. 23652 -> 23744 bytes; the row moves +20,
// the measured remainder (main carried 3 of headroom), pinned AT the measurement.
// ceil($(wc -c < skills/objectstack-automation/references/state-machines-and-approvals.md) / 4) == ceil(23744 / 4)
['skills/objectstack-automation/references/state-machines-and-approvals.md', 5936],
// 1779 -> 1769 (#26297): RE-LOCK at the landed count after a net cut — two
// stale `{ type: 'lookup', reference: 'user' }` fields (an object that does
// not exist) became `type: 'user'`; -10 tokens, the row follows the
Expand Down Expand Up @@ -1685,7 +1725,9 @@ export const CEILINGS = new Map([
// objectstack-ai/cloud#3659, letter A, maintainer 「A」 (ruling comment
// 6682024726); raise path the 2026-10-27 ruling 「A:先削重复,余额按实测提高」
// (ruling record 6513306068).
['skills/objectstack-data/references/seeds.md', 1747],
// 1747 -> 1746 (#34771): RE-LOCK at the landed count; the `defineSeed()` row of
// `### Seed best practices` says it is the TypeScript form. 6985 -> 6984 bytes.
['skills/objectstack-data/references/seeds.md', 1746],
// 1351 -> 1343: the body-pin values left the count (#31115, ruling B; see
// BODY_PIN_REPIN); the file's count fell by the same 8, headroom unchanged.
['skills/objectstack-platform/references/bootstrap.md', 1343],
Expand Down
Loading
Loading