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 468672a
Browse filesBrowse the repository at this point in the historyBrowse files
<!-- claude-projects-attribution: {"github_login":"hotlong"} -->
_Requested by **Jack** · [project
thread](https://claude.ai/code/project/chan_01EF41AQooqveF2DGD8nqPzS?thread=cmsg_01EF41AQooqveF2DGD8nqPzSUuFiSNNxgHbrBe6r4uDVrg)_Fixes#37762
Clause-②: no (published prose only; teaches the confirmation flag and
the delete floor already on main)
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:智能体照技能搭建时,AI 可调用的删除类动作会打开 `ai.requiresConfirmation`(以前只写
`confirmText`,那只是点击弹窗文案,不拦 AI 调用);给私有对象授删除权时会知道默认只能删自己创建的记录,要删全组织的记录需加
`writeScope: 'org'` 或 Modify All。
- 为什么做:objectstack-ai/cloud#5080 逐项拆分里,这两条技能缺口在 9 次 door 搭建中丢了 5 分(中位数各
1 分)。
- 出错会怎样:只改技能文字和两条 eval,不动产品。两个文件原本 token 余量为
0,各删了一处重复说法,剩余按实测抬高天花板(+10、+48)。
- 要你做什么:这是受管的技能文件,需要按受管路径审批后合并。
## What changes
- `skills/objectstack-ui/rules/actions.md`, `confirmText` bullet (card
step 1, line 49 on `8b9b9d23` as the card says): `confirmText` gates no
AI call; an `ai.exposed` action also sets `ai.requiresConfirmation:
true`.
- `skills/objectstack-data/rules/security.md`, Three axes (card step 2;
`allowDelete` is taught here, not in a SKILL.md): `allowDelete` removes
only rows the caller created (`owner_only_deletes`). On a `private`
object owning the row, `writeScope: 'org'` or `modifyAllRecords` widens
it, an `edit` share never; elsewhere only an authored `delete` row
policy does.
- Evals: `objectstack-ui` views-apps-actions-pages #26 (AI-exposed
delete action), `objectstack-data` hooks-security-seeds-datasources #38
(SDR with `readScope: 'org'` + `allowDelete` gets 403 on an
admin-imported contact). The ui evals README line names the new case.
- `scripts/check-skills-token-ratchet.mjs`: two rows raised by the
measured remainder, each with its arithmetic comment.
- `.changeset/37762-…md`: `@objectstack/skills` patch.
## Premise check and deviations
- Card premises re-measured on `origin/main` `8b9b9d23`: the
`confirmText` sentence and the absence of any `requiresConfirmation` /
owner-only delete line in both skills still hold.
- Deviation from the card's wording of rule 2, read off the code: the
floor is `created_by == current_user.id`
(`plugin-security/src/platform-ownership-policies.ts`), not "rows the
user owns", and it lifts where `SharingService.checkDelete` answers
`allow` (owning the row, write depth `org`, or `modifyAllRecords`, on an
owner-scoped object). So `writeScope: 'org'` alone widens it; no extra
row policy is needed. On a public object the sharing verdict abstains
and only an authored `delete` row policy widens it, Modify All included.
This matches the scorer's reading in
`packages/qa/scenarios/src/score/scenario-tags.ts`
(`deleteFloorReading`).
- Line budget: `skills/**` prose +2 lines net (card cap +4); eval JSON
+24 lines.
## Token ratchet raise
Standing maintainer ruling 2026-10-27, verbatim and untranslated:
「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). Paid down first
in the same file:
| file | added | cut (restatement) | bytes | tokens | ceiling |
|---|---|---|---|---|---|
| `skills/objectstack-ui/rules/actions.md` | 84 B | 43 B: intro's "A
parameterized bulk mutation is `script`." (the bulk bullet and
`crm_create_campaign` show it) | 15518 → 15559 | 3890 | 3880 → 3890
(+10) |
| `skills/objectstack-data/rules/security.md` | 248 B | 59 B: the
"Prefer `member_default`" bullet's `owner_only_deletes` (now taught
above), "the built-in", "for the common cases" | 17168 → 17357 | 4340 |
4292 → 4340 (+48) |
## Local checks (on `b613af38`)
- `node scripts/check-skills-token-ratchet.mjs --self-test` :: 104 cases
pass; gate :: exit 0 (61 authored files within ceilings)
- `pnpm check:skill-identifier-liveness` :: exit 0 (565 citations)
- `pnpm check:skill-links` :: exit 0 (272 links, 140 fragments)
- `pnpm check:skill-frame-sync`, `check:skill-frame-freshness`,
`check:skill-top-level-keys` :: exit 0
- `pnpm check:empty-changeset`, `check:changeset-fixed` :: exit 0
- NOT-MEASURED `pnpm check:adr-0087-registration` :: exit 3, no
`node_modules` in this checkout (patch changeset, no ADR-0087 marker
needed)
- Both eval JSON files parse; no SKILL.md or code block changed, so
`check:skill-docs` / `check:skill-examples` are untouched.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Q4EjjNM2fYmcPyh5YXpnjJ
Co-authored-by: Claude <noreply@anthropic.com>
docs(skills): actions teach `ai.requiresConfirmation` beside `confirmText`, and permission sets teach the owner-only delete floor
6
+
7
+
Clause-②: no (published prose only; teaches the confirmation flag and the delete floor already on main)
8
+
Metadata-protocol: none
9
+
10
+
`skills/objectstack-ui/rules/actions.md` (`confirmText` bullet) says `confirmText` gates no AI call: an `ai.exposed` action that is destructive or irreversible also sets `ai.requiresConfirmation: true`. `skills/objectstack-data/rules/security.md` (Three axes) says `allowDelete` removes only rows the caller created (the platform's `owner_only_deletes` floor); on a `private` object owning the row, `writeScope: 'org'` or `modifyAllRecords` widens it, an `edit` share never does, and elsewhere only an authored `delete` row policy does. One eval case per rule (`objectstack-ui` views-apps-actions-pages #26, `objectstack-data` hooks-security-seeds-datasources #38). Both files sat at zero token headroom: one restatement per file is cut and the ceilings move by the measured remainder (+10, +48).
"prompt": "`crm_contact` is a `private` object. Our `crm_sdr` permission set already reads every contact (`readScope: 'org'`) and grants `allowDelete`, yet an SDR deleting a contact an admin imported gets a 403. SDRs must be able to delete any contact in the organization. Fix the set.",
383
+
"expected_output": "`allowDelete` alone deletes only rows the caller created: every member carries the platform's `owner_only_deletes` floor (`created_by == current_user.id`), and `readScope: 'org'` widens reads, never deletes. On a `private` object the floor lifts where the sharing service allows the delete: owning the row, a write depth of `org`, or Modify All. So the grant becomes `crm_contact: { allowRead: true, allowDelete: true, readScope: 'org', writeScope: 'org' }` (or `modifyAllRecords: true` when the set should also bypass sharing everywhere on the object). An `edit` share or a sharing rule does not help: sharing widens rows, never the delete verb.",
"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.",
257
+
"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.",
Copy file name to clipboardExpand all lines: skills/objectstack-ui/rules/actions.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,7 @@
2
2
3
3
Actions are user-triggered operations on an object or a view.
4
4
Register them under `defineStack({ actions: [...] })`; the six types:
5
-
[Action Types](../SKILL.md#action-types). A parameterized bulk mutation is
6
-
`script`.
5
+
[Action Types](../SKILL.md#action-types).
7
6
8
7
**A record button needs a placement and a body that writes.**`objectName`
9
8
folds the action into that object's surfaces: `locations` without it
@@ -46,7 +45,7 @@ there: a wrong name draws nothing.
46
45
-`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
46
-`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
47
-`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
-
-`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.
48
+
-`confirmText` — set for any destructive or irreversible operation; the confirm dialog of a param-less action. It gates no AI call: an `ai.exposed` one also sets `ai.requiresConfirmation: true`. 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.
50
49
-`submitText` — the verb on the param dialog's submit button ("Send", "Log Call") in place of "Confirm": an I18nLabel, refused blank and refused without a non-empty `params` (no dialog opens); `submitLabel` / `confirmLabel` are refused naming this key.
51
50
-`preflight` — a read the param dialog shows above the params before submit: `{ read: { url }, path?, fields?, seed? }` sends one `GET` (no other `method`, no body or credentials) to a same-origin API path (one leading `/`) whose only holes are `${param.NAME}` (a declared param; re-read when it changes), `${ctx.recordId}` and `${ctx.record.FIELD}`. `path` selects the answer's sub-tree (`data`); `fields` rows are `resultDialog.fields`' (omitted: JSON). Each `seed: [{ param, path }]` entry fills a declared param, drawn read-only and submitted as shown: seeded once, no `defaultValue` / `defaultFromRow` / `carryOver`, read by no hole; mark it `required` so Confirm waits for the answer. Refused without a non-empty `params` and beside `execution: 'aggregate'`. UX, not authorization: the endpoint still checks a seeded value.
52
51
-`resultDialog` — a one-shot dialog that shows the server answer in place of the success toast (so no `successMessage`; `outcomeMessages` is refused beside it): `{ title?, description?, acknowledge?, format?, fields? }`. `fields: [{ path, label?, format? }]`, `path` a dot path into `result.data` (omitted: the whole answer as JSON); `format` is one of `qrcode`, `code-list`, `secret`, `text`, `json`, or `table` with `columns: [{ path, label?, format? }]` (one row per element of the array at `path`, one cell per column; required with `table` and refused beside any other format). The dialog-level `format` (default `json`) and a cell's (default `text`) take every format but `table`. A `text` or `code-list` cell draws the value with no copy control; a `secret` or `qrcode` cell keeps its own.
0 commit comments