You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 19b5b42
Browse filesBrowse the repository at this point in the historyBrowse files
docs(skills): show the reasons list shape on the actions page; narrow two hook-page claims
Contract review on #37407: actions.md now writes the list throw's shape and
its closing line; data-hooks.md says the HTTP doors (not every door) answer
details.refusals, and names a non-list reasons as a 500 too.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
Copy file name to clipboardExpand all lines: .changeset/37407-skills-multi-reason-refusal.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,4 +7,4 @@ docs(skills): data hooks and actions teach the multi-reason refusal throw
7
7
Clause-②: no (published prose only; teaches the list throw already on main)
8
8
Metadata-protocol: none
9
9
10
-
`skills/objectstack-data/references/data-hooks.md` (Declared refusals) now teaches the list form beside the single `reason`: throw `reasons: [{ reason, params? }, …]`; each line is translated and filled from its own `params`; `userMessage` joins the lines and closes with the entry's `message`, filled from the throw's top-level `params` (else its holes render empty); every door answers `details.refusals`. It says how an entry declares `reasons` (a snake_case reason to `{ message }` only; another status needs another code), that every listed reason must be declared (refused at save when literal, a `500` at run), and that `reason` beside `reasons`, an empty list or a malformed element is a `500`. `skills/objectstack-ui/rules/actions.md` (Refusing by code) points an action's body at the same list. Both files sat at zero token headroom, so the words are paid for by tightening prose in the same file; no fact is removed (one redundant `condition` example and a sample field go).
10
+
`skills/objectstack-data/references/data-hooks.md` (Declared refusals) now teaches the list form beside the single `reason`: throw `reasons: [{ reason, params? }, …]`; each line is translated and filled from its own `params`; `userMessage` joins the lines and closes with the entry's `message`, filled from the throw's top-level `params` (else its holes render empty); the HTTP doors answer `details.refusals`. It says how an entry declares `reasons` (a snake_case reason to `{ message }` only; another status needs another code), that every listed reason must be declared (refused at save when literal, a `500` at run), and that a `reasons` that is not a non-empty list of `{ reason, params? }`, or one beside `reason`, is a `500`. `skills/objectstack-ui/rules/actions.md` (Refusing by code) shows an action's body the same list shape, `reasons: [{ reason, params? }, …]` instead of `reason`, closed by the code's `message`, and points at the hook section for the rules. Both files sat at zero token headroom, so the words are paid for by tightening prose in the same file; no fact is removed (one redundant `condition` example and a sample field go).
Copy file name to clipboardExpand all lines: skills/objectstack-ui/rules/actions.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ in `language: 'js'` (an `expression` body has no I/O) with
21
21
|:-----------------|:--------|
22
22
|`record_header`| Detail page header |
23
23
|`record_more`| Detail page overflow menu (⋯) |
24
-
|`record_related`| Related-list section inside a record |
24
+
|`record_related`| Related-list section in a record |
25
25
|`record_section`| Body section/tab of a record |
26
26
|`list_item`| Per-row action in list views |
27
27
|`list_toolbar`| Toolbar button; one ticked row is its `recordId`, several are refused (no `_selectedIds`) |
@@ -42,8 +42,8 @@ there: a wrong name draws nothing.
42
42
43
43
## Visibility, Disable & Feedback
44
44
45
-
-`visible` — a bare CEL predicate over the current record (prefer the `P\`...\`` template; `record.<field>` resolves identically on every surface, never `${…}`- or `{…}`-wrapped — see `objectstack-formula`); when false the action is **hidden**.
46
-
-`disabled` — `boolean`**or** a CEL predicate; when true the action**shows but greys out**. A bare field ref in either (`done` for `record.done`) fails `os validate`.
45
+
-`visible` — a bare CEL predicate over the current record (prefer the `P\`...\`` template; `record.<field>` resolves identically on every surface, never `${…}`- or `{…}`-wrapped — see `objectstack-formula`); when false it is **hidden**.
46
+
-`disabled` — `boolean`**or** a CEL predicate; when true it**shows but greys out**. A bare field ref in either (`done` for `record.done`) fails `os validate`.
47
47
-`disabledReason` — an I18nLabel (a sentence or an inline locale map) a greyed action shows as its hover title and accessible description. Display-only: never a predicate or a gate (the hook or permission still refuses). Omit it to keep the console's default "Not available for this record"; a blank one is refused, and `disabledMessage` / `disabledTooltip` / `disabledHint` / `disabledText` are refused naming this key. The reason goes here, not in `description`.
48
48
-`pressed` — a CEL predicate over the same scope as `visible` that marks the action as already done by this reader: while TRUE the record header draws it pressed (`aria-pressed`). Display-only, never a gate; a boolean literal is refused (a constant is a style, not a reader's state), and `active` / `activeWhen` / `pressedWhen` are refused naming this key. A per-reader fact (the reader's vote) is a block the object declares under `attachedOnRead`, filled per caller by a service or `afterFind` hook, read as `has(record.viewer) && record.viewer.vote == 'helpful'`.
49
49
-`confirmText` — set for any destructive or irreversible operation; the confirm dialog of a param-less action. A registered action is refused it beside a non-empty `params` (put the question on `description`); a view's `bulkActionDefs` entry pairs the two by its own contract.
@@ -54,7 +54,7 @@ there: a wrong name draws nothing.
54
54
- Copy holes are `{{ }}`: `confirmText`, `description` and a param's `helpText` read `record`; `successMessage` and each `outcomeMessages` entry (`resent: 'Invitation resent to {{ result.email }}'`) read `result` and `record`; `errorMessage` takes none. A `bulkActionDefs` entry's `confirmText` reads `{{ count }}` and its params by bare name (`{{ tier }}`). In all of them `${record.name}`, `{name}`, logic in a hole and a blank sentence fail `os validate`.
55
55
- A param's `helpText`, like `description`, is a sentence or an inline locale map (`{ en: 'Why {{ record.name }} is paused', 'zh-CN': '暂停原因' }`); the map is how a page button's inline `action` (no bundle reaches it) writes its hint per locale.
56
56
-`undoable: true` — an **Undo** in the success toast (and `Ctrl+Z`). Snapshot: runtime on `operation: 'update'`, console on `type: 'api'`; else refused.
57
-
- A list view's `bulkActions: ['<name>']` runs the action once per ticked row. A body that writes each selected row takes that form: declare `execution: 'perRecord'` and write the row it is handed (`ctx.record`, `ctx.recordId`; `crm_create_campaign` below); a row whose run throws is listed with its message. A `bulkActionDefs` entry `{ name, operation: 'custom', execution: 'aggregate' }` runs it once for the selection. A script body or a flow receives the ids under the built-in key `params._selectedIds` (`input._selectedIds`), at most 5000 and only ids the caller can read: one the caller cannot read refuses the whole call (`404 RECORD_NOT_FOUND`) before it starts. A throw is one outcome for the selection; a return value's top-level `succeeded` or `failed` is read as a `BulkActionResult` (`@objectstack/spec/ui`), and in any other form (counts, one list) reported as unreadable.
57
+
- A list view's `bulkActions: ['<name>']` runs it once per ticked row. A body that writes each selected row takes that form: declare `execution: 'perRecord'` and write the row it is handed (`ctx.record`, `ctx.recordId`; `crm_create_campaign` below); a row whose run throws is listed with its message. A `bulkActionDefs` entry `{ name, operation: 'custom', execution: 'aggregate' }` runs it once for the selection. A script body or a flow receives the ids under the built-in key `params._selectedIds` (`input._selectedIds`), at most 5000 and only ids the caller can read: one the caller cannot read refuses the whole call (`404 RECORD_NOT_FOUND`) before it starts. A throw is one outcome for the selection; a return value's top-level `succeeded` or `failed` is read as a `BulkActionResult` (`@objectstack/spec/ui`), and in any other form (counts, one list) reported as unreadable.
0 commit comments