Skip to content

Commit 97e63d9

Browse files
docs(skills): a bundle navigation node may carry keywords without a label (#39357)
<!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg9nbS7sXTWidzP4DpWfN2PJ)_ Fixes #39209 Claim for this branch: comment 7381632637 Clause-②: no Metadata-protocol: none repo:objectstack@os-bill · os-bill · session_01Utp6Cbb4nipp9xHscbT4fu ## 维护者速读 - 用户能看到什么变化:文档和翻译技能现在写明,导航菜单项的翻译可以只给「搜索关键词」而不写标题;AI 帮人写翻译包时不会再硬塞一个占位标题。 - 为什么做:属于「导航项搜索关键词」这项功能的文档收尾,功能本身已上线,教学文字还停在旧说法。 - 出错会怎样:最坏是这三处说明写得不准,读者照旧多写一个标题;不影响任何运行中的应用,撤回本改动即可复原。 - 要你做什么:这是对外发布的技能包,需要你审阅后批准;其中技能文件的长度上限按你 11 月 27 日的话抬了 7 个 token。 ## What changes The contract has accepted a navigation translation node, `apps.APP.navigation.ID`, with `keywords` and no `label` since the change that made `label` optional beside `keywords` (`packages/spec/src/system/translation.zod.ts`, `requiredOneOf(['label', 'keywords'])`). Three taught surfaces still said `label` only. Each now states the rule once. - `content/docs/ui/apps.mdx`, the `keywords` paragraph: a bundle gives a locale's keywords beside the entry's `label` or without one. A locale that gives keywords and no `label` shows the label the next locale in its fallback chain gives, else the source label, and `os i18n check` still lists that label as untranslated. - `content/docs/ui/translations.mdx`, the App navigation row of the key table: the key is `label` / `keywords`, `keywords` is a list, a node carries at least one of the two, and the same fallback sentence. - `skills/objectstack-i18n/SKILL.md`, one line of the key map: `navigation.{id}.label` becomes `navigation.{id}.{label,keywords[]} (at least one)`. No bullet is added. - `skills/objectstack-i18n/evals/bundles-locales-coverage.json`: case 19 asks for a keywords-only node. - `scripts/check-skills-token-ratchet.mjs`: the `skills/objectstack-i18n/SKILL.md` row, 2243 to 2250. **The ratchet row.** The file sat at its ceiling with headroom 0, and the one-line edit measures 7 tokens (8999 bytes to 9027; 8972 priced to 9000). The entry is a router and nothing in it restates that line, so no deletion is shown. The row moves to the measurement and no further, under the maintainer's standing words of 2026-11-27 05:20Z, 「后续遇到这种问题,能适当放宽token 的限制」, as the note of record applies them (comment 7216253348 on the ratchet card: a PR's own legitimate change to that skill, at most 10 tokens over). The zone agreed before the commit. **Published skills size, before and after.** | | before | after | |:-|:-|:-| | `skills/objectstack-i18n/SKILL.md`, lines | 163 | 163 | | `skills/objectstack-i18n/SKILL.md`, tokens | 2243 | 2250 | | all `SKILL.md` files, lines | 2120 | 2120 | | authored bundle files, tokens | 182314 | 182321 | | eval fixtures, tokens (not ratcheted) | 96753 | 97047 | | whole shipped tree, tokens | 294016 | 294317 | Read first, by risk: `skills/objectstack-i18n/SKILL.md` (the key-map line, shipped to customer projects), `scripts/check-skills-token-ratchet.mjs` (the row and its comment), `content/docs/ui/translations.mdx` (the table row). ## Tests No package source changes, so no package build or test is owed. Gate readings are under Verification. ## Live check `pnpm --filter @objectstack/scenarios skill-evals --case objectstack-i18n/bundles-locales-coverage#19 --model haiku --effort medium`, one repeat, served claude-haiku-5-5, subscription login. The case asks for a zh-CN bundle that gives `nav_accounts` the search words 客户 and 公司 with no label, and whether a node without `label` is accepted. Run once on this branch (head 1958ca7) and once on a second tree at the base, 850d240, holding the same case file and the old skill text. | tree | with-skill | no-skill | |:-|:-|:-| | base 850d240 (old key-map line) | fail | fail | | this branch | pass | fail | <details><summary>What the with-skill turn answered</summary> - Base: "Nothing for `nav_accounts`. The skill's key map gives navigation text one path: `apps.{app}.navigation.{id}.label`", so it wrote no `keywords` at all (missing token `keywords`). - Branch: "add `keywords` under the navigation id and leave out `label`", with the bundle spelled as `apps.crm.navigation.nav_accounts.keywords` holding a list. </details> Notional cost the CLI reported: $0.01 per round, two rounds. ## Acceptance notes - The fallback sentence (next locale's label, else the source label; `os i18n check` still lists the label) is taken from the contract's own docblock on the node's `label` and from the changeset that shipped the change. It was not re-measured against a running app here. - The skill line does not carry the fallback sentence. The card asks the skill for `keywords` and the label-optional rule, and the skill's routing table already sends a reader to `translation.zod.ts` for the rest. - `scripts/check-skills-token-ratchet.mjs` and `content/docs/ui/translations.mdx` are also touched by other open PRs, on other rows. `overlap-check.mjs` at the push: clean against `origin/main` and the three PR heads it found. ## Verification Two minutes: open `skills/objectstack-i18n/SKILL.md` and read the `apps.{app}` line of the key map; then `node scripts/check-skills-token-ratchet.mjs` prints the i18n row at 2250 / 2250 and exits 0. Local gates, on head 1958ca7: the 82 commands `node scripts/pm/dispatch-gates.mjs --commands` derives from this diff, exit codes captured before any pipe. 79 exit 0, among them `check-skills-token-ratchet` and its `--self-test` (111 cases), `check:docs`, `check:skill-docs`, `check:doc-authoring`, `check:doc-anchors`, `check:skill-links`, `check:skill-identifier-liveness` and `check:nul-bytes`. <details><summary>The three that did not exit 0</summary> - `check:skill-examples`, exit 3, PREREQUISITE NOT MET (reads the client packages' built output). NOT MEASURED locally, reason: no full local build; CI's `TypeScript Type Check` is success on this head. - `check:dual-build-cjs-loads`, exit 3, PREREQUISITE NOT MET (every package's `dist/`). NOT MEASURED locally, same reason; CI's `Build Core` and `Lint & Repo Gates` are success on this head. - `check:pm-dispatch-gates`, exit 1 on its first run, on one self-test line about the tracked corpus listing, while a second worktree with an untracked copy of the eval file stood beside this one for the base live check. After that tree was removed, `node scripts/pm/dispatch-gates.mjs --self-test --fast` passes 2904 cases on the same head, and CI's `Lint · PM dispatch-gates` is success. Read as a reading of the box at that moment, not of this diff. </details> CI on head 1958ca7: every check run is success or an expected skip. Success: `Lint & Repo Gates`, `TypeScript Type Check`, `Test Core`, `Build Core`, `Governed Surface Queue Guard`, `Test UI`, `Live E2E UI`, `Dogfood Regression Gate`, `Check Changeset`, `Build Docs`, `Check Documentation Links`, `PR-body guards`. --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6Cbb4nipp9xHscbT4fu)_ <!-- signed: repo:objectstack@os-bill · os-bill · session_01Utp6Cbb4nipp9xHscbT4fu --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f32b7d6 commit 97e63d9

6 files changed

Lines changed: 40 additions & 4 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the objectstack-i18n key map says a navigation translation node takes keywords, with or without a label
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-i18n/SKILL.md`, one line of the key map: `apps.{app}: label, description, navigation.{id}.label` becomes `navigation.{id}.{label,keywords[]} (at least one)`. The contract has accepted a node with `keywords` and no `label` since the navigation translation node made `label` optional beside `keywords`; the skill still listed `label` alone, so an agent asked for a locale's search words wrote a placeholder label next to them, or did not know the key.
11+
12+
`keywords` is a list of strings, this locale's search words for the entry. A node with neither key is still refused. One eval case in `evals/bundles-locales-coverage.json` asks for a keywords-only node.

‎content/docs/ui/apps.mdx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ key instead.
315315
`keywords` lists other words a person may type to find the entry, such as its old
316316
name after a rename; they never gate anything, and a translation bundle gives each
317317
locale its own under `apps.<app>.navigation.<id>.keywords`, beside that entry's
318-
`label`. A locale's words add to the entry's own, never replace them, so a word
318+
`label` or without one. A locale that gives an entry keywords and no `label` shows
319+
the label the next locale in its fallback chain gives, else the entry's source label,
320+
and `os i18n check` still lists that label as untranslated. A locale's words add to the entry's own, never replace them, so a word
319321
written in the source language finds the entry in every language. The ⌘K command
320322
palette finds an `object`, `dashboard`, `page`, `report`, `component` or `url` entry
321323
by any of them, and when only one of these words matched it shows that word beside

‎content/docs/ui/translations.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default defineStack({
8080
| Form sections | `objects.<name>._sections.<section>` |
8181
| Custom validation-rule messages | `objects.<name>._validations.<rule>.message` |
8282
| Activity-milestone timeline rows | `objects.<name>._milestones.<field>.<value>.summary` — keyed by the milestone's watched `field` and the `value` it fires on; the template keeps the authored `{field}` tokens, and a reader in that language reads the row composed from it, a select token named by its translated option label. A language with no entry reads the authored `summary` |
83-
| App navigation | `apps.<app>.navigation.<id>.label` |
83+
| App navigation | `apps.<app>.navigation.<id>.label` / `keywords` — `keywords` is a list of the locale's search words for the entry, and a node carries at least one of the two. An entry given `keywords` and no `label` shows the label the next locale in the fallback chain gives, else its source label, and `os i18n check` still lists the label as untranslated |
8484
| Dashboard label / description | `dashboards.<name>.label` / `description` |
8585
| Dashboard widget title / description (the card-header subtitle) | `dashboards.<name>.widgets.<widgetId>.title` / `description` |
8686
| Dashboard global-filter label and static option labels | `dashboards.<name>.globalFilters.<filterName>.label` / `.options.<value>` — the key is the filter's `name`, or its `field` when it authors no `name`; an option is keyed by its `value` spelled as a string |

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,16 @@ export const CEILINGS = new Map([
11751175
// Authority: the ruling of record that orders the entry file down to router size, decision
11761176
// record #34691 S3 = A.
11771177
// ceil(($(wc -c < skills/objectstack-i18n/SKILL.md) - 27) / 4) == ceil(8969 / 4)
1178-
['skills/objectstack-i18n/SKILL.md', 2243],
1178+
// 2243 -> 2250: the key map's `navigation.{id}` line names `keywords[]` beside `label` and
1179+
// says a node carries at least one of the two, which is what the contract accepts since a
1180+
// navigation translation node parses with keywords and no label. One line changed, no
1181+
// bullet added; the file is 8999 bytes (8972 priced) -> 9027 (9000 priced). Nothing in a
1182+
// router this size restates that line, so there is no deletion to show: the row moves by
1183+
// the measured 7 tokens, pinned AT the measurement, under the maintainer's standing words
1184+
// of 2026-11-27 05:20Z, 「后续遇到这种问题,能适当放宽token 的限制」, as the note of
1185+
// record 7216253348 applies them (a PR's own legitimate change, at most 10 tokens over).
1186+
// ceil(($(wc -c < skills/objectstack-i18n/SKILL.md) - 27) / 4) == ceil(9000 / 4)
1187+
['skills/objectstack-i18n/SKILL.md', 2250],
11791188
// 12705 -> 12984 (2026-08-31 app-repo-principles raise, see the block above).
11801189
// The largest of the five and the frame the other four are read under: what an
11811190
// app IS (metadata under the platform's spec, authored from these skills,

‎skills/objectstack-i18n/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ objects.{object}: label, pluralLabel, description
8989
_tabs.{tab}.label, _relatedLists.{list}.label
9090
_milestones.{field}.{value}.summary, _validations.{rule}.message
9191
globalActions.{action}: the _actions keys (an action with no objectName)
92-
apps.{app}: label, description, navigation.{id}.label
92+
apps.{app}: label, description, navigation.{id}.{label,keywords[]} (at least one)
9393
picklists.{picklist}: label, options.{value}
9494
reports, positions, datasets, permissions (as the stack's permissions[]):
9595
{name}.label, {name}.description

‎skills/objectstack-i18n/evals/bundles-locales-coverage.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,19 @@
185185
"must_contain_any": [["title:", "\"title\":", ".title"], ["body:", "\"body\":", ".body"]],
186186
"must_not_contain": ["notices.0", "notices[0]"]
187187
}
188+
},
189+
{
190+
"id": 19,
191+
"prompt": "Our `crm` app has a navigation entry whose `id` is `nav_accounts`. Its zh-CN label is not decided yet, so this change must not write one, but zh-CN users should already find the entry in search by typing 客户 or 公司. What goes in the zh-CN translation bundle, and does `os validate` accept a navigation node that has no `label`?",
192+
"expected_output": "In the zh-CN `TranslationData`: `apps: { crm: { navigation: { nav_accounts: { keywords: ['客户', '公司'] } } } }`, that is `apps.crm.navigation.nav_accounts.keywords`. A navigation node carries `label`, `keywords`, or both, at least one of the two, so a node with `keywords` alone is accepted and no placeholder `label` is written. `keywords` is a list of strings, one per word a person types, not one string. A node with neither key is refused.",
193+
"files": [],
194+
"assertions": {
195+
"must_contain": ["apps", "crm", "navigation", "nav_accounts", "keywords", "客户", "公司"],
196+
"must_contain_any": [
197+
["keywords: [", "\"keywords\": [", "keywords`: ["]
198+
],
199+
"must_not_contain": ["searchKeywords", "synonyms: ["]
200+
}
188201
}
189202
]
190203
}

0 commit comments

Comments
 (0)