From 826660ada8ccc1cf641df52cec8846330c2adfca Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 23:26:40 +0000 Subject: [PATCH 1/3] docs(skills): objectstack-data teaches translating fieldPatches text in the patching package The fieldPatches paragraph names where the patched label, help text and option label are translated (the patching package's translations, under the owner's keys), that the owner's translation of the replaced text never applies, that a pair .custom translation comes first on /meta, and that an untranslated locale serves the patch text. One eval case exercises it. The file pays by dropping restatement; its token ceiling does not move. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz --- ...85-skills-fieldpatches-own-translations.md | 10 ++++++++++ skills/objectstack-data/SKILL.md | 19 +++++++++--------- .../evals/objects-fields-relationships.json | 20 +++++++++++++++++++ 3 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 .changeset/34785-skills-fieldpatches-own-translations.md diff --git a/.changeset/34785-skills-fieldpatches-own-translations.md b/.changeset/34785-skills-fieldpatches-own-translations.md new file mode 100644 index 00000000000..7fcd25d2b3b --- /dev/null +++ b/.changeset/34785-skills-fieldpatches-own-translations.md @@ -0,0 +1,10 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): objectstack-data teaches that the package shipping a `fieldPatches` relabel translates that text in its own `translations` + +Clause-②: no +Metadata-protocol: none + +`skills/objectstack-data/SKILL.md`, the `fieldPatches` paragraph: patched text is translated in the patching package's `translations`, under the owner's keys (`objects.crm_account.fields.industry.label`, `.help`, `.options.`); the owner's translation of the text the patch replaced never applies, a pair `.custom` translation comes first on `/meta`, and a locale the package does not translate serves the patch text. This is the skill text for the behaviour `@objectstack/spec` 18 already ships; the docs page `data-modeling/object-extensions` teaches the same. One eval case asks where a dependent package's zh-CN strings for its patch go. The file pays in full by dropping restatement and its token ceiling does not move: the lead-in line under the Quick Reference heading, the second half of the multi-value-lookup note (the Relationship Patterns rows carry it), and the two unique scopes named again under the index example. No schema or runtime change. diff --git a/skills/objectstack-data/SKILL.md b/skills/objectstack-data/SKILL.md index b08bdecba40..b823060cbf8 100644 --- a/skills/objectstack-data/SKILL.md +++ b/skills/objectstack-data/SKILL.md @@ -35,8 +35,6 @@ metadata: ## Quick Reference — Detailed Rules -Detailed rules, with incorrect/correct examples: - - **[Naming Conventions](./rules/naming.md)** — snake_case rules, option values, config properties - **[Field Types](./rules/field-types.md)** — All field types and configs - **[Relationships](./rules/relationships.md)** — lookup vs master_detail, junction patterns, delete behaviors @@ -312,12 +310,9 @@ picker; `formula` takes CEL in `expression` (`F\`...\`` from `@objectstack/spec` | Approval, review, routing, audit trail | not objects: an approval is a flow node (**objectstack-automation**) and its trail is platform history; model only the people it references (approver, reviewer), as `user` fields beside the owner | | Record owner | the platform's `owner_id` (`ownership: 'user'`, the default), also when the request says assignee, 负责人 or 处理人 — never a hand-added owner field, a second owner that owner-scoped visibility and "My records" views never read. A handler the request names apart from the owner is a `user` field that grants no access, with a label no other visible field carries, injected ones included: `owner_id` (Owner, 负责人), `created_by` (创建人), `updated_by` (更新人), `created_at` (创建时间), `updated_at` (更新时间). `ownership: 'none'` only for a shared catalog or a pure junction table | -> **`multiple: true` lookup ≠ junction object.** A multi-value lookup -> (`{ type: 'lookup', reference: 'x', multiple: true }`) is stored and read as an -> **array of ids** on the record — reference elements positionally -> (`{record.tags.0}` in flow values). It is NOT a junction table. Reach for a -> **junction object** (two lookups) only when the relationship itself carries -> attributes (role, added_at, …). +> **`multiple: true` lookup ≠ junction object.** A multi-value lookup is stored +> and read as an **array of ids** on the record — reference elements positionally +> (`{record.tags.0}` in flow values). ### Validation Patterns @@ -354,8 +349,7 @@ indexes: [ ``` See [rules/indexing.md](./rules/indexing.md) for composite indexes, unique scope -(`'organization'` / `'global'` — on a declared index bare `unique: true` is -refused), the retired `type` / `partial`, and partial / gin / gist indexes at the +(on a declared index bare `unique: true` is refused), the retired `type` / `partial`, and partial / gin / gist indexes at the database layer. --- @@ -380,6 +374,11 @@ text; between two extensions the higher `priority` wins. A patch naming a field or option value the target lacks is refused at install and by `os validate`, and a `picklist`-bound field's options are never patchable. Example: `defineObjectExtension({ extend: 'crm_account', fieldPatches: { industry: { label: 'Sector' }, type: { options: { customer: { label: 'Client' } } } } })`. +Translate patched text in the patching package's `translations`, under the +owner's keys (`objects.crm_account.fields.industry.label`, `.help`, +`.options.`): the owner's translation of the replaced text never applies, a +pair `.custom` translation comes first on `/meta`, and an untranslated locale +serves the patch text. **An object an installed package ships** is extended from the base's paired `.custom` package (`hotcrm.custom`; **objectstack-platform** diff --git a/skills/objectstack-data/evals/objects-fields-relationships.json b/skills/objectstack-data/evals/objects-fields-relationships.json index b70e73571cb..08b528aaf0a 100644 --- a/skills/objectstack-data/evals/objects-fields-relationships.json +++ b/skills/objectstack-data/evals/objects-fields-relationships.json @@ -362,6 +362,26 @@ "defaultCurrency: 'USD'" ] } + }, + { + "id": 21, + "prompt": "Our package `acme_billing` depends on HotCRM and already relabels its `crm_account` fields with `fieldPatches`: `industry` reads \"Sector\" and the `type` option `customer` reads \"Client\". Our zh-CN users still see that English text. Where do the Chinese strings go?", + "expected_output": "In `acme_billing`'s own translation bundle, registered on its `defineStack({ translations: [...] })`, under the same keys HotCRM translates its own text under: `'zh-CN': { objects: { crm_account: { fields: { industry: { label: '板块' }, type: { options: { customer: '委托方' } } } } } }` (a patched help text or description goes under the field's `help`). The package that ships the patch translates it: never edit HotCRM's translation files, and never redeclare the field in `fields` to carry a label. HotCRM's zh-CN translation of the text the patch replaced (\"Industry\") never applies to the patched label. A translation of the same key in the paired `hotcrm.custom` package still comes first on the `/meta` reads, and a locale `acme_billing` does not translate serves the patch text (`Sector`) as written.", + "files": [], + "assertions": { + "must_contain": [ + "translations", + "'zh-CN'", + "crm_account", + "industry: { label:", + "options: { customer:" + ], + "must_not_contain": [ + "industry: Field.", + "overrides:", + "name: 'crm_account'" + ] + } } ] } From 0b60aa4ce7b57189a15d98a84bce51e26e3a35e1 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 23:37:33 +0000 Subject: [PATCH 2/3] docs(skills): the fieldPatches translation eval asserts layout-free tokens only Each must_contain / must_not_contain token of the new case is a single word, so an answer written across lines or with double quotes grades the same. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz --- .../evals/objects-fields-relationships.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/skills/objectstack-data/evals/objects-fields-relationships.json b/skills/objectstack-data/evals/objects-fields-relationships.json index 08b528aaf0a..a5accfb5ec0 100644 --- a/skills/objectstack-data/evals/objects-fields-relationships.json +++ b/skills/objectstack-data/evals/objects-fields-relationships.json @@ -371,15 +371,14 @@ "assertions": { "must_contain": [ "translations", - "'zh-CN'", + "acme_billing", + "zh-CN", "crm_account", - "industry: { label:", - "options: { customer:" + "industry", + "customer" ], "must_not_contain": [ - "industry: Field.", - "overrides:", - "name: 'crm_account'" + "overrides" ] } } From ba3ed914914fefbd31dd5d6d104de3bb1bebcf5f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 00:00:44 +0000 Subject: [PATCH 3/3] docs(skills): the fieldPatches translation eval forbids the overrides key, not the bare word A correct answer may say a pair translation overrides the package's; the token is spelled as cases 5 and 7 spell it. objects joins must_contain. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz --- .../objectstack-data/evals/objects-fields-relationships.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skills/objectstack-data/evals/objects-fields-relationships.json b/skills/objectstack-data/evals/objects-fields-relationships.json index a5accfb5ec0..447afd2999f 100644 --- a/skills/objectstack-data/evals/objects-fields-relationships.json +++ b/skills/objectstack-data/evals/objects-fields-relationships.json @@ -373,12 +373,13 @@ "translations", "acme_billing", "zh-CN", + "objects", "crm_account", "industry", "customer" ], "must_not_contain": [ - "overrides" + "overrides:" ] } }