Skip to content

Commit e089e41

Browse files
committed
docs(spec): say the stored pass cannot list an object_extension row with a non-grammar fieldPatches key
`applyConversionsToStoredItem` maps no `object_extension` row onto a stack collection, so it returns the row untouched and no REFUSED_STORED_SHAPES detector could reach it. The semantic entry and the changeset now say so and name the check an operator runs instead. Claude-Session: https://claude.ai/code/session_01ADHkmSCC3J91hA9anBJ81g Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6a70094 commit e089e41

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎.changeset/29366-field-patches-key-grammar.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ Skills-docs: updated here — `content/docs/data-modeling/object-extensions.mdx`
1919
- **Before.** `fieldPatches: { Industry: { label: 'Sector' } }` parsed in `defineStack`, was stored by the save door and booted: the registry fold named the patch once in the log and applied nothing, and `os validate` refused it only when the target object was in the same stack.
2020
- **Now.** One `invalid_key` issue at `fieldPatches.Industry`, naming the grammar and an example. The key schema is the one `ObjectSchema.fields` reads, hoisted to one constant, so the two cannot drift.
2121
- **Unchanged.** A snake_case key parses as before, and a `__c` key is still refused by the `__c` rule with its own prescription.
22-
- **Who sees it.** No extension in this repository's examples, skills, docs or templates writes such a key. A stored `object_extension` row that carries one no longer parses, so the sync names the row (`INVALID_METADATA`) and registers none of it, its `fields` included; its next save is refused until the key is renamed.
22+
- **Who sees it.** No extension in this repository's examples, skills, docs or templates writes such a key. A stored `object_extension` row that carries one no longer parses, so the sync names the row (`INVALID_METADATA`) and registers none of it, its `fields` included; its next save is refused until the key is renamed. `os migrate meta --stored` does not list such a row beforehand: the stored pass has no stack collection for an `object_extension` row and hands it back untouched, so check each stored extension's `fieldPatches` keys against the grammar before upgrading.
2323

2424
**FROM → TO.** `fieldPatches: { Industry: { label: 'Sector' } }` → `fieldPatches: { industry: { label: 'Sector' } }`: key each patch by the name of the field the extended object declares (the key of its `fields` entry), never by its label. The upgrade guide entry is `object-extension-field-patch-key-grammar-refused`.

‎packages/spec/src/migrations/entries/semantic/18.object-extension-field-patch-key-grammar-refused.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ import type { SemanticMigration } from '../../types.js';
77
// that was meant is the name of a field the target declares, and a rewrite of
88
// the spelling (lower-casing, `-` to `_`) can land on a different field or on
99
// none, so which field is the author's to name.
10+
//
11+
// No `REFUSED_STORED_SHAPES` detector lists a stored row in this shape, because
12+
// none could be reached: `applyConversionsToStoredItem` maps a row type onto a
13+
// stack collection, and `object_extension` has none (it is in neither
14+
// `SINGULAR_TO_PLURAL` nor the stored-only map), so the stored pass hands the
15+
// row back untouched and runs no conversion or detector over it. The criteria
16+
// below say so, and name the query that finds such a row instead.
1017
export const entry: SemanticMigration = {
1118
id: 'object-extension-field-patch-key-grammar-refused',
1219
surface:
@@ -30,5 +37,8 @@ export const entry: SemanticMigration = {
3037
+ 'at `fieldPatches.KEY` that names the grammar and an example. A stored `object_extension` row whose '
3138
+ 'body still carries such a key no longer parses, so the sync that registers stored extensions names '
3239
+ 'the row (`INVALID_METADATA`) and registers none of it, its `fields` included, and its next save is '
33-
+ 'refused until the key is renamed to the field it meant.',
40+
+ 'refused until the key is renamed to the field it meant. `os migrate meta --stored` does not list such '
41+
+ 'a row: the stored pass maps no `object_extension` row onto a stack collection, so it reads the row as '
42+
+ 'already on protocol. Find one before upgrading by reading each stored `object_extension` row\'s '
43+
+ '`fieldPatches` keys against the snake_case grammar of `fields` keys.',
3444
};

0 commit comments

Comments
 (0)