Repository navigation
Commit 81c0947
docs(skills): teach the mappings group, action and hook texts, and drop the stale label-serving caveat (#35302)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg1XdbbGasMNVx41tq3hZKV4)_
Fixes #34962
Fixes #35097
Fixes #34053
Part of #34546 — this PR carries its i18n half only (where a hook's
`texts` sit in a bundle, plus one i18n eval case). The declaration half
(hook `texts` and `ctx.text` in
`skills/objectstack-data/references/data-hooks.md`, plus one
objectstack-data eval case) rides with the area's data-hooks group, per
the PM's fence ruling in this dispatch: that file and the data eval set
sit under open draft #34964 and the next data-hooks group.
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:已发布技能 `objectstack-i18n` 的顶层分组列表加入 `mappings`(导入映射的 `label`,按映射
`name` 存放,附 showcase 的 zh-CN 实例);"按组织语言取句"一段扩到钩子与脚本动作在 `texts` 里声明、用
`ctx.text`
写入记录的句子(`hooks.HOOK.texts.KEY.message`、`_actions.ACT.texts.KEY.message`,无对象动作在
`globalActions` 下);删去已失效的"标签服务把内联文字当 `defaultLocale`
读"提醒,只保留仍然成立的一句:校验与拒绝消息仍经 `t()` 读标签,英文源、中文默认的应用仍需声明 `fallbackLocale:
'en'`。`objectstack-ui` 的 `rules/actions.md` 新增一小节,教脚本动作声明 `texts` 并用
`ctx.text` 取句。i18n 评测加 2 条、改 1 条,ui 评测加 1 条。
- 为什么改:`mappings` 分组、动作 `texts`、钩子 `texts` 都已在 main 上落地,但技能没教;照技能写包的
agent 会把映射名留成英文、把句子硬编码进动作体。旧提醒在 sourceLocale 服务落地后已经说错。
- 风险与回滚:只改发布技能文字、评测、一行 token 棘轮与 changeset;无运行时影响。`rules/actions.md`
的棘轮行 3180 → 3333(先删同文件两处复述示例的句子 53 字节,余额按实测);i18n SKILL.md 在原上限内付清(6327
→ 6329,上限 6333 不动)。回滚 = revert 本 PR。
- 先看:① `skills/objectstack-i18n/SKILL.md` 第 50–53 行(新的 `t()`
提醒是否准确)与分组段(`mappings`、`texts` 键);②
`skills/objectstack-ui/rules/actions.md` 新增的 `texts` 小节;③
`scripts/check-skills-token-ratchet.mjs` 中 actions.md 行的注释与 +153。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期
`skills/objectstack-ui/rules/actions.md is 3333 tokens (ceiling 3333;
headroom 0)`、`skills/objectstack-i18n/SKILL.md is 6329 tokens (ceiling
6333; headroom 4)`,末行 ✓。
- 需要你做的:审阅并合并(`skills/**` 属 Tier H 受管面)。
## What changes
- `skills/objectstack-i18n/SKILL.md`
- The top-level group list names `mappings` (`mappings.{mapping}.label`,
an import mapping's `label` by its `name`; a mapping declares no
description). The zh-CN example block gains the showcase's `mappings: {
showcase_inquiry_feed: { label: … } }`, the spelling
`examples/app-showcase` ships. (#34962)
- The paragraph on keys picked in the organization's language (it
already carried the flow record-write key) now covers each sentence a
hook or a `script` action declares in `texts` and writes through
`ctx.text`: `hooks.{hook}.texts.{key}.message` and
`_actions.{action_name}.texts.{key}.message`, also under
`globalActions`. The skill states the bundle shape only. The
declaration, the `ctx.text` lookup and the missing-key behaviour live in
the ui actions rule (and, for hooks, the data-hooks group), so nothing
is said a third time. (#35097, #34546 i18n half)
- The caveat "Label serving still reads inline text as `defaultLocale`
text …" is gone. The `sourceLocale` row now says a request in that
locale is served the inline text. The remaining truth is kept, measured
on `origin/main` `01889892` (see Acceptance notes): validation and
refusal messages still read labels through `t()`, which falls back to
`fallbackLocale`, else `defaultLocale`. Without `fallbackLocale: 'en'`,
an `en` refusal names a field by its zh-CN row. (#34053)
- `skills/objectstack-ui/rules/actions.md`: a new H3 "Writing in the
organization's language (`texts`)" after the refusals paragraph. The
same actions that may declare `refusals` (a `script` action with a `js`
body) declare a sentence under `texts` and ask for it with `await
ctx.text(key, params)`. It is answered in the organization's language,
never the caller's. With no translation the declared sentence is
written, filled. An unreadable Localization setting rejects. An
undeclared key is refused at save when named literally, else at run. The
H3 names the `texts.KEY.message` key beside the refusals key, which the
refusals paragraph still spells in full. The wording comes from
`content/docs/ui/actions.mdx` as merged with the action-texts carrier.
(#35097)
- Evals
- `skills/objectstack-i18n/evals/bundles-locales-coverage.json`: case 14
(`mappings.lead_csv.label`), case 15 (a hook's `texts` key and whose
language picks it; it does not require the `{{ lead }}` hole), and case
11's `expected_output` now gives the `t()` reason for `fallbackLocale:
'en'`. Its `must_contain` keeps `fallbackLocale: 'en'`, decided below.
- `skills/objectstack-ui/evals/views-apps-actions-pages.json`: case 21
(the `send_email` action's subject via `texts` + `ctx.text`; it does not
forbid the prompt's own `'Email: ' +`).
- `scripts/check-skills-token-ratchet.mjs`: the `rules/actions.md` row
3180 -> 3333 with its row note. The i18n row is untouched.
- `.changeset/34962-i18n-skill-texts.md`: `@objectstack/skills` patch,
carrying both declaration lines.
### Ratchet and size readings
Raise authority, quoted verbatim and untranslated: the standing ruling
of 2026-10-27, 「A:先削重复,余额按实测提高」, made the gate-recognised path by ruling
record 6513306068 (letter B). Restatement in the same file is cut first;
the remainder moves by measurement.
- `skills/objectstack-i18n/SKILL.md`: paid in full in the same file, so
the row does not move (open draft #34970 edits the same file). The
restatement cut:
- the renamed-target sentence, which restates the option paragraph's
"parse, ship, and resolve to nothing" and the
`translation-target-unknown` error stated just above it;
- `--objects-only` and `--source-hashes` from the `extract --help` list,
both taught in place (the paragraph right below and the Register code
comment);
- the group-name list in the `--objects-only` paragraph and the surface
list in `os i18n check`'s paragraph, two partial copies of the group
list (neither named `mappings`, `hooks` or `books`);
- the empty step "### 2. Translate / Fill in the values manually.";
- the flow-key language parenthetical, merged into the one sentence that
now also covers `texts`.
- `skills/objectstack-ui/rules/actions.md`: paid down first by 53 bytes
of restatement, each of the example right below its sentence: " as
`${result.output.NAME}`" in the `onSuccess` sentence (27; the Convert
Lead block spells `${result.output.opportunity_id}`) and "`{recordId}`
placeholder; " in the `newTabUrl` sentence (26; the Open PDF block
spells it). The refusals bundle key stays: the bundle's own evals grade
`_actions`, and the with-skill arm reads this bundle only. Nothing else
in the file restates another passage, so the rest moves by measurement:
12720 -> 13330 bytes, `ceil(13330 / 4) == 3333`, +153 tokens, pinned AT
the measurement.
| Reading (tree `objectstack-ai/objectstack`, base `01889892` -> head
14899df) | Before | After |
|:--|--:|--:|
| `skills/objectstack-i18n/SKILL.md` lines | 527 | 523 |
| `skills/objectstack-i18n/SKILL.md` bytes / priced tokens (ceiling) |
25325 / 6327 (6333) | 25336 / 6329 (6333) |
| `skills/objectstack-ui/rules/actions.md` lines | 248 | 258 |
| `skills/objectstack-ui/rules/actions.md` bytes / tokens (ceiling) |
12720 / 3180 (3180) | 13330 / 3333 (3333) |
| All published `skills/*/SKILL.md` lines (sum, 13 files) | 4835 | 4831
|
| All published `skills/*/SKILL.md` bytes (sum) | 254161 | 254172 |
| Bundle total, whole shipped tree (ratchet units) | 270968 | 271945 |
The bundle total's +977 units are mostly eval fixtures (+822, measured,
not ratcheted).
## Tests
Text-only change to served skill text, eval fixtures and one ratchet
row. No tested behaviour changed, so there is no ablation and no package
`test` / `typecheck` is owed (the diff touches no package source).
<details><summary>Token ratchet, gate and self-test (head
14899df)</summary>
```
node scripts/check-skills-token-ratchet.mjs -> exit 0
✓ check-skills-token-ratchet: skills/objectstack-i18n/SKILL.md is 6329 tokens (ceiling 6333; headroom 4).
✓ check-skills-token-ratchet: skills/objectstack-ui/rules/actions.md is 3333 tokens (ceiling 3333; 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
✓ check-skills-token-ratchet self-test: 104 cases pass.
```
Before the row was re-pinned, the same gate read `3333 / 3180 (+153)`
and exited 1: the remainder this PR carries.
</details>
## Acceptance notes
- **A3 measured false.** The automation skill does not teach hooks.
`skills/objectstack-automation/SKILL.md:9` sends object-layer lifecycle
hooks to objectstack-data, and hooks, their `refusals` catalogue and its
translation key are taught in
`skills/objectstack-data/references/data-hooks.md` (§ Error Handling →
Declared refusals). That file is outside this dispatch's fence, and per
the PM it belongs to the data-hooks group. The automation skill is
untouched.
- **The #34053 decision: case 11 keeps `fallbackLocale: 'en'` as a
required string, with its reason rewritten.** Serving honours
`sourceLocale` (the carrier merged as `2068e037`). But #34030 is still
open: validation and refusal messages read labels through `t()`. Read on
`origin/main` `01889892`: `resolveFieldLabel`
(`packages/objectql/src/validation/record-validator.ts:463`) asks
`ctx.translate` before the declared label, and `FileI18nAdapter.t()`
(`packages/services/service-i18n/src/file-i18n-adapter.ts:176-181`)
falls back to `fallbackLocale`, which the stack config fills as
`fallbackLocale || defaultLocale || 'en'`. So in an English-source app
with a zh-CN default, `fallbackLocale: 'en'` still keeps an `en` refusal
off the zh-CN row. When #34030 lands, its own skills follow-up drops the
sentence and the requirement. This is a reading of the tree; no request
was run.
- `skills/objectstack-ui/evals/README.md` lists each eval file's topics
broadly. It is not extended for the new case.
## Verification
Local gate union derived by `node scripts/pm/dispatch-gates.mjs
--commands --repo objectstack-ai/objectstack` at head 81eae9a (6
paths, 66 commands). Every family CI runs is read from this PR's
check-runs. Fix round `14899df1c` (contract review 6999139326, M1)
re-ran the token ratchet and its self-test, the skills gates
(`check:skill-docs`, `check:skill-refs`, `check:skill-links`,
`check:skill-identifier-liveness`, `check:skill-compatibility`,
`check:skill-frame-sync`), `check:nul-bytes`, `check:doc-authoring`,
`check:pm-skill-id-lint`, the changeset gates and overlap-check: all
exit 0. `check:doc-formula-expressions` was NOT MEASURED there (no lint
dist in the recreated worktree; no code block touched; exit 0 at
81eae9a).
<details><summary>Local run (head 81eae9a)</summary>
```
Run reconciliation: 66 derived, 64 run (exit 0), 2 NOT-MEASURED, 0 UNRUN.
✓ dispatch-gates --ran: 66 derived famil(ies) accounted for — 64 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).
pnpm --filter @objectstack/spec run check:skill-docs -> exit 0 ✅ Skill docs in sync
pnpm --filter @objectstack/spec run check:skill-refs -> exit 0 ✅ 9 generated files in sync with packages/spec
pnpm check:skill-links -> exit 0 267 relative link(s) in 73 published skill file(s) resolve; 138 fragment(s) name a real heading
pnpm check:skill-identifier-liveness -> exit 0 Leg 1: 484 citation(s) over 73 published file(s); Leg 2: 11 registered exhaustive section(s), 0 ledgered gap(s)
pnpm check:skill-compatibility -> exit 0 13 SKILL.md file(s) reconciled against 91 workspace packages
pnpm check:doc-authoring -> exit 0
pnpm check:pm-skill-id-lint -> exit 0 120 file(s) clean
pnpm check:nul-bytes -> exit 0 no raw ASCII control bytes
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 the @objectstack/lint closure)
pnpm check:dual-build-cjs-loads -> exit 3 PREREQUISITE NOT MET (needs every package's built dist/)
pnpm check:lean-entry-closure -> exit 3 PREREQUISITE NOT MET (needs the objectql build)
```
</details>
NOT MEASURED locally: `check:dual-build-cjs-loads` and
`check:lean-entry-closure`. Reason: PREREQUISITE NOT MET (exit 3). They
load built `dist/` trees that this docs-only diff does not build, and CI
runs them. No package `test` / `typecheck` is owed, and no `test:repo`
either: the diff touches no package source and no repo-project test.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CazXu8zyYD5PC6J2u7 -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 084f606 commit 81c0947
6 files changed
Lines changed: 92 additions & 27 deletions
File tree
- .changeset
- scripts
- skills
- objectstack-i18n
- evals
- 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 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1448 | 1448 | | |
1449 | 1449 | | |
1450 | 1450 | | |
1451 | | - | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
1452 | 1467 | | |
1453 | 1468 | | |
1454 | 1469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
182 | | - | |
| 183 | + | |
| 184 | + | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
| |||
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
191 | | - | |
192 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
193 | 197 | | |
194 | | - | |
195 | | - | |
| 198 | + | |
| 199 | + | |
196 | 200 | | |
197 | 201 | | |
198 | 202 | | |
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
| 206 | + | |
202 | 207 | | |
203 | 208 | | |
204 | 209 | | |
| |||
234 | 239 | | |
235 | 240 | | |
236 | 241 | | |
237 | | - | |
238 | | - | |
239 | | - | |
| 242 | + | |
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
| |||
305 | 308 | | |
306 | 309 | | |
307 | 310 | | |
308 | | - | |
309 | | - | |
| 311 | + | |
310 | 312 | | |
311 | 313 | | |
312 | 314 | | |
| |||
426 | 428 | | |
427 | 429 | | |
428 | 430 | | |
429 | | - | |
| 431 | + | |
430 | 432 | | |
431 | 433 | | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
| 434 | + | |
| 435 | + | |
436 | 436 | | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
| 437 | + | |
442 | 438 | | |
443 | 439 | | |
444 | 440 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
133 | 153 | | |
134 | 154 | | |
135 | 155 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
203 | 213 | | |
204 | 214 | | |
205 | 215 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
144 | 154 | | |
145 | 155 | | |
146 | 156 | | |
| |||
168 | 178 | | |
169 | 179 | | |
170 | 180 | | |
171 | | - | |
| 181 | + | |
172 | 182 | | |
173 | 183 | | |
174 | 184 | | |
| |||
0 commit comments