From 8ce5a4afcee50282c6432133ab1aa0bc826b2f41 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 08:19:24 +0000 Subject: [PATCH 1/3] docs(skills): relationships rule names reference_out_of_scope, and _relatedLists keys follow the served tab list The import clause of the objectstack-data relationships rule said another master's detail fails with reference_not_found; on main it is reference_out_of_scope with a scope on the cell error. The related-lists bullet there and the _relatedLists row of objectstack-i18n now say the key is refused where the paired .custom arrangement re-states the entry without a label or hides it, with the remedy the refusal prescribes. Both files stay at their token ceilings: the words are paid for by deleting restatement in the same file. Claude-Session: https://claude.ai/code/session_01L6bhgTFpGNWjLMTYXbjD1f Co-authored-by: Claude --- ...kills-import-scope-and-related-list-key.md | 14 +++++++++ .../objectstack-data/rules/relationships.md | 29 ++++++++----------- skills/objectstack-i18n/SKILL.md | 13 ++++----- 3 files changed, 31 insertions(+), 25 deletions(-) create mode 100644 .changeset/37590-skills-import-scope-and-related-list-key.md diff --git a/.changeset/37590-skills-import-scope-and-related-list-key.md b/.changeset/37590-skills-import-scope-and-related-list-key.md new file mode 100644 index 00000000000..2f5fc7cf985 --- /dev/null +++ b/.changeset/37590-skills-import-scope-and-related-list-key.md @@ -0,0 +1,14 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): the relationships rule names `reference_out_of_scope` for a scoped import miss, and both pages say when a `_relatedLists` key is refused under a `.custom` arrangement + +Clause-②: no (published prose only; teaches two behaviours already on main) +Metadata-protocol: none + +`skills/objectstack-data/rules/relationships.md` (Optional master, the import clause) no longer says another master's detail fails an import with `reference_not_found`. It is `reference_out_of_scope`, whose `scope` (`[{ field, value }]`) names the scoping columns; `reference_not_found` stays for a name no record carries and for a scoping field the caller cannot read. + +The same file (Detail-page related lists) and `skills/objectstack-i18n/SKILL.md` (the `_relatedLists.{list}` row) now say that the translation key follows the label the served tab list carries: where the paired `.custom` package's `relatedLists` re-states the entry without a `label`, or hides it, `os validate` refuses the key. The remedy is the one the refusal prescribes: drop the key, or re-state the entry with the owner's own `label`. + +Both files sat at their token ceiling, so the words are paid for in the same file and no ceiling moves. `relationships.md` drops a third copy of the `summary` shape (the JSON block under Roll-up Summaries; the TypeScript forms above and below it stay), the sentence that restated what a form without the field group looks like, the lead-in that restated when a roll-up recomputes, and the intro sentence over the grid modeling bullets. `objectstack-i18n/SKILL.md` drops three history notes that teach nothing an author can write today: that `messageFormat` was removed (the schema's own refusal says so), that `getAppBundle` / `loadAppBundle` are gone, and that nothing converts between formats, together with "one locale per item", which the sentence before it already states. diff --git a/skills/objectstack-data/rules/relationships.md b/skills/objectstack-data/rules/relationships.md index ec39a4d7587..65441af6bbe 100644 --- a/skills/objectstack-data/rules/relationships.md +++ b/skills/objectstack-data/rules/relationships.md @@ -114,7 +114,9 @@ an omitted `required` as `true`. **Import resolves a detail's name within its master** when the row sets that master (one reference column to it) or the lookup's `dependsOn` sibling: a tie -there is `reference_ambiguous`, another master's detail `reference_not_found`. +there is `reference_ambiguous`, another master's detail `reference_out_of_scope` +(`scope: [{ field, value }]` names the scoping columns). A name no record +carries, or a scoping field the caller cannot read, is `reference_not_found`. ### Many-to-Many: Junction Object @@ -188,13 +190,6 @@ A parent `summary` field aggregates a child collection. The engine recomputes it **server-side** on every child insert/update/delete, in the write's transaction. -```json -{ - "type": "summary", - "summaryOperations": { "object": "invoice_line", "field": "amount", "function": "sum" } -} -``` - `object` is the child object to aggregate, `field` its field (ignored for `count`), `function` one of `count` / `sum` / `min` / `max` / `avg`. Optional: `filter` (below) and `relationshipField` (omitted: the child's `lookup` / @@ -219,9 +214,9 @@ operator and compound forms work completion rate = a child count ÷ a capacity) is a `formula` over a working `summary` — author the summary first; the rate computes only once it does. -**The recompute runs only on a child write.** A `summary` declared after its -parent rows exist reads `NULL` on every existing parent until a child of it is -written. The backfill is `os migrate summary-nulls --apply` +**A `summary` declared after its parent rows exist reads `NULL`** on every +existing parent until a child of it is written. The backfill is +`os migrate summary-nulls --apply` (`--recompute-undefined-on-empty OBJECT.FIELD` for a `min` / `max` / `avg` declared late) — never an edit to a child. Declare the summary with the object where you can; declared late, run the migration before you call the number ready. @@ -258,8 +253,7 @@ The parent's standard create/edit form enters a child's rows where **a field group of the parent names that child** (`relatedList`): the group draws the child's table at its place in the record's details and in the parent's entry form (below the form's fields when its sections name no field group), -and parent + children save in **one atomic transaction**. Without the group -nothing changes: the child is a tab and the form has no lines. A parent or child +and parent + children save in **one atomic transaction**. A parent or child declaring `enable.apiMethods` must list `'bulk'`, or that save is refused `405 OBJECT_API_METHOD_NOT_ALLOWED`. ```typescript @@ -295,8 +289,7 @@ Omitted (a boolean is refused) — **smart default**: picks `form` when the chil rich/form-only fields (textarea, file, image, json, location…) or more than ~8 editable fields, else `grid`. -**Modeling a `'grid'` line item for the full editor.** The grid lights up extra -behaviors from how you model the child + parent: +**Modeling a `'grid'` line item for the full editor:** ```typescript // Parent (a field group names invoice_line, as above) @@ -366,8 +359,10 @@ audit_ref: { type: 'master_detail', reference: 'invoice', relatedList: false }, only the named lists show, in order, built-ins by name (`sys_attachment`, `sys_approval_request`, `sys_activity`). An entry is the child, `object.field` or `{ list, label, columns }`; its `label` translates at - `objects.{parent}._relatedLists.{list}.label` (none: nothing to translate). - A child in the stack with no inbound FK + `objects.{parent}._relatedLists.{list}.label` (none: no key). A `.custom` + arrangement re-stating the entry with no `label`, or hiding it, leaves none, + and `os validate` refuses the key: drop it, or re-state the entry with the + owner's `label`. A child in the stack with no inbound FK is refused everywhere; one that exists nowhere is refused by `os validate` / `os build` (bar a platform or sibling-artifact name) and by a metadata write naming no package (one into a package is stored, placing nothing). diff --git a/skills/objectstack-i18n/SKILL.md b/skills/objectstack-i18n/SKILL.md index 89ade39e39a..7a149bb9f91 100644 --- a/skills/objectstack-i18n/SKILL.md +++ b/skills/objectstack-i18n/SKILL.md @@ -163,7 +163,7 @@ All translatable content for a single object is aggregated under | `_actions.{action_name}` | `label`, `description`, `confirmText`, `submitText` (the param dialog's button verb — only under an action that declares `params`), `cancelText` (the dismiss button of the confirm or param dialog — only under an action that declares `confirmText` or a non-empty `params`), `successMessage`, `disabledReason` (the sentence a greyed action shows; absent keeps the console's default), `params.{param_name}` (and `.options.{value}` beneath it — an option's stored `value` in that param's inline `options`), `outcomeMessages.{outcome}` (an outcome the action's own `outcomeMessages` declares), `resultDialog.title` / `.description` / `.acknowledge` (only under an action that declares a `resultDialog`), `resultDialog.fields.{path}` (the literal `path` of a field in `resultDialog.fields[]`, dots included — `client.secret` is one key), `preflight.fields.{path}` (only under an action that declares `preflight`: a field's literal `path` in its `preflight.fields[]`, its value a plain string as under `resultDialog.fields`), `resultDialog.columns.{path}.{column_path}` / `preflight.columns.{path}.{column_path}` (a table's column headers, beside `fields`: the literal `path` of a `format: 'table'` field, then of one of its `columns[]`, each a plain string; `defineTranslationBundle` refuses any other key under `preflight`, a `title` included); the same keys hold under `globalActions.{action_name}` | | `_sections.{section_name}` | Form section `label`, `description`; `fields.{field_name}` — the `label`, `placeholder`, `helpText` an entry overrides for that form alone (`helpText` here, `help` under `fields.{field_name}` above: each spells what its source does) | | `_tabs.{tab_name}` | Filter-preset tab `label` (`ViewTabSchema.name`) | -| `_relatedLists.{list}` | `label` of an object-form `relatedLists` entry on this (parent) object, by its literal `list` (`event.related_to` is one key); an entry with no `label` has no key and keeps the child field's `relatedListTitle`, else the child's plural label. Spelled `relatedLists`, the group is refused, naming this one | +| `_relatedLists.{list}` | `label` of an object-form `relatedLists` entry on this (parent) object, by its literal `list` (`event.related_to` is one key); an entry with no `label` has no key and keeps the child field's `relatedListTitle`, else the child's plural label. Where the paired `.custom` package's `relatedLists` (**objectstack-data**) re-states the entry without a `label`, or hides it, `os validate` refuses the key: drop it, or re-state the entry with the owner's own `label`. Spelled `relatedLists`, the group is refused, naming this one | | `_validations.{rule_name}` | `message` only — the sentence a rejected write returns (replaces the retired `validationMessages`) | | `_actions.{action_name}.refusals.{CODE}` | `message`, and `reasons.{reason}.message` per declared reason — the sentences of the action's `refusals` catalogue (**objectstack-ui** → Actions), for a code and reason it declares (any other is `translation-target-unknown`); the same under `globalActions.{action_name}` | @@ -263,9 +263,8 @@ directory tree for you. A **`translation` metadata item** — created in the Studio, through the metadata API, or by an agent — carries one locale's worth of the **same** `objects.*` groups documented above plus the `locale` it translates. `locale` is -required, one locale per item, and published items load at boot and on every publish, -layering **over** the file bundles (delete the item and the shipped value returns). There -is exactly one shape; nothing converts between formats. Author with `defineTranslation`; +required, and published items load at boot and on every publish, layering **over** +the file bundles (delete the item and the shipped value returns). Author with `defineTranslation`; exact Zod shape is `TranslationItemSchema` in `node_modules/@objectstack/spec/src/system/translation.zod.ts`. @@ -291,8 +290,7 @@ what the runtime implements.) ### No ICU MessageFormat -There is no ICU MessageFormat engine (the aspirational `messageFormat` config knob -was removed). To pluralize, select the form in application code before calling `t()`. +There is no ICU MessageFormat engine. To pluralize, select the form in application code before calling `t()`. --- @@ -373,8 +371,7 @@ case-insensitive → same platform-table language (`zh-TW` → `zh-Hant`) → ba The contract declares optional methods — `getFieldLabels`, `getCoverage`, `suggestTranslations` — that **no shipped implementation provides**: extension -points for a custom workbench or TMS adapter. (`getAppBundle` / -`loadAppBundle` went with the `o.*` shape they returned.) +points for a custom workbench or TMS adapter. ### Registration From 8a0f315c63881878a5574309ae1e83b454df1145 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 08:29:51 +0000 Subject: [PATCH 2/3] docs(skills): keep the served roll-up section as on main; pay with the pattern example's summary copy The Roll-up Summaries section is served by exact heading and its JSON fence is validated, so it stays byte-identical to main. The words are paid for by the third copy of the summary shape in the master-detail pattern example. Claude-Session: https://claude.ai/code/session_01L6bhgTFpGNWjLMTYXbjD1f Co-authored-by: Claude --- ...kills-import-scope-and-related-list-key.md | 2 +- .../objectstack-data/rules/relationships.md | 25 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.changeset/37590-skills-import-scope-and-related-list-key.md b/.changeset/37590-skills-import-scope-and-related-list-key.md index 2f5fc7cf985..05b05fedcd2 100644 --- a/.changeset/37590-skills-import-scope-and-related-list-key.md +++ b/.changeset/37590-skills-import-scope-and-related-list-key.md @@ -11,4 +11,4 @@ Metadata-protocol: none The same file (Detail-page related lists) and `skills/objectstack-i18n/SKILL.md` (the `_relatedLists.{list}` row) now say that the translation key follows the label the served tab list carries: where the paired `.custom` package's `relatedLists` re-states the entry without a `label`, or hides it, `os validate` refuses the key. The remedy is the one the refusal prescribes: drop the key, or re-state the entry with the owner's own `label`. -Both files sat at their token ceiling, so the words are paid for in the same file and no ceiling moves. `relationships.md` drops a third copy of the `summary` shape (the JSON block under Roll-up Summaries; the TypeScript forms above and below it stay), the sentence that restated what a form without the field group looks like, the lead-in that restated when a roll-up recomputes, and the intro sentence over the grid modeling bullets. `objectstack-i18n/SKILL.md` drops three history notes that teach nothing an author can write today: that `messageFormat` was removed (the schema's own refusal says so), that `getAppBundle` / `loadAppBundle` are gone, and that nothing converts between formats, together with "one locale per item", which the sentence before it already states. +Both files sat at their token ceiling, so the words are paid for in the same file and no ceiling moves. `relationships.md` drops a third copy of the `summary` shape (the parent's `total` field in the master-detail pattern; the JSON form under Roll-up Summaries and the TypeScript form in the grid example stay), the sentence that restated what a form without the field group looks like, and the intro sentence over the grid modeling bullets. `objectstack-i18n/SKILL.md` drops three history notes that teach nothing an author can write today: that `messageFormat` was removed (the schema's own refusal says so), that `getAppBundle` / `loadAppBundle` are gone, and that nothing converts between formats, together with "one locale per item", which the sentence before it already states. diff --git a/skills/objectstack-data/rules/relationships.md b/skills/objectstack-data/rules/relationships.md index 65441af6bbe..9d05e12bfc1 100644 --- a/skills/objectstack-data/rules/relationships.md +++ b/skills/objectstack-data/rules/relationships.md @@ -41,14 +41,6 @@ export default ObjectSchema.create({ sharingModel: 'public_read_write', fields: { invoice_number: { type: 'text', required: true }, - total: { - type: 'summary', - summaryOperations: { - object: 'invoice_line_item', - field: 'amount', - function: 'sum', - }, - }, } }); @@ -190,6 +182,13 @@ A parent `summary` field aggregates a child collection. The engine recomputes it **server-side** on every child insert/update/delete, in the write's transaction. +```json +{ + "type": "summary", + "summaryOperations": { "object": "invoice_line", "field": "amount", "function": "sum" } +} +``` + `object` is the child object to aggregate, `field` its field (ignored for `count`), `function` one of `count` / `sum` / `min` / `max` / `avg`. Optional: `filter` (below) and `relationshipField` (omitted: the child's `lookup` / @@ -214,9 +213,9 @@ operator and compound forms work completion rate = a child count ÷ a capacity) is a `formula` over a working `summary` — author the summary first; the rate computes only once it does. -**A `summary` declared after its parent rows exist reads `NULL`** on every -existing parent until a child of it is written. The backfill is -`os migrate summary-nulls --apply` +**The recompute runs only on a child write.** A `summary` declared after its +parent rows exist reads `NULL` on every existing parent until a child of it is +written. The backfill is `os migrate summary-nulls --apply` (`--recompute-undefined-on-empty OBJECT.FIELD` for a `min` / `max` / `avg` declared late) — never an edit to a child. Declare the summary with the object where you can; declared late, run the migration before you call the number ready. @@ -360,8 +359,8 @@ audit_ref: { type: 'master_detail', reference: 'invoice', relatedList: false }, (`sys_attachment`, `sys_approval_request`, `sys_activity`). An entry is the child, `object.field` or `{ list, label, columns }`; its `label` translates at `objects.{parent}._relatedLists.{list}.label` (none: no key). A `.custom` - arrangement re-stating the entry with no `label`, or hiding it, leaves none, - and `os validate` refuses the key: drop it, or re-state the entry with the + arrangement re-stating the entry with no `label`, or hiding it, leaves none and + `os validate` refuses the key: drop it, or re-state the entry with the owner's `label`. A child in the stack with no inbound FK is refused everywhere; one that exists nowhere is refused by `os validate` / `os build` (bar a platform or sibling-artifact name) and by a metadata From c62f65f07a6c151cc203a0c196c25ac385cd29b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 08:50:21 +0000 Subject: [PATCH 3/3] docs(skills): fit the import clause under the ceiling main lowered main shortened the same file and lowered its row to 4181; two bytes come off the new clause so the file sits at that measurement. Claude-Session: https://claude.ai/code/session_01L6bhgTFpGNWjLMTYXbjD1f Co-authored-by: Claude --- skills/objectstack-data/rules/relationships.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/objectstack-data/rules/relationships.md b/skills/objectstack-data/rules/relationships.md index 25a8b88a6f0..abddc037598 100644 --- a/skills/objectstack-data/rules/relationships.md +++ b/skills/objectstack-data/rules/relationships.md @@ -108,7 +108,7 @@ an omitted `required` as `true`. master (one reference column to it) or the lookup's `dependsOn` sibling: a tie there is `reference_ambiguous`, another master's detail `reference_out_of_scope` (`scope: [{ field, value }]` names the scoping columns). A name no record -carries, or a scoping field the caller cannot read, is `reference_not_found`. +has, or a scoping field the caller cannot read, is `reference_not_found`. ### Many-to-Many: Junction Object