Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
17312b8
feat(spec,ui): an object declares when a whole record is read-only by…
claude Nov 28, 2026
a824f8c
feat(spec,ui): object-level uiReadonlyWhen — changesets, dogfood pin,…
claude Nov 28, 2026
36f0326
feat(platform-objects): translate the object form's uiReadonlyWhen row
claude Nov 28, 2026
0228594
docs(spec): regenerate references for the object-level uiReadonlyWhen…
claude Nov 28, 2026
f5aec61
test(lint): the object read surface now reads uiReadonlyWhen
claude Nov 28, 2026
6ce7aa6
test(ui): pin the object-level hand lock on the dialog fields, line i…
claude Nov 28, 2026
fe9fc9c
fix(plugin-form): type the folded predicate and the child schema's lo…
claude Nov 28, 2026
0c03dd7
test(dogfood): the locked-order fixture takes the package namespace p…
claude Nov 28, 2026
1079887
test(platform-objects): the object form's advanced section gains the …
claude Nov 28, 2026
dbb395c
test(metadata-protocol): /meta/types serves the object's uiReadonlyWh…
claude Nov 28, 2026
0bee2a8
Merge remote-tracking branch 'origin/main' into claude/issue-37402-ob…
claude Nov 28, 2026
20624cb
feat(ui,spec): uiReadonly: false is not a field's own hand lock — it …
claude Nov 28, 2026
696c37e
docs(spec,platform-objects): the object-level hand-lock help and refe…
claude Nov 28, 2026
36e883f
fix(plugin-form): the wizard's final-submit gate does not judge the h…
claude Nov 28, 2026
fe52e09
fix(mcp): shorten describe_object's object-lock clause to fit the too…
claude Nov 28, 2026
b012f9b
test(dogfood): the expression conformance ledger classifies ObjectSch…
claude Nov 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-lint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/lint': patch
---

feat(lint): `os validate` checks an object's `uiReadonlyWhen` as it checks a field's

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

The whole-record hand lock has no server judge, so this pass is the only place an author hears about a broken one: it must parse, read the record's own columns as `record.FIELD` (never a bare field), name only declared fields, and read only the roots the field-rule slots bind — the same record-scoped check and root verdict a field's `uiReadonlyWhen` gets, reported at `object 'NAME' uiReadonlyWhen`.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-mcp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/mcp': patch
---

feat(mcp): `describe_object` reports an object's whole-record hand lock (`uiReadonlyWhen`), and its description says how to read it

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

The stdio transport and the `objectstack://objects/{name}` resource answer the object's `uiReadonlyWhen` predicate text at the top level where authored, the twin of the HTTP transport. The tool description names it: while it holds, a person cannot edit any field at the console — a field that lists its own `uiReadonlyWhen` is judged by that predicate instead, which may itself lock it, and one listing `uiReadonly: true` is always locked; an agent's write may still set every field, judged by the validations.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-metadata-core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/metadata-core': patch
---

feat(metadata-core): the field-level-security scrub keeps an object's whole-record hand lock closed for a caller who cannot evaluate it

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

`uiReadonlyWhen` on the object is classified in the object-schema FLS reference table. Where its predicate reads a field denied to the caller, it is served as the constant predicate `true` instead of being deleted: the console fails the hand lock closed and no server judges it, so deleting the predicate would silently open every record for exactly that caller. A field's own `uiReadonlyWhen` still wins over it.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-platform-objects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/platform-objects': patch
---

feat(platform-objects): the Studio object form's whole-record hand-lock row is translated in every metadata-forms locale pack

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

The object form's Advanced section offers `uiReadonlyWhen` (the object level of the field hand lock); its label and help text are authored in all eleven metadata-forms locale packs, the generator re-run after the leaf values so no fill hash is left.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-plugin-calendar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/plugin-calendar': patch
---

feat(plugin-calendar): the object's whole-record hand lock (`uiReadonlyWhen`) holds here

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

An object's `uiReadonlyWhen` is the hand lock of every field that declares none of its own: an event drag judges the start and end fields against the object's whole-record lock at the drop, through the one verdict of `@object-ui/core`. Writes outside the console are unchanged.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-plugin-detail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/plugin-detail': patch
---

feat(plugin-detail): the object's whole-record hand lock (`uiReadonlyWhen`) holds here

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

An object's `uiReadonlyWhen` is the hand lock of every field that declares none of its own: the record page's inline edit, the highlight-strip chip, the save bar's fill-in and the stage path judge a field against its object's whole-record lock, through the one verdict of `@object-ui/core`. Writes outside the console are unchanged.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-plugin-form.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/plugin-form': patch
---

feat(plugin-form): the object's whole-record hand lock (`uiReadonlyWhen`) holds here

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

An object's `uiReadonlyWhen` is the hand lock of every field that declares none of its own: the create and edit dialogs' form fields and the line-item grid's columns carry the EFFECTIVE hand-lock predicate (a field's own, else the object's; a child field's own, else the child object's), through the one verdict of `@object-ui/core`. The wizard's final-submit required re-check does not judge the hand lock on a CREATE wizard (as the form renderer does not), so an object lock TRUE over a new record's values cannot skip that check. Writes outside the console are unchanged.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-plugin-gantt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/plugin-gantt': patch
---

feat(plugin-gantt): the object's whole-record hand lock (`uiReadonlyWhen`) holds here

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

An object's `uiReadonlyWhen` is the hand lock of every field that declares none of its own: every Gantt write judges its fields against the object's whole-record lock (`ganttPatchByHand` takes the object definition), through the one verdict of `@object-ui/core`. Writes outside the console are unchanged.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-plugin-grid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/plugin-grid': patch
---

feat(plugin-grid): the object's whole-record hand lock (`uiReadonlyWhen`) holds here

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

An object's `uiReadonlyWhen` is the hand lock of every field that declares none of its own: a grid cell judges its field against the object's whole-record lock, and the grid's own row load fetches that predicate's operands (`cellReadOnlyKind` takes a required `object`), through the one verdict of `@object-ui/core`. Writes outside the console are unchanged.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-plugin-kanban.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/plugin-kanban': patch
---

feat(plugin-kanban): the object's whole-record hand lock (`uiReadonlyWhen`) holds here

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

An object's `uiReadonlyWhen` is the hand lock of every field that declares none of its own: a card drag judges the lane field against the object's whole-record lock at the drop, through the one verdict of `@object-ui/core`. Writes outside the console are unchanged.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-plugin-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/plugin-list': patch
---

feat(plugin-list): the object's whole-record hand lock (`uiReadonlyWhen`) holds here

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

An object's `uiReadonlyWhen` is the hand lock of every field that declares none of its own: the list view's `$select` fetches the operands of the object's whole-record lock for every field it edits in place, through the one verdict of `@object-ui/core`. Writes outside the console are unchanged.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-plugin-timesheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/plugin-timesheet': patch
---

feat(plugin-timesheet): the object's whole-record hand lock (`uiReadonlyWhen`) holds here

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

An object's `uiReadonlyWhen` is the hand lock of every field that declares none of its own: a timesheet cell edit judges the value field against the object's whole-record lock, through the one verdict of `@object-ui/core`. Writes outside the console are unchanged.
10 changes: 10 additions & 0 deletions .changeset/37402-object-ui-readonly-when-runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/runtime': patch
---

feat(runtime): MCP `describe_object` reports an object's whole-record hand lock (`uiReadonlyWhen`)

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

The HTTP transport's `describe_object` answer carries the object's `uiReadonlyWhen` predicate text at its top level where the object authors one, so an agent acting for a person knows the record cannot be edited by hand and reaches for an action. Never folded into any field's `readonly`: an agent's write still sets every field, judged by the validations.
15 changes: 15 additions & 0 deletions .changeset/37402-object-ui-readonly-when-spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@objectstack/spec': minor
---

feat(spec): an object declares when a whole record is read-only by hand (`uiReadonlyWhen` on the object)

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

A confirmed order, a posted invoice or a closed ticket is locked as a whole, and writing a `uiReadonlyWhen` on every field was both tedious and easy to get wrong by missing one. The object now carries the hand lock's object level:

- **`ObjectSchema.uiReadonlyWhen`** (CEL over the record's own columns, the same scope as a field's `readonlyWhen`), e.g. `uiReadonlyWhen: P\`record.status in ['confirmed', 'done']\``. While TRUE no person edits any field of an existing record on the console surfaces a field's own `uiReadonlyWhen` locks. A create is not judged.
- **A field's own declaration wins.** A field that declares `uiReadonly: true` or its own `uiReadonlyWhen` is judged by that instead of the object default, in both directions: `uiReadonlyWhen: P\`false\`` keeps a field (notes, internal tags) editable inside a locked record, and a field's own predicate can lock it where the object does not. `uiReadonly: false` is NOT a declaration of its own — it is that key's default, and a Studio switch turned on and off stores it — so such a field follows the object lock; the one opt-out spelling is `uiReadonlyWhen: P\`false\``. A field's server lock (`readonly`, `readonlyWhen`) is not a hand-lock declaration and keeps locking on its own.
- **Every write keeps every field.** The engine never reads the key: REST, import, declarative and script actions and flows write a locked record, judged by the object's validations, and nothing is dropped from the write (`X-ObjectStack-Dropped-Fields` stays absent).
- A predicate the console cannot evaluate locks every field that inherits it, as at the field level; `os validate` checks it. Liveness row `object.uiReadonlyWhen` (live), the Studio object form's Advanced section offers it as a CEL row, and the reference docs, authorable-surface record and state counts are regenerated.
11 changes: 11 additions & 0 deletions .changeset/37402-object-ui-readonly-when-ui-core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@object-ui/core': minor
---

feat(core): the one hand-lock verdict folds an object's whole-record `uiReadonlyWhen`, and asks every caller for the object

Clause-②: yes (widening: one new optional authorable key, `ObjectSchema.uiReadonlyWhen`)
Metadata-protocol: added

- `fieldReadOnlyByHand(def, record, context)` now takes the object definition in a REQUIRED `context.object` (pass `null` only where a surface has none), and so does `fieldHasConditionalHandLock(def, object)`: a caller that forgot the object would silently open a locked record. The record and context arguments are required too (pass `null` for no record). Migration: add `{ object: objectDef }` to the context of every call. These helpers first shipped in the `19.0.0-next.0` prerelease (the field-level hand lock) and are in no stable release; a caller written against that prerelease's `fieldReadOnlyByHand(def, record?, context?)` must now pass `{ object }` (or `{ object: null }`) as shown above.
- New `effectiveUiReadonlyWhen(def, object)` — the field's own `uiReadonlyWhen` when it declares a hand lock of its own (`uiReadonly: true` or a `uiReadonlyWhen`; `uiReadonly: false` reads as absent and follows the object lock), else the object's — and `fieldLockPredicates(def, object)`, the predicates whose operands a surface fetches before it judges a row. New type `ObjectHandLockDef`.
1 change: 1 addition & 0 deletions content/docs/references/api/metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ Metadata query with filtering, sorting, and pagination
| **schemaReadDelegate** | `string` | optional | Kernel service that decides whether a caller who may not read this object is still served its definition on the metadata API, projected by that caller's field-level security. For objects whose rows reach callers only through a service's own door (e.g. sys_approval_request → approvals); it opens no row. Fails closed. |
| **validations** | `any[]` | optional | Object-level validation rules |
| **activityMilestones** | `{ field: string; value: string; summary: string; type?: string }[]` | optional | Declarative semantic activity milestones — emit a templated timeline row when a field transitions into a value, no hook code (ADR-0052 §5b.2). |
| **uiReadonlyWhen** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Predicate (CEL) — every field of an existing record is read-only BY HAND while TRUE: the console surfaces a field's own `uiReadonlyWhen` locks (the edit dialog, record-page inline edit and the stage path, the highlight-strip chip, grid inline edit and multi-row save, kanban column drag, calendar drag, the Gantt, the timesheet cell, the line-item grid) do not let a person edit the record, while REST, import, action and flow writes keep every field, judged by the object's validations. e.g. P`record.status in ['confirmed', 'done']` on an order moved by Confirm / Cancel actions. A default for every field: a field that declares `uiReadonly: true` or its own `uiReadonlyWhen` is judged by that instead, so a field whose own `uiReadonlyWhen` is P`false` stays editable inside a locked record; `uiReadonly: false` is not such a declaration and the field follows the object lock. A create is not judged. A predicate the console cannot evaluate locks every field that inherits it. Same scope as a field's `readonlyWhen`: the record's OWN columns. The engine never reads this key. |
| **nameField** | `string` | optional | [ADR-0079] Canonical primary title field — the stored field used as the record display name (e.g. "name", "title"). |
| **displayNameField** | `string` | optional | [DEPRECATED → nameField] Field to use as the record display name (e.g., "name", "title"). Accepted as an alias for nameField. |
| **titleFormat** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object }` | optional | [DEPRECATED → nameField (ADR-0079)] Render-only title template; the server cannot return or query it, and an explicit nameField now takes precedence. An object definition that declares it is refused at the metadata save gate and by os validate; a stored object that carries it still parses and reads. Migrate a single-field title to nameField; a composite title that import, sort or search must match to a stored computed field (a non-formula field with an expression, computed and stored on every write) designated as nameField — a text formula designated as nameField stays legal for a title shown for display only. Placeholders may be written `{{field}}` or `{field}` — the title renderers treat the two as equivalent, normalizing `{{field}}` to `{field}` before substituting; neither spelling is judged at parse time. |
Expand Down
1 change: 1 addition & 0 deletions content/docs/references/data/object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ const result = ApiMethod.parse(data);
| **schemaReadDelegate** | `string` | optional | Kernel service that decides whether a caller who may not read this object is still served its definition on the metadata API, projected by that caller's field-level security. For objects whose rows reach callers only through a service's own door (e.g. sys_approval_request → approvals); it opens no row. Fails closed. |
| **validations** | `any[]` | optional | Object-level validation rules |
| **activityMilestones** | `{ field: string; value: string; summary: string; type?: string }[]` | optional | Declarative semantic activity milestones — emit a templated timeline row when a field transitions into a value, no hook code (ADR-0052 §5b.2). |
| **uiReadonlyWhen** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Predicate (CEL) — every field of an existing record is read-only BY HAND while TRUE: the console surfaces a field's own `uiReadonlyWhen` locks (the edit dialog, record-page inline edit and the stage path, the highlight-strip chip, grid inline edit and multi-row save, kanban column drag, calendar drag, the Gantt, the timesheet cell, the line-item grid) do not let a person edit the record, while REST, import, action and flow writes keep every field, judged by the object's validations. e.g. P`record.status in ['confirmed', 'done']` on an order moved by Confirm / Cancel actions. A default for every field: a field that declares `uiReadonly: true` or its own `uiReadonlyWhen` is judged by that instead, so a field whose own `uiReadonlyWhen` is P`false` stays editable inside a locked record; `uiReadonly: false` is not such a declaration and the field follows the object lock. A create is not judged. A predicate the console cannot evaluate locks every field that inherits it. Same scope as a field's `readonlyWhen`: the record's OWN columns. The engine never reads this key. |
| **nameField** | `string` | optional | [ADR-0079] Canonical primary title field — the stored field used as the record display name (e.g. "name", "title"). |
| **displayNameField** | `string` | optional | [DEPRECATED → nameField] Field to use as the record display name (e.g., "name", "title"). Accepted as an alias for nameField. |
| **titleFormat** | `string \| { dialect: 'template'; source?: string; ast?: any; meta?: object }` | optional | [DEPRECATED → nameField (ADR-0079)] Render-only title template; the server cannot return or query it, and an explicit nameField now takes precedence. An object definition that declares it is refused at the metadata save gate and by os validate; a stored object that carries it still parses and reads. Migrate a single-field title to nameField; a composite title that import, sort or search must match to a stored computed field (a non-formula field with an expression, computed and stored on every write) designated as nameField — a text formula designated as nameField stays legal for a title shown for display only. Placeholders may be written `{{field}}` or `{field}` — the title renderers treat the two as equivalent, normalizing `{{field}}` to `{field}` before substituting; neither spelling is judged at parse time. |
Expand Down
Loading
Loading