Skip to content

Commit c0eecb1

Browse files
docs(skills): objectstack-data teaches the paired .custom package's whole arrangement (fieldGroups, relatedLists) (#36568)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi91tYCagMT6JaQ6YA5YqnWwi)_ Fixes #36541 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用 AI 写配置的客户,想给已安装软件包里的对象重排记录页(换字段分组、调页签顺序、隐藏页签)时,AI 现在知道这份排布要写在该软件包配套的环境定制包里;以前技能没讲这件事,AI 要么不会用,要么写进别的扩展包后被拒收。 - 属于「记录页标签与分组」专题:环境管理员整页排布的能力上一步已经上线,这一步把它教给 AI 作者,并补一道考题。 - 如果教错,AI 会把排布写到会被拒收的位置,保存或校验时当场报错并给出改法,数据不受影响;撤回这次改动,技能文字就回到原样。 - 审批这次对外技能文字的改动(技能包属于受管范围,需要你来合入)。 ## Fix round 1 Head `90a673de67`, one commit on top of `0db54351e8`, answering the contract review of that head (record 7087999230). - **S1, the refused writer is named by what the judge tests.** The paragraph's last sentence read "In any other package both keys are refused at those doors". That is false for a `.custom` package that is not the object's pair: `judgeExtensionArrangement` returns no refusal when `isCustomizationPackage(packageId)` holds (`packages/metadata-protocol/src/protocol-extension-arrangement.ts:94`; the predicate is the id's `.custom` suffix over a valid base, `packages/spec/src/kernel/customization-package.ts:119`), and the key descriptions say such a package "is not refused at those doors: the registry merge does not apply what it writes here ... and the boot log names it" (`CUSTOM_ARRANGEMENT_WRITER`, `packages/spec/src/data/object.zod.ts:6832`). Both files read again on `main` at `abe95a950d`: unchanged since `d463c46f`. The sentence now reads "Outside a `.custom` package both keys are refused at those doors: use `place`." The changeset's first bullet carries the same words. - **Bytes.** The new wording is 7 bytes longer and the file had exactly 7 priced bytes of headroom, so nothing more is cut: 26,853 to 26,860 bytes, 6,709 to 6,710 tokens, ceiling 6,710 unchanged. - **N1, case 27 asserts `place:`.** The token `place` also matched the word "replaces", so an answer that never said what the add-on package writes could pass. It is `place:` now, the token case 26 uses; the reference answer already contains `place: [`. Regraded below. - **N2 is left as it is.** No byte remains after S1, and the review ties the clause to bytes being left. ## What changes **One paragraph in `skills/objectstack-data/SKILL.md`, § Object Extension Model** (lines 386 to 390 at head `90a673de67`), inside the paragraph about an object an installed package ships, right after the sentence that lists the doors of the `__c` rule: > 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. Outside a `.custom` package both keys are refused at those doors: use `place`. "Those doors" are the ones the sentence before it names: save, publish and install, `os validate` and `os build`. **What it teaches is what is on `main`** (PR #36517, merge commit `45ef94ef`; ADR-0146 D2, D3 and D10), read at `d463c46f`: | Sentence | Where it is on `main` | |:---|:---| | The two keys, in an object's shapes | `packages/spec/src/data/object.zod.ts:7070` (`fieldGroups`, an array of the object's group schema) and `:7082` (`relatedLists`); the key list is `CUSTOM_ARRANGEMENT_KEYS`, `packages/spec/src/data/field-customization.ts:124` | | `{ list, hidden: true }` | `packages/spec/src/data/object.zod.ts:6703`: `hidden` is a boolean on the extension's entry only; an object's own entry refuses it by name (`:1347`) | | A written key replaces whole; an unlisted field after the last group; an unnamed tab still shows after the listed ones | the two key descriptions, `packages/spec/src/data/object.zod.ts:6837` and `:6863`; the fold is `applyCustomArrangement`, `packages/objectql/src/registry-custom-arrangement.ts:144` | | Only the pair writes them; outside a `.custom` package they are refused and the writer is told to use `place` | one judge, `judgeExtensionArrangement`, `packages/metadata-protocol/src/protocol-extension-arrangement.ts:91`. Its answer is `VALIDATION_ERROR` / 400 (`:116`); the message, measured on this PR's eval shape: "`relatedLists` in the extension of object 'crm_account' in package 'acme_contracts': only the object extension of a base's paired `.custom` package declares an object's whole arrangement (ADR-0146 D10). Remove the key and place what this package brings with `place`, e.g. `place: [{ list: 'contract', after: 'opportunity' }]`." | | The doors | save `packages/metadata-protocol/src/protocol-save.ts:1390`; publish `protocol-history-and-publish.ts:1062`; restore `protocol-authoring-gate.ts:129` (all three through `objectExtensionItemRefusal`, `protocol-object-extension-item.ts:257`); `os validate` `packages/cli/src/commands/validate.ts:895`; `os build` `packages/cli/src/commands/compile.ts:948`; install `packages/cloud-connection/src/marketplace-install-local-plugin.ts:3192` (`VALIDATION_ERROR` / 422, one row per key in `details.refusals`) | **Paid for in the same file; the token ceiling is not raised.** The file had 0 tokens of headroom (6,710 of 6,710). The paragraph is 407 bytes (400 before fix round 1); five restatements are cut, 405 bytes, and the content of each stays in the bundle. The remaining 2 bytes come out of the 2 priced bytes the file had under its ceiling: | Cut from `SKILL.md` | Bytes | Where the content stays | |:---|---:|:---| | § Validation Patterns, the note that on insert an omitted optional field reads as `null` in a predicate | 240 | `rules/validation.md` lines 80 to 83 (the same note) and line 17 (a `script` rule judges the merged record: prior row plus this write) | | § Index Patterns, "`unique` defaults to `false`; omit it when that is what you mean." | 66 | `rules/indexing.md` line 11 | | Quick Reference, the lifecycle row's "append-only objects must declare one" | 42 | the `lifecycle` row of the optional-properties table in the same file ("Required for append-only, high-write-rate objects") and `rules/lifecycle.md` line 14 | | The `sharingModel` heading's "(ADR-0090 D4; legacy aliases removed)" | 38 | `references/lint-rules.md` line 23 (`security-owd-alias`: a legacy spelling is an error, ADR-0090 D4) | | The `pluralLabel` row's `(e.g., "Accounts")` | 19 | the object JSON example in the same file (`"pluralLabel": "Accounts"`) | **The two readings** (tokens in the ratchet's convention, `ceil(utf8 bytes / 4)`, the release-stamp line not priced): | | Before (`d463c46f`) | After (`90a673de67`) | |:---|:---|:---| | `skills/objectstack-data/SKILL.md` | 473 lines · 26,858 bytes · 6,710 tokens (ceiling 6,710) | 472 lines · 26,860 bytes · 6,710 tokens (ceiling 6,710, unchanged) | | All 14 `skills/*/SKILL.md` | 4,951 lines · 261,175 bytes | 4,950 lines · 261,177 bytes | | Ratcheted (authored) tokens, whole bundle | 197,573 | 197,573 | | Eval fixtures (measured, not ratcheted) | 81,141 | 81,720 | | Bundle total | 293,321 | 293,900 | **One eval case**, `skills/objectstack-data/evals/objects-fields-relationships.json` case 27: an add-on package put the tab arrangement (two tabs swapped, one hidden) on its own extension of an installed object and `os validate` refused it. The answer moves the arrangement to the object extension of the base's paired `.custom` package and names `place` as what the add-on package writes. `must_contain`: `hotcrm.custom`, `defineObjectExtension`, `extend: 'crm_account'`, `relatedLists`, `hidden: true`, `place:`. Two riders in the eval directory: - Case 26 (the `place` case) said in its reference answer that "an extension has neither key". That stopped being true when the two keys shipped, and the new paragraph says the opposite, so the parenthesis now reads: only the object extension of HotCRM's paired `hotcrm.custom` package writes those keys; here they are refused. Its prompt and assertions are unchanged, so its case hash is unchanged. - `evals/README.md` lists what the file covers and gains the new case's topic. **Changeset**: `.changeset/36541-skills-custom-arrangement.md`, `@objectstack/skills` patch. ## Tests The grader and gate readings are at head `90a673de67`, tree clean. The door suites were run at `0db54351e8`; fix round 1 touches no file they read. <details> <summary>The eval file's reference answers under its own grader</summary> `gradeAnswer` (`packages/qa/scenarios/src/skill-evals/grade.ts`) over each case's `expected_output`, cases parsed by the runner's own `parseEvalFile`. No model round was run. | Tree | Reading | |:---|:---| | `d463c46f` (control) | 26 cases parsed, 0 refusals; reference answers PASS 26/26 | | `0db54351e8` (the head reviewed before) | 27 cases parsed, 0 refusals; reference answers PASS 27/27; case 26 PASS; case 27 PASS | | `90a673de67` | 27 cases parsed, 0 refusals; reference answers PASS 27/27; case 26 PASS; case 27 PASS | Named answers for case 27, each graded under the assertions of both heads and each as expected: | Answer | At `0db54351e8` (`place`) | At `90a673de67` (`place:`) | |:---|:---|:---| | the reference answer | PASS | PASS | | a short answer: the pair, the arrangement, `place: [...]` for the add-on package | PASS | PASS | | the pair and the arrangement, "the key replaces the tab list whole", nothing about what the add-on package writes (the N1 control) | PASS | FAIL, `missing=["place:"]` | | the arrangement kept on the add-on package, the pair never named | FAIL, `missing=["hotcrm.custom"]` | FAIL, `missing=["hotcrm.custom"]` | | the pair named, the tab hidden by leaving it out (an object's own rule) | FAIL, `missing=["hidden: true"]` | FAIL, `missing=["hidden: true"]` | At `0db54351e8` two more named answers were graded as expected: the object redeclared with an `overrides` declaration (FAIL, `forbidden=["name: 'crm_account'","overrides:"]`), and the pair named with nothing said about the add-on package (FAIL, `missing=["place"]`). The reference answer's extension, `{ extend: 'crm_account', relatedLists: ['crm_opportunity', 'crm_contact', { list: 'crm_lead', hidden: true }] }`, parses under `ObjectExtensionSchema`; `judgeExtensionArrangement` answers 1 refusal for package `acme_contracts` (path `objectExtensions[0].relatedLists`) and 0 for `hotcrm.custom`. `node ui/scripts/check-skill-eval-tokens.mjs`: exit 0, "Every must_contain token is taught by its own skill bundle." </details> <details> <summary>Which doors refuse: the suites of the merged protocol, run on this head</summary> The dispatch asked which doors actually refuse a writer that is not a `.custom` package. Each door's suite was run, at `0db54351e8`, after building its dependency closure (`turbo run build --filter='@objectstack/cli^...'`, 64 tasks, exit 0), each run under the shared verification lock: | Door | Suite | Reading | |:---|:---|:---| | The judge, and the gate the save, publish and restore doors ask | `packages/metadata-protocol/src/protocol-extension-arrangement.test.ts` | exit 0, `Tests 13 passed (13)` | | Save, through the real protocol and engine | `packages/objectql/src/protocol-custom-arrangement.test.ts` | exit 0, `Tests 6 passed (6)` | | `os validate` and `os build`, both commands in process | `packages/cli/test/validate-build-extension-arrangement.test.ts`, `packages/cli/src/utils/extension-arrangement.test.ts` | exit 0, `Test Files 2 passed (2)`, `Tests 10 passed (10)` | | Install | `packages/cloud-connection/src/marketplace-install-local-extension-arrangement.test.ts` | exit 0, `Tests 5 passed (5)` | | What a written key does (replaces whole, the unlisted field, the unnamed tab, the hidden tab) | `packages/objectql/src/registry-custom-arrangement.test.ts`, `packages/spec/src/data/object-extension-arrangement.test.ts` | exit 0, `Tests 33 passed (33)` and `Tests 53 passed (53)` | The publish and restore doors are measured at the gate they call (`objectExtensionItemRefusal`); that each of them calls it is read from the call sites cited above, not from a run through the door. </details> <details> <summary>Gates</summary> `node scripts/pm/dispatch-gates.mjs --commands` at `90a673de67` derives the same 50 commands as at `0db54351e8`. All 50 were run again on this head, each exit code recorded before any pipe; `--ran` answers: "50 derived famil(ies) accounted for — 49 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)", exit 0. - 49 exit 0. Among them: `node scripts/check-skills-token-ratchet.mjs` ("60 authored bundle file(s) within their ceilings"; the data row reads `6710 / 6710 (+0)`), `check:skill-docs`, `check:skill-served-sections`, `check:skill-links`, `check:skill-identifier-liveness`, `check:skill-compatibility`, `check:skill-frame-sync`, `check:doc-authoring`, `check:doc-formula-expressions`, `check:role-word`, `check:nul-bytes`, `check-empty-changeset`, `check-changeset-no-major`, `check-adr-0087-registration`. - NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3. It reads the built output of every package and asks for a whole-workspace build; this change touches no package source, and the full build was not made for it. CI reads it. - Outside the derived list, also run on this head: `check:skill-refs` exit 0 ("10 generated files in sync"), `check:skill-examples` exit 0 ("349 prose examples type-check across 3 surface(s)"), `node ui/scripts/check-skill-eval-tokens.mjs` exit 0. - The gates that read built output (`check:dts-closure`, `check:published-files`, `check:sourcemap-no-sources-content`, `check:driver-memory-census`, `check:lean-entry-closure`) answered exit 0 on a tree where the spec, lint, objectql, metadata-protocol and client-react closures were built, not the whole workspace; their full reading is CI's. </details> ## Acceptance notes 1. **Overlap.** `node scripts/pm/overlap-check.mjs` at `90a673de67`: `origin/main` (`abe95a950d`) merges cleanly; #35129 and #36559 merge cleanly (#36559 edits case 3 of the same eval file); draft #36158 conflicts in `skills/objectstack-data/SKILL.md`. That one is known to the seat and ruled: this card does not wait, and whichever of the two lands second replays its text. 2. **`main` moved after the branch was cut**, `d463c46f` to `abe95a950d`. It merges cleanly and the branch was not merged again. 3. **Both mechanism assumptions of the dispatch hold.** The refusal fires at save, publish and install and at `os validate` / `os build`, the doors the `__c` sentence already lists, so the paragraph says "at those doors". `{ list, hidden: true }` is the schema's spelling. 4. **What the paragraph leaves to the refusal texts and the docs page** (`content/docs/data-modeling/object-extensions.mdx`, "Arranging the whole record page"), to stay inside the ratchet: a `place` entry beside the key that replaces it is refused at parse with its own prescription; a built-in tab is written as its bare name and cannot be hidden; a `.custom` package that is not the object's pair is not refused, it is skipped and named in the boot log (since fix round 1 the paragraph no longer says the opposite; it still does not teach the skip); a list the owner hid by leaving it out stays hidden until the arrangement names it; a field is kept off the page by a group whose `visibleWhen` is false. 5. **Case 27's prompt carries two of its own `must_contain` tokens** (`relatedLists`, `hidden: true`), because the colleague's refused extension is quoted in it. The tokens the prompt does not hand over are `hotcrm.custom`, `defineObjectExtension`, `extend: 'crm_account'` and `place:`. With `place:` an answer that names `place` only in prose, without an entry, does not pass; case 26 has the same property. 6. **`evals/README.md` is outside the file surface the claim lists.** It is the index of the eval file and the same-file PR before this one updated it with its case, so it is updated here too. 7. **The ceiling row is untouched at 6,710** and the file sits exactly on it, with 0 tokens of headroom, as it did on `main`. ## Verification **Read first:** 1. `skills/objectstack-data/SKILL.md` lines 386 to 390, the last sentence first (fix round 1), beside `CUSTOM_ARRANGEMENT_WRITER` and the two key descriptions in `packages/spec/src/data/object.zod.ts` (lines 6828 to 6888). The risk is a sentence that says more than the runtime does. 2. The five deletions in the same diff, each against the home named in the table above. The riskiest is the insert-null note: it leaves the always-loaded file and stays in `rules/validation.md`. 3. Case 27, and the one changed parenthesis of case 26, in `skills/objectstack-data/evals/objects-fields-relationships.json`. **Two-minute check:** `node scripts/check-skills-token-ratchet.mjs`. Expected: the data row reads `6710 / 6710 (+0)` and the last line reads "60 authored bundle file(s) within their ceilings". 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPTDM2MxHR8cvoMVUX <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmPTDM2MxHR8cvoMVUX --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1a2a8a9 commit c0eecb1

4 files changed

Lines changed: 44 additions & 12 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
The `objectstack-data` skill teaches the whole-arrangement keys of the paired `.custom` package's object extension:
9+
10+
- 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`.
11+
- 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.
12+
- 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).

‎skills/objectstack-data/SKILL.md‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ metadata:
3636
- **[Relationships](./rules/relationships.md)** — lookup vs master_detail, junction patterns, delete behaviors
3737
- **[Validation Rules](./rules/validation.md)** — All validation types, script inversion, severity levels
3838
- **[Index Strategy](./rules/indexing.md)** — btree/gin/gist/fulltext, composite indexes, partial indexes
39-
- **[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`)
39+
- **[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`)
4040
- **[Lifecycle Hooks](./references/data-hooks.md)** — the lifecycle events, the sandboxed `body` (ctx + capability contract; the inline `handler` is deprecated), registration, canonical patterns
4141
- **[Datasources & Federation](./rules/datasources.md)** — `defineDatasource`, external/federated objects (`remoteName`/`columnMap`), auto-connect gating, credentials; ❌ no `field.columnName` on external objects
4242
- **[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({...})`):
6868
| `fields` | map | keys in `snake_case` | Field definitions |
6969
| `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 |
7070

71-
**`sharingModel` — the four canonical values** (ADR-0090 D4; legacy aliases
72-
removed):
71+
**`sharingModel` — the four canonical values:**
7372

7473
| Value | Who can read / write |
7574
|:--|:--|
@@ -91,7 +90,7 @@ all (Relationship Patterns below).
9190
| Property | Default | Description |
9291
|:---------|:--------|:------------|
9392
| `label` | Auto from `name` | Human-readable singular label |
94-
| `pluralLabel` | — | Plural form (e.g., "Accounts"); author it alongside `label` |
93+
| `pluralLabel` | — | Plural form; author it alongside `label` |
9594
| `icon` | — | Icon for nav, list headers and lookup pickers; give every object one |
9695
| `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 |
9796
| `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
317316

318317
**⚠️ Script validation is inverted:** Validation **fails** when expression is `true`.
319318

320-
> On **insert**, an optional field omitted from the payload reads as `null` in a
321-
> validation predicate — so `record.due_date == null` matches an omitted field the
322-
> same as an explicit `null`. (On update, the prior record supplies it.)
323-
324319
The **complete** set of types (`ValidationRuleSchema` discriminators): `script`,
325320
`state_machine`, `format`, `cross_field`, `json_schema`, `conditional`.
326321

@@ -335,8 +330,7 @@ keys and values are option `value`s, never labels.
335330
336331
### Index Patterns
337332

338-
**The whole declaration surface is `fields` / `unique` / `name`.** `unique`
339-
defaults to `false`; omit it when that is what you mean.
333+
**The whole declaration surface is `fields` / `unique` / `name`.**
340334

341335
```typescript
342336
indexes: [
@@ -389,6 +383,11 @@ declaration. Every field the pair adds ends in `__c` (`region__c`). The suffix i
389383
reserved to the pair, so a `__c` field in any other package, or an unsuffixed
390384
field in a `.custom` extension, is refused at save, publish and install and by
391385
`os validate` / `os build`.
386+
Only the pair's extension may also write `fieldGroups` and `relatedLists`, shaped
387+
as on an object. A written key replaces that arrangement whole (the owner's and
388+
every `place`): an unlisted field shows after the last group, an unnamed tab
389+
still shows after the listed ones, and `{ list: 'crm_note', hidden: true }` hides
390+
a tab. Outside a `.custom` package both keys are refused at those doors: use `place`.
392391
Studio's **Add field** on a base object writes the same extension, as an
393392
`object_extension` item of the pair.
394393

‎skills/objectstack-data/evals/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ JSON fixtures in the objectui shape (`skill_name`, `evals[]`: `prompt`,
77
`password`), relationships (junction vs multi-value lookup,
88
`deleteBehavior`, on a `user` field too), validation (`state_machine`, unique **index**),
99
conditional field rules, the record owner (负责人 is `owner_id`), an
10-
object extension placing what it brings (`place`).
10+
object extension placing what it brings (`place`), the `.custom` pair's
11+
whole arrangement (`relatedLists`, `{ list, hidden: true }`).
1112
- `hooks-security-seeds-datasources.json` — search mirrors via hooks,
1213
permission-set scopes, external datasources, seeds (`externalId`,
1314
CEL dynamic values).

‎skills/objectstack-data/evals/objects-fields-relationships.json‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@
451451
{
452452
"id": 26,
453453
"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.",
454-
"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.",
454+
"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.",
455455
"files": [],
456456
"assertions": {
457457
"must_contain": [
@@ -466,6 +466,26 @@
466466
"overrides:"
467467
]
468468
}
469+
},
470+
{
471+
"id": 27,
472+
"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?",
473+
"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.",
474+
"files": [],
475+
"assertions": {
476+
"must_contain": [
477+
"hotcrm.custom",
478+
"defineObjectExtension",
479+
"extend: 'crm_account'",
480+
"relatedLists",
481+
"hidden: true",
482+
"place:"
483+
],
484+
"must_not_contain": [
485+
"name: 'crm_account'",
486+
"overrides:"
487+
]
488+
}
469489
}
470490
]
471491
}

0 commit comments

Comments
 (0)