From b6a298b6fe0a4ba27cdf8ab047fa78c7e8afef6a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 02:50:23 +0000 Subject: [PATCH 1/3] docs(skills): teach the mappings group, action and hook texts, and drop the stale label-serving caveat The i18n skill names the `mappings` translation group and where a hook's or a script action's declared `texts` sit in a bundle; the ui actions rule teaches declaring `texts` and asking for them with `ctx.text`. The caveat that serving reads inline labels as defaultLocale text is replaced by the narrower truth that still holds (`t()`-read labels in refusal messages). Claude-Session: https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7 Co-authored-by: Claude --- .changeset/34962-i18n-skill-texts.md | 13 +++++++ scripts/check-skills-token-ratchet.mjs | 15 +++++++- skills/objectstack-i18n/SKILL.md | 34 ++++++++----------- .../evals/bundles-locales-coverage.json | 22 +++++++++++- .../evals/views-apps-actions-pages.json | 10 ++++++ skills/objectstack-ui/rules/actions.md | 15 ++++++-- 6 files changed, 85 insertions(+), 24 deletions(-) create mode 100644 .changeset/34962-i18n-skill-texts.md diff --git a/.changeset/34962-i18n-skill-texts.md b/.changeset/34962-i18n-skill-texts.md new file mode 100644 index 00000000000..5da9ddbe93a --- /dev/null +++ b/.changeset/34962-i18n-skill-texts.md @@ -0,0 +1,13 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): the i18n and ui skills teach the `mappings` translation group, an action's `texts` and where hook and action texts sit in a bundle; the stale label-serving caveat is gone + +Clause-②: no +Metadata-protocol: none + +- `objectstack-i18n`: the top-level group list names `mappings` (`mappings.{mapping}.label`, an import mapping's label by its `name`). The paragraph on keys picked in the organization's language now covers the sentences 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`. +- `objectstack-i18n`: the caveat that label serving reads inline text as `defaultLocale` text is removed, because serving honours `i18n.sourceLocale`. What is still true stays: validation and refusal messages read labels through `t()`, which falls back to `fallbackLocale`, else `defaultLocale`, so an English-source app with a zh-CN default still declares `fallbackLocale: 'en'`. +- `objectstack-ui` `rules/actions.md`: a `script` action declares a sentence it writes into a record under `texts` and asks for it with `ctx.text`. The rule covers the organization's language, a missing translation, an unreadable Localization setting and an undeclared key. The refusals paragraph points at the i18n skill for its bundle keys instead of spelling them. +- Evals: the i18n set gains a `mappings` case and a hook-texts bundle-key case, and case 11 states the remaining `t()` reason for `fallbackLocale: 'en'`. The ui set gains an action `texts` case. diff --git a/scripts/check-skills-token-ratchet.mjs b/scripts/check-skills-token-ratchet.mjs index b8d6ab2ecd2..d5749052388 100644 --- a/scripts/check-skills-token-ratchet.mjs +++ b/scripts/check-skills-token-ratchet.mjs @@ -1424,7 +1424,20 @@ export const CEILINGS = new Map([ // in the text that row moved in). Same ruling as the lines above (2026-10-27, tap A): // 「A:先削重复,余额按实测提高」 (ruling record 6513306068). // ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(12720 / 4) - ['skills/objectstack-ui/rules/actions.md', 3180], + // 3180 -> 3334 (#35097): a script action writes a sentence in the organization's language. + // One H3 after the refusals paragraph: declare it under `texts`, ask for it with `ctx.text`, the + // missing-translation and unreadable-setting answers, and when an undeclared key is refused; + // the bundle keys are the i18n skill's and only pointed at. PAID DOWN FIRST by 29 bytes of + // restatement in this file: the refusals paragraph no longer spells the bundle key + // `objects.._actions..refusals..message`, which objectstack-i18n owns + // (its `_actions.{action_name}.refusals.{CODE}` row), and points there instead. Nothing else + // in the file restates another passage (see the 2777 -> 2808 note above), so the same ruling's + // second half carries the rest. Arithmetic: the text adds 644 bytes, the cut removes 29, so + // the file is 12720 -> 13335 bytes -> 3334 tokens, zero headroom before, ceiling +154, the + // measured remainder only, pinned AT the measurement. Same ruling (2026-10-27, tap A): + // 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). + // ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(13335 / 4) + ['skills/objectstack-ui/rules/actions.md', 3334], // 6090 -> 6252 (#19715, card item 4): a 5-line table of contents at the top, // anchors to the file's existing headings, nothing else changed. +162 tokens, // zero headroom to absorb any of it, ceiling +162. Maintainer ruling diff --git a/skills/objectstack-i18n/SKILL.md b/skills/objectstack-i18n/SKILL.md index 6625e0bde0a..494d1326cd1 100644 --- a/skills/objectstack-i18n/SKILL.md +++ b/skills/objectstack-i18n/SKILL.md @@ -43,13 +43,14 @@ export default defineStack({ | Property | Type | Required / Default | Description | |:---------|:-----|:-------------------|:------------| | `defaultLocale` | `string` | **required** | The locale a user who has not chosen one gets | -| `sourceLocale` | `string` | optional, defaults to `defaultLocale` | The language inline `label:` text is written in; read by `os lint`, `os i18n check`, `os i18n extract` | +| `sourceLocale` | `string` | optional, defaults to `defaultLocale` | The language inline `label:` text is written in: a request in it is served that text; read by `os lint`, `os i18n check`, `os i18n extract` | | `supportedLocales` | `string[]` | **required** | All supported locales | | `fallbackLocale` | `string` | optional | Fallback when translation missing | An app authored in English for Chinese users declares `defaultLocale: 'zh-CN', sourceLocale: 'en'`, -not an English `defaultLocale`. ⚠️ Label serving still reads inline text as `defaultLocale` text: with no -`fallbackLocale: 'en'`, an `en` request reaches the zh-CN bundle before the English inline label. +not an English `defaultLocale`. ⚠️ 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. `sourceLanguage`, `authoringLocale` and `authoringLanguage` are refused, each naming `sourceLocale`. --- @@ -182,14 +183,17 @@ the pages themselves localize through `doc.translations`, and the inline `transl book once carried stays retired), `metadataForms`, `settingsCommon`; `reports`, `positions` and `permissions` hold `label` + `description` by name, so do `datasets` and each dataset member at `datasets.{dataset}.{dimensions,measures}.{member}` (a member's `synonyms` have no key: one -authored list carries every language), and a joined report's block headings sit at +authored list carries every language), `mappings` holds an import mapping's `label` by its `name` +(`mappings.{mapping}.label`), and a joined report's block headings sit at `reports.{report}.blocks.{block_name}.{label,description}`, keyed by the block's required `name`. Three keys sit deeper than their group's `label`: a `page:tabs` item at `pages.{page}.components.{tabs_id}.items.{value}.label` (by the item's `value`; an item without one has no key), an approval step at `flows.{flow}.approvals.{node_id}.label`, and the text a `create_record` / `update_record` writes into a field marked `{ dialect: 'template', source }` at -`flows.{flow}.records.{node_id}.fields.{field}`, picked in the organization's language (the -Localization setting if set, else `i18n.defaultLocale`; never the run starter's). +`flows.{flow}.records.{node_id}.fields.{field}`. That text, and each sentence a hook or a `script` +action declares in `texts` and writes through `ctx.text` — `hooks.{hook}.texts.{key}.message`, +`_actions.{action_name}.texts.{key}.message` (also under `globalActions`) — is picked in the +organization's language (the Localization setting if set, else `i18n.defaultLocale`; never the caller's). `os i18n extract --no-objects-only` scaffolds every group above but `messages` and `settingsCommon`, all three keys included. The `inlineTitle`, report-block and table-column keys, as the shipped `app-crm`, `app-showcase` and platform bundles spell them for `zh-CN` @@ -234,9 +238,7 @@ whose column path that field's `columns[]` does not list; under an action that declares neither `confirmText` nor a non-empty `params` — a bundle translates a dialog the action declares and cannot add one. A param's inline option keys share the option warning with a field's `options`; a param that -references a `field` and declares no inline `options` is not judged. A bundle keyed to -something since renamed still parses — the label just renders silently in its source locale -while every neighbouring one resolves. +references a `field` and declares no inline `options` is not judged. --- @@ -426,19 +428,13 @@ This writes `.objects.generated.ts` TypeScript modules (not JSON), plus the source locale is filled from schema labels, other locales follow `--fill` (`empty | default | todo`). `--default-locale` overrides the source locale for one run (`i18n.sourceLocale`, else `i18n.defaultLocale`, else `en`). `os i18n extract --help` lists -the rest: `--filter`, `--no-merge`, `--objects-only`, `--source-hashes`, `--dry-run`, `--json`, … +the rest: `--filter`, `--no-merge`, `--dry-run`, `--json`, … ⚠️ **`--objects-only` is on by DEFAULT**, so extract writes only the `objects` / -`globalActions` subtree — while `os i18n check` also demands `app`, `navigation`, -`dashboard`, `widget`, `dataset`, `report`, `picklist`, `page`, `flow`, `position` and -`permission` keys. Pass `--no-objects-only` to include those -groups, or author them by hand. +`globalActions` subtree while `os i18n check` still asks for the other groups: pass +`--no-objects-only`, or author them by hand. -### 2. Translate - -Fill in the values manually. - -### 3. Register +### 2. Register A stack registers its bundles with `defineStack({ translations: [...] })`. A **package or plugin shipping its own generated bundle** — the most common shape in this repo — has one diff --git a/skills/objectstack-i18n/evals/bundles-locales-coverage.json b/skills/objectstack-i18n/evals/bundles-locales-coverage.json index 5e229184997..d48e66ebaa2 100644 --- a/skills/objectstack-i18n/evals/bundles-locales-coverage.json +++ b/skills/objectstack-i18n/evals/bundles-locales-coverage.json @@ -114,7 +114,7 @@ { "id": 11, "prompt": "Our app's metadata is authored in English — every inline `label:` is English — but it is sold to Chinese users, who should get Chinese without choosing a language. How do we declare the stack's `i18n` config?", - "expected_output": "Declare `sourceLocale: 'en'` beside `defaultLocale: 'zh-CN'` in the stack's `i18n` block, with `zh-CN` in `supportedLocales`: `defaultLocale` is the locale a user who has not chosen one gets, `sourceLocale` the language the inline labels are written in. `os lint`, `os i18n check` and `os i18n extract` then treat `en` as the source — extract fills the `en` bundle from the inline text, and the rows the tooling asks for are the zh-CN ones. Also declare `fallbackLocale: 'en'`: label serving still reads inline text as `defaultLocale` text, so without it an `en` request reaches the zh-CN bundle before the English inline label.", + "expected_output": "Declare `sourceLocale: 'en'` beside `defaultLocale: 'zh-CN'` in the stack's `i18n` block, with `zh-CN` in `supportedLocales`: `defaultLocale` is the locale a user who has not chosen one gets, `sourceLocale` the language the inline labels are written in. `os lint`, `os i18n check` and `os i18n extract` then treat `en` as the source — extract fills the `en` bundle from the inline text, and the rows the tooling asks for are the zh-CN ones. Label serving then answers an `en` request from the English inline label. Also declare `fallbackLocale: 'en'`: validation and refusal messages still read labels through `t()`, which falls back to `fallbackLocale`, else `defaultLocale`, so without it an `en` refusal names a field by its zh-CN row.", "files": [], "assertions": { "must_contain": ["sourceLocale", "defaultLocale: 'zh-CN'", "fallbackLocale: 'en'", "supportedLocales"], @@ -130,6 +130,26 @@ "must_contain": ["_actions", "import_leads", "resultDialog.columns.rows", "error.message"], "must_not_contain": ["error: {"] } + }, + { + "id": 14, + "prompt": "Our package ships a named import mapping `lead_csv` with `label: 'Lead CSV (standard)'`. zh-CN users still see that English label in the import wizard's saved-mapping picker. Where does the translation go?", + "expected_output": "`mappings.lead_csv.label` in the zh-CN `TranslationData`: `mappings` is a top-level group beside `objects`, keyed by the mapping's `name` — `mappings: { lead_csv: { label: '线索 CSV(标准)' } }`. `label` is the only key (a mapping declares no description). The mapped fields' own labels stay under `objects..fields..label`. Not an `objects` entry and not a `messages` key.", + "files": [], + "assertions": { + "must_contain": ["mappings", "lead_csv", "label"], + "must_not_contain": ["objects: { lead_csv", "messages: {"] + } + }, + { + "id": 15, + "prompt": "The `lead_follow_up` hook declares `texts: { follow_up_subject: { message: 'Follow up with qualified lead: {{ lead }}', params: ['lead'] } }` and writes a task subject with `ctx.text('follow_up_subject', { lead: ctx.input.name })`. Our organization works in zh-CN, but the tasks still read English. Which bundle key translates it, and whose language is picked?", + "expected_output": "`hooks.lead_follow_up.texts.follow_up_subject.message` in the zh-CN bundle, keyed by the hook's `name` (not under `objects` or `messages`), the translation keeping its `{{ lead }}` hole, which the runtime fills after picking it: `'跟进已确认的线索:{{ lead }}'`. It is picked in the organization's language — the Localization setting if somebody set it, else `i18n.defaultLocale` — never the language of the person whose save fired the hook. With no translation the declared sentence is written, filled.", + "files": [], + "assertions": { + "must_contain": ["hooks", "lead_follow_up", "texts", "follow_up_subject", "{{ lead }}", "defaultLocale"], + "must_not_contain": ["messages: {", "_hooks"] + } } ] } diff --git a/skills/objectstack-ui/evals/views-apps-actions-pages.json b/skills/objectstack-ui/evals/views-apps-actions-pages.json index acd3596f15e..a3d3dc8ec91 100644 --- a/skills/objectstack-ui/evals/views-apps-actions-pages.json +++ b/skills/objectstack-ui/evals/views-apps-actions-pages.json @@ -200,6 +200,16 @@ "must_contain": ["refusals", "NOT_DRAFT", "409", "_actions"], "must_not_contain": ["hooks.submit_signoff"] } + }, + { + "id": 21, + "prompt": "The `send_email` script action on `crm_contact` logs a `crm_activity` whose subject its `js` body builds as `'Email: ' + input.subject`. Our organization works in zh-CN, but every logged subject reads English. Make the subject follow the organization's language.", + "expected_output": "The action declares `texts: { email_subject: { message: 'Email: {{ subject }}', params: ['subject'] } }` and the body writes `const subject = await ctx.text('email_subject', { subject: input.subject });` instead of concatenating. The sentence is answered in the organization's language (the Localization setting if somebody set it, else `i18n.defaultLocale`), never the language of the person who pressed the button, and translated at `objects.crm_contact._actions.send_email.texts.email_subject.message`, the translation keeping its `{{ subject }}` hole. With no translation the declared sentence is written. A key `texts` does not declare is refused. Not a locale branch in the body, and not a `messages` lookup.", + "files": [], + "assertions": { + "must_contain": ["texts", "email_subject", "ctx.text", "_actions"], + "must_not_contain": ["'Email: ' +", "hooks.send_email"] + } } ] } diff --git a/skills/objectstack-ui/rules/actions.md b/skills/objectstack-ui/rules/actions.md index 8d9776350bc..86289a3b1e5 100644 --- a/skills/objectstack-ui/rules/actions.md +++ b/skills/objectstack-ui/rules/actions.md @@ -137,9 +137,18 @@ Bodies execute **trusted** (`ctx.api` / with a `js` body (an inline `target` function is lowered to one; any other action is refused the key) declares `refusals` and throws the code, as `crm_add_invoice_line` below does: the catalogue, throws and checks are a hook's (objectstack-data → Lifecycle Hooks → Declared refusals). The -sentence is answered as `userMessage`, translated at -`objects.._actions..refusals..message` (objectstack-i18n); the console's -failure toast shows it unless the action authors `errorMessage`. +sentence is answered as `userMessage`, translated under the action's `refusals` keys +(objectstack-i18n); the console's failure toast shows it unless the action authors `errorMessage`. + +### Writing in the organization's language (`texts`) + +A sentence the body writes into a record (an activity's subject) is read by the whole +organization: the same actions declare it under `texts` and ask for it by key — +`texts: { email_subject: { message: 'Email: {{ subject }}', params: ['subject'] } }`, then +`await ctx.text('email_subject', { subject: input.subject })`. It answers in the organization's +language, never the caller's (keys: objectstack-i18n); 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. ## Opening in a New Tab From 81eae9ab9bf7e203dc0531557439ce71d8fa171c Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 02:56:47 +0000 Subject: [PATCH 2/3] docs(skills): the i18n group list names mappings with the showcase example Claude-Session: https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7 Co-authored-by: Claude --- skills/objectstack-i18n/SKILL.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/skills/objectstack-i18n/SKILL.md b/skills/objectstack-i18n/SKILL.md index 494d1326cd1..5543761fae0 100644 --- a/skills/objectstack-i18n/SKILL.md +++ b/skills/objectstack-i18n/SKILL.md @@ -180,11 +180,11 @@ picklist inherits them), `dashboards`, `datasets`, `reports`, `pages`, `flows`, spine, by `Book.name`: `books.{book}.label` / `.description`, and `groups.{group_key}.label` by each group's stable `key`, never its position — `books.crm_manual.groups.getting_started.label`; the pages themselves localize through `doc.translations`, and the inline `translations` map a -book once carried stays retired), `metadataForms`, `settingsCommon`; `reports`, `positions` and +book once carried stays retired), `mappings` (an import mapping's `label` by its `name`: +`mappings.{mapping}.label`), `metadataForms`, `settingsCommon`; `reports`, `positions` and `permissions` hold `label` + `description` by name, so do `datasets` and each dataset member at `datasets.{dataset}.{dimensions,measures}.{member}` (a member's `synonyms` have no key: one -authored list carries every language), `mappings` holds an import mapping's `label` by its `name` -(`mappings.{mapping}.label`), and a joined report's block headings sit at +authored list carries every language), and a joined report's block headings sit at `reports.{report}.blocks.{block_name}.{label,description}`, keyed by the block's required `name`. Three keys sit deeper than their group's `label`: a `page:tabs` item at `pages.{page}.components.{tabs_id}.items.{value}.label` (by the item's `value`; an item without @@ -195,14 +195,15 @@ action declares in `texts` and writes through `ctx.text` — `hooks.{hook}.texts `_actions.{action_name}.texts.{key}.message` (also under `globalActions`) — is picked in the organization's language (the Localization setting if set, else `i18n.defaultLocale`; never the caller's). `os i18n extract --no-objects-only` scaffolds every group above but `messages` and -`settingsCommon`, all three keys included. The `inlineTitle`, report-block and table-column -keys, as the shipped `app-crm`, `app-showcase` and platform bundles spell them for `zh-CN` +`settingsCommon`, all three keys included. The `inlineTitle`, report-block, table-column and +mapping keys, as the shipped `app-crm`, `app-showcase` and platform bundles spell them for `zh-CN` (`rows` is the table field's `path`, `error.message` one column's): ```typescript objects: { crm_opportunity_line_item: { fields: { opportunity: { inlineTitle: '产品明细' } } } }, reports: { showcase_task_overview: { blocks: { open_block: { label: '未完成任务' } } } }, objects: { sys_user: { _actions: { import_sso_users: { resultDialog: { columns: { rows: { email: '邮箱', 'error.message': '未添加的原因' } } } } } } }, +mappings: { showcase_inquiry_feed: { label: '询盘导入(营销 CSV)' } }, ``` `settings` is **platform-only** — it is keyed by a settings manifest's namespace and only @@ -307,8 +308,7 @@ os i18n check --strict --threshold=95 # CI gate: locale parity + minimum covera ``` It compares registered bundles against source metadata and reports missing keys -per locale for every surface the extractor walks — objects and their sub-keys, -global actions, apps, dashboards, pages, flow screens. The platform's metadata +per locale for every surface the extractor walks. The platform's metadata forms count only for a stack that ships their translations (`--include-platform` audits them anyway). Gaps in the source locale are errors, `--strict` promotes the rest, `--show-keys` lists them all; `os lint --i18n-strict` folds it in. From 14899df1c2c7c4e9ad221d8d209825f745ca5ffc Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 03:55:14 +0000 Subject: [PATCH 3/3] docs(skills): the ui actions rule keeps the refusals bundle key and names the texts key beside it The `_actions` key spelling is graded by the ui bundle's own evals, and the with-skill arm reads that bundle only, so it stays. Paid by two sentences that restated the example right below them; the ratchet row moves by the measured remainder. Two eval assertions no longer require text the prompt hands the answerer or the bundle does not teach. Claude-Session: https://claude.ai/code/session_01Utp6CazXu8zyYD5PC6J2u7 Co-authored-by: Claude --- .changeset/34962-i18n-skill-texts.md | 3 +- scripts/check-skills-token-ratchet.mjs | 28 ++++++++++--------- .../evals/bundles-locales-coverage.json | 4 +-- .../evals/views-apps-actions-pages.json | 2 +- skills/objectstack-ui/rules/actions.md | 19 +++++++------ 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/.changeset/34962-i18n-skill-texts.md b/.changeset/34962-i18n-skill-texts.md index 5da9ddbe93a..d7ae8c4f268 100644 --- a/.changeset/34962-i18n-skill-texts.md +++ b/.changeset/34962-i18n-skill-texts.md @@ -9,5 +9,6 @@ Metadata-protocol: none - `objectstack-i18n`: the top-level group list names `mappings` (`mappings.{mapping}.label`, an import mapping's label by its `name`). The paragraph on keys picked in the organization's language now covers the sentences 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`. - `objectstack-i18n`: the caveat that label serving reads inline text as `defaultLocale` text is removed, because serving honours `i18n.sourceLocale`. What is still true stays: validation and refusal messages read labels through `t()`, which falls back to `fallbackLocale`, else `defaultLocale`, so an English-source app with a zh-CN default still declares `fallbackLocale: 'en'`. -- `objectstack-ui` `rules/actions.md`: a `script` action declares a sentence it writes into a record under `texts` and asks for it with `ctx.text`. The rule covers the organization's language, a missing translation, an unreadable Localization setting and an undeclared key. The refusals paragraph points at the i18n skill for its bundle keys instead of spelling them. +- `objectstack-ui` `rules/actions.md`: a `script` action declares a sentence it writes into a record under `texts` and asks for it with `ctx.text`. The rule covers the organization's language, the `texts..message` key beside the refusals key, a missing translation, an unreadable Localization setting and an undeclared key. Two sentences that restated the example below them are shorter. +- `objectstack-i18n` pays for its new text in the same file. It drops a sentence that restated the option-key paragraph, two flags from the `extract --help` list that are taught in place, two partial copies of the group list, and the empty "Translate" step. - Evals: the i18n set gains a `mappings` case and a hook-texts bundle-key case, and case 11 states the remaining `t()` reason for `fallbackLocale: 'en'`. The ui set gains an action `texts` case. diff --git a/scripts/check-skills-token-ratchet.mjs b/scripts/check-skills-token-ratchet.mjs index d5749052388..27a889fc287 100644 --- a/scripts/check-skills-token-ratchet.mjs +++ b/scripts/check-skills-token-ratchet.mjs @@ -1424,20 +1424,22 @@ export const CEILINGS = new Map([ // in the text that row moved in). Same ruling as the lines above (2026-10-27, tap A): // 「A:先削重复,余额按实测提高」 (ruling record 6513306068). // ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(12720 / 4) - // 3180 -> 3334 (#35097): a script action writes a sentence in the organization's language. + // 3180 -> 3333 (#35097): a script action writes a sentence in the organization's language. // One H3 after the refusals paragraph: declare it under `texts`, ask for it with `ctx.text`, the - // missing-translation and unreadable-setting answers, and when an undeclared key is refused; - // the bundle keys are the i18n skill's and only pointed at. PAID DOWN FIRST by 29 bytes of - // restatement in this file: the refusals paragraph no longer spells the bundle key - // `objects.._actions..refusals..message`, which objectstack-i18n owns - // (its `_actions.{action_name}.refusals.{CODE}` row), and points there instead. Nothing else - // in the file restates another passage (see the 2777 -> 2808 note above), so the same ruling's - // second half carries the rest. Arithmetic: the text adds 644 bytes, the cut removes 29, so - // the file is 12720 -> 13335 bytes -> 3334 tokens, zero headroom before, ceiling +154, the - // measured remainder only, pinned AT the measurement. Same ruling (2026-10-27, tap A): - // 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). - // ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(13335 / 4) - ['skills/objectstack-ui/rules/actions.md', 3334], + // missing-translation and unreadable-setting answers, when an undeclared key is refused, and the + // `texts..message` key beside the refusals key the paragraph above spells (that key stays: + // the bundle's evals grade `_actions` and the with-skill arm reads this bundle only). PAID DOWN + // FIRST by 53 bytes of restatement in this file, each of an example right below its sentence: + // " as `${result.output.NAME}`" in the `onSuccess` sentence (27; the Convert Lead block's + // `${result.output.opportunity_id}` shows the spelling) and "`{recordId}` placeholder; " in the + // `newTabUrl` sentence (26; the Open PDF block's `newTabUrl: '/api/v1/invoice/{recordId}/pdf'` + // shows it). Nothing else in the file restates another passage (see the 2777 -> 2808 note + // above), so the same ruling's second half carries the rest. Arithmetic: the text adds 663 + // bytes, the cuts remove 53, so the file is 12720 -> 13330 bytes -> 3333 tokens, zero headroom + // before, ceiling +153, the measured remainder only, pinned AT the measurement. Same ruling + // (2026-10-27, tap A): 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). + // ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(13330 / 4) + ['skills/objectstack-ui/rules/actions.md', 3333], // 6090 -> 6252 (#19715, card item 4): a 5-line table of contents at the top, // anchors to the file's existing headings, nothing else changed. +162 tokens, // zero headroom to absorb any of it, ceiling +162. Maintainer ruling diff --git a/skills/objectstack-i18n/evals/bundles-locales-coverage.json b/skills/objectstack-i18n/evals/bundles-locales-coverage.json index d48e66ebaa2..ddbef9e8731 100644 --- a/skills/objectstack-i18n/evals/bundles-locales-coverage.json +++ b/skills/objectstack-i18n/evals/bundles-locales-coverage.json @@ -144,10 +144,10 @@ { "id": 15, "prompt": "The `lead_follow_up` hook declares `texts: { follow_up_subject: { message: 'Follow up with qualified lead: {{ lead }}', params: ['lead'] } }` and writes a task subject with `ctx.text('follow_up_subject', { lead: ctx.input.name })`. Our organization works in zh-CN, but the tasks still read English. Which bundle key translates it, and whose language is picked?", - "expected_output": "`hooks.lead_follow_up.texts.follow_up_subject.message` in the zh-CN bundle, keyed by the hook's `name` (not under `objects` or `messages`), the translation keeping its `{{ lead }}` hole, which the runtime fills after picking it: `'跟进已确认的线索:{{ lead }}'`. It is picked in the organization's language — the Localization setting if somebody set it, else `i18n.defaultLocale` — never the language of the person whose save fired the hook. With no translation the declared sentence is written, filled.", + "expected_output": "`hooks.lead_follow_up.texts.follow_up_subject.message` in the zh-CN bundle, keyed by the hook's `name` (not under `objects` or `messages`), the translation keeping its `{{ lead }}` hole, which the runtime fills after picking it: `'跟进已确认的线索:{{ lead }}'`. It is picked in the organization's language — the Localization setting if somebody set it, else `i18n.defaultLocale` — never the language of the person whose save fired the hook.", "files": [], "assertions": { - "must_contain": ["hooks", "lead_follow_up", "texts", "follow_up_subject", "{{ lead }}", "defaultLocale"], + "must_contain": ["hooks", "lead_follow_up", "texts", "follow_up_subject", "defaultLocale"], "must_not_contain": ["messages: {", "_hooks"] } } diff --git a/skills/objectstack-ui/evals/views-apps-actions-pages.json b/skills/objectstack-ui/evals/views-apps-actions-pages.json index a3d3dc8ec91..1c689a3e9ba 100644 --- a/skills/objectstack-ui/evals/views-apps-actions-pages.json +++ b/skills/objectstack-ui/evals/views-apps-actions-pages.json @@ -208,7 +208,7 @@ "files": [], "assertions": { "must_contain": ["texts", "email_subject", "ctx.text", "_actions"], - "must_not_contain": ["'Email: ' +", "hooks.send_email"] + "must_not_contain": ["hooks.send_email"] } } ] diff --git a/skills/objectstack-ui/rules/actions.md b/skills/objectstack-ui/rules/actions.md index 86289a3b1e5..0caea918a60 100644 --- a/skills/objectstack-ui/rules/actions.md +++ b/skills/objectstack-ui/rules/actions.md @@ -64,7 +64,7 @@ export const ReassignLeadAction = defineAction({ ## Examples -`onSuccess` hops once the flow run completes, not when it pauses at a screen; its URL template reads an `isOutput` variable as `${result.output.NAME}`: +`onSuccess` hops once the flow run completes, not when it pauses at a screen; its URL template reads an `isOutput` variable: ```typescript @@ -137,18 +137,19 @@ Bodies execute **trusted** (`ctx.api` / with a `js` body (an inline `target` function is lowered to one; any other action is refused the key) declares `refusals` and throws the code, as `crm_add_invoice_line` below does: the catalogue, throws and checks are a hook's (objectstack-data → Lifecycle Hooks → Declared refusals). The -sentence is answered as `userMessage`, translated under the action's `refusals` keys -(objectstack-i18n); the console's failure toast shows it unless the action authors `errorMessage`. +sentence is answered as `userMessage`, translated at +`objects.._actions..refusals..message` (objectstack-i18n); the console's +failure toast shows it unless the action authors `errorMessage`. ### Writing in the organization's language (`texts`) -A sentence the body writes into a record (an activity's subject) is read by the whole -organization: the same actions declare it under `texts` and ask for it by key — +A sentence the body writes into a record (an activity's subject) is read organization-wide: +the same actions declare it under `texts` and ask for it by key — `texts: { email_subject: { message: 'Email: {{ subject }}', params: ['subject'] } }`, then `await ctx.text('email_subject', { subject: input.subject })`. It answers in the organization's -language, never the caller's (keys: objectstack-i18n); 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. +language, never the caller's, translated at the same node's `texts..message`; 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. ## Opening in a New Tab @@ -177,7 +178,7 @@ export const PrintA3Action = defineAction({ A redirect URL **computed after a fetch**: `opensInNewTab: true` pre-opens the tab synchronously on click (no popup blocker), then navigates it to the handler's `redirectUrl`. `newTabUrl` skips the round-trip — a backend -path starting with `/` (`{recordId}` placeholder; an external URL is refused, use +path starting with `/` (an external URL is refused, use `openIn`), valid only with `opensInNewTab: true`; the endpoint enforces its own auth (the tab carries no in-app session).