Skip to content

Commit 73639a7

Browse files
committed
docs(skills): add an objectstack-data eval for relabelling a vendor field with fieldPatches
Case 7 of objects-fields-relationships.json: an author wants HotCRM's crm_account.industry to read "Sector". The accept set requires fieldPatches on a defineObjectExtension in hotcrm.custom; it refuses industry redeclared in fields, which takes the field over. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyYUF3Rw1uw6uU1yUy
1 parent 4d56914 commit 73639a7

2 files changed

Lines changed: 30 additions & 0 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): an objectstack-data eval checks that a vendor field is relabelled with `fieldPatches`, never redeclared in `fields`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-data/evals/objects-fields-relationships.json` gains case 7: an author wants HotCRM's `crm_account.industry` to read "Sector" instead of "Industry". The accept set requires `fieldPatches` on a `defineObjectExtension` authored in `hotcrm.custom` (an option's label keyed by its stored value where the field declares its own options); it refuses `industry` redeclared in `fields`, which takes the field over and cuts it off from HotCRM's upgrades. No skill text changes.

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,26 @@
115115
"deleteBehavior: 'cascade'"
116116
]
117117
}
118+
},
119+
{
120+
"id": 7,
121+
"prompt": "We installed HotCRM (`hotcrm`, namespace `crm`). Its `crm_account` object's `industry` field should read \"Sector\" instead of \"Industry\" for our users, without touching HotCRM's source.",
122+
"expected_output": "An object extension in HotCRM's paired customization package `hotcrm.custom`, registered in that stack's `objectExtensions`: `defineObjectExtension({ extend: 'crm_account', fieldPatches: { industry: { label: 'Sector' } } })`. A patch carries display keys only (`label`, `description`, `inlineHelpText`, `placeholder`); the field's type, values and rules stay HotCRM's, so its upgrades still reach it, and a key the tenant edited keeps the tenant's text. Never redeclare `industry` in `fields`: that takes the field over whole and cuts it off from the owner's upgrades, and an unsuffixed field in a `.custom` extension is refused anyway. An option's label rides the same patch keyed by the option's stored `value` (`options: { technology: { label: 'Tech' } }`) only for a field that declares its own `options`; a `picklist`-bound field's options are never patchable, and a patch naming a field or option value the target lacks is refused at install and by `os validate`.",
123+
"files": [],
124+
"assertions": {
125+
"must_contain": [
126+
"hotcrm.custom",
127+
"defineObjectExtension",
128+
"extend: 'crm_account'",
129+
"fieldPatches",
130+
"label: 'Sector'"
131+
],
132+
"must_not_contain": [
133+
"industry: Field.select(",
134+
"overrides:",
135+
"name: 'crm_account'"
136+
]
137+
}
118138
}
119139
]
120140
}

0 commit comments

Comments
 (0)