Skip to content

docs(skills): ui router names action files by the registry suffix - #35300

Merged
os-zhuang merged 1 commit into
mainfrom
claude/issue-35284-router-action-glob
Nov 19, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
claude/issue-35284-router-action-glob

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread
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.

Skill gates (head 402e7b8)
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)
Run reconciliation
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 c809deb67b, #35294 and #35129 merge cleanly)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7

The Actions row's In column said src/actions/*.actions.ts; the action
type registry declares **/*.action.ts and `os generate action` writes
NAME.action.ts. Name that first and *.actions.ts second (a barrel import
loads either). Paid by one same-file restatement cut in Trap 3; the
token-ratchet row follows the file down 2279 -> 2272.

Claude-Session: https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 402e7b861acad233cc21f629a129a6410ad0e1b7
Local-runs: none
Scope: skills/objectstack-ui/SKILL.md + scripts/check-skills-token-ratchet.mjs
Security-touching: no

PR #35300 (Fixes #35284), rules face. Read: the diff origin/main...402e7b861a (3 files, merge-base 0188989212), the card with its claim, triage and os-dev-report comments, the PR body, the cited code at the head, and the head's check-runs. origin/main has moved 7 commits past the merge-base and touched none of the three changed files nor any cited file. The PR carried no comment and no earlier record at read time.

① Derived judgments

Each claim was read in the code at the head, not taken from the PR body.

  1. The singular suffix is the registry's. Holds. packages/spec/src/kernel/metadata-plugin.zod.ts:969: { type: 'action', ..., filePatterns: ['**/*.action.ts', '**/*.action.yml'], ... }.
  2. The singular suffix and the src/actions/ directory are what os generate action writes. Holds. packages/cli/src/commands/generate.ts:473 defaultDir: 'src/actions'; :1992 const dir = flags.dir || generator.defaultDir; :1996 metadataFileName(type, toSnakeCase(name)); packages/cli/src/utils/metadata-file-name.ts:13,19-28,115-118 takes the first **/*.INFIX.ts pattern of the type and returns NAME.INFIX.ts, here NAME.action.ts. The generator then writes the barrel line into DIR/index.ts (generate.ts:1102-1111 barrelExportLine, :2048, :2259 / :2264). The directory part is also the scaffold's: packages/create-objectstack/src/templates/blank/src/actions/index.ts and that template's objectstack.config.ts:7,78 (import * as actions from './src/actions', actions: exportsOf(actions)). The product docs say the same: content/docs/deployment/cli.mdx:2742 (src/actions/, NAME.action.ts).
  3. The plural suffix loads, and only through the barrel. Holds, and the wording in the diff is exact about it. examples/app-todo/src/actions/index.ts:12-21 re-exports eight actions from ./task.actions; examples/app-todo/objectstack.config.ts:12,69 hands Object.values(actions) to defineStack. The registry glob does not load it: **/*.action.ts does not match task.actions.ts, and the one reader of that glob as a loader, MetadataPlugin._loadFromFileSystem (packages/metadata/src/plugin.ts:1676-1688, patterns: entry.filePatterns), runs only on eager with no artifact source (plugin.ts:918-923). No non-test construction site reaches it: packages/runtime/src/standalone-stack.ts:1068 and packages/cli/src/commands/serve.ts:3801 pass an artifact source, serve.ts:3854 and packages/verify/src/harness.ts:1090 run bootstrap: 'lazy', which never globs (serve.ts:3838-3843: that door "registers NONE of the stack's metadata"). So in this tree the barrel's module specifier is the whole load path for either spelling, as metadata-file-name.ts:42-69 records. The other two readers of filePatterns are prescriptions, not loaders (packages/metadata-protocol/src/protocol-write-gates.ts:182-189 codeOnlySourceHint prints filePatterns[0]), and they prescribe the singular.
    • Note on the PR body, not on the diff: "both non-test MetadataPlugin construction sites pass an artifact source" repeats the docblock's older count. There are four such sites today; two pass an artifact source and two are lazy. The conclusion is unchanged.
  4. Examples. examples/app-crm/src/actions/convert-lead.action.ts (barrel index.ts:3, config :11,88) and examples/app-showcase/src/ui/actions/predicate-matrix.action.ts (config :27,217) use the singular; examples/app-todo the plural. The showcase directory is src/ui/actions/, which the row's src/actions/ prefix does not match. That prefix is the generator's and the scaffold's default, was already in the row on main, and is spelled the way every sibling row spells its directory; it is not this diff's delta.
  5. No other plural mention in a shipped skill. Holds. git grep '\.actions\.ts' over skills/ at the head returns only skills/objectstack-ui/SKILL.md:84; ui/skills/ does not exist at the head.
  6. Nothing else in the ui skill contradicts the row. Frontmatter skills/objectstack-ui/SKILL.md:9 already says *.action.ts, so the row's first glob now agrees with the file's own description. rules/actions.md:3-4 says "Register them under defineStack({ actions: [...] })" and names no suffix. references/_index.md names only the Zod sources. No file under evals/ or rules/ names an action file path. No other skill names an action file suffix.
  7. The Trap 3 cut lost no instruction. Before: "Read Dashboards before writing any widget, dataset or chart." After: "Read Dashboards first." The mandatory read and its anchor are kept (rules/dashboards.md:33 ### Dataset-Bound Widgets). What left is the trigger list, and each of its three subjects is still named twice in the same file: by the trap itself (SKILL.md:60-64: chart, widget, report, dataset) and by the routing row (SKILL.md:85: "A number, chart, KPI or report over records: datasets, widgets, ..." with Open first → Dashboards). "first" inside a numbered trap is scoped by that trap and uses the table's own "Open first" idiom. The edit is outside the two sections the hosted cloud serves by heading (### List Views, ## Actions) and the three headings check-skill-identifier-liveness binds; no copy of the sentence exists elsewhere in the tree (git grep "widget, dataset or chart" returns only the new ratchet comment).
  8. The ratchet row is consistent with the bytes. Measured from the blobs: base 9133 bytes, 169 lines; head 9107 bytes, 168 lines; net minus 26. The cell grows 15 (26 → 41 characters with backticks), the trap shrinks 41 (" before writing any" plus newline plus " widget, dataset or chart." is 48, " first." is 7). The unpriced stamp line version: "18.6.0" plus newline is 20 bytes: 9113 → 9087 priced, ceil(9087 / 4) = 2272; before, ceil(9113 / 4) = 2279. The row reads 2272, zero headroom, no raise, lowered to the measurement, which is the direction every earlier note on this row records.

② Semver level

  • Clause-②: no. Correct: served skill text only; no published schema, no acceptance set, no export, no runtime code. Not a narrowing: the row named one glob and now names that glob's registry spelling plus the old one, so nothing an author could do before is withdrawn.
  • Metadata-protocol: none. Correct: nothing a metadata author can write changes.
  • Both lines are line-initial in the PR body and in the changeset body.
  • .changeset/35284-ui-router-action-suffix.md: '@objectstack/skills': patch (packages/skills/package.json:2). none takes patch; correct. Its three sentences were checked against the diff and hold (the changeset is a prose face; named here for the seat's ACCEPT, not reviewed as a face).

③ Boundary flags

  • open_questions: none in the report.
  • deviations: one, the PR-body footer form. Prose face, no contract effect; the seat's ACCEPT.
  • security_findings: none. Agreed. Why the line above reads no: the two changed hunks in the skill are a file glob in a routing cell and a trimmed read pointer on the analytics trap; the script hunk is a byte-budget note and its number. None teaches permission, sharing, credential, token, authentication or other security behaviour. Trap 4 ("presentation scope, not security") and the row's visibility / refusals words are unchanged context, and "token" in the script is a size unit.
  • out_of_scope_findings (docs still teach *.actions.ts, noted and not filed, "not a defect"): answered, in part disagreed. See nit N1 below. It does not block this PR.
  • SQL push-down check: not applicable; the diff holds no query or data-path code.
  • Author: the PR's user.login is objectstack-fleet[bot]; no separate-author note is owed.
  • Check-runs on the head: 45 runs, 29 success, 16 skipped, none failed, none pending. Among the greens: Governed Surface Queue Guard, Check Changeset, Lint · docs & code guards, Lint · repo & tooling gates, Lint · PM dispatch-gates, PR-body guards, Test Core, Type Check · workspace.

④ Design judgment

skills/objectstack-ui/SKILL.md — holds against the code it cites and against the card.

  • The card's Do line: "correct the In column ... to the suffix the platform loads. Check whether *.actions.ts is also accepted anywhere (barrel or defineStack import); if so say both." The diff does exactly that, and the order is the right one: the registry and generator spelling first, so a new file takes it; the accepted spelling second.
  • The reader of this cell is First checks 2 ("the project's own files for it (the globs under Where to go)"). On main that glob missed every generated file, which is the defect. Naming both is right for a read glob: first-party sources put plural files into real projects (examples/app-todo, content/docs/ui/actions.mdx:39, content/docs/getting-started/build-with-claude-code.mdx:160, and a downstream tree this repo records with both spellings, docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md:970 and content/docs/ui/forms.mdx:436), so singular alone would trade one blind spot for the other.
  • The cell claims no more than is true. It does not say the registry discovers either file, and rules/actions.md:3-4 carries the registration fact (defineStack({ actions })).
  • The Trap 3 payment is a true restatement cut (① item 7), taken outside the served sections, and leaves the file smaller than it was.

scripts/check-skills-token-ratchet.mjs — the row agrees with the file it enforces. The note is accurate on each point checked in ① (registry pattern, metadataFileName, barrel loading, plus 15, minus 41, 9133 / 9113 → 9107 / 9087, 2272) and follows the form of the two notes above it. No raise is taken, so the standing ruling is cited only as the payment order, correctly.

Findings

  • must-fix: none.
  • should-fix: none.
  • nit N1 (follow-up, outside the diff): the dev's "not a defect" is right for loading and for the lines that describe app-todo's real file (content/docs/getting-started/examples.mdx:88,110, content/docs/ui/actions.mdx:39), but it does not cover two shipped statements that prescribe the plural as the convention: content/docs/getting-started/examples.mdx:512 ("Naming conventions: ... Files: {name}.object.ts, {name}.actions.ts, {name}.flow.ts"), which contradicts content/docs/deployment/cli.mdx:2742 on the same site, the registry and the generator; and packages/spec/prompts/create-new-project.md:27 (actions/ # *.actions.ts), which the note did not list and which ships in @objectstack/spec (packages/spec/package.json:258, files: prompts). Two first-party sources prescribing different names for one file is what leaves a project with mixed spellings, the risk this PR's own body names. Nothing fails to load, so this is a p3 docs follow-up: one line on the review follow-ups of PR #35300 card or the docs area's loose-ends card (filing-gate.md), not a card per mention. The same line can carry two stale comments: packages/cli/src/utils/metadata-file-name.ts:72-73 ("the registry and every example already agree on", which app-todo contradicts) and :51 (the two-site count, see ① item 3).
  • nit N2 (no action asked): the second glob is bare (*.actions.ts) beside a directory-qualified first one. It reads as "any directory", as *.page.ts does in the Pages row, which is the wider and harmless reading. Accepted as written; spelling it out would cost bytes the file does not have.

Accepted deviation recorded: the PR-body footer form (③).

Implemented-by: claude/issue-35284-router-action-glob
Reviewed-by: session_01Utp6CbUb7TcZK1XUAddUmQ

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

维护者速读

  • 改了什么:UI 技能路由表 Actions 行的「文件位置」改为并列 src/actions/*.action.ts(注册表后缀、os generate action 写出的文件)与 *.actions.ts(经 objectstack.config.ts 的 barrel 进 defineStack 也能加载);同文件 Trap 3 删一处复述,棘轮该行 2279 → 2272(下降)。
  • 为什么改:原行只写 *.actions.ts,按路由找生成器写出的单数后缀文件会找不到(ui skill router: the Actions row's In column says src/actions/*.actions.ts, but action files are NAME.action.ts #35284,源自 docs(skills): the objectstack-ui router names action refusals #35279 合同审查)。
  • 风险与回滚:只改一份发布技能文字、棘轮一行与 changeset;无代码。回滚 = revert。
  • 先看:skills/objectstack-ui/SKILL.md 路由表 Actions 行与 Trap 3。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs,预期 ui 行 2272,末行 ✓。
  • 需要你做的:审阅并合并或批准(Tier H:动了棘轮脚本)。合同审查 PASS 6999015677,Head-sha 402e7b861acad233cc21f629a129a6410ad0e1b7。席位意见:两种后缀与代码一致,可合。

席位核对 — ACCEPT · repo:objectstack#5 · head 402e7b861acad233cc21f629a129a6410ad0e1b7 · 2026-11-19T03:44Z

  • 形态: 3 files, +24/−4; governed skills/** plus the ratchet script → Tier H. Fixes #35284. Clause-②: no, Metadata-protocol: none, changeset patch. Claim 6998095398.
  • 前提实测: L2 read the registry (metadata-plugin.zod.ts:969), the generator (generate.ts:473,1992,1996 writes src/actions/NAME.action.ts), and the barrel load for *.actions.ts (app-todo index.ts:12-21, config :12,69).
  • 合同审查: L2 at CONTRACT_REVIEW_TIER, PASS, comment 6999015677, same head; no must-fix, no should-fix. Bytes 9133 → 9107, ratchet 2272. Security-touching: no.
  • 门禁: check-runs on head: 29 success, 16 skipped, none red.
  • 接受的偏差: N2 (bare *.actions.ts glob) accepted as written.
  • 范围外去向: N1: content/docs/getting-started/examples.mdx:512 and packages/spec/prompts/create-new-project.md:27 present the plural suffix as the convention, against cli.mdx:2742. Loads either way through the barrel; recorded here as a loose end for the next docs touch, no card.
  • 落地条款: Tier H. K = 8 first-parent commits on main since merge base 01889892 (< 15); mergeable_state clean. This stroke: pm:awaiting-merge + reviewers os-zhuang, hotlong. After approval the seat lands; on MERGED close-out on ui skill router: the Actions row's In column says src/actions/*.actions.ts, but action files are NAME.action.ts #35284.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 19, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 19, 2026 04:28
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 084f606 Nov 19, 2026
51 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-35284-router-action-glob branch November 19, 2026 04:55
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui skill router: the Actions row's In column says src/actions/*.actions.ts, but action files are NAME.action.ts

3 participants