Repository navigation
Commit b33365c
docs(skills): objectstack-i18n teaches i18n.sourceLocale (#33934)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9XvDBw73kUzCQbvPjg5vDdt)_
Fixes #33635
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:`objectstack-i18n` 技能的 `i18n` 键表新增 `sourceLocale` 一行(内联 `label:`
文本的语言,缺省即 `defaultLocale`),并写明英文编写、中文用户的配法和 `fallbackLocale`
的服务端注意事项;`--default-locale` 的说明改为"覆盖源语言"。
- 为什么改:技能只教 `defaultLocale`,AI 给"英文写、卖给中国用户"的应用会写 `defaultLocale:
'en'`,丢掉用户默认语言,或得到大量误报的"缺 en"。
- 风险与回滚:纯文档 + 一条评测用例,不动运行时;回滚即 revert 本 PR。
- 先看:`skills/objectstack-i18n/SKILL.md`
键表下方新增的四行(服务端注意事项一句)、`skills/objectstack-i18n/evals/bundles-locales-coverage.json`
的第 11 条用例。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期 i18n 行显示 `6146
/ 6333` 且全绿。
- 需要你做的:批准本 PR。
## What changes
`skills/objectstack-i18n/SKILL.md` (published, English):
- **Key table:** a `sourceLocale` row (optional, defaults to
`defaultLocale`; the language inline `label:` text is written in; read
by `os lint`, `os i18n check`, `os i18n extract`). The `defaultLocale`
row now says what it is: the locale a user who has not chosen one gets.
- **Under the table (4 lines):** an English-authored app for Chinese
users declares `defaultLocale: 'zh-CN', sourceLocale: 'en'`, not an
English `defaultLocale` (the warning does not spell the literal the eval
refuses). The serving caveat as the spec change published it: label
serving still reads inline text as `defaultLocale` text, so without
`fallbackLocale: 'en'` an `en` request reaches the zh-CN bundle before
the English inline label. The serving card (#33634) is still open, so
the caveat names no future behaviour. One clause names the refused
near-miss spellings `sourceLanguage` / `authoringLocale` /
`authoringLanguage`.
- **Translation Coverage:** "Gaps in the default locale are errors" now
says source locale. That is the locale `computeI18nCoverage` raises
errors against (`resolveSourceLocale`).
- **Extract Skeletons:** the source locale (not "the default locale") is
filled from schema labels. `--default-locale` overrides the source
locale for one run (`i18n.sourceLocale`, else `i18n.defaultLocale`, else
`en`). It moved out of the trailing flag list into that sentence, so the
list no longer repeats it.
Every taught fact is read from origin/main:
`TranslationConfigSchema.sourceLocale` and its `aliases` in
`packages/spec/src/system/translation.zod.ts`; `resolveSourceLocale` /
`withGatedDefaultLocale` in `packages/cli/src/utils/i18n-coverage.ts`;
the `--default-locale` help in
`packages/cli/src/commands/{lint,i18n/check,i18n/extract}.ts`.
`skills/objectstack-i18n/evals/bundles-locales-coverage.json`: case 11
(English-authored app, Chinese users by default). It must contain
`sourceLocale`, `defaultLocale: 'zh-CN'`, `fallbackLocale: 'en'` and
`supportedLocales`, and must not contain `defaultLocale: 'en'` or
`sourceLocale: 'zh-CN'`, shapes only a wrong (English-default or
role-swapped) config writes. It is self-consistent: no
`must_not_contain` string occurs in its own `expected_output` or in the
skill passages a correct answer quotes (the only SKILL.md hits are the
two English-default config examples). Spliced with the file's hand
formatting kept.
`.changeset/33635-i18n-source-locale-skill.md`: `'@objectstack/skills':
patch`.
### Size readings (tree: objectstack-ai/objectstack, origin/main
895783a → this head)
| Reading | Before | After |
|:--|--:|--:|
| `skills/objectstack-i18n/SKILL.md` lines | 524 | 530 (net +6, at
budget) |
| `skills/objectstack-i18n/SKILL.md` bytes | 23901 | 24603 |
| `skills/objectstack-i18n/SKILL.md` tokens (ratchet convention) | 5971
| 6146 (ceiling 6333, headroom 187) |
| All 11 `skills/*/SKILL.md` lines | 4590 | 4596 |
| All 11 `skills/*/SKILL.md` tokens | 59043 | 59218 (+175) |
| `evals/bundles-locales-coverage.json` bytes | 8195 | 9353 (eval
fixture, measured, not ratcheted) |
The ratchet row is untouched: the file stays under its ceiling, so
nothing is raised. No duplicate needed trimming to pay for it.
## Tests
No code changed, so there is nothing to ablate. Gate readings are below
under Verification.
## Acceptance notes
- **Build tier, declared:** `dispatch-gates --tier` puts `skills/**` at
the contract-review tier (clause ①, no one-line exit). This card thread
is served at the default build tier and cannot switch its own model.
With the seat's consent, the authoring (all three files and the commit)
ran in an isolated os-dev subagent pinned to the contract-review tier
inside this worktree. The relay writes, gates and report ran in the
thread.
- **Not taught, on purpose:** "`sourceLocale` need not appear in
`supportedLocales`" and "with `sourceLocale` declared, `defaultLocale`
is gated and scaffolded even when `supportedLocales` omits it". Both are
true on main. They did not fit the +6-line budget, and
`content/docs/ui/translations.mdx` carries both.
- The config example at the top of the skill keeps `defaultLocale:
'en'`, which is correct for an English-default app.
## Verification
All readings are at head `5b52d088` (review round 1; the derived list is
unchanged from `d3909868`) (`git rev-parse --short HEAD` after the last
commit), tree objectstack-ai/objectstack.
- Package build closure: `turbo run build --concurrency=2
--filter='./packages/**'` under `os-verify-lock.sh`, `VERDICT
command-exit 0` (held 9m38s).
- Acceptance gates: `check:skill-docs` ✅ "Skill docs in sync";
`check:skill-refs` ✅ "9 generated files in sync with packages/spec";
`check:skill-examples` ✅ "346 prose examples type-check across 3
surface(s)"; `check-skills-token-ratchet` ✓ "57 authored bundle file(s)
within their ceilings", i18n row `6146 / 6333`.
- `dispatch-gates --ran`: "47 derived famil(ies) accounted for — 47 run,
0 NOT-MEASURED (a DERIVED zero)". Two extra runs are recorded outside
the derivation (`check:skill-examples`, `check:skill-refs`).
- CI families outside the derived list are left to this PR's check-runs.
<details><summary>Derived gate list, 47 + 2, exit codes captured before
any pipe</summary>
```text
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-doc-route-spelling.mjs --advisory :: exit 0
node scripts/check-doc-route-spelling.mjs --self-test :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-skills-token-ratchet.mjs :: exit 0
node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/spec run check:skill-docs :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:corpus-claim-drift :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-skill-id-lint :: exit 0
pnpm check:published-files :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:role-word :: exit 0
pnpm check:skill-compatibility :: exit 0
pnpm check:skill-frame-sync :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:skill-links :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm --filter @objectstack/spec check:skill-examples :: exit 0
pnpm --filter @objectstack/spec check:skill-refs :: exit 0
```
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmSpA1arrHg2f7Nwofb)_
<!-- signed: domain:skills#2 · os-steve ·
session_01ADHkmRxXmVQ41fqnaTPGAv -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 4f20614 commit b33365c
3 files changed
Lines changed: 32 additions & 6 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 | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| |||
300 | 306 | | |
301 | 307 | | |
302 | 308 | | |
303 | | - | |
| 309 | + | |
304 | 310 | | |
305 | 311 | | |
306 | 312 | | |
| |||
416 | 422 | | |
417 | 423 | | |
418 | 424 | | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
423 | 429 | | |
424 | 430 | | |
425 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
0 commit comments