Repository navigation
Commit 301b7c1
docs(skills): the i18n skill names the action table column label keys (#35031)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBLW6dHPW6sSheA32XPKZzPV)_
Fixes #34917
Clause-②: no
Metadata-protocol: none
Served-tier: CONTRACT_REVIEW_TIER
repo:objectstack#3 · os-support-ai · session_01WGufziunkXbDT7wUWqfmWz
## 维护者速读
- 改了什么:已发布技能 `objectstack-i18n` 的动作键表补上两个表格列标题键
`resultDialog.columns.{path}.{column_path}` 和
`preflight.columns.{path}.{column_path}`,拒收段补上对应的两种报错情形,zh-CN
示例块加一行表格列标题的写法,evals 加一条用例。
- 为什么改:这两个键运行时已经支持,但技能没提。照技能写翻译的 agent 会把结果表格的列标题留成英文。
- 风险与回滚:只改教学文本和一条 eval,不动 spec、lint 或运行时。新增文字靠同文件删五处重复付账,token
上限行不动(6219 → 6256,上限 6333)。回滚即 revert 本 PR。
- 先看:`skills/objectstack-i18n/SKILL.md` 的 `_actions.{action_name}`
表格行;同文件 `translation-target-unknown` 段的 "Six more shapes" 一句;下面 "Cuts"
列出的五处删减。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期
`skills/objectstack-i18n/SKILL.md is 6256 tokens (ceiling 6333; headroom
77)`。
- 需要你做的:无。`check-governed-merges` 判为 Tier H(`skills/**`),按低风险 skills
通道(2026-11-14 #33501 裁决)由席位落地:前提是本 head 有席位达档合同审记录,且写明
`Security-touching: no`。
## What changes
`skills/objectstack-i18n/SKILL.md`:
- Key table, `_actions.{action_name}` row: names
`resultDialog.columns.{path}.{column_path}` /
`preflight.columns.{path}.{column_path}`. They are a table's column
headers, written beside `fields`, keyed by the literal `path` of a
`format: 'table'` field and then by the literal `path` of one of its
`columns[]`, each value a plain string. The existing sentence that
`defineTranslationBundle` refuses any other key under `preflight` now
ends the list after `columns`, so it no longer says `fields` is the only
key.
- `translation-target-unknown` paragraph: "Five more shapes" becomes
six. The new one is a `columns` key whose field path is no declared
`format: 'table'` field, or whose column path that field's `columns[]`
does not list.
- zh-CN example block: one more line, the column keys as the platform's
`sys_user` bundle ships them for `import_sso_users` (`rows` is the table
field's `path`, `error.message` one column's).
`skills/objectstack-i18n/evals/bundles-locales-coverage.json`:
- New case 12: a result-dialog table whose headers stayed English; the
prompt asks which bundle key carries them. It requires the dotted key
path `resultDialog.columns.rows` and the column path `error.message`.
Round 3 (review S2): the rule name `translation-target-unknown` left
`must_contain`, because a correct answer to "which key" has no reason to
name the lint rule; the refusal sentence stays in `expected_output`.
Round 2 (review S1): the path token replaces `columns: { rows:`, and the
forbidden `fields: { rows: {` is dropped. The grader matches literal
substrings, so both graded spacing, quoting and line breaks. No
layout-free token tells the wrong nesting apart in a literal answer, so
placement is graded by the required path alone, which a wrong-nesting
answer does not state. `error: {` stays as it is (review N3): the dotted
spelling `error.message` reads the same whether or not the answer splits
it, so no layout-free token does that job.
- Case 10 (preflight) said the `preflight` node "holds nothing else"
beside `fields`. It now says the node holds only `fields` and `columns`.
`.changeset/34917-skills-i18n-action-column-keys.md`:
`@objectstack/skills` patch, with both declaration lines.
### Cuts that pay for the text (same file)
| Cut | Text that still carries it |
|:--|:--|
| The paragraph "For the exact Zod shape … read
`node_modules/@objectstack/spec/src/system/translation.zod.ts` —
`TranslationDataSchema`, `ObjectTranslationDataSchema`, and
`FieldTranslationSchema`." | `## References` ("Always `Read` the source
for exact field shapes; do not rely on memory of property names") and
`references/_index.md`, whose Core schemas line names that file and
those three exports |
| "interpolation is always simple `{{variable}}` substitution" under *No
ICU MessageFormat* | *Simple Format (Default)*, directly above: both
adapters "substitute double-brace `{{variable}}` placeholders only" |
| "so import the type from `@objectstack/spec/contracts` rather than
reading `node_modules` source" under *Service Contract* | The code block
directly above it: `import type { II18nService } from
'@objectstack/spec/contracts';` |
| Workflow step "3. Verify Coverage: Run `os i18n check` (**Translation
Coverage** above)"; step 4 is renumbered 3 | `## Translation Coverage` →
`os i18n check`, and `## Verify your work` |
| "(an action with no `preflight` declares none)" in the refusal
paragraph | The key-table row: `preflight.fields.{path}` "only under an
action that declares `preflight`" |
### Size readings (`skills/**`)
| | Before (origin/main 4443014) | After (bc3f321) |
|:--|:--|:--|
| `skills/objectstack-i18n/SKILL.md`, lines | 533 | 526 |
| `skills/objectstack-i18n/SKILL.md`, tokens (ratchet, ceiling 6333) |
6219 | 6256 |
| All `SKILL.md` under `skills/`, lines | 4730 | 4723 |
| Bundle total, tokens (whole shipped tree) | 257961 | 258329 |
The bundle moves +368 tokens: +37 in the SKILL.md and +331 in the eval
fixture, which the ratchet measures and does not price. The ceiling row
in `scripts/check-skills-token-ratchet.mjs` is not touched.
## Tests
- No runtime behaviour changes, so there is no unit test and no
ablation.
- Eval assertions, checked by script over all 12 cases at bc3f321:
every `must_contain` string is in its `expected_output`, no
`must_not_contain` string is, and the ids are distinct. 0 violations.
- Case 12 against two probe answers, graded as `grade.ts` does: a
correct answer written across lines with quoted keys passes; a
wrong-nesting answer written across lines fails.
- The taught accept set, probed against the built `@objectstack/spec`
and `@objectstack/lint` (results under Verification).
## Acceptance notes
- No example app ships an action answer with a `format: 'table'` field.
The only shipped one is the platform's `sys_user` → `import_sso_users`,
so the example line quotes that bundle. The existing two lines of the
block quote `app-crm` and `app-showcase`.
- Open PR #34970 edits another section of the same SKILL.md and pays the
same ratchet row. A local three-way merge of the two heads is clean and
reads 6319 tokens against the 6333 ceiling, so either landing order
stays under it.
- Open PR #35022 edits the same eval file. A local merge of the two
heads is clean and the case ids stay distinct (1 to 12).
## Verification
<details><summary>Premise, on origin/main 4443014</summary>
- `skills/objectstack-i18n/SKILL.md:167` named
`resultDialog.fields.{path}` and `preflight.fields.{path}` and no
`columns` key. `:230` named no `columns` refusal.
- `packages/spec/src/system/translation.zod.ts`:
`ActionResultDialogTranslationSchema.columns` and
`ActionPreflightTranslationSchema.columns` are both a record of field
path → record of column path → string.
- `packages/lint/src/validate-translation-references.ts`
(`checkActionAnswerTableColumns`) reports `translation-target-unknown`
for a field path with no declared table field, and for a column path the
field's `columns[]` does not list.
</details>
<details><summary>Accept-set probe against the built packages, at
9777f6a (round 2 changed only the eval file)</summary>
`defineTranslationBundle`:
- ACCEPT `resultDialog.columns.rows.{email, "error.message"}`,
`preflight.columns.rows.email`, and the same under `globalActions`.
- REFUSE `preflight.title` and `preflight.headers`
(`unrecognized_keys`).
- REFUSE a column value that is an object (`expected string`) and a
`columns.rows` that is a string (`expected record`).
`resolveActionResultDialog` / `resolveActionPreflight`, on a `rows`
table with columns `email` and `error.message`:
- `zh-CN`: result dialog headers `["邮箱","原因"]`, preflight headers
`["邮箱"]`.
- `en`: `["Email","Reason"]` and `["Email"]` (the authored labels).
`validateTranslationReferences`:
- Declared columns: no finding.
- A column the table does not list, a field that is not a table, a field
no row declares, and `preflight.columns` under an action with no
`preflight`: each one `error translation-target-unknown`.
</details>
<details><summary>Gates</summary>
Round 1, head 9777f6a:
- `os-verify-lock` running `pnpm --workspace-concurrency=2 --filter
'@objectstack/lint...' build`: `VERDICT command-exit 0`.
- `dispatch-gates --commands`: 48 derived commands. `dispatch-gates
--ran`: `48 derived famil(ies) accounted for — 46 run, 2 NOT-MEASURED (2
DERIVED from a recorded exit 3)`. The 46 exited 0.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads` and `pnpm
check:lean-entry-closure`, both exit 3. They need a full build, which
was not run locally. CI runs them.
- `node scripts/check-skills-token-ratchet.mjs`: exit 0,
`skills/objectstack-i18n/SKILL.md is 6256 tokens (ceiling 6333; headroom
77)`. `--self-test`: exit 0.
- `pnpm --filter @objectstack/spec run check:skill-docs`: `Skill docs in
sync`. `check:skill-refs` (outside the derived set): `9 generated files
in sync`.
- `overlap-check` against origin/main 4443014 and open PRs #34970 and
#33849: `VERDICT clean exit 0`.
Round 2, head 59f7a31 (the diff from round 1 is the eval file alone):
- `dispatch-gates --commands` derives the same 48 commands. The 42 that
need no build were re-run and all exited 0, the token ratchet among them
(SKILL.md still 6256 of 6333; the eval fixture measures 2678 tokens,
unpriced).
- Not re-run: the four build-backed gates (`check:skill-docs`,
`check:doc-formula-expressions`, `check:dts-closure`,
`check:sourcemap-no-sources-content`), which do not read the eval file.
`check:dual-build-cjs-loads` and `check:lean-entry-closure` remain NOT
MEASURED. CI runs all six.
- `overlap-check` against origin/main 65ec3c5 and open PRs #35022,
#34970 and #33849: `VERDICT clean exit 0`.
Round 3, head bc3f321 (the diff from round 2 is one token removed
from case 12's `must_contain`):
- Eval script check: 0 violations, ids distinct.
- `node scripts/check-skills-token-ratchet.mjs`: exit 0, SKILL.md
unchanged at 6256 of 6333; the eval fixture measures 2670 tokens,
unpriced.
- No other gate was re-run for a one-token change to an eval fixture. CI
runs the full set.
- `overlap-check` against origin/main 1282a46 and open PRs #34970 and
#33849: `VERDICT clean exit 0`.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz)_
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufziunkXbDT7wUWqfmWz -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent 80d474b commit 301b7c1
3 files changed
Lines changed: 33 additions & 20 deletions
File tree
- .changeset
- skills/objectstack-i18n
- evals
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| 200 | + | |
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | 206 | | |
209 | 207 | | |
210 | 208 | | |
| |||
226 | 224 | | |
227 | 225 | | |
228 | 226 | | |
229 | | - | |
| 227 | + | |
230 | 228 | | |
231 | | - | |
| 229 | + | |
| 230 | + | |
232 | 231 | | |
233 | 232 | | |
234 | 233 | | |
| |||
287 | 286 | | |
288 | 287 | | |
289 | 288 | | |
290 | | - | |
291 | | - | |
292 | | - | |
| 289 | + | |
| 290 | + | |
293 | 291 | | |
294 | 292 | | |
295 | 293 | | |
| |||
360 | 358 | | |
361 | 359 | | |
362 | 360 | | |
363 | | - | |
364 | | - | |
| 361 | + | |
365 | 362 | | |
366 | 363 | | |
367 | 364 | | |
| |||
440 | 437 | | |
441 | 438 | | |
442 | 439 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
| 440 | + | |
448 | 441 | | |
449 | 442 | | |
450 | 443 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
113 | 123 | | |
114 | 124 | | |
115 | 125 | | |
0 commit comments