Repository navigation
Commit e6e0faa
docs(skills): the actions rule, its eval and the i18n skill teach an action's
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi96X1GPgpRmHCPT8gaow65Ld)_
Fixes #26790
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:`skills/objectstack-ui/rules/actions.md` 在 `disabled` 旁加一条
`disabledReason`(I18nLabel,只做显示:灰掉的按钮悬停标题与无障碍描述;不是谓词、不是门,拒绝仍由 hook
或权限做;不写则用控制台默认句 "Not available for this record";空串拒收,`disabledMessage` /
`disabledTooltip` / `disabledHint` / `disabledText` 四个近似拼法拒收并点名正键;理由不写进
`description`),ReassignLead 示例在 `disabled` 行旁带上该键。eval 文件加第 9 题:要求
`disabledReason` 与 `disabled` 谓词并列,禁止理由落进
`description`。`skills/objectstack-i18n/SKILL.md` 分组表
`_actions.{action_name}` 行(同样适用于 `globalActions.{action_name}`)在
`confirmText` / `successMessage` 旁列出 `disabledReason`。两行 token 棘轮按裁决 A
处理;`@objectstack/skills` 补丁 changeset。
- 为什么改:PR #26786 把 `ActionSchema.disabledReason` 加进协议,卡 #26790 是它欠下的
`Skills-docs:` 后续——AI 作者照技能写 action 时不知道这把键,要么留着通用默认句,要么把理由塞进
`description`。
- 风险与回滚:只改两份技能文本、一个 eval JSON、两行棘轮上限和一个 changeset;不动 schema、运行时或任何键。回滚即
revert 本 PR。
- 先看:`skills/objectstack-ui/rules/actions.md`(L20 新条目、L43–44
示例、删掉的两条重复代码注释)、`skills/objectstack-ui/evals/views-apps-actions-pages.json`(第
9 题)、`scripts/check-skills-token-ratchet.mjs`(两行:2151 → 2259、1789 →
2009,算式在注释里)。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期
`rules/actions.md` ✓ 2259/2259、`views-apps-actions-pages.json` ✓
2009/2009、`objectstack-i18n/SKILL.md` ✓ 5485/6333,总行 `82 authored bundle
file(s) within their ceilings`。
- 需要你做的:批准本 PR(`skills/**` 受管面,Tier H)。
## What changes
Every key and sentence below is read off
`packages/spec/src/ui/action.zod.ts` on `origin/main` `4b8f8cdc` (the
`disabledReason` docblock L892–911, the blank refusal L913–919, the four
aliases L954–955, the `.describe()` L1586) and the console renderer
`ui/packages/components/src/renderers/action/disabled-reason.tsx` L88
(the default sentence); nothing is invented.
- **`skills/objectstack-ui/rules/actions.md`** (the rule an AI author of
actions reads):
- one bullet beside `disabled`: `disabledReason` is an I18nLabel (a
plain sentence or an inline locale map) a greyed action shows as its
hover title and accessible description; display-only, never a predicate
and never a gate (the hook or permission still refuses); omitted keeps
the console's default "Not available for this record"; a blank one is
refused; `disabledMessage` / `disabledTooltip` / `disabledHint` /
`disabledText` are refused naming the key; the reason goes here, not in
`description`;
- the ReassignLead example carries `disabledReason` on the line after
`disabled`, so the pair is shown once in code.
- Paid down first (ruling 「A:先削重复,余额按实测提高」): two code comments in that
example restated bullets the reader has just read and were cut, 122
bytes — `// Greys out (stays visible) once the lead is converted:`
(home: the `disabled` bullet, "shows but greys out … stay discoverable")
and `// success toast offers Undo; Ctrl+Z works too` (home: the
`undoable` bullet, "an Undo in the success toast (and Ctrl+Z)"). The
example's keys are unchanged.
- **`skills/objectstack-ui/evals/views-apps-actions-pages.json`**: case
9 asks for an Approve action on `contract` that stays visible but greyed
until `legal_review_status` is `approved`, with the rep told why;
expects `disabled: P\`record.legal_review_status != "approved"\`` beside
`disabledReason: '…'`, display-only, the reason not in `description`,
omitted = the default, blank and near-miss spellings refused.
`must_contain` `disabled:` / `disabledReason`; `must_not_contain`
`description:` / `disabledMessage` / `disabledTooltip` / `visible:`
(hiding instead of greying). No `must_not_contain` string occurs in its
`expected_output`; every `must_contain` string does. The file's cases
share no sentence, so 0 bytes of duplicate were available to cut.
- **`skills/objectstack-i18n/SKILL.md`**: the `_actions.{action_name}`
group-table row lists `disabledReason` (the sentence a greyed action
shows; absent keeps the console's default) between `successMessage` and
`params.{param_name}`; the row's closing clause already says the same
keys hold under `globalActions.{action_name}`, so that slot is covered
by the same edit. The file had headroom, so its ratchet row does not
move.
- **`scripts/check-skills-token-ratchet.mjs`**: `rules/actions.md` 2151
→ 2259 and the eval 1789 → 2009, each pinned AT the measurement with the
arithmetic and the standing ruling quoted verbatim beside the sibling
rows.
- **Changeset** `.changeset/26790-actions-disabled-reason-skills.md`:
`@objectstack/skills` patch, both declaration lines at line start.
**Skills readings** (`skills/**` touched; before = `origin/main`
`4b8f8cdc`, after = head; tokens = the ratchet's `ceil(bytes/4)`,
release-stamp line excluded):
| Reading | Before | After |
| --- | --- | --- |
| `skills/objectstack-ui/rules/actions.md` lines / bytes / tokens | 203
/ 8602 / 2151 (ceiling 2151, headroom 0) | 204 / 9035 / 2259 (ceiling
2259, headroom 0) |
| `skills/objectstack-ui/evals/views-apps-actions-pages.json` lines /
bytes / tokens | 85 / 7154 / 1789 (ceiling 1789, headroom 0) | 95 / 8034
/ 2009 (ceiling 2009, headroom 0) |
| `skills/objectstack-i18n/SKILL.md` lines / bytes / tokens | 521 /
21866 / 5462 (ceiling 6333, headroom 871) | 521 / 21957 / 5485 (ceiling
6333, headroom 848) |
| all `SKILL.md` lines / tokens (whole package, 11 files, ratchet table
sum) | 4614 / 56368 | 4614 / 56391 |
## Why
A record action greyed by `disabled` can now say why through a
translatable `disabledReason` (PR #26786, #26619 ruling A); the
console's hover title and accessible description read it and "Not
available for this record" stays the default when it is absent. An agent
authoring an action from the published skill was not told the key exists
and would leave the generic sentence in place or put the reason into
`description`, the workaround the card names. The skills lane owes this
`Skills-docs:` follow-up because `skills/**` is Tier H and stayed out of
the spec PR.
## Tests
- `node scripts/check-skills-token-ratchet.mjs` at head: `82 authored
bundle file(s) within their ceilings; 10 generator-owned file(s)
measured, not ratcheted`, exit 0; `rules/actions.md` ✓ 2259 / 2259
(headroom 0), `views-apps-actions-pages.json` ✓ 2009 / 2009 (headroom
0), `objectstack-i18n/SKILL.md` ✓ 5485 / 6333 (headroom 848).
- `node scripts/check-skills-token-ratchet.mjs --self-test`: `79 cases
pass`, exit 0.
- The eval file parses (`JSON.parse`); case 9 has no `must_not_contain`
string in its `expected_output` and every `must_contain` string in it.
- No test file edited; no forced test edit.
## Acceptance notes
- The eval is not run by any gate (there is no eval runner;
`check:skill-docs` / `check:skill-refs` / `check:skill-examples` read
`SKILL.md`, `references/` and the marked code fences). The ReassignLead
fence carries `os:check`, so `check:skill-examples` compiles the new
`disabledReason` key against the spec that now declares it.
- Eval cases 5 and 8 each spelled their own `must_not_contain` string
(`sourceView`, `${record.name}`) inside `expected_output`; round 2 (head
4092ea0) rewords both ("no deprecated source view", "a `${…}` hole
fails `os validate`"), assertions unchanged, 8036 → 8034 bytes, same
2009-token ceiling. Per-case cross-check over all 9 cases: 0 failures
(seat claim amendment 6456927584).
- The i18n skill's example bundle mirrors `examples/app-todo`, whose
`complete` action declares no `disabledReason`, so no example row was
invented; the group-table row is the teaching.
## Verification
- `node scripts/pm/dispatch-gates.mjs --tier --repo
objectstack-ai/objectstack`: `Model tier — MANDATORY` (derived from the
file surface: `skills/**` carries no one-line exemption, clause ① — the
card is `Clause-②: no`); changed lines 49 (+44 / −5, 5 files) vs the
3000 threshold.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at head `d42ad5dc` (the only commit) derived
63 commands. All 63 ran in the worktree after that commit, each as `bash
-c CMD` with stdin from /dev/null and its exit code captured before any
pipe and recorded as `CMD :: exit N`: 63 of 63 exit 0 — 55
source-reading commands in one serial runner while the build held the
lock, the 8 dist-reading ones (`pnpm --filter @objectstack/lint run
check:doc-formula-expressions`, `pnpm --filter @objectstack/spec run
check:skill-docs`, `check:dts-closure`, `check:dual-build-cjs-loads`,
`check:entry-guard`, `check:lean-entry-closure`,
`check:published-files`, `check:sourcemap-no-sources-content`) after it.
Among the 55: `node scripts/check-skills-token-ratchet.mjs` and its
`--self-test`, `node scripts/check-empty-changeset.mjs --base
origin/main`, `node scripts/check-adr-0087-registration.mjs --base
origin/main`, `node scripts/check-changeset-no-major.mjs --base
origin/main`, `pnpm check:pm-dispatch-gates`, `pnpm
check:pm-governed-merges`, `pnpm check:pm-skill-id-lint`, `pnpm
check:doc-authoring`, `pnpm check:ratchet-remedy-authority`, `pnpm
check:skill-compatibility`, `pnpm check:skill-frame-sync`, `pnpm
check:skill-identifier-liveness`, `pnpm check:nul-bytes`.
- `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--ran RANFILE`: `63 derived famil(ies) accounted for — 63 run, 0
NOT-MEASURED (a DERIVED zero — all 63 recorded an exit code and none of
them is 3)`, exit 0; no UNRUN family named on stderr.
- Build closure before the dist-reading gates: `turbo run build
--filter='./packages/**' --concurrency=2` under
`scripts/pm/os-verify-lock.sh`: `VERDICT command-exit 0 · held the lock
408s (6m48s)`, 75 tasks, 0 cached.
- Derived outside the list and run as well, both exit 0: `pnpm --filter
@objectstack/spec run check:skill-examples` (compiles the ReassignLead
`os:check` fence with its new `disabledReason` key against the built
spec) and `pnpm --filter @objectstack/spec run check:skill-refs` (`9
generated files in sync with packages/spec`).
- No package source is touched, so no package `test` / `typecheck` is
owed; the edited gate script's own suite is its `--self-test` (79
cases); `pnpm lint` is CI's run.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No schema touched.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (the repo-wide run is
CI's; no source file edited).
- [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: n/a, not touched.
- [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.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ADHkmTQn7vTBdkhp6FF1Rs
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmTQn7vTBdkhp6FF1Rs)_
---------
Co-authored-by: Claude <noreply@anthropic.com>disabledReason (#26983)1 parent 403ca01 commit e6e0faa
5 files changed
Lines changed: 47 additions & 7 deletions
File tree
- .changeset
- scripts
- skills
- objectstack-i18n
- 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
797 | | - | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
798 | 808 | | |
799 | 809 | | |
800 | 810 | | |
| |||
1000 | 1010 | | |
1001 | 1011 | | |
1002 | 1012 | | |
1003 | | - | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
1004 | 1021 | | |
1005 | 1022 | | |
1006 | 1023 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
0 commit comments