Skip to content

Commit 3fc850a

Browse files
committed
docs(skills,spec): fieldPatches example patches options only on a field that declares them
HotCRM's crm_account.industry takes its options from the shared industry picklist, so the taught example's options patch was refused at install and by os validate (picklist-option). The skill, the spec description and TSDoc, and the object-extensions docs page now relabel industry only and patch an option of type, which declares its own options. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAmsHMwmra6cg78RoEp
1 parent 1b3e22f commit 3fc850a

5 files changed

Lines changed: 32 additions & 6 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the `fieldPatches` example relabels HotCRM's `industry` and patches options only on a field that declares its own
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The `objectstack-data` skill's one `fieldPatches` example patched an option of `crm_account.industry`. HotCRM binds that field to the shared `industry` picklist, so a verbatim copy was refused at install and by `os validate` (`picklist-option`). The example now sets `industry`'s `label` only and patches an option of `type`, which declares its own `options` (`customer` → `Client`); the sentence before it names `industry` as the picklist-bound field whose options no patch reaches. No schema, key or behaviour changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the `fieldPatches` description's example no longer patches an option of a picklist-bound field
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`ObjectExtensionSchema.fieldPatches`'s description and the `ObjectExtensionSchema` TSDoc taught `industry: { label: 'Sector', options: { technology: { label: 'Tech' } } }`. HotCRM's `crm_account.industry` takes its options from a shared picklist, so the install door and `os validate` refuse that patch (`picklist-option`). The description now says an option of a picklist-bound field is never patchable and only a field declaring its own `options` takes an option patch, and its example sets `industry`'s label and help text and patches `type`'s `customer` option. The generated `references/data/object.mdx` follows. Description text only: no schema, key or behaviour changes.

‎content/docs/data-modeling/object-extensions.mdx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ export const AccountWordingExtension = defineObjectExtension({
110110
industry: {
111111
label: 'Sector',
112112
inlineHelpText: 'The market the account sells into.',
113-
options: { technology: { label: 'Tech' } }, // addressed by the stored value
113+
// no `options` here: `industry` takes its options from a shared picklist
114+
},
115+
type: {
116+
options: { customer: { label: 'Client' } }, // addressed by the stored value
114117
},
115118
},
116119
});

‎packages/spec/src/data/object.zod.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5112,8 +5112,10 @@ function fieldPatchesDescription(): string {
51125112
'(`mergeObjectDefinitions`) after the additive merges, on every object read: a tenant\'s own text keeps ' +
51135113
'winning, and between two extensions the higher `priority` wins. A patch naming a field or option value ' +
51145114
'the target does not have is refused at install and by `os validate`; a field the same extension ' +
5115-
'replaces in `fields` is refused here. Example: `fieldPatches: { industry: { label: \'Sector\', ' +
5116-
'inlineHelpText: \'The market the account sells into\', options: { technology: { label: \'Tech\' } } } }`.'
5115+
'replaces in `fields` is refused here. An option of a field bound to a shared `picklist` is never ' +
5116+
'patchable: its labels are the picklist\'s, so only a field declaring its own `options` takes an option ' +
5117+
'patch. Example: `fieldPatches: { industry: { label: \'Sector\', inlineHelpText: \'The market the ' +
5118+
'account sells into\' }, type: { options: { customer: { label: \'Client\' } } } }`.'
51175119
);
51185120
}
51195121

@@ -5128,7 +5130,8 @@ function fieldPatchesDescription(): string {
51285130
* fields: { sales_stage: Field.select([...]) },
51295131
* // A base field's display properties only (ADR-0146 D10), applied by the
51305132
* // registry merge (`mergeObjectDefinitions`) — see `fieldPatches`.
5131-
* fieldPatches: { industry: { label: 'Sector', options: { technology: { label: 'Tech' } } } },
5133+
* // `industry` is picklist-bound, so only its label; `type` declares its own options.
5134+
* fieldPatches: { industry: { label: 'Sector' }, type: { options: { customer: { label: 'Client' } } } },
51325135
* }]
51335136
* ```
51345137
*/

‎skills/objectstack-data/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ owner's upgrades. A patch carries display keys only
360360
values and rules stay the owner's. A key the tenant edited keeps the tenant's
361361
text; between two extensions the higher `priority` wins. A patch naming a field
362362
or option value the target lacks is refused at install and by `os validate`, and
363-
a `picklist`-bound field's options are never patchable. Example:
364-
`defineObjectExtension({ extend: 'crm_account', fieldPatches: { industry: { label: 'Sector', options: { technology: { label: 'Tech' } } } } })`.
363+
a `picklist`-bound field's options (HotCRM's `industry`) are never patchable. Example:
364+
`defineObjectExtension({ extend: 'crm_account', fieldPatches: { industry: { label: 'Sector' }, type: { options: { customer: { label: 'Client' } } } } })`.
365365

366366
**An object an installed package ships** (ADR-0146 D10) is extended from the
367367
base's paired `.custom` package (`hotcrm.custom`; **objectstack-platform**

0 commit comments

Comments
 (0)