Repository navigation
Commit cad3030
docs(skills): teach the action locations that say what an action acts on (#38104)
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)_
Fixes #37895
This is PR 2 of 2 on that card. PR 1 was #37947 (merged as `b4921982`);
#37929 put the new words on `main` as `58b513a6`.
**Ordering: this must land before the next `next` prerelease is cut**
(serial note 7227457027 on the card). `main` has refused the four
retired location words since `58b513a6`, and the published skills still
teach them. A prerelease cut before this lands ships skills that teach
words its own save door refuses.
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:写应用的 AI
助手读到的「按钮放在哪里」说明换成了新词,只说按钮作用在列表上还是一条记录上;六个按钮示例重新写明了位置。
- 为什么做:「按钮位置改用新词」这项工作已经合入主线,旧的四个位置词保存时会被拒绝,而技能包还在教旧词。
- 出错会怎样:照技能包写按钮的 AI 助手会写出保存不了、或者哪里都不显示的按钮;本改动只动说明文字和示例,可以直接撤回。
- 要你做什么:在下一个预发布版本切出之前合并本改动(技能包属于要你亲手合并的范围)。
## What changes
The published skills teach the action `locations` vocabulary that
`@objectstack/spec` 19 accepts: `list` (acts on no record) and `record`
(acts on one record: the record page and each list row), with the narrow
words `record_page`, `record_row`, `record_related` and
`record_section`. Vocabulary ruling on #36495, verbatim: 「照卡上这套」
(7213827153).
| File | Change |
|:--|:--|
| `skills/objectstack-ui/rules/actions.md` | The location table's four
page-part rows become `list`, `record`, `record_page`, `record_row`. One
line under the table names what replaced each old word. The
`actionLayout` paragraph says the `record` arm takes `record` /
`record_page` actions and the `list` arm takes `list` actions, which is
what `validateObjectActionLayout` enforces. The `defaultFromRow`
sentence names `record` / `record_row`. Five checked examples declare
`locations` again. The opening sentence is cut (see the token rows). |
| `skills/objectstack-ui/SKILL.md` | The "Mark as done" JSON in Actions
declares `"locations": ["record"]`. Nothing else changes: against `main`
the file differs by that key alone. |
| `skills/objectstack-ui/rules/record-page.md` | A `record_section`
action that must show on the standard page also lists `record_page`. |
| `skills/objectstack-formula/SKILL.md` | "a list row" in place of the
retired word in the sparse-row paragraph. |
| `skills/objectstack-ui/evals/views-apps-actions-pages.json` | Cases 3,
14, 24 and 26 expect the new words. Case 3's `must_contain` token is
`'record'`. |
| `skills/objectstack-ui/evals/record-page.json` | Case 3:
`placedActions: true` draws the actions placed at `record` or
`record_page`. |
| `scripts/check-skills-token-ratchet.mjs` | Three rows move to their
measurements (below). |
| `.changeset/37895-skills-action-locations-acted-on.md` | `patch` for
`@objectstack/skills`. |
`skills/objectstack-ai` is not touched: no Ask AI example and no
placement is written back there.
### The word each example takes
| Example | Before PR 1 | Now | Drawn |
|:--|:--|:--|:--|
| `crm_reassign_lead` | `record_header`, `list_item` | `record` | as
before |
| `crm_convert_lead` | `record_header`, `list_item` | `record` | as
before |
| `crm_print_a3` | `record_header` | `record_page` | as before |
| `mark_done` (SKILL.md JSON) | `record_header` | `record` | also on
each list row |
| `crm_open_invoice_pdf` | `record_header` | `record` | also on each
list row |
| `crm_add_invoice_line` | `record_header` | `record` | also on each
list row |
The first three are the lossless conversion
(`action-locations-acted-on`). The last three were header-only and now
take `record`. This is a judgement, and the alternative is `record_page`
on those three lines:
- The spec's docblock calls `record` "the word an action that acts on a
record writes by default", and the ruled vocabulary treats the other
four as exception words. Nothing in these three examples, or in eval
case 14's prompt (a "button on `task` records"), limits the action to
the record page.
- An agent copies the placement it sees. With `record_page` on four of
six examples, agent-written apps would use an exception word as the
norm.
- None of the three carries a `visible` or `disabled` predicate, so the
sparse list row adds no risk to them.
- `crm_print_a3` keeps `record_page`: N1 asks for its placement back,
and it gives the file one checked example of a narrow word in the
`record` arm.
Eval cases 24 and 26 use `record_page`: case 24 describes existing
header actions, and case 26's prompt asks for a button "on the record
page".
## Why
#37929 retired `list_toolbar`, `list_item`, `record_header` and
`record_more` on `main`. The skills are what an agent reads before it
writes an action, so an agent following them wrote a word that validate
and save refuse. PR 1 had also left six examples with no placement at
all, which made the `actionLayout` example beside them an error (N1).
## Acceptance checklist
- [x] Card: `git grep -nE
"record_header|record_more|list_item|list_toolbar" -- skills/` returns
one line, `skills/objectstack-ui/rules/actions.md:28`, the line that
names the conversion.
- [x] Card: eval expected outputs use the new words; the token rows
follow the measurement; the skills checks pass (Tests).
- [x] N1 (7218905729): `crm_convert_lead` and `crm_print_a3` are placed
in the `record` arm's scope again. A probe that runs
`@objectstack/lint`'s two rules over the examples as written reports 2
`object-action-layout-not-placed` on `main` and 0 at this head.
- [x] N2 as corrected in 7221834136: six examples declare a placement
again, and the eval cases that expected the old words moved with them.
Nothing is written back into `skills/objectstack-ai`; its eval case 10
still refuses `locations:`.
- [x] Ordering (7227457027): stated at the top of this body.
## Size of the published skills
| Reading | Lines before | Lines after | Tokens before | Tokens after |
|:--|--:|--:|--:|--:|
| `skills/objectstack-ui/rules/actions.md` | 262 | 268 | 3844 | 3918 |
| `skills/objectstack-ui/SKILL.md` | 165 | 165 | 2256 | 2262 |
| `skills/objectstack-ui/rules/record-page.md` | 64 | 64 | 990 | 990 |
| `skills/objectstack-formula/SKILL.md` | 485 | 485 | 6090 | 6088 |
| `skills/objectstack-ui/evals/views-apps-actions-pages.json` | 275 |
275 | not ratcheted | not ratcheted |
| `skills/objectstack-ui/evals/record-page.json` | 119 | 119 | not
ratcheted | not ratcheted |
| Bundle: all 14 `SKILL.md` files | 4936 | 4936 | 65337 | 65341 |
| Authored files the ratchet prices | n/a | n/a | 199591 | 199669 |
| Eval fixtures (measured, not ratcheted) | n/a | n/a | 88563 | 88550 |
Net change under `skills/`: 26 lines added, 20 removed, **+6** against a
budget of +6. Tokens are the ratchet's own count, `ceil(utf8 bytes / 4)`
with the release-stamp line left out.
### Token rows
- `skills/objectstack-ui/rules/actions.md` **3844 to 3918 (+74)**, by
the standing maintainer ruling of 2026-10-27, verbatim: 「A:先削重复,余额按实测提高」
(ruling record 6513306068, letter B). Restatement cut first, in the same
file: the opening "Actions are user-triggered operations on an object or
a view." (62 bytes; the paragraph under it says how `objectName` binds
an action to an object and how a view names one). The new text adds 359
bytes, of which 130 are the five `locations` lines PR 1 took out as 186.
The file is 15373 to 15670 bytes, and the row is pinned at the
measurement. It is 28 above the 3890 the row held before PR 1.
- `skills/objectstack-ui/SKILL.md` **2256 to 2262 (+6)**, by the same
standing ruling, verbatim: 「A:先削重复,余额按实测提高」 (ruling record 6513306068,
letter B). Nothing is paid down: the file has no restatement to cut, and
the seat ruled at 2026-11-28T02:42Z that the gallery phrase " over an
image, avatar or file field" teaches and stays (ruling on the card). The
+25 bytes are the `"locations": ["record"],` key PR 1 removed as 32
bytes; the file is 9050 to 9075 bytes (9048 priced), and the row ends 2
under the 2264 it held before this card.
- `skills/objectstack-formula/SKILL.md` 6090 to 6088: 7 bytes shorter;
the row follows it down.
- `skills/objectstack-ui/rules/record-page.md`: 990, unchanged (the two
words have the same length).
## Tests
The gates below were re-run at head `a7aee8ef` (the seat's 02:42Z
rework, which restored one phrase in `skills/objectstack-ui/SKILL.md`
and moved its row); the branch's diff against `main` (`f72f3353`) was
empty before the first edit. The placement probe, the `platform-catalog`
test and the eval dry run were read at `27cb6e21`; the rework touches no
example, fixture or script logic.
<details>
<summary>Skills gates: all exit 0</summary>
`@objectstack/spec`, `@objectstack/client` and
`@objectstack/client-react` were built first (turbo, 47 tasks, 0 cached,
`VERDICT command-exit 0`).
- `pnpm --filter @objectstack/spec run check:skill-examples`: exit 0.
`351 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.`
- `pnpm --filter @objectstack/spec run check:skill-docs`: exit 0. `Skill
docs in sync`.
- `pnpm --filter @objectstack/spec run check:skill-refs`: exit 0. `10
generated files in sync with packages/spec`.
- `node scripts/check-skills-token-ratchet.mjs`: exit 0. `61 authored
bundle file(s) within their ceilings`. On the first commit, before the
rows moved, it was exit 1, `3 of 114 published bundle file(s) failed
their check`; at this head the three rows sit at their measurement
(3918, 2262, 6088).
- `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 21 passed (21)`.
- `pnpm --filter @objectstack/scenarios skill-evals --dry-run --skills
objectstack-ui` (the strict reader of the eval fixtures; no model call):
exit 0, `objectstack-ui: 51 case(s)`.
- `pnpm check:nul-bytes`: exit 0.
</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 8 changed paths. Each ran 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.
- Outside the derived list, run because the order names them:
`check:skill-examples`, `check:skill-refs`, the `platform-catalog` test
and the eval reader's dry run.
- `pnpm --dir ui run check:skill-eval-tokens` exits 0, but it scans the
`skills/objectui` bundle only. It is no reading about the fixtures this
PR edits.
- `pnpm check:dev-prereqs` (local-only family) exits 1: 63 of 110
packages have no `dist/` here, which is the targeted build above and
nothing about this diff.
</details>
<details>
<summary>Does any gate check the examples for a missing or misplaced
placement? No.</summary>
- `check:skill-examples` type-checks the marked TypeScript blocks. An
action with no `locations` compiles.
- `check:skill-served-sections` parses the JSON fences with the spec
schema. `locations` is optional there.
- `action-no-placement` and `object-action-layout-not-placed` are
`@objectstack/lint` rules. They run in `os validate`, `os build` and `os
lint` over a whole stack, and no gate feeds them the skill examples.
One-off probe (not committed): it reads the `defineAction` blocks of
`rules/actions.md`, the Actions JSON fence of `SKILL.md` and the
`actionLayout` example at a git ref, builds a stack from them, and calls
`validateActionLocations` and `validateObjectActionLayout` from the
built `@objectstack/lint`.
| Ref | `action-no-placement` | `object-action-layout-not-placed` |
|:--|:--|:--|
| `origin/main` (`f72f3353`) | 7 | 2 (`record.pinned[0]`,
`record.more[0]`) |
| `27cb6e21` (examples unchanged at `a7aee8ef`) | 1
(`crm_create_campaign`) | 0 |
`crm_create_campaign` has never carried `locations`: a list view's
`bulkActions` places it by name, and the probe's stack has no view.
</details>
## Acceptance notes
- **PR 1's changeset is not edited.** It says an action copied from one
of the six examples needs its `locations` added. This PR's changeset
says that it replaces that note. Both ship in the same release.
- **The branch.** The remote branch was absent when this run started:
`git ls-remote` listed no such head, and `refs/pull/37947/head` still
held `78295ae3`. The work starts from `78295ae3` plus a real merge of
`main` (`b8b31cca`), and the first push created the branch again, with
no force.
- **NOT MEASURED: a skill-evals round** (the with-skill and no-skill
pass rates), reason: it needs a Claude Code login and model calls, and
it is not a merge gate.
- **Case 3's token.** `'record'` is single-quoted, as the file's other
code tokens are. An answer that writes `['record_page', 'record_row']`
is valid metadata and fails the token. The old token, `record_header`,
had the same limit.
- **Not changed, outside this card:** `rules/actions.md` line 3 says
"the six types", and the Action Types table it links to has seven rows.
`content/docs/protocol/objectui/actions.mdx` says the console does not
draw `record_related` yet, while `RelatedRecordActionsBridge.tsx` reads
it; this is a reading of the source and was not exercised.
- **Main moved after the merge.** `origin/main` went from `f72f3353` to
`93fa9118` during the run (two commits: `packages/runtime`, a changeset,
and the lockfile and workspace files). Neither touches a file of this
PR, and the branch was not merged again. At `a7aee8ef`, `origin/main` is
`6e06729a`; `git merge-tree` with it is clean and the PR reads
`mergeable_state: clean`.
## Verification
Read first, by risk:
1. `skills/objectstack-ui/rules/actions.md`: the location table hunk,
and the `locations` line of each of the five examples (the word chosen
for the three header-only ones).
2. `scripts/check-skills-token-ratchet.mjs`: the two raises, the
`rules/actions.md` row (3844 to 3918) and the
`skills/objectstack-ui/SKILL.md` row (2256 to 2262).
3. `skills/objectstack-ui/evals/views-apps-actions-pages.json`: case 3's
`must_contain`.
Two-minute check: run `git grep -nE
"record_header|record_more|list_item|list_toolbar" -- skills/`. Expect
exactly one line, `skills/objectstack-ui/rules/actions.md:28`, which
begins "Until protocol 19:".
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No schema is touched.)
- [x] 2. Every name I added uses the casing for its kind. (No name is
added.)
- [ ] 3. No formatter ran; `pnpm lint` passes. (No formatter ran. `pnpm
lint` is CI's run and was not run locally.)
- [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: its generated artifacts are
regenerated and committed. (Not touched; `check:skill-docs` and
`check:skill-refs` are in sync.)
- [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. (The maintainer's
rulings are quoted in their own words, and the quick-read section is the
house form.)
- [ ] The *Before Submitting* list in CONTRIBUTING.md is done. (All but
`pnpm lint`, as item 3.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L9qibztwLPZEpzDMBn2GM6
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent e606bab commit cad3030
8 files changed
Lines changed: 74 additions & 23 deletions
File tree
- .changeset
- scripts
- skills
- objectstack-formula
- objectstack-ui
- evals
- rules
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
833 | | - | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
834 | 837 | | |
835 | 838 | | |
836 | 839 | | |
| |||
1142 | 1145 | | |
1143 | 1146 | | |
1144 | 1147 | | |
1145 | | - | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
1146 | 1159 | | |
1147 | 1160 | | |
1148 | 1161 | | |
| |||
1714 | 1727 | | |
1715 | 1728 | | |
1716 | 1729 | | |
1717 | | - | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
1718 | 1747 | | |
1719 | 1748 | | |
1720 | 1749 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | | - | |
| 236 | + | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
0 commit comments