Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/37590-skills-import-scope-and-related-list-key.md
Original file line number Diff line number Diff line change
@@ -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 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.
24 changes: 9 additions & 15 deletions skills/objectstack-data/rules/relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
}
});

Expand Down Expand Up @@ -114,7 +106,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
has, or a scoping field the caller cannot read, is `reference_not_found`.

### Many-to-Many: Junction Object

Expand Down Expand Up @@ -257,8 +251,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
Expand Down Expand Up @@ -294,8 +287,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)
Expand Down Expand Up @@ -365,8 +357,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).
Expand Down
13 changes: 5 additions & 8 deletions skills/objectstack-i18n/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}` |

Expand Down Expand Up @@ -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`.

Expand All @@ -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()`.

---

Expand Down Expand Up @@ -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

Expand Down
Loading