Skip to content

Commit c3da753

Browse files
feat(ui): the field hand lock holds on the Gantt, the timesheet cell and the palette prefill (#37888)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu7gWK41QJR6jihChx1HnxCf)_ Part of #37448 Open surface: the in-app assistant acting for a person. Its writes run in the AI service, which does not read the hand lock, so this pull request does not cover it; card #37898 carries it. The field descriptions, the metadata-form help texts and the MCP `describe_object` guidance name it as the one surface that does not honour the lock yet. Every other surface the card lists is covered, and so is the calendar's quick-create, which the contract review (7214835610) found writing a locked field. Clause-②: no Metadata-protocol: semantic Skills-docs: none — no page under skills/** teaches `uiReadonly` or the hand lock (grep on main), so no skill sentence becomes false ## 维护者速读 - 改了什么:手动锁(`uiReadonly` / `uiReadonlyWhen`)现在在 Gantt(拖动、调整、进度、连线、就地编辑、自动排程、撤销重做)、工时表单元格、日历快速新建和命令面板预填上都生效。 - 用户会看到:被锁的字段在这些界面上改不动,Gantt 会把条退回并提示“只读”;工时表锁定的格子变成只读,全局锁定时不再出现“添加行”;日历的标题或日期字段被锁(含服务端只读)时,点空白日期改开完整新建表单。 - 没覆盖的:应用内助手代人写入(在云端 AI 服务里,不读这个锁),描述里已写明,由 #37898 承接。 - 风险:只收紧手动编辑;API、导入、动作、流程写入不变。 ## What changes Each surface reads the one verdict of `@object-ui/core` (`fieldReadOnlyByHand`, or its static half `fieldStaticallyReadOnlyByHand` where no record exists yet) with the shell's predicate scope (`usePredicateScope`). - **Gantt** (`@object-ui/plugin-gantt`, new `ganttHandLock.ts`). - `ganttPatchByHand` judges each write over the stored record inside `handleTaskUpdateDefault`, the handler every bar write reaches: drag, resize, progress handle, in-place edit, auto-schedule, conflict reschedule, and undo/redo (which skips `onBeforeTaskUpdate`, so the gate sits on the write itself). A write that changes a locked field is refused: nothing is sent, the bar is put back and a toast gives the read-only reason. A locked field the write leaves unchanged is dropped from the patch, so an in-place title edit still saves when the dates it echoes are locked. Dates compare as instants. - `persistDependencies` judges a drawn link over the target record's dependencies field. - `ganttHandLockedInteractions` narrows the authored interaction switches by the static half: a move closes when either date is locked, a resize only when both are, and the progress handle and the link tool close with their own field. An authored `false` stays `false`. - ObjectGantt fetches its own rows without `$select`, so the predicate operands are on the record. - **Timesheet** (`@object-ui/plugin-timesheet`). `cellEditable` takes a `lockedByHand` judge: a cell whose record's value field is locked by hand is read-only, so it is neither edited nor cleared. A row, date or value field locked on every record closes the create (`grants.create`), which also hides **Add row**. `writeCell` refuses a locked update or delete like a `readonly` one. The timesheet fetch has no `$select`, so the operands are on the record. - **Calendar quick-create** (`@object-ui/plugin-calendar`, `ObjectCalendar.tsx`). A create is judged by the static half (`fieldStaticallyReadOnlyByHand`), as the create dialog judges it. Where a field the dialog writes itself (the title field, the start or end field) is locked on every record, `quickCreateLockedOwnFields` sends the day click and the range drag to the host's full create form, and a locked date field is left out of that form's prefill. The static half also answers `readonly: true`, so a server-locked title or date field now hands off the same way, where `main` opened the dialog and the server dropped the value on insert. A required locked field is left out of the dialog's write (the auto-fill loop skips it), so the server applies its `defaultValue`; `requiredFieldsQuickCreateCannotFill` counts one with no `defaultValue` as unfillable, so the gesture is handed off rather than offering a write that would be refused. With no host form, nothing is offered, as before. - **Command palette** (`@object-ui/app-shell`, `paletteCreate.ts`). The create-as prefill skips a `uiReadonly` field, as it already skipped `readonly`. A create is judged by the static half only, as the create dialog judges it. - **List view** (`@object-ui/plugin-list`). `editedInPlace` takes the kanban lane field the board actually uses (`kanbanLaneFieldOf`: the block's `groupByField`, else the object's detected lifecycle field), so the lane field's lock operands are in `$select` even when the block names no `groupByField` (scope addition from comment 7187109328). - **Kanban swimlane drag.** No code change: a drop on the swimlane layout passes only column ids to `onCardMove`, so the write is the lane (column) field alone, and the existing lane-field gate in `ObjectKanban.handleCardMove` holds there too. Now pinned. - **N8 (`BEHAVIOUR_SEGMENTS`).** `uiReadonlyWhen` is not added. The key is authorable only on field definitions under `objects`, which `bucketFor` already reads as behaviour; `readonlyWhen` is in the set because inline-grid columns (a `columns` display segment) carry it, and those columns have no hand lock. A pin in `validate-field-consumers.test.ts` proves both keys already credit the fields they name; the lint source is unchanged. - **Prose.** The `uiReadonly` / `uiReadonlyWhen` JSDoc and `.describe`, their metadata-form help texts (all eleven locales), the MCP `describe_object` guidance and its code comment, and the `handLock.ts` header now say every console surface honours the hand lock, and each names the in-app assistant acting for a person as the one that does not yet. The `uiReadonly` surface lists add "calendar drag and quick-create" (`uiReadonlyWhen` does not: a create is not judged by the conditional half). The liveness evidence (`packages/spec/liveness/field.json`) cites the new readers: `ganttHandLock.ts#ganttPatchByHand`, `ObjectTimesheet.tsx#valueLockedByHand`, and the calendar's quick-create. N7: the `cel-field-ui-readonly-when` row of the expression-conformance ledger is reworded (the edit dialog and grid cell call `resolveFieldRuleState` directly; every other surface goes through `fieldReadOnlyByHand`) and lists the Gantt and timesheet readers. ### Small decisions taken in this pull request - Gantt: a move closes on either locked date, a resize only on both (the locked edge is refused on the write); a locked but unchanged field is pruned from the patch rather than refusing it; a refusal toasts the read-only reason; in-place edit stays open and is judged on the write. - Timesheet: any statically locked row, date or value field closes the create (and Add row); a locked record's cell is read-only, which also blocks clearing it. - Calendar quick-create: a locked field the dialog writes itself hands the gesture to the full form rather than closing it; a locked date field is not prefilled there; a required locked field with a default is left out of the write, one without counts as unfillable. - Palette: static half only. - List view: the detected lane field is always harvested. - N8: not added, reason above. - `Metadata-protocol: semantic` where the claim had `none`: the keys' descriptions change what an author's `uiReadonly` / `uiReadonlyWhen` does (five more surfaces lock), so the changeset is `minor` on the packages that move behaviour. ## Why Phase 1 (#37436) routed the dialogs, record page, grid, kanban column drag and calendar drag through `fieldReadOnlyByHand`, but a person could still change a hand-locked field from the Gantt, the timesheet cell and the palette's create-as prefill. The card asks the lock to hold on every console surface. ## Tests One pin per surface; each was ablated with `scripts/ablation-replace.mjs` and went red, then the file was restored (`git diff --quiet HEAD`). | Surface | Pin | Ablation | Red | |:--|:--|:--|:--| | Palette prefill | `CommandPalette.previewCreate-36286.test.tsx` | `fieldStaticallyReadOnlyByHand(field)` → `field.readonly === true` | 1 | | List view lane operand | `ListView.lockOperandSelect-36806.test.tsx` "the lane field the board detects when the block names none" | `kanbanLaneFieldOf(...)` → the block's `groupByField` | 1 | | Gantt write | `ObjectGantt.harness.test.tsx` "ObjectGantt.handLock-37448" | verdict forced to `write` | 2 | | Gantt link | same describe, link test | link gate forced open | 1 | | Gantt interactions | same describe, static test | lock defs passed as `undefined` | 1 | | Timesheet cell | `ObjectTimesheet.test.tsx` "the field hand lock" | `lockedByHand(...)` line disabled | 2 | | Timesheet create | same describe | `&& !createLockedByHand` removed | 2 | | Kanban swimlane | `ObjectKanban.handLock-36806.test.tsx` "a drag on the swimlane board" | lane `fieldReadOnlyByHand` forced false | 1 | | Calendar quick-create, own fields | `ObjectCalendar.quickCreateHandLock-37448.test.tsx` | `quickCreateLockedOwn.length === 0` made always true | 3 | | Calendar quick-create, prefill | same file | the prefill's locked-key filter made a pass-through | 2 | | Calendar quick-create, unfillable | same file | the locked branch of `requiredFieldsQuickCreateCannotFill` disabled | 1 | | Calendar quick-create, auto-fill | same file | the auto-fill loop's locked-field skip disabled | 1 | Each Gantt, timesheet, kanban and calendar describe also carries a CONTROL (an unlocked record or field still writes; on the calendar, a `uiReadonlyWhen` does not judge the create). ## Acceptance notes - The in-app assistant is the open surface named above; it needs the hand lock judged where the assistant's writes run. Card #37898 carries it. ## Verification Head `1916ae98` (main merged in twice; no conflict, the merges bring only `main`'s content). CI on the head: 61 success, 9 skipped, none failed. - Affected suites: UI (plugin-gantt, plugin-timesheet, the ListView operand pin, the kanban hand-lock pin, app-shell `chrome/`, core `evaluator/`) 1650 passed, 148 skipped; UI plugin-calendar and core `evaluator/` after the rework 1105 passed, 122 skipped; `@objectstack/spec` `src/data` 6893 passed; `@objectstack/mcp` 1589 passed; `@objectstack/platform-objects` 2214 passed; `@objectstack/lint` `validate-field-consumers.test.ts` 203 passed. After the last merge the new calendar pin re-ran: 7 passed. - `pnpm --filter @objectstack/spec run check:generated` passes on a fresh spec build (docs, liveness state counts and api-surface included); `check:liveness` passes; `node scripts/check-i18n-bundles.mjs` OK; `node scripts/check-nul-bytes.mjs` passes. - `node scripts/pm/dispatch-gates.mjs --commands` (122 commands) ran on the first head: every one passes except three that refused on a missing prerequisite (no verdict): `check:skill-examples`, `check:dts-closure` and `check:dual-build-cjs-loads`, which read `.d.ts` files this container built without (`OS_SKIP_DTS=1`). On the rework the families its paths touch were re-run, all exit 0: `check-changeset-no-major`, `check-empty-changeset` (and `--self-test`), `check-issue-citations`, `check:changeset-gate-self-tests`, `check:doc-authoring`, `check:i18n`, `check:i18n-stale-fill`, `check:issue-citations`. - Package type-checks were not measured locally (the workspace's dependent declarations are not emitted here); CI's `TypeScript Type Check` and `Type Check UI` are green on the head. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (only describe and JSDoc text moved there). - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A changeset with both declaration lines, here and in the changeset. - [x] 6. `packages/spec` generated artifacts regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgWGbDsK1qEW72jibhi)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgWGbDsK1qEW72jibhi <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgWGbDsK1qEW72jibhi --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ff63b02 commit c3da753

36 files changed

Lines changed: 804 additions & 69 deletions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/mcp': minor
4+
'@objectstack/platform-objects': minor
5+
'@object-ui/app-shell': minor
6+
'@object-ui/plugin-calendar': minor
7+
'@object-ui/plugin-gantt': minor
8+
'@object-ui/plugin-list': minor
9+
'@object-ui/plugin-timesheet': minor
10+
'@object-ui/core': patch
11+
---
12+
13+
feat(ui): the field hand lock (`uiReadonly` / `uiReadonlyWhen`) holds on the Gantt, the timesheet cell, the calendar quick-create and the palette prefill
14+
15+
Clause-②: no
16+
Metadata-protocol: semantic
17+
18+
A field a person may not edit by hand (`uiReadonly: true`, or `uiReadonlyWhen` true over the record) now stays locked on the console surfaces that still wrote it:
19+
20+
- **Gantt.** A bar's drag and edge resize, the progress handle, the title and dates edited in place, the auto-schedule and the conflict reschedule, undo and redo, and a drawn dependency link all read the one verdict of `@object-ui/core` (`fieldReadOnlyByHand`) over the stored record, with the shell's predicate scope. A write that would change a locked field is refused: nothing is sent, the bar goes back and a toast gives the read-only reason. A locked field the write only echoes back (an in-place title edit carries the dates and progress too) is dropped from the write, so the rest still saves. A field locked on every record also closes the gesture before it starts: a move closes when either date is locked, a resize only when both are (the locked edge is refused on the write), and the progress handle and the link tool close with their own field.
21+
- **Timesheet.** A cell whose record's value field is locked by hand is drawn read-only, so it cannot be edited or cleared. A row, date or value field locked on every record closes the create, so the empty cells and **Add row** are not offered.
22+
- **Calendar quick-create.** A click on an empty day or a range drag no longer writes a field locked by hand on every record. Where the title or a date field the dialog writes is locked, the gesture opens the full create form instead (a locked date field is not prefilled there). A required locked field is left out of the dialog's write so the server applies its `defaultValue`; one with no default sends the gesture to the full form too.
23+
- **Command palette.** The create-as prefill skips a field that is `uiReadonly`, as it already skipped a `readonly` one; a create is judged by the static half only, as the create dialog judges it.
24+
- **List view.** A kanban board whose block names no `groupByField` takes the object's lifecycle field as its lanes; the operands of that field's lock predicates are now read with the rows too, so a card drag is judged over the whole record.
25+
26+
A kanban drag on the swimlane layout writes only the lane (column) field, never the swimlane field; that is now pinned.
27+
28+
Not yet covered: the in-app assistant acting for a person. Its writes run in the AI service, which does not read the hand lock, and the field descriptions now say so. Every other console surface a person edits through honours the hand lock, and the `uiReadonly` / `uiReadonlyWhen` descriptions and the MCP `describe_object` guidance say that. Writes through the API, import, actions and flows are unchanged: only the server lock (`readonly` / `readonlyWhen`) binds them.

‎content/docs/references/data/field.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const result = CurrencyConfigSchema.parse(data);
111111
| **group** | `string` | optional | Older spelling of field-group membership, still read: the key of one of the object's fieldGroups (e.g. "contact_info"); the field joins that group in field declaration order. New metadata lists members on the group instead (fieldGroups[].fields), which also sets their order. A field a group lists may not name a different group here; a field naming a group whose fields list leaves it out follows the listed ones. |
112112
| **visibleWhen** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Predicate (CEL) — field is shown only when TRUE (else hidden). e.g. P`record.type == 'invoice'`. On a `required` field the server reads it on every write: where it is not TRUE (FALSE, or null such as an unset boolean) the field is not required for that write, and a predicate the server cannot evaluate counts as shown, so the field stays required. Reads the record's own columns, with `formula` fields computed over the record being written, as the form computes them over the record being edited; a read THROUGH a reference field, or a formula that reads through one, calls label(), calls can() on a write that picks no permission-gated option, or reads current_user on a system write with no user, cannot be evaluated there. |
113113
| **readonlyWhen** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Predicate (CEL) — field is read-only when TRUE. e.g. P`record.status == 'paid'`. Reads the bound record's OWN columns: the field level never reads a related record, so a read THROUGH a reference field (`record.account.tier`) faults on every row and refuses every update that writes the field — `objectstack validate` refuses it. Put such a check in a `validations[]` `script` rule, whose `condition` is read one hop through a reference. |
114-
| **uiReadonlyWhen** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Predicate (CEL) — the field is read-only BY HAND on an existing record while TRUE: the console surfaces that honour `uiReadonly` (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 line-item grid) do not let a person edit it, while REST, import, action and flow writes keep it, judged by the object's validations — see `uiReadonly`. A create is not judged: the create dialog offers the field whatever the predicate says. A predicate the console cannot evaluate locks the field, and the edit dialog refuses to submit until it is fixed. Same scope as `readonlyWhen`: the bound record's OWN columns, e.g. P`record.status != 'draft'`. Allowed beside `readonlyWhen`, which is the stricter lock: where `readonlyWhen` is TRUE non-system writes are dropped as well. The engine never reads this key. |
114+
| **uiReadonlyWhen** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Predicate (CEL) — the field is read-only BY HAND on an existing record while TRUE: every console surface that honours `uiReadonly` (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's drag, resize, progress handle, dependency link and in-place edit, the timesheet cell, the line-item grid) does not let a person edit it, while REST, import, action and flow writes keep it, judged by the object's validations — see `uiReadonly`. A create is not judged: the create dialog offers the field whatever the predicate says. A predicate the console cannot evaluate locks the field, and the edit dialog refuses to submit until it is fixed. Same scope as `readonlyWhen`: the bound record's OWN columns, e.g. P`record.status != 'draft'`. Allowed beside `readonlyWhen`, which is the stricter lock: where `readonlyWhen` is TRUE non-system writes are dropped as well. The engine never reads this key. |
115115
| **requiredWhen** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Predicate (CEL) — field is required when TRUE. A TRANSITION GATE, not an invariant: the write is refused only when the merged record violates the requirement AND the pre-write record complied — so the write that flips the predicate TRUE, an INSERT born inside the gate, and a write that clears the cell are all refused, while a row that was already missing the value keeps passing unrelated edits and state moves that stay inside the gate (ADR-0113 non-regression: adding the rule to a deployed object never bricks existing rows). Need an invariant every write must satisfy instead ('X may never exceed Y') — declare a `validations[]` `script` rule, which re-checks the merged record with no exemption. Enforced by `evaluateValidationRules`. Reads the bound record's OWN columns: the field level never reads a related record, so a read THROUGH a reference field (`record.account.tier`) faults on every row and refuses every write that reaches it — `objectstack validate` refuses it; put such a check in a `validations[]` `script` rule, whose `condition` is read one hop through a reference. The only slot; the `conditionalRequired` alias was removed in protocol 17. |
116116
| **dueLike** | `boolean` | optional | Deadline semantic (`date` / `datetime` only): TRUE declares this date a deadline, so a renderer may show relative overdue wording ("Overdue 3d") and an overdue colour once it has passed. Absent or FALSE: not a deadline — nothing is inferred from the field's name. Pair with `settledWhen` to say when the deadline is settled for a record. Refused on any other type. Display only: nothing on the write path reads it. |
117117
| **settledWhen** | `string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Predicate (CEL) — the deadline is SETTLED while TRUE: no overdue wording or colour applies to this record, e.g. P`record.status == 'done'`. Evaluated per record like `visibleWhen`, reading the record's own columns as `record`. Requires `dueLike: true` on a `date` / `datetime` field; refused otherwise. Display only: nothing on the write path reads it. |
@@ -121,7 +121,7 @@ const result = CurrencyConfigSchema.parse(data);
121121
| **showOnCreate** | `boolean` | optional | Ask for this field when a record is created. Absent or `true`: the field is on every create surface (the create dialog, the full-page create, an action-opened create). `false`: no create surface shows it; editing, the record page and lists still do, so a value is filled in after the record exists. Refused on a `required: true` field, with or without a `defaultValue`: a required field is always asked for on create. Keep the field on create, or drop `required`. A `requiredWhen` field is accepted, and its create is still refused when the predicate holds and the value is empty. |
122122
| **internal** | `boolean` | optional | Never return this field's value on the generic data path — the engine OMITS the key from `find`/`findOne` results, the 201 create body and the by-id update body, on the default projection AND when a client names the field in `?select=`. Storage, filtering and indexing are untouched, so a server-side verifier can still match on the column and a purpose-built mint route can still return the value once at creation. The read protection for ADR-0100's third credential channel (auth-subsystem one-way hashes on `text` columns). Omission, not masking: a mask signals 'a value is set', which carries no information on a `required` column. |
123123
| **readonly** | `boolean` | optional (default: `false`) | Read-only — never editable in forms, AND server-enforced on BOTH write paths: a non-system write to this field is silently dropped from the payload on UPDATE and on INSERT (a create can no longer directly seed e.g. `approval_status: "approved"`), symmetric with `readonlyWhen`. A stripped INSERT field still falls back to its `defaultValue`. Exempt from the strip on BOTH paths: `isSystem` writes (seed replay, migration). Exempt on the UPDATE path ONLY: an opt-in "historical" import (`preserveAudit`) — which admits a whitelist (the audit/timestamp family plus author-declared business `readonly` fields). On INSERT the exemption does NOT apply: a non-system create that requests `preserveAudit` still has its readonly fields stripped, and is warned loudly that the exemption is UPDATE-only — replaying archival readonly facts on create requires a system context. A normal (non-system) import is NOT system-context and still strips. |
124-
| **uiReadonly** | `boolean` | optional | Read-only BY HAND: the console's editing surfaces do not let a person edit the field — the create and edit dialogs (it is left off them and out of their payload), record-page inline edit and the stage path, the highlight-strip chip, grid inline edit and multi-row save, kanban column drag, calendar drag and the line-item grid; other console surfaces do not read it yet. Every other write KEEPS it — REST create/update, import, declarative and script actions and flows write it, judged by the object's validations exactly as an ordinary field (a `state_machine` rule included). For a field that changes only through actions, e.g. an order `status` moved by Confirm / Cancel buttons. A console create leaves the field out and the server applies its `defaultValue`, so a `required` field needs a `defaultValue`: without one every create from the console fails. An API, import or action insert may set it, judged by validations (a state machine's `initialStates`). Absent = false. Refused beside `readonly: true`, which already keeps every client out: `readonly` when no client may write the field, `uiReadonly` when only people at the console may not. Not a security boundary — field permissions are. The conditional twin is `uiReadonlyWhen`. |
124+
| **uiReadonly** | `boolean` | optional | Read-only BY HAND: the console's editing surfaces do not let a person edit the field — the create and edit dialogs (it is left off them and out of their payload), record-page inline edit and the stage path, the highlight-strip chip, grid inline edit and multi-row save, kanban column drag, calendar drag and quick-create, the Gantt's drag, resize, progress handle, dependency link and in-place edit, the timesheet cell, the command palette's create-as prefill and the line-item grid — every console surface; the in-app assistant acting for a person does not honour it yet. Every other write KEEPS it — REST create/update, import, declarative and script actions and flows write it, judged by the object's validations exactly as an ordinary field (a `state_machine` rule included). For a field that changes only through actions, e.g. an order `status` moved by Confirm / Cancel buttons. A console create leaves the field out and the server applies its `defaultValue`, so a `required` field needs a `defaultValue`: without one every create from the console fails. An API, import or action insert may set it, judged by validations (a state machine's `initialStates`). Absent = false. Refused beside `readonly: true`, which already keeps every client out: `readonly` when no client may write the field, `uiReadonly` when only people at the console may not. Not a security boundary — field permissions are. The conditional twin is `uiReadonlyWhen`. |
125125
| **requiredPermissions** | `string[]` | optional | [ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate). |
126126
| **maskingRule** | `Enum<'phone' \| 'id_card' \| 'bank_account' \| 'email' \| 'name'> \| { keepHead: integer; keepTail: integer }` | optional | Partial masking rule enforced by the runtime FieldMasker (single channel — API, UI, export and AI context all see the same masked value). A named preset ('phone' 138****5678, 'id_card' keep 6+4, 'bank_account' keep last 4, 'email' j***@example.com, 'name' keep first char) or `{ keepHead, keepTail }`. Masked for every non-system caller unless the field's `requiredPermissions` are ALL held (that evaluation is the unmask gate); a permission set marking the field non-readable still deletes it entirely. Deterministic, length-preserving output; masked callers cannot filter/sort/group/aggregate on the field. |
127127
| **ackPlaintextMasking** | `boolean` | optional | [ADR-0100] Affirm a generic `password` field's plaintext-at-rest / masked-on-read contract is intended, silencing the author-time warning. No effect on non-password fields. |

0 commit comments

Comments
 (0)