You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d9ae50b
Browse filesBrowse the repository at this point in the historyBrowse files
feat(metadata-protocol,objectql): an object extension is an authorable item of a writable package
`object_extension` joins the metadata type registry. A writable package
saves, publishes, restores and deletes one through the existing /meta
doors; the gate refuses an unbound write, the registry's extend refusals,
a name other than the target, an unknown or out-of-closure target and a
`.custom` field without `__c`. Every stored-row sync registers the whole
parsed body as the package's 'extend' contributor and delete/uninstall
withdraw it. The package export carries the rows as `objectExtensions`
and no longer exports an extended object as the package's own.
Co-Authored-By: Claude <noreply@anthropic.com>
feat(metadata-protocol,objectql): an object extension is an item of a writable package — saved, published and exported through the existing doors
10
+
11
+
Clause-②: yes (widening)
12
+
Metadata-protocol: added
13
+
14
+
A package can now add fields and rules to an object another package defines by saving an `object_extension` item through `/api/v1/meta`, the same way it saves any other item. This is what Studio's add-field on a base object writes (ADR-0146 D10): an extension in the base's paired `<base>.custom` package, its fields suffixed `__c`, the base untouched.
15
+
16
+
-**The type** (`@objectstack/spec/kernel`). `object_extension` joins `MetadataTypeSchema` and the metadata type registry. Its body is `ObjectExtensionSchema` as it stands: it carries `extend` and no `name`. The row is filed under the target object's name, one extension per package per target. `OVERRIDE_TYPE_CLASSIFICATION` lists it as `excluded`: an extension adds to its target, it never replaces a base item, so it never carries `overrides`. That disposition does not close the type to a `.custom` pair.
17
+
-**The doors.** Draft, publish, history restore and delete are the doors every item uses. The save, publish and restore doors refuse, with `VALIDATION_ERROR` / 400 and an issue path: a write bound to no package; `defaultRowScope` or `membershipKeys` in the body (the registry's own sentences); a row filed under a name other than its `extend`; an unregistered target; a target outside the package's dependency closure (with the closure prescription the other save doors print); and a `.custom` field without the `__c` suffix (the existing `__c` judge). A body the schema refuses answers 422 `INVALID_METADATA` with the schema's issues. No error code is added.
18
+
-**The registry** (`@objectstack/objectql`). A published row registers its whole parsed body as the package's `'extend'` contributor (`SchemaRegistry.registerObjectExtension`), so its fields, validations and indexes appear on every read of the object, and a publish adds the column to the target's table. Every stored-row sync re-registers it (boot, write-through, read hydration), and deleting the row or uninstalling the package withdraws it (`SchemaRegistry.withdrawObjectExtension`). What a manifest's `objectExtensions` register is unchanged.
19
+
-**The export** (`@objectstack/runtime`). `GET /packages/:id/export` carries each of the package's extension items as an `objectExtensions` entry that re-installs. A package's `objects` are now only the objects it owns: an object the package extends is no longer exported as an `'own'` object, which re-install refused with `ObjectOwnershipConflictError`.
20
+
-**`@objectstack/lint/runtime`** exports `closureDependencyRemedy`, the closure prescription the save doors print.
21
+
22
+
Two costs, both on purpose: `/meta/types` serves no JSON schema for `object_extension`, and a draft carries no `_diagnostics` badge, because the type is not bound in `BUILTIN_METADATA_TYPE_SCHEMAS` (that map requires the ADR-0010 envelope, which would change the schema a manifest's `objectExtensions` parse with).
'Also carries the validation-rule surface: rules are authored inline via object `validations` (the `validation` KIND was retired in #4509 — ADR-0088 — because a standalone rule had no way to name the object it validated). Every declared rule type is write-path enforced (rule-validator dispatches all of state_machine/script/cross_field/format/json_schema/conditional — ADR-0020 "no silent no-ops", closing the #1475 gap) and each is demonstrated: state_machine (task/project), script+cross_field (project), format/json_schema/conditional (account). Field-level requiredWhen/readonlyWhen are likewise enforced and demonstrated on invoice.',
59
59
},
60
+
// [#28574] A registry kind since an extension became an authorable item of a
61
+
// writable package. The showcase's own extension is the code half (the stack's
62
+
// `objectExtensions`, also tracked in STACK_COLLECTION_COVERAGE); the runtime
63
+
// half is `PUT /api/v1/meta/object_extension/<target>?package=<pkg>`.
notes: 'Authored in code as an `objectExtensions` entry; the same body is an `object_extension` item when a writable package saves it through `/api/v1/meta`.',
0 commit comments