Skip to content

Commit 23fa361

Browse files
docs(skills): objectstack-i18n teaches the packages group, and both related-list skills name the two routes for a .custom arrangement's tab title (#38205)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuLGxAx4KpiXZ5b78imiUHke)_ Fixes #37988 Fixes #38128 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:给客户写翻译包的人和 AI 现在能从技能和文档里学到两件新事:软件包的名称怎么按语言显示,定制包自己改的相关列表标签页标题怎么翻译;运行时行为不变。 - 为什么做:是两次已合并改动欠下的技能补课(软件包名称按语言显示、定制包标签页标题按译文显示),不补的话 AI 会漏写软件包名称的译文,或继续走「照抄原标题」这条已不是唯一的老路。 - 出错会怎样:最坏是技能里某句说法和实际行为对不上,AI 写出的翻译会多报或漏报一条提示;只改文字,可以直接撤回。 - 要你做什么:技能文件改动需要你批准合并。 ## What changes **#37988: the translation bundle's `packages` group (shipped in ab04434).** - `skills/objectstack-i18n/SKILL.md`, the top-level group list: `packages` holds `name` / `description` keyed by `manifest.id`, the dotted id one key, with an inline example; a locale with no row shows `manifest.name`; `os lint` warns `i18n/missing-package` (`os i18n check` lists the same gap by key) until the package's own bundle carries the row. - `content/docs/ui/translations.mdx`: a "Package name / description" row in "What you can translate" (Setup's package list and Studio's switcher, where an app-carrying package keeps its app's label), and a paragraph with an example under "Draft with the CLI, gate in CI": `os lint` reports `i18n/missing-package`, `os i18n check` lists the key, and the row clears both. - `content/docs/protocol/kernel/i18n-standard.mdx`: a `packages` line in the `TranslationData` example with a paragraph on the key grammar, the refused spellings and the fallback; and a paragraph in "Orphan Keys and Option Keys": `packages` keys are held to the id grammar at parse, not resolved against manifests, and their coverage is `os lint`'s `i18n/missing-package` warning, which `os i18n check` lists by key. No row in the "Resolves when it names" table, because `os validate` does not resolve these keys (the out-of-scope question #37988 names). **#38128: a `.custom` arrangement's own tab title translates (shipped in ee2ffca).** - `skills/objectstack-i18n/SKILL.md`, the `_relatedLists.{list}` row, and `skills/objectstack-data/rules/relationships.md`, the `relatedLists` bullet: the remedy is now "drop it, or re-state the entry, shown, with a `label`": the owner's own keeps the owner's translation, and the arrangement's own (relationships.md now says "the arrangement's own") is read at the same key from the `.custom` package's bundle, which `os i18n check` expects. The owner-label route stays. - `i18n-standard.mdx`'s `_relatedLists` row already says this (PR #38085), so it is unchanged. **Token ratchet** (`scripts/check-skills-token-ratchet.mjs`): no raise, no ruling spent. Each addition is paid by deleting restatement in the same file. - `objectstack-i18n/SKILL.md` row 6333 → 6315, pinned at the measurement. Cut: the translation-reference paragraph's six-item list of action keys judged against a declaration (each item is already conditioned in the `_actions` row; now one sentence pointing at it, and the row gains "non-empty" on `submitText`, the one nuance only the list carried), and the three code-comment tails of the first example ("one TranslationData per locale", "assemble the locales into one bundle…", "…and register it on the stack"), which repeat the sentence introducing it. - `objectstack-data/rules/relationships.md` row 4181 → 4179, pinned at the measurement. Cut: "(cascade delete)" in the type table (Delete Behaviors states it), "to aggregate" after the roll-up intro, the grid example comment "(a field group names invoice_line, as above)", and "places the lines and" in the inline-entry example's comment. **Changeset**: `.changeset/37988-skills-i18n-packages-group.md`, `@objectstack/skills` patch. No package ships `content/docs`. ### Skills readings (lines / bytes / tokens) | | before | after | |:-|:-|:-| | `skills/objectstack-i18n/SKILL.md` | 506 / 25359 / 6333 | 504 / 25285 / 6315 | | `skills/objectstack-data/rules/relationships.md` | 383 / 16724 / 4181 | 384 / 16714 / 4179 | | all `skills/*/SKILL.md` | 4953 / 262572 | 4951 / 262498 | | all of `skills/**` | 23330 / 1224868 | 23329 / 1224784 | ## Tests Text only; no runtime code changes. The shapes taught were read on `main`: `packages/spec/src/system/translation.zod.ts` (the `packages` member: id-grammar key, `name` / `description`, aliases `package`, `label`, `title`, `displayName`), `packages/cli/src/utils/i18n-coverage.ts` (the `package` bucket, `i18n/missing-package`), `StudioPackageSwitcher.tsx` (`appLabel || packageName(p)`), and PR #38085's commit body plus `i18n-standard.mdx`'s `_relatedLists` row. A `tsx` probe of `defineTranslationBundle` from source refused a `crm` key (id grammar) and answered `package` → `packages` and leaf `label` → `name`. ## Acceptance notes - Branch `claude/project-thread-o2yspl` is assigned by the harness, not the repo's `claude/issue-N-…` convention. - Open PR #38196 edits other lines of `skills/objectstack-i18n/SKILL.md` (table separators, the Registration paragraph, the `os i18n check` examples). This diff stays out of those lines, and `git merge-tree` of this head with #38196's head is clean. The i18n ratchet row will need a re-measure on whichever lands second; this branch merges `main` again after #38196 lands. - Contract review 7235862784 (PASS on 49440c7): S1 fixed in 626d0d9 (the id `i18n/missing-package` is `os lint`'s, built by `foldCoverageIssues` in `packages/cli/src/commands/lint.ts`; `os i18n check` prints the key and `source: "package"`, never the id), in the skill and both docs pages; N1 fixed ("or the arrangement's own"); N2 kept as written, as the record accepts. - Setup's package list fallback to `manifest.name`: confirmed by the review's reading of `PackagesPage.tsx`. ## Verification Two-minute check: `node scripts/check-skills-token-ratchet.mjs`, expect exit 0 with `skills/objectstack-i18n/SKILL.md` 6315 / 6315 and `skills/objectstack-data/rules/relationships.md` 4179 / 4179. Read first, by risk: `skills/objectstack-i18n/SKILL.md` (the `_relatedLists` row and the replaced action-key sentence), `skills/objectstack-data/rules/relationships.md` (the remedy), `content/docs/protocol/kernel/i18n-standard.mdx` (the `packages` paragraphs). <details><summary>Local gates at 626d0d9</summary> `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran FILE` with each command recorded as `CMD :: exit N`: **92 derived, 91 run, 1 NOT-MEASURED, 0 UNRUN**; every run family exit 0, among them `check-skills-token-ratchet.mjs` (and `--self-test`), `check:doc-authoring`, spec `check:docs` / `check:skill-docs` / `check:skill-examples` / `check:skill-served-sections` / `check:liveness`, `check:empty-changeset`, `check-adr-0087-registration.mjs --base origin/main`. - NOT MEASURED: `check:dual-build-cjs-loads`, exit 3 (prerequisite not met: it reads every package's `dist/`, and only the spec and client-react closure was built). The diff publishes skills text only. - CI at 626d0d9: 33 success, 15 skipped, 0 failed; mergeable. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgX4oqMXTKRLtGx5S9c <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgX4oqMXTKRLtGx5S9c --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent c823577 commit 23fa361

6 files changed

Lines changed: 88 additions & 21 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): `objectstack-i18n` teaches the bundle's `packages` group, and both related-list skills name the two ways a `.custom` arrangement's tab title is translated
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-i18n/SKILL.md`, the top-level group list: `packages` holds a package's display `name` / `description`, keyed by its `manifest.id` with the dotted id as one key (`packages: { 'com.acme.crm': { name: '客户关系' } }`). A locale with no row shows `manifest.name`, and `os lint` warns `i18n/missing-package` (`os i18n check` lists the same gap by key) until that package's own bundle carries the row.
11+
12+
`skills/objectstack-i18n/SKILL.md`, the `_relatedLists.{list}` row, and `skills/objectstack-data/rules/relationships.md`, the `relatedLists` bullet: where the paired `.custom` arrangement leaves a list with no key, the remedy is to drop the key or re-state the entry, shown, with a `label`. The owner's own `label` keeps the owner's translation; a `label` of the arrangement's own is translated at the same `objects.{parent}._relatedLists.{list}.label` key in the `.custom` package's bundle, which `os i18n check` expects.
13+
14+
Nothing an author can write changes. Neither file grows: `objectstack-i18n/SKILL.md` moves down to its measurement (6333 to 6315), the additions paid by replacing the translation-reference paragraph's list of action keys judged against a declaration, each already conditioned in the `_actions` row, with one sentence pointing at that row, and by dropping the code-comment tails that repeat the sentence introducing the first example; `rules/relationships.md` moves down too (4181 to 4179), paid by four restating phrases in the same file.

‎content/docs/protocol/kernel/i18n-standard.mdx‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,23 @@ const zh: TranslationData = {
378378
apps: { crm: { label: '客户关系管理', navigation: { home: { label: '首页' } } } },
379379
dashboards: { sales_overview: { label: '销售概览' } },
380380
pages: { landing: { title: '欢迎' } },
381+
packages: { 'com.acme.crm': { name: '客户关系管理', description: '销售与客户管理' } }, // keyed by manifest.id
381382
globalActions: { export_csv: { label: '导出 CSV' } },
382383
messages: { commonSave: '保存' },
383384
};
384385
```
385386

387+
`packages` is keyed by the package's `manifest.id`, and the dotted id is **one**
388+
key: a client reads the row by direct property access, never as a dot path. A
389+
key that is not a manifest id (a namespace like `crm`, a display name) is
390+
refused at parse, as are `package` and the leaf spellings `label`, `title` and
391+
`displayName`, each answered with the declared spelling. A row overlays the
392+
manifest's own `name` / `description` where the console lists packages (Setup's
393+
package list and Studio's package switcher); a package with no row for the
394+
reader's locale shows its `manifest.name`, which stays the authored value on
395+
every wire and in every editor. Each package ships the row for its own id in
396+
the bundle it already carries.
397+
386398
**Key benefits:**
387399
- ✅ All translatable content for one object in one place
388400
- ✅ CLI can generate translation skeletons per object
@@ -1221,6 +1233,14 @@ options: { 'Direct Mail': '直邮' } // ❌ keyed by the label — never resolv
12211233
options: { 'direct-mail': '直邮' } // ❌ a variant spelling of the value
12221234
```
12231235

1236+
`packages` keys are held to the manifest id grammar at parse and are not
1237+
resolved against the artifact's manifests here. Their coverage is a separate
1238+
report: `os i18n extract` scaffolds `packages.{id}.name` / `.description` for
1239+
the stack's manifest and every composed package. `os lint` reports a missing
1240+
one as the warning `i18n/missing-package`, and `os i18n check` lists the same
1241+
gap by its key; adding the row to that package's own bundle for the locale
1242+
clears both.
1243+
12241244
`messages`, `settingsCommon` and `metadataForms` are **not** checked: their
12251245
keys are owned by application code, plugins, and the platform's own
12261246
metadata-type registry rather than by this stack's metadata, so there is no set

‎content/docs/ui/translations.mdx‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export default defineStack({
102102
| Permission-set label / description | `permissions.<name>.label` / `description` — the group is spelled as the stack spells the collection (`permissions[]`), keyed by the set's `name` |
103103
| Doc book title, description and section titles | `books.<name>.label` / `description` / `groups.<key>.label` — keyed by the book's `name` and each group's `key`; overlaid on every served book and on the book tree, which is what the docs sidebar draws. A doc's own title and body localize through `doc.translations` instead |
104104
| Import mapping label | `mappings.<name>.label` — keyed by the mapping's `name`; overlaid on every served mapping, which is the list the import wizard offers by name. A mapping's `fieldMapping` holds column and field names, not copy: a target field's label is translated under `objects.<object>.fields.<field>.label` |
105+
| Package name / description | `packages.<manifest id>.name` / `description` — keyed by the package's `manifest.id` (reverse-domain, such as `com.acme.crm`; the dotted id is one key), never by its namespace or display name, which the parse refuses. Overlaid where the console lists packages: Setup's package list and Studio's package switcher, where a package that publishes an app is still named by the app's label. With no row for the reader's locale, a package shows its `manifest.name`. Each package ships the row for its own id in its own bundle |
105106
| Global actions, messages | `globalActions`, `messages` |
106107
| Settings UI shell copy (the source badge on a settings row) | `settingsCommon.sourceLabels.<layer>` — the per-namespace settings copy under `settings` is **platform-only**: an app bundle carrying it is refused by name, and the platform's own strings are translated in `@objectstack/service-settings`'s bundle |
107108
| A label written as an inline locale map (`label: { en: 'Members', 'zh-CN': '成员' }`) | Nowhere — it is written on the metadata and resolved at render time; see **Current boundaries** below |
@@ -360,6 +361,19 @@ A missing string in the **default** locale is an error; missing strings in
360361
other locales are warnings until you set `--strict` / `--threshold`. The Todo
361362
example ships a completeness test alongside its bundles — worth copying.
362363

364+
A package's own display name is part of that report. `os i18n extract` scaffolds
365+
`packages.<manifest id>.name` / `.description` for the stack's manifest and
366+
every composed package. `os lint` reports a missing one as the warning
367+
`i18n/missing-package`, and `os i18n check` lists the same gap by its key
368+
(`packages.com.acme.crm.name`). Clear it by adding the row to that package's
369+
own bundle for the locale; the source locale needs one only when the displayed
370+
name should differ from `manifest.name`:
371+
372+
```typescript
373+
// one locale of the package's own bundle (zh-CN)
374+
packages: { 'com.acme.crm': { name: '客户关系管理', description: '销售与客户管理' } },
375+
```
376+
363377
### What counts as *your* coverage
364378

365379
The Studio's own metadata forms (`metadataForms.*` — several hundred keys

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,19 @@ export const CEILINGS = new Map([
847847
// the retired action location word `list_item` (-7 bytes); the row follows the measurement
848848
// down, 24384 bytes (24357 priced) -> 24377 (24350 priced) -> 6088 tokens.
849849
['skills/objectstack-formula/SKILL.md', 6088], // -53 (was 6055), then -5 A2′ (was 6002), then +11 (was 5997), then +82 (was 6008), then -2 (was 6090)
850-
['skills/objectstack-i18n/SKILL.md', 6333], // -11 (was 6349), then -5 A2′ (was 6338)
850+
// 6333 -> 6315: the top-level group list gains `packages` (`name` / `description` by
851+
// `manifest.id`, the `os lint` warning `i18n/missing-package` and what clears it), and the
852+
// `_relatedLists` row's remedy names both routes under a `.custom` arrangement (the owner's
853+
// `label`, or the arrangement's own, read from the `.custom` package's bundle). Paid in full
854+
// by deleting restatement in this file: the translation-reference paragraph's list of action
855+
// keys judged against a declaration, each already conditioned in the `_actions` row (now one
856+
// sentence pointing at that row, which gains "non-empty" on `submitText`), and the
857+
// first example's three code-comment tails ("one TranslationData per locale", "assemble the
858+
// locales into one bundle…", "…and register it on the stack"), which repeat the sentence
859+
// introducing that example. No raise, no ruling spent:
860+
// 25359 bytes (25332 priced) -> 25285 (25258 priced); the row follows the measurement down.
861+
// ceil(($(wc -c < skills/objectstack-i18n/SKILL.md) - 27) / 4) == ceil(25258 / 4)
862+
['skills/objectstack-i18n/SKILL.md', 6315], // -11 (was 6349), then -5 A2′ (was 6338), then -18 (was 6333)
851863
// 12705 -> 12984 (2026-08-31 app-repo-principles raise, see the block above).
852864
// The largest of the five and the frame the other four are read under: what an
853865
// app IS (metadata under the platform's spec, authored from these skills,
@@ -1381,7 +1393,15 @@ export const CEILINGS = new Map([
13811393
// 4201 -> 4181: the roll-up visibility paragraph no longer asks to remove Modify All before
13821394
// masking a summary (19: it overrides no mask). 16801 -> 16723 bytes.
13831395
// ceil($(wc -c < skills/objectstack-data/rules/relationships.md) / 4) == ceil(16723 / 4)
1384-
['skills/objectstack-data/rules/relationships.md', 4181], // -2 to the measurement (was 4203)
1396+
// 4181 -> 4179: the `relatedLists` bullet's remedy under a `.custom` arrangement names the
1397+
// arrangement's own `label` beside the owner's (translated in the `.custom` package's
1398+
// bundle). Paid by deleting restatement in this file: "(cascade delete)" in the type table
1399+
// (the Delete Behaviors section states it), "to aggregate" after the roll-up intro, and the
1400+
// grid example's "(a field group names invoice_line, as above)", and "places the lines and"
1401+
// in the inline-entry example's comment (the prose above it says so). 16724 -> 16714 bytes;
1402+
// the row follows the measurement down.
1403+
// ceil($(wc -c < skills/objectstack-data/rules/relationships.md) / 4) == ceil(16714 / 4)
1404+
['skills/objectstack-data/rules/relationships.md', 4179], // -2 to the measurement (was 4203), then -2 (was 4181)
13851405
// NEW FILE (#14296 item 1 = A, condition (b)): the entry's Security & Access
13861406
// Control block moved here whole. Pinned at its landed count — no headroom,
13871407
// because a split that arrives with budget is a raise wearing a new path.

‎skills/objectstack-data/rules/relationships.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| Type | Lifecycle | Required | Sharing | Roll-ups | Use Case |
1212
|:-----|:----------|:---------|:--------|:---------|:---------|
1313
| `lookup` | Independent | Optional by default | Independent | Via `summary` | "Related to" |
14-
| `master_detail` | Coupled (cascade delete) | Forced only under `controlled_by_parent`, unless the optional master (below); else lint-warned | Inherits parent; read-on-master opt-ins (below) | Via `summary` | "Owned by" |
14+
| `master_detail` | Coupled | Forced only under `controlled_by_parent`, unless the optional master (below); else lint-warned | Inherits parent; read-on-master opt-ins (below) | Via `summary` | "Owned by" |
1515
| `tree` | Self-reference | Optional — and so is `reference`, which when written must name this object itself; any other object is refused at parse, not lint-warned | N/A | Not available | Hierarchical |
1616

1717
## Patterns
@@ -188,7 +188,7 @@ transaction.
188188
}
189189
```
190190

191-
`object` is the child object to aggregate, `field` its field (ignored for
191+
`object` is the child object, `field` its field (ignored for
192192
`count`), `function` one of `count` / `sum` / `min` / `max` / `avg`. Optional:
193193
`filter` (below) and `relationshipField` (omitted: the child's `lookup` /
194194
`master_detail` referencing this parent). Refused at publish when omitted and the
@@ -254,7 +254,7 @@ and parent + children save in **one atomic transaction**. A parent or child
254254
declaring `enable.apiMethods` must list `'bulk'`, or that save is refused `405 OBJECT_API_METHOD_NOT_ALLOWED`.
255255

256256
```typescript
257-
// PARENT `invoice`: the group places the lines and holds no fields
257+
// PARENT `invoice`: the group holds no fields
258258
fieldGroups: [{ key: 'lines', label: 'Line Items', relatedList: 'invoice_line' }],
259259

260260
// CHILD `invoice_line`: its master_detail FK, declaring no `relatedList`
@@ -289,7 +289,7 @@ editable fields, else `grid`.
289289
**Modeling a `'grid'` line item for the full editor:**
290290

291291
```typescript
292-
// Parent (a field group names invoice_line, as above)
292+
// Parent
293293
Invoice = {
294294
fields: {
295295
tax_rate: Field.number({ label: 'Tax Rate (%)' }), // → live Subtotal/Tax/Total stack
@@ -360,7 +360,8 @@ audit_ref: { type: 'master_detail', reference: 'invoice', relatedList: false },
360360
arrangement re-stating the entry with no `label`, or hiding it, leaves none (a
361361
bare child's name, labelled or not, covers each of its `child.field` lists too) and
362362
`os validate` refuses the key: drop it, or re-state the entry, shown, with the
363-
owner's `label`. A child in the stack with no inbound FK
363+
owner's `label`, or the arrangement's own, translated at that key in the `.custom`
364+
package's bundle. A child in the stack with no inbound FK
364365
is refused everywhere; one that exists nowhere is refused by `os validate` /
365366
`os build` (bar a platform or sibling-artifact name) and by a metadata
366367
write naming no package (one into a package is stored, placing nothing).

0 commit comments

Comments
 (0)