From 0db54351e8e6ed14e0b367b9663eeb8774e6deaa Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 23:12:13 +0000 Subject: [PATCH 1/2] docs(skills): objectstack-data teaches the paired .custom package's whole arrangement (fieldGroups, relatedLists) The object-extension section says only the pair's extension may write fieldGroups and relatedLists, that a written key replaces the arrangement whole, that { list, hidden: true } hides a tab, and that any other package is refused at the same doors as a __c field and told to use place. Paid for in the same file by five restatement cuts; the token ceiling is unchanged. One eval case added; the place case no longer says an extension has neither key. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01ADHkmPTDM2MxHR8cvoMVUX --- .changeset/36541-skills-custom-arrangement.md | 12 ++++++++++ skills/objectstack-data/SKILL.md | 19 ++++++++-------- skills/objectstack-data/evals/README.md | 3 ++- .../evals/objects-fields-relationships.json | 22 ++++++++++++++++++- 4 files changed, 44 insertions(+), 12 deletions(-) create mode 100644 .changeset/36541-skills-custom-arrangement.md diff --git a/.changeset/36541-skills-custom-arrangement.md b/.changeset/36541-skills-custom-arrangement.md new file mode 100644 index 00000000000..a26e29afd33 --- /dev/null +++ b/.changeset/36541-skills-custom-arrangement.md @@ -0,0 +1,12 @@ +--- +'@objectstack/skills': patch +--- + +Clause-②: no +Metadata-protocol: none + +The `objectstack-data` skill teaches the whole-arrangement keys of the paired `.custom` package's object extension: + +- Object Extension Model: only the object extension of a base's paired `.custom` package may write `fieldGroups` and `relatedLists`, in the shape an object declares them. A written key replaces that arrangement whole (the owner's and every `place`); an unlisted field shows after the last group, an unnamed tab still shows after the listed ones, and `{ list: 'crm_note', hidden: true }` hides a tab. In any other package both keys are refused at save, publish and install and by `os validate` / `os build`, with the prescription to use `place`. +- Eval: a new `objectstack-data` case moves an installed object's tab arrangement from an add-on package's extension, where it is refused, to the pair's extension, and names `place` as what the add-on package writes. The `place` case no longer says an extension has neither key. +- Five restatements in the same file are cut to pay for the paragraph; each one's content stays in the bundle (`rules/validation.md`, `rules/indexing.md`, `rules/lifecycle.md`, `references/lint-rules.md`, the object JSON example). diff --git a/skills/objectstack-data/SKILL.md b/skills/objectstack-data/SKILL.md index a1f48e49367..5caca0695e1 100644 --- a/skills/objectstack-data/SKILL.md +++ b/skills/objectstack-data/SKILL.md @@ -36,7 +36,7 @@ metadata: - **[Relationships](./rules/relationships.md)** — lookup vs master_detail, junction patterns, delete behaviors - **[Validation Rules](./rules/validation.md)** — All validation types, script inversion, severity levels - **[Index Strategy](./rules/indexing.md)** — btree/gin/gist/fulltext, composite indexes, partial indexes -- **[Data Lifecycle & Retention](./rules/lifecycle.md)** — `lifecycle` classes (record/audit/telemetry/transient/event), retention/TTL/rotation/archive policies; ❗ append-only objects must declare one (distinct from lifecycle *hooks* below); plus the **save notice** a hook hands the saver (`ctx.notice`) +- **[Data Lifecycle & Retention](./rules/lifecycle.md)** — `lifecycle` classes (record/audit/telemetry/transient/event), retention/TTL/rotation/archive policies (distinct from lifecycle *hooks* below); plus the **save notice** a hook hands the saver (`ctx.notice`) - **[Lifecycle Hooks](./references/data-hooks.md)** — the lifecycle events, the sandboxed `body` (ctx + capability contract; the inline `handler` is deprecated), registration, canonical patterns - **[Datasources & Federation](./rules/datasources.md)** — `defineDatasource`, external/federated objects (`remoteName`/`columnMap`), auto-connect gating, credentials; ❌ no `field.columnName` on external objects - **[Security & Access Control](./rules/security.md)** — permission sets, assignment rows, RLS policies, `secret` / `requiredPermissions`, `tenancy`, platform-global posture @@ -68,8 +68,7 @@ same literal goes inside `ObjectSchema.create({...})`): | `fields` | map | keys in `snake_case` | Field definitions | | `sharingModel` | enum | one of the four below | Org-wide default record visibility (OWD). Zod marks it optional, but **a publish with no authored `sharingModel` is refused** with the 422 lint envelope `security-owd-unset` — absence is not a decision. Author it on every object | -**`sharingModel` — the four canonical values** (ADR-0090 D4; legacy aliases -removed): +**`sharingModel` — the four canonical values:** | Value | Who can read / write | |:--|:--| @@ -91,7 +90,7 @@ all (Relationship Patterns below). | Property | Default | Description | |:---------|:--------|:------------| | `label` | Auto from `name` | Human-readable singular label | -| `pluralLabel` | — | Plural form (e.g., "Accounts"); author it alongside `label` | +| `pluralLabel` | — | Plural form; author it alongside `label` | | `icon` | — | Icon for nav, list headers and lookup pickers; give every object one | | `color` | `gray` | Tile colour, one of `gray` `blue` `teal` `green` `amber` `orange` `red` `pink` `purple` (no hex); the console draws `icon` white on it. Give every object one; avoid repeats in one app | | `highlightFields` | derived | Ordered field keys used as a record's compact face: the columns a **related list** renders on the parent's detail page, and what a lookup picker shows. Declare it on the CHILD object (see [Relationships](./rules/relationships.md)) | @@ -317,10 +316,6 @@ picker; `formula` takes CEL in `expression` (a `{ dialect: 'cel', source }` enve **⚠️ Script validation is inverted:** Validation **fails** when expression is `true`. -> On **insert**, an optional field omitted from the payload reads as `null` in a -> validation predicate — so `record.due_date == null` matches an omitted field the -> same as an explicit `null`. (On update, the prior record supplies it.) - The **complete** set of types (`ValidationRuleSchema` discriminators): `script`, `state_machine`, `format`, `cross_field`, `json_schema`, `conditional`. @@ -335,8 +330,7 @@ keys and values are option `value`s, never labels. ### Index Patterns -**The whole declaration surface is `fields` / `unique` / `name`.** `unique` -defaults to `false`; omit it when that is what you mean. +**The whole declaration surface is `fields` / `unique` / `name`.** ```typescript indexes: [ @@ -389,6 +383,11 @@ declaration. Every field the pair adds ends in `__c` (`region__c`). The suffix i reserved to the pair, so a `__c` field in any other package, or an unsuffixed field in a `.custom` extension, is refused at save, publish and install and by `os validate` / `os build`. +Only the pair's extension may also write `fieldGroups` and `relatedLists`, shaped +as on an object. A written key replaces that arrangement whole (the owner's and +every `place`): an unlisted field shows after the last group, an unnamed tab +still shows after the listed ones, and `{ list: 'crm_note', hidden: true }` hides +a tab. In any other package both keys are refused at those doors: use `place`. Studio's **Add field** on a base object writes the same extension, as an `object_extension` item of the pair. diff --git a/skills/objectstack-data/evals/README.md b/skills/objectstack-data/evals/README.md index 4d2473e2efc..41ef4dd78b2 100644 --- a/skills/objectstack-data/evals/README.md +++ b/skills/objectstack-data/evals/README.md @@ -7,7 +7,8 @@ JSON fixtures in the objectui shape (`skill_name`, `evals[]`: `prompt`, `password`), relationships (junction vs multi-value lookup, `deleteBehavior`, on a `user` field too), validation (`state_machine`, unique **index**), conditional field rules, the record owner (负责人 is `owner_id`), an - object extension placing what it brings (`place`). + object extension placing what it brings (`place`), the `.custom` pair's + whole arrangement (`relatedLists`, `{ list, hidden: true }`). - `hooks-security-seeds-datasources.json` — search mirrors via hooks, permission-set scopes, external datasources, seeds (`externalId`, CEL dynamic values). diff --git a/skills/objectstack-data/evals/objects-fields-relationships.json b/skills/objectstack-data/evals/objects-fields-relationships.json index f5e2e27086b..a00deff354f 100644 --- a/skills/objectstack-data/evals/objects-fields-relationships.json +++ b/skills/objectstack-data/evals/objects-fields-relationships.json @@ -450,7 +450,7 @@ { "id": 26, "prompt": "Our add-on package `acme_contracts` depends on HotCRM (`hotcrm`, namespace `crm`). Its extension of `crm_account` adds a `tax_id` text field, and the package ships an `acme_contract` object whose `account` lookup points at `crm_account`. On the account record page, show Tax ID right after Industry in the Basic section, and the Contracts tab right after Opportunities. `crm_account` declares `fieldGroups: [{ key: 'basic', label: 'Basic', fields: ['name', 'industry', 'website'] }]` and `relatedLists: ['crm_contact', 'crm_opportunity', 'crm_lead', 'sys_activity']`. We cannot edit HotCRM.", - "expected_output": "Two `place` entries on the package's own object extension, registered in its stack's `objectExtensions`: `defineObjectExtension({ extend: 'crm_account', fields: { tax_id: Field.text({ label: 'Tax ID' }) }, place: [{ field: 'tax_id', group: 'basic', after: 'industry' }, { list: 'acme_contract', after: 'crm_opportunity' }] })`. `place` arranges only what the extension brings (its own field, its package's child list), each right after (or `before`) an item the account already has, and it applies here because the account declares `fieldGroups` and `relatedLists`. Without it the field arrives after the account's own and the Contracts tab at the end of the tabs, before the activity stream. The extension does not carry `fieldGroups` or `relatedLists` of its own (an extension has neither key), does not redeclare the account, and nothing in HotCRM is edited.", + "expected_output": "Two `place` entries on the package's own object extension, registered in its stack's `objectExtensions`: `defineObjectExtension({ extend: 'crm_account', fields: { tax_id: Field.text({ label: 'Tax ID' }) }, place: [{ field: 'tax_id', group: 'basic', after: 'industry' }, { list: 'acme_contract', after: 'crm_opportunity' }] })`. `place` arranges only what the extension brings (its own field, its package's child list), each right after (or `before`) an item the account already has, and it applies here because the account declares `fieldGroups` and `relatedLists`. Without it the field arrives after the account's own and the Contracts tab at the end of the tabs, before the activity stream. The extension does not carry `fieldGroups` or `relatedLists` of its own (only the object extension of HotCRM's paired `hotcrm.custom` package writes those keys; here they are refused), does not redeclare the account, and nothing in HotCRM is edited.", "files": [], "assertions": { "must_contain": [ @@ -465,6 +465,26 @@ "overrides:" ] } + }, + { + "id": 27, + "prompt": "We installed HotCRM (`hotcrm`, namespace `crm`) and cannot edit it. Its `crm_account` declares `relatedLists: ['crm_contact', 'crm_opportunity', 'crm_lead', 'sys_activity']`. On the account record page our admins want Opportunities before Contacts and the Leads tab gone, for every user. Our add-on package `acme_contracts` already extends `crm_account`, so a colleague put `relatedLists: ['crm_opportunity', 'crm_contact', { list: 'crm_lead', hidden: true }]` on that extension, and `os validate` refused it. Where does this arrangement go, and what may `acme_contracts` write instead?", + "expected_output": "The arrangement goes on the object extension of HotCRM's paired customization package `hotcrm.custom`, registered in that stack's `objectExtensions`: `defineObjectExtension({ extend: 'crm_account', relatedLists: ['crm_opportunity', 'crm_contact', { list: 'crm_lead', hidden: true }] })`. Only the pair's extension writes `relatedLists` (and `fieldGroups`), in the shape an object declares them. The key it writes replaces the tab list whole (HotCRM's own list and every other extension's `place`); a tab it does not name still shows after the listed ones (the activity stream here), so hiding is written, as `{ list: 'crm_lead', hidden: true }`; `fieldGroups`, not written, keeps the groups as they were. `acme_contracts` is not a `.custom` package, so both keys are refused there at save, publish and install and by `os validate` / `os build`, and the refusal prescribes `place`: that package places only what it brings, e.g. `place: [{ list: 'acme_contract', after: 'crm_opportunity' }]`, and cannot reorder or hide HotCRM's tabs. The account is not redeclared, takes no `overrides` declaration, and nothing in HotCRM is edited.", + "files": [], + "assertions": { + "must_contain": [ + "hotcrm.custom", + "defineObjectExtension", + "extend: 'crm_account'", + "relatedLists", + "hidden: true", + "place" + ], + "must_not_contain": [ + "name: 'crm_account'", + "overrides:" + ] + } } ] } From 90a673de6756a9b5963aee96265a5a7b39dfe3e3 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 00:02:56 +0000 Subject: [PATCH 2/2] docs(skills): name the refused arrangement writer by what the judge tests; case 27 asserts place: The paragraph said any other package is refused both keys. The one judge refuses a writer that is not a .custom package; another .custom package is not refused at the doors, its keys are not applied. The sentence and the changeset bullet now say outside a .custom package. Case 27's must_contain token place also matched the word replaces; it is place: now. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01ADHkmPTDM2MxHR8cvoMVUX --- .changeset/36541-skills-custom-arrangement.md | 2 +- skills/objectstack-data/SKILL.md | 2 +- skills/objectstack-data/evals/objects-fields-relationships.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.changeset/36541-skills-custom-arrangement.md b/.changeset/36541-skills-custom-arrangement.md index a26e29afd33..dce691ea2b2 100644 --- a/.changeset/36541-skills-custom-arrangement.md +++ b/.changeset/36541-skills-custom-arrangement.md @@ -7,6 +7,6 @@ Metadata-protocol: none The `objectstack-data` skill teaches the whole-arrangement keys of the paired `.custom` package's object extension: -- Object Extension Model: only the object extension of a base's paired `.custom` package may write `fieldGroups` and `relatedLists`, in the shape an object declares them. A written key replaces that arrangement whole (the owner's and every `place`); an unlisted field shows after the last group, an unnamed tab still shows after the listed ones, and `{ list: 'crm_note', hidden: true }` hides a tab. In any other package both keys are refused at save, publish and install and by `os validate` / `os build`, with the prescription to use `place`. +- Object Extension Model: only the object extension of a base's paired `.custom` package may write `fieldGroups` and `relatedLists`, in the shape an object declares them. A written key replaces that arrangement whole (the owner's and every `place`); an unlisted field shows after the last group, an unnamed tab still shows after the listed ones, and `{ list: 'crm_note', hidden: true }` hides a tab. Outside a `.custom` package both keys are refused at save, publish and install and by `os validate` / `os build`, with the prescription to use `place`. - Eval: a new `objectstack-data` case moves an installed object's tab arrangement from an add-on package's extension, where it is refused, to the pair's extension, and names `place` as what the add-on package writes. The `place` case no longer says an extension has neither key. - Five restatements in the same file are cut to pay for the paragraph; each one's content stays in the bundle (`rules/validation.md`, `rules/indexing.md`, `rules/lifecycle.md`, `references/lint-rules.md`, the object JSON example). diff --git a/skills/objectstack-data/SKILL.md b/skills/objectstack-data/SKILL.md index 5caca0695e1..01667870333 100644 --- a/skills/objectstack-data/SKILL.md +++ b/skills/objectstack-data/SKILL.md @@ -387,7 +387,7 @@ Only the pair's extension may also write `fieldGroups` and `relatedLists`, shape as on an object. A written key replaces that arrangement whole (the owner's and every `place`): an unlisted field shows after the last group, an unnamed tab still shows after the listed ones, and `{ list: 'crm_note', hidden: true }` hides -a tab. In any other package both keys are refused at those doors: use `place`. +a tab. Outside a `.custom` package both keys are refused at those doors: use `place`. Studio's **Add field** on a base object writes the same extension, as an `object_extension` item of the pair. diff --git a/skills/objectstack-data/evals/objects-fields-relationships.json b/skills/objectstack-data/evals/objects-fields-relationships.json index a00deff354f..9688d2182a1 100644 --- a/skills/objectstack-data/evals/objects-fields-relationships.json +++ b/skills/objectstack-data/evals/objects-fields-relationships.json @@ -478,7 +478,7 @@ "extend: 'crm_account'", "relatedLists", "hidden: true", - "place" + "place:" ], "must_not_contain": [ "name: 'crm_account'",