Skip to content

Commit b492198

Browse files
docs(skills): the checked action examples drop their locations key (#37947)
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoEfAeSobHZgSLfHP3844ZfC)_ Part of #37895 This is PR 1 of 2 on that card. It lands before #36495 (draft PR #37929), so that #37929's `check:skill-examples` and `check:skill-served-sections` go green. PR 2, the teaching of the new words, stays behind #36495. Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:写应用的 AI 助手读到的六个按钮示例,不再写明按钮放在哪里;说明文字和位置对照表一字未动,也没有教任何新词。 - 为什么做:这是「按钮位置改用新词」这项工作的前置一步。旧的位置词即将退役,这六个示例不先让路,那项改动的两道示例检查过不了。 - 出错会怎样:照抄示例的人会得到一个哪里都不显示的按钮,校验时有一条提醒告诉他补上位置;本改动只删了几行,可以直接撤回。 - 要你做什么:在「按钮位置改用新词」那项改动之前合并本改动(技能包属于要你亲手合并的范围)。 ## What changes Six checked examples in the published skills drop their `locations` key. Eight old words leave compiled text; no word is added. (A seventh, `ask_about_contract` in `skills/objectstack-ai/SKILL.md`, left with C1s #37937, which deleted its whole Ask AI block; see the update below.) | File | Example | Line on the base | Words dropped | |:--|:--|:--|:--| | `skills/objectstack-ui/SKILL.md` | `mark_done`, § Actions, JSON fence 1 | 136 | `record_header` | | `skills/objectstack-ui/rules/actions.md` | `crm_reassign_lead` (os:check) | 69 | `record_header`, `list_item` | | `skills/objectstack-ui/rules/actions.md` | `crm_convert_lead` (os:check) | 96 | `record_header`, `list_item` | | `skills/objectstack-ui/rules/actions.md` | `crm_print_a3` (os:check) | 180 | `record_header` | | `skills/objectstack-ui/rules/actions.md` | `crm_open_invoice_pdf` (os:check) | 205 | `record_header` | | `skills/objectstack-ui/rules/actions.md` | `crm_add_invoice_line` (os:check) | 239 | `record_header` | Two more files move because the gates measure them as owed: - `scripts/check-skills-token-ratchet.mjs`: two rows follow their files down to the measurement (2264 to 2256, 3890 to 3844). The gate refuses a ceiling above its file's measurement. The `objectstack-ai` row is `main`'s own (6609) after the merges below. - `.changeset/37895-skills-action-examples-no-location-key.md`: a `patch` for `@objectstack/skills`, which ships the catalog. Not changed: every sentence, the location table (`actions.md` lines 17 to 26), the `actionLayout` paragraph, `actions.md` line 222, `skills/objectstack-formula/SKILL.md`, `skills/objectstack-ui/rules/record-page.md` and the eval fixtures. None of them is compiled, and they are PR 2's. ## Why On #37929's branch the action location vocabulary is `list`, `record`, `record_page`, `record_row`, `record_related`, `record_section`. On main it is `list_toolbar`, `list_item`, `record_header`, `record_more`, `record_related`, `record_section`. The only words both accept are `record_related` and `record_section`, and neither means a record-header button. So each example drops the key instead of taking a word with a different meaning. ## Size of the published skills | Reading | Lines before | Lines after | Tokens before | Tokens after | |:--|--:|--:|--:|--:| | `skills/objectstack-ai/SKILL.md` | 487 | 486 | 6799 | 6791 | | `skills/objectstack-ui/SKILL.md` | 165 | 165 | 2264 | 2256 | | `skills/objectstack-ui/rules/actions.md` | 266 | 261 | 3890 | 3844 | | Bundle: all 14 `SKILL.md` files | 4959 | 4958 | 65451 | 65435 | | Authored files the ratchet prices | n/a | n/a | 199689 | 199627 | Net change under `skills/`: 1 line added, 7 removed. Tokens are the ratchet's own count, `ceil(utf8 bytes / 4)` with the release-stamp line left out. ## Tests **Update at head `78295ae3`.** Two real merges of `main` (`d7c3960e`, then `e5898ad9` on `4de4e3e9`) and one changeset commit. Net diff against `main`: 4 files, +18 / −8, `skills/` net −5. The two `objectstack-ui` rows measure 2256 and 3844 on the merged tree. `check:skill-examples` exits 0 with 351 examples (the one that left is Ask AI). `check:skill-served-sections`, the ratchet and its `--self-test` exit 0. Merge delta reports are on #37895; the review records are on this PR. The size table and readings below are the first measurement and still count the `objectstack-ai` row. The readings below are at head `661e8e90`, on base `f926dfab` (origin/main when the worktree was made). <details> <summary>Main-based tree: the two spec gates and the token ratchet</summary> - `pnpm --filter @objectstack/spec run check:skill-examples`: exit 0. `352 prose examples type-check across 3 surface(s)`. - `pnpm --filter @objectstack/spec run check:skill-served-sections`: exit 0. `24 served section(s), each heading exactly once in its file (6 json, 2 json+ts, 16 neutral); 10 JSON fence(s) parse and pass their spec validators.` - `node scripts/check-skills-token-ratchet.mjs`: exit 0. `61 authored bundle file(s) within their ceilings`. Before the three rows moved it was exit 1, `3 of 114 published bundle file(s) failed their check`, each row above its measurement (by 8, 8 and 46). - `node scripts/check-skills-token-ratchet.mjs --self-test`: exit 0. `111 cases pass`. - `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 scripts/platform-catalog.test.ts` (the one test file that names the ratchet script): `Test Files 1 passed (1)`, `Tests 20 passed (20)`. </details> <details> <summary>#37929's branch at e3b2ea9: red before these edits, green with them</summary> Method: a second worktree, detached at `e3b2ea95`. `@objectstack/spec`, `@objectstack/client` and `@objectstack/client-react` were built there (turbo, 47 tasks). The gates ran once on the untouched tree, as the control. Then this PR's `skills/` diff was applied with `git apply`, and the gates ran again. The two `objectstack-ui` files were byte-identical to this PR's head after the apply. - Control, `check:skill-served-sections`: exit 1. `skills/objectstack-ui/SKILL.md § Actions: JSON fence 1 is refused as Action: locations.0`. - Control, `check:skill-examples`: exit 1. Eight `TS2322` errors, at `skills/objectstack-ai/SKILL.md:189:15` and `skills/objectstack-ui/rules/actions.md` 69:15, 69:32, 96:15, 96:32, 180:15, 205:15, 239:15. - With the edits, `check:skill-served-sections`: exit 0. `10 JSON fence(s) parse and pass their spec validators.` - With the edits, `check:skill-examples`: exit 0. `352 prose examples type-check across 3 surface(s)`. The token ratchet on that tree stays red on that branch's own three rows until main, with this PR in it, is merged there. That is not a reading about this PR. </details> <details> <summary>Derived gate families: 68 derived, 67 run, 1 not measured</summary> `node scripts/pm/dispatch-gates.mjs --commands` derived 68 commands for the 5 changed paths. Each was run with its exit code recorded before any pipe, and `--ran` answered: `68 derived famil(ies) accounted for — 67 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)`. - 67 commands: exit 0. - NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: exit 3, `PREREQUISITE NOT MET`. It reads the `dist/` of every package and this tree built only the three packages above. The diff changes no package source, so this one is CI's. - `check:skill-examples` is outside the derived list; it was run because the order names it. </details> ## Acceptance notes - **The examples now show an action with no placement.** The text above them still says that an action with neither `locations` nor a list view naming it renders nowhere, and the Ask AI paragraph still says to declare the action in `locations`. An action copied from one of these seven examples as it stands draws the `action-no-placement` warning at `os validate` and no button. No sentence was added to say so: the order set a budget of zero added lines and no new word. PR 2 gives each of the six examples its placement again, in the new words. Carrier: PR 2 on this card. - **The token rows are banked.** The three ceilings are 62 tokens lower in total. When PR 2 writes `locations` back, those three files grow again. The ratchet's header gives one path for a row to go up: restatement cut from the same file first, then the measured remainder, with the standing ruling quoted in the PR body. - **The sibling branch landed first.** C1s #37937 (`4de4e3e9`) deleted the whole Ask AI block. The merge `e5898ad9` keeps `main`'s `skills/objectstack-ai/SKILL.md` byte for byte, so this PR no longer touches that file, and the ratchet row stays `main`'s 6609. - **Old words that stay.** `git grep` for the four retired words under `skills/` still finds prose, the location table and eval fixtures. They are not compiled and they are PR 2's. - **Main moved after the base.** origin/main went from `f926dfab` to `a3c229ea` during the run. None of the five files changed there and `git merge-tree` reports a clean merge. The readings above were not repeated on the merged tree. ## Verification Read first, by risk: 1. `skills/objectstack-ui/SKILL.md`, the hunk at line 136. This JSON is served to clients by the hosted door, and it is the one example in a section whose headline is that a write button needs a placement. 2. `skills/objectstack-ui/rules/actions.md`, the hunks at lines 69 and 96. Each dropped two words, a header placement and a row placement. 3. `scripts/check-skills-token-ratchet.mjs`, the three rows. Each new number is the gate's own measurement. Two-minute check, no build needed: `pnpm --filter @objectstack/spec run check:skill-served-sections`. Expect the last line to end with `10 JSON fence(s) parse and pass their spec validators.` and exit 0. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No schema changes.) - [x] 2. Every name I added uses the casing for its kind. (No name added.) - [x] 3. No formatter ran. `pnpm lint` is CI's on this PR. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: not touched. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibztwLPZEpzDMBn2GM6 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0b87f12 commit b492198

4 files changed

Lines changed: 18 additions & 8 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the checked action examples no longer carry a `locations` key
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Six examples drop their `locations` key: the "Mark as done" JSON in `skills/objectstack-ui/SKILL.md` (Actions), and five `defineAction` examples in `skills/objectstack-ui/rules/actions.md` (`crm_reassign_lead`, `crm_convert_lead`, `crm_print_a3`, `crm_open_invoice_pdf`, `crm_add_invoice_line`). Nothing an author can write changes, and the text around the examples is as it was: an action still draws only where its `locations` or a list view places it, so an action copied from one of these examples needs its `locations` added. Two token ceilings follow their files down to the measurement (2264 to 2256, 3890 to 3844).

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,9 @@ export const CEILINGS = new Map([
10901090
// (-41 bytes). Net shrink, so no raise: the ceiling follows the file down to the
10911091
// measurement, 9133 bytes (9113 priced) -> 9107 (9087 priced) -> 2272 tokens.
10921092
// ceil(($(wc -c < skills/objectstack-ui/SKILL.md) - 20) / 4) == ceil(9087 / 4)
1093-
['skills/objectstack-ui/SKILL.md', 2264], // -8 to the measurement (was 2272)
1093+
// 2264 -> 2256: the Actions JSON fence drops its `locations` key (32 bytes), so it parses
1094+
// under both action location vocabularies; the row follows the measurement down.
1095+
['skills/objectstack-ui/SKILL.md', 2256], // -8 to the measurement (was 2264)
10941096
// 8333 -> 6193: RE-LOCK at the landed count after the #19715 split (decision
10951097
// batch #213 item 1, maintainer 「1 2 4 同意」): the worked R1, the report
10961098
// template and the v17-canonical shapes block moved VERBATIM into
@@ -1659,7 +1661,10 @@ export const CEILINGS = new Map([
16591661
// measured remainder only. Same ruling (2026-10-27, tap A): 「A:先削重复,余额按实测提高」
16601662
// (ruling record 6513306068, letter B).
16611663
// ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(15559 / 4)
1662-
['skills/objectstack-ui/rules/actions.md', 3890],
1664+
// 3890 -> 3844: five checked examples drop their `locations` line (186 bytes), so each
1665+
// compiles under both action location vocabularies; the row follows the measurement down.
1666+
// ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(15373 / 4)
1667+
['skills/objectstack-ui/rules/actions.md', 3844],
16631668
// 6090 -> 6252 (#19715, card item 4): a 5-line table of contents at the top,
16641669
// anchors to the file's existing headings, nothing else changed. +162 tokens,
16651670
// zero headroom to absorb any of it, ceiling +162. Maintainer ruling

‎skills/objectstack-ui/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ reports success and changes nothing. Call the API, with the option `value`,
133133
never its label ([Actions](./rules/actions.md)):
134134

135135
```json
136-
{ "name": "mark_done", "label": "Mark as done", "objectName": "task", "locations": ["record_header"],
136+
{ "name": "mark_done", "label": "Mark as done", "objectName": "task",
137137
"type": "script", "body": { "language": "js", "capabilities": ["api.write"],
138138
"source": "await ctx.api.object('task').update({ id: ctx.recordId, status: 'done' });" } }
139139
```

‎skills/objectstack-ui/rules/actions.md‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export const ReassignLeadAction = defineAction({
6666
objectName: 'lead',
6767
type: 'api',
6868
target: 'lead',
69-
locations: ['record_header', 'list_item'],
7069
disabled: P`record.status == "converted"`,
7170
disabledReason: 'A converted lead is reassigned from its opportunity.',
7271
params: [{ field: 'owner_id', required: true }],
@@ -93,7 +92,6 @@ export const ConvertLeadAction = defineAction({
9392
icon: 'arrow-right-circle',
9493
type: 'flow',
9594
target: 'crm_lead_conversion',
96-
locations: ['record_header', 'list_item'],
9795
visible: P`record.status == "qualified" && record.is_converted == false`,
9896
confirmText: 'Convert this lead?',
9997
successMessage: 'Lead converted.',
@@ -177,7 +175,6 @@ export const PrintA3Action = defineAction({
177175
type: 'url',
178176
target: '/print/a3?id=${ctx.recordId}', // interpolated at click
179177
openIn: 'new-tab',
180-
locations: ['record_header'],
181178
});
182179
```
183180

@@ -202,7 +199,6 @@ export const OpenInvoicePdfAction = defineAction({
202199
target: 'crm_open_invoice_pdf',
203200
opensInNewTab: true,
204201
newTabUrl: '/api/v1/invoice/{recordId}/pdf',
205-
locations: ['record_header'],
206202
});
207203
```
208204

@@ -236,7 +232,6 @@ export const AddInvoiceLineAction = defineAction({
236232
label: 'Add Line',
237233
objectName: 'invoice',
238234
type: 'script',
239-
locations: ['record_header'],
240235
params: [
241236
{ field: 'product', objectOverride: 'invoice_line', required: true },
242237
{ field: 'quantity', objectOverride: 'invoice_line', required: true },

0 commit comments

Comments
 (0)