Skip to content

Commit 084f606

Browse files
docs(skills): ui router names action files by the registry suffix (#35300)
<!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg1XdbbGasMNVx41tq3hZKV4)_ Fixes #35284 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:`objectstack-ui` 技能路由表里 Actions 一行的文件位置,从 `src/actions/*.actions.ts` 改为 `src/actions/*.action.ts`, `*.actions.ts`;同文件 Trap 3 删掉一处重复的对象清单作为付账。 - 为什么改:平台的类型注册表与 `os generate action` 写出的都是单数 `NAME.action.ts`,AI 按旧的复数路径找文件会漏掉生成的 action,还可能在旁边再建一个重复的。 - 风险与回滚:只改对外发布的技能文字,不动任何运行时代码;回滚即还原这一个提交。 - 先看:`skills/objectstack-ui/SKILL.md` 第 84 行(路由表 Actions 行)与第 65 行(Trap 3 的删减);再看 `scripts/check-skills-token-ratchet.mjs` 中该文件的天花板行。 - 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,应看到 `skills/objectstack-ui/SKILL.md is 2272 tokens (ceiling 2272; headroom 0)`。 - 需要你做的:`skills/**` 属于 Tier H 受管面,需要你批准或亲手合并;席位做契约审核后落地。 ## What changes The Actions row of the `objectstack-ui` routing table (`skills/objectstack-ui/SKILL.md`, In column) said `src/actions/*.actions.ts`. It now says `` `src/actions/*.action.ts`, `*.actions.ts` ``: the registry suffix first, and the plural one second because it loads too. What the code says, read on `origin/main` `01889892`: - **Registry.** The action type declares `filePatterns: ['**/*.action.ts', '**/*.action.yml']` (`packages/spec/src/kernel/metadata-plugin.zod.ts:969`). - **Generator.** `os generate action` uses `defaultDir: 'src/actions'` (`packages/cli/src/commands/generate.ts:473`) and takes the file name from the registry (`generate.ts:1993-1996`, `metadataFileName(type, toSnakeCase(name))`). `packages/cli/src/utils/metadata-file-name.ts:13-28,115-118` reads the first `**/*.INFIX.ts` pattern and writes `NAME.INFIX.ts`, which is `NAME.action.ts` here. The generator then adds a re-export line for that file to the directory's barrel (`generate.ts:2018-2048`, `barrelExportLine`). - **Loader.** The glob loader `MetadataPlugin._loadFromFileSystem` (`packages/metadata/src/plugin.ts:1676`) runs only on the eager path that has no artifact source. `metadata-file-name.ts:42-77` records that both non-test `MetadataPlugin` construction sites pass an artifact source, so nothing in this tree gets its actions from that glob. Actions load through the barrel that `objectstack.config.ts` imports into `defineStack({ actions })`: `examples/app-crm/objectstack.config.ts:11,88`, `examples/app-showcase/objectstack.config.ts:27,217`, `examples/app-todo/objectstack.config.ts:12,69`. - **So is `*.actions.ts` accepted too? Yes, through the barrel.** `examples/app-todo/src/actions/index.ts` re-exports `./task.actions`, and that app loads it. Some hand-written docs also teach the plural (`content/docs/ui/actions.mdx:39`, `content/docs/getting-started/examples.mdx:512`). That is why the cell names both: First checks 2 tells the agent to read the project's own files by these globs, and a project can hold either spelling. The registry and generator suffix comes first, so it is the one a new file gets. Other `*.actions.ts` mentions under `skills/` and `ui/skills/`: none. `git grep` over both trees finds only the cell changed here. `skills/objectstack-ui/rules/actions.md` (edited on the i18n branch) names no action file suffix and is not touched. **Payment (ruling record 6513306068, letter B; the standing ruling, verbatim: 「A:先削重复,余额按实测提高」).** The cell grows by 15 bytes. One restatement is cut from the same file to pay for it: Trap 3 ended "Read [Dashboards](...) before writing any widget, dataset or chart." That list repeats the trap's own subjects, which the routing table's dashboards row already sends to the same rule file, so the pointer now reads "Read [Dashboards](...) first." (−41 bytes). The file shrinks overall, so there is no remainder and no raise. The ceiling row comes down to the measurement: 9133 bytes (9113 priced) to 9107 (9087 priced), 2279 to 2272 tokens. I did not use the two served sections (`### List Views`, `## Actions`): `packages/qa/scenarios` keeps a verbatim copy of the List Views section. Changeset: `.changeset/35284-ui-router-action-suffix.md`, `@objectstack/skills` patch. ## Tests Text-only change. No tested behaviour changed, so there is no ablation. Skills readings (lines are the measure; token convention `ceil(bytes / 4)`): | Reading | Before (`01889892`) | After (`402e7b861`) | |:--|--:|--:| | `skills/objectstack-ui/SKILL.md` lines | 169 | 168 | | `skills/objectstack-ui/SKILL.md` bytes / priced tokens | 9133 / 2279 | 9107 / 2272 | | all 13 `skills/*/SKILL.md` lines (sum) | 4835 | 4834 | | published bundle total, tokens (ratchet report) | 270968 | 270961 | ## Acceptance notes - The glob loader (`filePatterns`) has no measured consumer in this tree (`metadata-file-name.ts:79-89` records that as a disposition). The singular suffix therefore matters for consistency with the generator and registry, not for discovery. A plural file that no barrel imports does not load, and neither does a singular one. - Hand-written docs still teach `*.actions.ts` (`content/docs/ui/actions.mdx:39`, `content/docs/getting-started/examples.mdx:88,110,512`, `content/docs/getting-started/build-with-claude-code.mdx:160`), and so does `examples/app-todo`. The suffix is accepted, so these are not defects. They are outside this card's surface (`skills/`, `ui/skills/`) and noted only. ## Verification Local gate set derived by `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at head `402e7b861`: 67 families, reconciled with `--ran` as 63 run with exit 0 and 4 NOT MEASURED (exit 3, prerequisite: a full workspace build). Those four are `check:dts-closure`, `check:dual-build-cjs-loads`, `check:lean-entry-closure` and `check:sourcemap-no-sources-content`. They read built `dist/` across all packages, and this diff touches no package source; that narrowing is declared and CI runs them. The full gate farm and check-runs are CI's. <details><summary>Skill gates (head 402e7b8)</summary> ```text node scripts/check-skills-token-ratchet.mjs :: exit 0 ✓ check-skills-token-ratchet: skills/objectstack-ui/SKILL.md is 2272 tokens (ceiling 2272; headroom 0). ✓ check-skills-token-ratchet: 59 authored bundle file(s) within their ceilings; 10 generator-owned file(s) and 38 eval fixture(s) measured, not ratcheted. node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0 pnpm --filter @objectstack/spec run check:skill-docs :: exit 0 pnpm --filter @objectstack/spec run check:skill-served-sections :: exit 0 pnpm check:skill-identifier-liveness :: exit 0 pnpm check:skill-links :: exit 0 pnpm check:skill-compatibility :: exit 0 pnpm check:skill-frame-sync :: exit 0 pnpm check:nul-bytes :: exit 0 pnpm check:pm-dispatch-gates :: exit 0 (fast tier: 2249 cases pass) pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0 (after building formula + lint; first run exit 3, prerequisite) ``` </details> <details><summary>Run reconciliation</summary> ```text Run reconciliation — 67 derived, 63 run, 4 NOT-MEASURED, 0 UNRUN. ✓ dispatch-gates --ran: 67 derived famil(ies) accounted for — 63 run, 4 NOT-MEASURED (4 DERIVED from a recorded exit 3). overlap-check: VERDICT clean exit 0 (origin/main c809deb, #35294 and #35129 merge cleanly) ``` </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7 Co-authored-by: Claude <noreply@anthropic.com>
1 parent ee5fdc8 commit 084f606

3 files changed

Lines changed: 24 additions & 4 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the objectstack-ui router names action files by the suffix the platform writes
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The Actions row of the `objectstack-ui` routing table pointed at `src/actions/*.actions.ts`. The metadata type registry declares `**/*.action.ts` for actions and `os generate action` writes `src/actions/NAME.action.ts`, so an agent reading a project's actions by that glob missed every generated file. The row now names `src/actions/*.action.ts` first and `*.actions.ts` second: a project loads its actions through the barrel its `objectstack.config.ts` imports, so a plural file the barrel names loads as well.
11+
12+
Trap 3 keeps its pointer to the Dashboards rule and drops the list of widgets, datasets and charts after it, which the routing table already sends to that rule.

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,16 @@ export const CEILINGS = new Map([
983983
// letter B): 9128 bytes (9108 priced) -> 9133 (9113 priced) -> 2279 tokens, pinned AT
984984
// the measurement, zero headroom.
985985
// ceil(($(wc -c < skills/objectstack-ui/SKILL.md) - 20) / 4) == ceil(9113 / 4)
986-
['skills/objectstack-ui/SKILL.md', 2279],
986+
// 2279 -> 2272 (#35284): the Actions row's In column names the suffix the registry
987+
// declares and `os generate action` writes (`**/*.action.ts`, metadata-plugin.zod.ts;
988+
// `metadataFileName`), then `*.actions.ts`, which loads too when the actions barrel
989+
// imports it (+15 bytes). PAID DOWN FIRST by one restatement cut from this file: Trap
990+
// 3's "before writing any widget, dataset or chart" restates the subjects the routing
991+
// table's dashboards row sends to the same rule file, so the pointer reads "first"
992+
// (-41 bytes). Net shrink, so no raise: the ceiling follows the file down to the
993+
// measurement, 9133 bytes (9113 priced) -> 9107 (9087 priced) -> 2272 tokens.
994+
// ceil(($(wc -c < skills/objectstack-ui/SKILL.md) - 20) / 4) == ceil(9087 / 4)
995+
['skills/objectstack-ui/SKILL.md', 2272],
987996
// 8333 -> 6193: RE-LOCK at the landed count after the #19715 split (decision
988997
// batch #213 item 1, maintainer 「1 2 4 同意」): the worked R1, the report
989998
// template and the v17-canonical shapes block moved VERBATIM into

‎skills/objectstack-ui/SKILL.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ Two more: [List Views](#list-views), [Actions](#actions).
6262
without one has no analytics face. A dataset is narrow: a window, a to-many
6363
rollup or a computed dimension is a stored field or app code, never forced
6464
into one; an ad-hoc chart in a `kind: 'react'` page needs none. Read
65-
[Dashboards](./rules/dashboards.md#dataset-bound-widgets) before writing any
66-
widget, dataset or chart.
65+
[Dashboards](./rules/dashboards.md#dataset-bound-widgets) first.
6766
4. **A filter token is presentation scope, not security.** `{current_user_id}`,
6867
`{today}` and the rest (vocabulary: objectstack-query → `rules/filters.md`,
6968
load it before writing one; an unrecognised token is a build error) decide
@@ -82,7 +81,7 @@ Two more: [List Views](#list-views), [Actions](#actions).
8281
| A form (`simple` / `tabbed` / `wizard`): width, columns and `sections`; master-detail (a parent with line items), a public form, field conditional rules | `src/views/*.view.ts` | [Form Views](./rules/list-views.md#form-views) |
8382
| An app and its navigation; who sees or opens it; object nav, a `filters` slice or an interface page | `src/apps/*.app.ts` | [Navigation](./rules/navigation.md) |
8483
| What a record page shows: related lists, a slotted or full page, drawer or page | the object | [Record Page](./rules/record-page.md) |
85-
| A button or operation: `locations`, visibility, dialog and toast copy, params, new tab, the body's `ctx`, refusing by code (`refusals`) | `src/actions/*.actions.ts` | [Actions](./rules/actions.md) |
84+
| A button or operation: `locations`, visibility, dialog and toast copy, params, new tab, the body's `ctx`, refusing by code (`refusals`) | `src/actions/*.action.ts`, `*.actions.ts` | [Actions](./rules/actions.md) |
8685
| A number, chart, KPI or report over records: datasets, widgets, dashboard filters, `compareTo`, date bucketing, drilldown, cubes | `src/datasets/*.dataset.ts`, `src/dashboards/*.dashboard.ts`, `src/reports/*.report.ts` | [Dashboards](./rules/dashboards.md) |
8786
| A page (regions, components, print, `kind: 'html'` / `'react'` source, styling) or package docs | `*.page.ts`, `src/docs/*.md` | [Pages & Docs](./rules/pages.md) |
8887
| The props of a block in a `kind: 'react'` page | | [react-blocks.md](./references/react-blocks.md) |

0 commit comments

Comments
 (0)