Repository navigation
Commit a64c3b8
docs(skills): objectstack-ui actions rule names the selection key a bulk body receives (#36067)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D4n2wzAmmp4Z6W5jsqtM2qx)_
Fixes #35647
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:照着界面技能写「批量操作」的作者,以前会写出一个读不到所选记录的按钮;现在技能教的是两种真正能拿到记录的接法,示例用的是「每条勾选记录执行一次」的那一种。「新标签页打开」的示例也改成了能取到当前记录的写法。
- 为什么做:属于「对外发布的技能包教的内容要和运行时一致」这条线,替按技能生成应用的作者和 AI
解决「按钮点了显示成功、实际一条都没处理」的问题。
- 出错会怎样:只改技能文字、示例和一条评测用例,不动运行时;写错的话作者拿到的仍是一段错误示例,直接回退这个 PR 即可。
- 要你做什么:无。
## What changes
State at head `a7f91e14` (round 3, four commits). One wiring story
throughout: a name in the list view's `bulkActions` runs the action once
per ticked row and the body reads that row as `ctx.recordId`; a
`bulkActionDefs` entry with `operation: 'custom', execution:
'aggregate'` runs it once and the body reads the ids as
`input._selectedIds`.
`skills/objectstack-ui/rules/actions.md` (published catalog), paid in
place:
- **Opening paragraph.** The placements a view can give an action now
read `rowActions` / `bulkActions` / `bulkActionDefs`; the placement lint
counts all three (contract record 7062828763, N2).
- **`list_toolbar` row.** It said a bulk action receives
`input.selectedIds`; no path delivers that key. The row now reads:
toolbar button; one ticked row is its `recordId`, several are refused
(no `_selectedIds`) (N1 of the same record).
- **Bulk bullet, first sentence.** Names both list-view wirings and what
each hands the body, as above.
- **`AddToCampaignAction` example.** Declares `execution: 'perRecord'`,
carries no `list_toolbar` placement (the list view names it in
`bulkActions`), and its body inserts one `campaign_member` row for
`ctx.recordId`. The loop over an id array, the `campaignId` alias and
the `return { count }` line are gone.
- **`PrintA3Action` example** (the fold row on the card: the closed card
about the new-tab example). `target` used a `record.id` hole; the runner
substitutes only the `param` and `ctx` scopes. It now uses the
`ctx.recordId` hole and sits on `record_header`, which has a record.
Changeset `.changeset/35647-ui-bulk-selected-ids.md`,
`@objectstack/skills` patch. Its sentence now reads: no bulk body
receives `input.selectedIds`; a name in `bulkActions` runs the action
once per ticked row, its body reading `ctx.recordId`; only a
`bulkActionDefs` entry with `operation: 'custom', execution:
'aggregate'` runs it once, the ids in `input._selectedIds`; plus the
new-tab example line.
Review findings of contract record 7062828763, as closed at this head:
- S1: the changeset keeps the two wirings apart (sentence above).
- S2: removed the refusal clause (contract record 7062828763).
- N1 and N2: folded in (row and opening paragraph above).
- N3 not taken: `successMessage` stays on the example.
<details><summary>Trace on origin/main 3c06fc5: what a bulk body
receives</summary>
- Toolbar button: `resolveServerActionRecordId` in
`ui/packages/core/src/actions/serverActionHandler.ts`. With no
`_selectedIds` in the bag, one ticked row becomes `recordId`, several
ticked rows are refused, none sends no record. No id array is sent under
any key.
- Per-row wiring: `ui/packages/plugin-grid/src/resolveBulkActions.ts`
promotes a `bulkActions` name to one dispatch per row;
`packages/runtime/src/sandbox/body-runner.ts` hands the body that row's
id as `ctx.recordId`.
- Aggregate wiring: `wantsAggregateResolve` in `resolveBulkActions.ts`
asks for `execution === 'aggregate'`, `operation === 'custom'` and a
name; the dispatch adds `_selectedIds` to the params, and the
body-runner sets a body's `input` to them.
- `execution` on the action: `packages/spec/src/ui/action.zod.ts`
describes `'perRecord'` as one dispatch per selected row carrying that
row's `recordId`, the `bulkActions` bare-name form.
- Placement: `packages/lint/src/validate-action-locations.ts` reads
`rowActions`, `bulkActions` and each `bulkActionDefs` entry's name.
- URL holes: `interpolateTarget` in
`ui/packages/core/src/actions/ActionRunner.ts` builds its scopes from
`param` and `ctx`.
</details>
## Evals
`skills/objectstack-ui/evals/views-apps-actions-pages.json`, case 3 only
(Convert plus bulk "Add to campaign"). It pinned the wrong teaching:
`must_contain` held `list_toolbar` and `selectedIds`, and the expected
answer read `input.selectedIds`.
- `expected_output`: the bulk action declares `execution: 'perRecord'`,
is wired by the lead list view's `bulkActions`, and its body runs once
per ticked row and reads that row's id as `ctx.recordId`.
- `must_contain`: `list_toolbar` and `selectedIds` are replaced by
`bulkActions` and `ctx.recordId`.
- `must_not_contain`: adds `input.selectedIds`.
No eval round was run (a round is the eval seat's). The prompt is
unchanged; both token lists changed, so earlier records of this case are
set apart on a regrade.
## Tests
All readings at head `a7f91e14`.
<details><summary>Token ratchet, size and line budget</summary>
- `node scripts/check-skills-token-ratchet.mjs`: exit 0.
`skills/objectstack-ui/rules/actions.md is 3701 tokens (ceiling 3711;
headroom 10)`. On the merge base `7ba22bb6ee`: 3708 tokens (14830 bytes;
now 14804). No ceiling row moved.
- `rules/actions.md` whole file: 261 lines before, 256 after. Every
`SKILL.md` summed: 4945 lines before and after (none touched).
- Ratcheted authored total 197415 tokens; eval fixtures (measured, not
ratcheted) 76671; bundle total 288685.
- PR net added lines (`git diff --numstat` against the merge base,
changeset included): 20 added, 17 deleted, net +3. Budget 15.
</details>
<details><summary>Gates run locally</summary>
- Derived list (`node scripts/pm/dispatch-gates.mjs --commands`, 47
commands): 41 run, all exit 0, each exit code captured before any pipe.
Among them the ratchet and its `--self-test`, `check-empty-changeset`,
`check-changeset-no-major`, `check-adr-0087-registration`,
`check:skill-links`, `check:skill-identifier-liveness`,
`check:skill-compatibility`, `check:skill-frame-sync`,
`check:nul-bytes`, `check:pm-skill-id-lint`, `check:doc-authoring`,
`check:role-word`, `check:corpus-claim-drift`,
`check-closing-keyword-parity`.
- `node scripts/pm/dispatch-gates.mjs --ran`: `47 derived, 41 run, 0
NOT-MEASURED, 6 UNRUN`. The six need built `dist/` trees and are left to
CI (declared narrowing): `check:doc-formula-expressions`,
`check:dts-closure`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure`, `check:published-files`,
`check:sourcemap-no-sources-content`.
- Eval file: parses as JSON, 23 cases; case 3 has every `must_contain`
token in its own `expected_output` (0 missing); 0 `must_not_contain`
hits across the file.
- `node scripts/pm/overlap-check.mjs --branch=claude/area-a4A-35647`:
`VERDICT clean exit 0`.
- Not re-run locally at this head, left to CI: `check:skill-examples`
(the fenced example blocks are byte-identical to `d2db0a8b`, where `Type
Check · source gates` concluded success) and the skill-evals vitest file
(the eval file did not move after `d2db0a8b`).
</details>
No ablation: the diff changes prose, an example and an eval fixture, no
tested behaviour.
## Acceptance notes
- The card's ask was to name the key delivered to a `list_toolbar` bulk
handler. Measured answer: a `list_toolbar` placement delivers no id
array; the selection reaches a body only through the list view's two
wirings. The text teaches those, which is wider than swapping one
spelling.
- The fold record on the card lists the new-tab example as a row of this
card; it is fixed here in place.
- A `type: 'url'` action on `list_toolbar` can still carry the selection
through the runner's `ctx.selection.ids` hole. The spec's `target`
description does not list that hole, so the skill does not teach it.
Noted, not filed.
- The example action carries no `locations`; the list view naming it is
its placement.
## Verification
Read first, by risk:
1. `skills/objectstack-ui/rules/actions.md`, the first sentence of the
bulk bullet under "Visibility, Disable & Feedback": it carries the
wiring contract.
2. Same file, `AddToCampaignAction`: `execution: 'perRecord'` and a body
that writes one row for `ctx.recordId`.
3. `skills/objectstack-ui/evals/views-apps-actions-pages.json`, case 3
token lists.
Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints
`rules/actions.md is 3701 tokens (ceiling 3711; headroom 10)` and exits
0.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5krBqrrgxCYgjXmfbv)_
<!-- signed: repo:objectstack#4 · os-project-manager ·
session_01FEkQ5krBqrrgxCYgjXmfbv -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent f5cfdd2 commit a64c3b8
3 files changed
Lines changed: 20 additions & 17 deletions
File tree
- .changeset
- skills/objectstack-ui
- evals
- rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
117 | 112 | | |
118 | 113 | | |
119 | 114 | | |
| |||
170 | 165 | | |
171 | 166 | | |
172 | 167 | | |
173 | | - | |
| 168 | + | |
174 | 169 | | |
175 | | - | |
| 170 | + | |
176 | 171 | | |
177 | 172 | | |
178 | 173 | | |
| |||
0 commit comments