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
fix(spec): declare ownership as a first-class ObjectSchema field (#3175) (#3185)
The object-level record-ownership model — `ownership: 'user' | 'org' | 'none'`,
which drives the registry's `owner_id` auto-provisioning (`applySystemFields`) —
was read by the engine via `(schema as any).ownership` while `ObjectSchema.create()`
REJECTED it as an unknown top-level key (ADR-0032 "no silent failure" / #1535). So a
tested engine opt-out (`ownership: 'org' | 'none'` on catalog / junction tables)
could not be authored through the sanctioned `create()` path, the scaffold still
emitted a now-invalid `ownership: 'own'`, and the same word was read elsewhere as the
unrelated package-contribution kind (`own` / `extend`).
Resolves the collision by formalizing the property the engine already honors:
- spec: `ObjectSchema` declares `ownership: z.enum(['user','org','none']).optional()`.
The registry reads it off the typed schema (no `as any`). A retired `own`/`extend`
value fails with guidance distinguishing it from the contribution kind (registerObject).
- cli: the `object` scaffold no longer emits the invalid `ownership: 'own'` (owner
injection is the default), and `objectstack info` labels the record model with the
correct `user` default.
- Regenerated the object reference doc; liveness ledger + changeset added.
No runtime behavior change: `applySystemFields` and its `owner_id` injection logic are
unchanged — this makes the already-honored property legally authorable and typed.
Claude-Session: https://claude.ai/code/session_014343Qv6DFAykuAJc9yjANb
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments