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
16 changes: 16 additions & 0 deletions .changeset/37895-skills-action-locations-acted-on.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@objectstack/skills': patch
---

docs(skills): the published skills teach the action `locations` words of protocol 19

Clause-②: no
Metadata-protocol: none

`skills/objectstack-ui/rules/actions.md`: the location table lists `list` (acts on no record: the list page toolbar), `record` (acts on one record, on the record page and on each list row; the default), `record_page` (the record page only), `record_row` (each list row only), `record_related` and `record_section`. One line under it names what replaced `list_toolbar`, `list_item`, `record_header` and `record_more`. The `actionLayout` paragraph says the `record` arm takes `record` / `record_page` actions and the `list` arm takes `list` actions.

The six examples that had dropped their `locations` key declare a placement again: `"locations": ["record"]` on the "Mark as done" JSON in `skills/objectstack-ui/SKILL.md`; `['record']` on `crm_reassign_lead`, `crm_convert_lead`, `crm_open_invoice_pdf` and `crm_add_invoice_line`; and `['record_page']` on `crm_print_a3`. This replaces the earlier note in this release, which said that an action copied from one of them needs its `locations` added.

`skills/objectstack-ui/rules/record-page.md` and `skills/objectstack-formula/SKILL.md` each change one sentence to the new words, and five eval cases under `skills/objectstack-ui/evals/` expect them. Nothing an author can write changes: these are the words `@objectstack/spec` 19 already accepts.

Token ceilings: `skills/objectstack-ui/rules/actions.md` 3844 to 3918, after one restating sentence was cut from it; `skills/objectstack-ui/SKILL.md` 2256 to 2262; `skills/objectstack-formula/SKILL.md` 6090 to 6088.
35 changes: 32 additions & 3 deletions scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,10 @@ export const CEILINGS = new Map([
// 6090; the ceiling moves +82, the measured remainder only. Pinned AT the
// measurement.
// ceil(($(wc -c < skills/objectstack-formula/SKILL.md) - 20) / 4) == ceil(24357 / 4)
['skills/objectstack-formula/SKILL.md', 6090], // -53 (was 6055), then -5 A2′ (was 6002), then +11 (was 5997), then +82 (was 6008)
// 6090 -> 6088: the action `visible` / `disabled` paragraph says "a list row" where it wrote
// the retired action location word `list_item` (-7 bytes); the row follows the measurement
// down, 24384 bytes (24357 priced) -> 24377 (24350 priced) -> 6088 tokens.
['skills/objectstack-formula/SKILL.md', 6088], // -53 (was 6055), then -5 A2′ (was 6002), then +11 (was 5997), then +82 (was 6008), then -2 (was 6090)
['skills/objectstack-i18n/SKILL.md', 6333], // -11 (was 6349), then -5 A2′ (was 6338)
// 12705 -> 12984 (2026-08-31 app-repo-principles raise, see the block above).
// The largest of the five and the frame the other four are read under: what an
Expand Down Expand Up @@ -1125,7 +1128,17 @@ export const CEILINGS = new Map([
// ceil(($(wc -c < skills/objectstack-ui/SKILL.md) - 20) / 4) == ceil(9087 / 4)
// 2264 -> 2256: the Actions JSON fence drops its `locations` key (32 bytes), so it parses
// under both action location vocabularies; the row follows the measurement down.
['skills/objectstack-ui/SKILL.md', 2256], // -8 to the measurement (was 2264)
// 2256 -> 2262: the Actions JSON fence declares its placement again, in the protocol-19 word
// (`"locations": ["record"],`, +25 bytes; it had dropped the key so that it parsed under
// both vocabularies, the 2264 -> 2256 note above). No cut pays for it: the one passage
// weighed as restatement, " over an image, avatar or file field" beside `gallery` in the
// List Views kind list, was ruled teaching by the seat's review of the PR and stays, and
// nothing else in the file restates another passage. So the ruling's second half carries the
// delta: 9050 bytes (9023 priced) -> 9075 (9048 priced) -> 2262 tokens, headroom 0 before,
// ceiling +6, the measured remainder only, pinned AT the measurement (2 under the 2264 the
// row held before the fence dropped its key). Standing ruling (2026-10-27, tap A):
// 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B).
['skills/objectstack-ui/SKILL.md', 2262], // +6 to the measurement (was 2256)
// 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 @@ -1697,7 +1710,23 @@ export const CEILINGS = new Map([
// 3890 -> 3844: five checked examples drop their `locations` line (186 bytes), so each
// compiles under both action location vocabularies; the row follows the measurement down.
// ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(15373 / 4)
['skills/objectstack-ui/rules/actions.md', 3844],
// 3844 -> 3918: the file teaches the protocol-19 action location vocabulary, which says what
// an action acts on (`list`, `record`, and the narrow words `record_page`, `record_row`,
// `record_related`, `record_section`). The location table's four page-part rows become four
// rows in those words, one line under the table names what replaced each old word, the
// `actionLayout` paragraph and the `defaultFromRow` sentence name the new words, and the five
// checked examples declare a placement again (130 bytes; the 3890 -> 3844 note above is the
// 186 they dropped). PAID DOWN FIRST by 62 bytes of restatement in this file: the opening
// "Actions are user-triggered operations on an object or a view." (the paragraph under it
// says how `objectName` binds an action to an object and how a view names one). Nothing else
// in the file restates another passage, so the same ruling's second half carries the rest.
// Arithmetic: the text adds 359 bytes, the cut removes 62, so the file is 15373 -> 15670
// bytes -> 3918 tokens, headroom 0 before, ceiling +74, the measured remainder only, pinned
// AT the measurement (28 above the 3890 the row held before the examples dropped their key).
// Same ruling (2026-10-27, tap A): 「A:先削重复,余额按实测提高」 (ruling record 6513306068,
// letter B).
// ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(15670 / 4)
['skills/objectstack-ui/rules/actions.md', 3918],
// 6090 -> 6252 (#19715, card item 4): a 5-line table of contents at the top,
// anchors to the file's existing headings, nothing else changed. +162 tokens,
// zero headroom to absorb any of it, ceiling +162. Maintainer ruling
Expand Down
2 changes: 1 addition & 1 deletion skills/objectstack-formula/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ does not satisfy that gate. `has()` over an **undeclared** key stays legal: that
is its use there — telling "absent from this PATCH" apart from "explicitly null".

**The exception: action `visible` / `disabled` are client-side and sparse.**
They bind the row the client already holds, and that row — a `list_item` row
They bind the row the client already holds, and that row — a list row
above all — lacks a key when the column is outside the view's projection, when
field-level security refuses it, or when it was never written (the mongo and
memory drivers).
Expand Down
2 changes: 1 addition & 1 deletion skills/objectstack-ui/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ reports success and changes nothing. Call the API, with the option `value`,
never its label ([Actions](./rules/actions.md)):

```json
{ "name": "mark_done", "label": "Mark as done", "objectName": "task",
{ "name": "mark_done", "label": "Mark as done", "objectName": "task", "locations": ["record"],
"type": "script", "body": { "language": "js", "capabilities": ["api.write"],
"source": "await ctx.api.object('task').update({ id: ctx.recordId, status: 'done' });" } }
```
Expand Down
2 changes: 1 addition & 1 deletion skills/objectstack-ui/evals/record-page.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{
"id": 3,
"prompt": "Our account record page is a custom `kind: 'full'` page with its own tab strip. Installed packages keep adding header actions to `account` (an 'Open in billing' link, for one), and none of them ever shows in the page header. Make the header show every action placed on the account's header, including ones a package adds later, without us listing ids. None of the project's files are in this directory: write the change in your answer.",
"expected_output": "Keep the `kind: 'full'` page and its tab strip, and set `placedActions: true` on its `page:header` node: `{ type: 'page:header', properties: { placedActions: true } }`. The header then draws every action of `account` whose `locations` include `record_header` or `record_more`, read live, so a package's action appears without a page edit. No `actions` id list beside it: an authored list is the whole set, and `placedActions: true` beside one is refused. Not a return to a `slotted` page and never a `slots.tabs`.",
"expected_output": "Keep the `kind: 'full'` page and its tab strip, and set `placedActions: true` on its `page:header` node: `{ type: 'page:header', properties: { placedActions: true } }`. The header then draws every action of `account` whose `locations` include `record` or `record_page`, read live, so a package's action appears without a page edit. No `actions` id list beside it: an authored list is the whole set, and `placedActions: true` beside one is refused. Not a return to a `slotted` page and never a `slots.tabs`.",
"files": [],
"assertions": {
"must_contain": [
Expand Down
12 changes: 6 additions & 6 deletions skills/objectstack-ui/evals/views-apps-actions-pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
{
"id": 3,
"prompt": "Add a Convert action on `lead` — only for qualified, not-yet-converted leads, from the record header and each list row, launching the `crm_lead_conversion` flow — and a bulk 'Add to campaign' that asks which campaign, for the selected rows.",
"expected_output": "Two `defineAction` items. Convert: `type: 'flow'`, `target: 'crm_lead_conversion'`, `locations: ['record_header', 'list_item']`, `visible: P`record.status == \"qualified\" && record.is_converted == false`` (bare CEL, never brace-wrapped), `confirmText`, `successMessage`, `refreshAfter: true`. Bulk: `type: 'script'`, `execution: 'perRecord'`, wired by the lead list view's `bulkActions: ['<name>']`, a field-backed `params: [{ field: 'campaign_id', objectOverride: 'campaign', required: true }]`, and a `body` that runs once per ticked row and reads that row's id as `ctx.recordId`.",
"expected_output": "Two `defineAction` items. Convert: `type: 'flow'`, `target: 'crm_lead_conversion'`, `locations: ['record']`, `visible: P`record.status == \"qualified\" && record.is_converted == false`` (bare CEL, never brace-wrapped), `confirmText`, `successMessage`, `refreshAfter: true`. Bulk: `type: 'script'`, `execution: 'perRecord'`, wired by the lead list view's `bulkActions: ['<name>']`, a field-backed `params: [{ field: 'campaign_id', objectOverride: 'campaign', required: true }]`, and a `body` that runs once per ticked row and reads that row's id as `ctx.recordId`.",
"files": [],
"assertions": {
"must_contain": ["defineAction", "locations", "record_header", "bulkActions", "visible", "successMessage", "ctx.recordId"],
"must_contain": ["defineAction", "locations", "'record'", "bulkActions", "visible", "successMessage", "ctx.recordId"],
"must_not_contain": ["{record.", "input.selectedIds"]
}
},
Expand Down Expand Up @@ -134,7 +134,7 @@
{
"id": 14,
"prompt": "Add a 'Mark as done' button on `task` records that sets `status` to Done (the option is labelled Done, its value is `done`).",
"expected_output": "A `defineAction`, not a view: `name`, `label: 'Mark as done'`, `objectName: 'task'`, `locations: ['record_header']`, `type: 'script'`, `body: { language: 'js', source: \"await ctx.api.object('task').update({ id: ctx.recordId, status: 'done' });\", capabilities: ['api.write'] }`, `refreshAfter: true`. The body CALLS the update with the option value: a body that returns `{ status: 'done' }` or assigns to `ctx.record` writes nothing, an `expression` body cannot write, and without `api.write` the sandbox refuses the call.",
"expected_output": "A `defineAction`, not a view: `name`, `label: 'Mark as done'`, `objectName: 'task'`, `locations: ['record']`, `type: 'script'`, `body: { language: 'js', source: \"await ctx.api.object('task').update({ id: ctx.recordId, status: 'done' });\", capabilities: ['api.write'] }`, `refreshAfter: true`. The body CALLS the update with the option value: a body that returns `{ status: 'done' }` or assigns to `ctx.record` writes nothing, an `expression` body cannot write, and without `api.write` the sandbox refuses the call.",
"files": [],
"assertions": {
"must_contain": ["defineAction", "objectName: 'task'", "ctx.api.object('task').update", "ctx.recordId", "api.write", "status: 'done'"],
Expand Down Expand Up @@ -233,8 +233,8 @@
},
{
"id": 24,
"prompt": "`crm_opportunity` has five record actions, all placed at `record_header`: `mark_won`, `mark_lost`, `clone`, `share`, `archive`. The team wants Mark Won, Mark Lost, Clone and Share as header buttons in that order, Archive under More, and on the list page Export as a button after the `mass_assign` toolbar action. Write the metadata that does this.",
"expected_output": "One key on the object, no page file and no edit to any action: `actionLayout: { record: { pinned: ['mark_won', 'mark_lost', 'clone'], more: ['share', 'archive'] }, list: { pinned: ['mass_assign', '$export'] } }`. The answer says an arm pins at most three buttons, so the fourth requested button, Share, leads `more` instead (a fourth name in `pinned` is refused). The `record` arm holds for the record page, the side preview and the phone action bar alike. `$export` is the list page's built-in, named only in the `list` arm's `pinned`; `mass_assign` must be placed at `list_toolbar` or `os validate` refuses the name. Not four names in `pinned`, not an `order` renumbering on each action (shared by every surface, and it names no buttons), not `$export` in `more`, and not a `definePage` header listing action ids.",
"prompt": "`crm_opportunity` has five record actions, all placed at `record_page`: `mark_won`, `mark_lost`, `clone`, `share`, `archive`. The team wants Mark Won, Mark Lost, Clone and Share as header buttons in that order, Archive under More, and on the list page Export as a button after the `mass_assign` toolbar action. Write the metadata that does this.",
"expected_output": "One key on the object, no page file and no edit to any action: `actionLayout: { record: { pinned: ['mark_won', 'mark_lost', 'clone'], more: ['share', 'archive'] }, list: { pinned: ['mass_assign', '$export'] } }`. The answer says an arm pins at most three buttons, so the fourth requested button, Share, leads `more` instead (a fourth name in `pinned` is refused). The `record` arm holds for the record page, the side preview and the phone action bar alike. `$export` is the list page's built-in, named only in the `list` arm's `pinned`; `mass_assign` must be placed at `list` or `os validate` refuses the name. Not four names in `pinned`, not an `order` renumbering on each action (shared by every surface, and it names no buttons), not `$export` in `more`, and not a `definePage` header listing action ids.",
"files": [],
"assertions": {
"must_contain": ["actionLayout", "pinned", "more", "$export"],
Expand All @@ -254,7 +254,7 @@
{
"id": 26,
"prompt": "Add a 'Delete Task' button on the `project_task` record page that deletes the task. Our in-app assistant must be able to run it too, but only after the user agrees, since a deleted task's time entries go with it.",
"expected_output": "One registered `defineAction` on `objectName: 'project_task'` with a placement (`locations: ['record_header']`), a body that deletes the current record (a `type: 'script'` `js` body calling `ctx.api.object('project_task').delete(...)` on `ctx.recordId`, with `capabilities: ['api.write']`), `confirmText` for the person clicking, and `ai: { exposed: true, description: '…', requiresConfirmation: true }`. `confirmText` is the click dialog's copy only and gates no AI call, so the assistant's run is held for the user's approval by `ai.requiresConfirmation: true`, not by `confirmText` or by a sentence in `ai.description` asking the model to confirm first.",
"expected_output": "One registered `defineAction` on `objectName: 'project_task'` with a placement (`locations: ['record_page']`), a body that deletes the current record (a `type: 'script'` `js` body calling `ctx.api.object('project_task').delete(...)` on `ctx.recordId`, with `capabilities: ['api.write']`), `confirmText` for the person clicking, and `ai: { exposed: true, description: '…', requiresConfirmation: true }`. `confirmText` is the click dialog's copy only and gates no AI call, so the assistant's run is held for the user's approval by `ai.requiresConfirmation: true`, not by `confirmText` or by a sentence in `ai.description` asking the model to confirm first.",
"files": [],
"assertions": {
"must_contain": ["requiresConfirmation: true", "exposed: true", "confirmText", "project_task"],
Expand Down
Loading
Loading