Skip to content

Commit a7da761

Browse files
committed
docs(skills): name what an option visibleWhen refuses and what a readonlyWhen does on the form
An option visibleWhen that faults refuses only a write that picks that option, and forms keep offering it. A readonlyWhen that faults on a bare ref keeps the field editable on the form, the save succeeds, and the server drops the change with a warning. Paid by dropping the form-side visibleWhen clause (the ui skill states it) and a self-restating "from any non-system write" in the readonly bullet. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAjPD6BESVmRJphXXyw
1 parent 99852c0 commit a7da761

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎.changeset/30893-bare-field-ref-symptom.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ docs(skills): three skills describe a bare field ref in a predicate as the fault
77
Clause-②: no
88
Metadata-protocol: none
99

10-
`objectstack-platform/references/operations.md`, `objectstack-data` and `objectstack-ui` said a bare field ref (`done` instead of `record.done`) "evaluates to `null`" and silently hides or never fires. It faults. On the server an `error` validation rule, a `requiredWhen` and an option `visibleWhen` refuse the write and name the rule, a `readonlyWhen` holds its field locked, and a formula reads `null` with a logged warning. In the console an action's `visible` hides it, its `disabled` greys it out, and a field `visibleWhen` shows the field, each with a console warning. The data skill no longer lists RLS / sharing predicates here: their compiler reads a bare name as the column. The prevention advice (`os validate` / `os build`, `record.<field>`) is unchanged. Growth is paid by same-file deletions of restated prose.
10+
`objectstack-platform/references/operations.md`, `objectstack-data` and `objectstack-ui` said a bare field ref (`done` instead of `record.done`) "evaluates to `null`" and silently hides or never fires. It faults. On the server an `error` validation rule and a `requiredWhen` refuse the write and name the rule, an option `visibleWhen` refuses only a write that picks that option (forms still offer it), a `readonlyWhen` field stays editable on the form while the server drops the change with a warning and the save succeeds, and a formula reads `null` with a logged warning. In the console an action's `visible` hides it, its `disabled` greys it out, and a field `visibleWhen` shows the field, each with a console warning. The data skill no longer lists RLS / sharing predicates here: their compiler reads a bare name as the column. The prevention advice (`os validate` / `os build`, `record.<field>`) is unchanged. Growth is paid by same-file deletions of restated prose.

‎skills/objectstack-data/SKILL.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export const Invoice = ObjectSchema.create({
202202
set → field permission `when`, rules/security.md).
203203
- **`readonly: true` governs the end-user surface, not trusted system writers.**
204204
A non-system write (REST/UI, and any `runAs:'user'` flow — the default) has
205-
the field **stripped** from any non-system write; the write reports
205+
the field **stripped**; the write reports
206206
success but the value never lands. System-context writes —
207207
`runAs:'system'` flows, system hooks, seeds, imports, migrations — are exempt
208208
and DO write it. So the pattern "users can't edit this, but automation
@@ -448,9 +448,10 @@ os validate # Zod schema + CEL predicates (record.<field> existence) + bindi
448448
```
449449

450450
It catches what otherwise surfaces only at runtime, where a bare field ref
451-
(`done` for `record.done`) faults: an `error` validation rule, `requiredWhen`
452-
or option `visibleWhen` refuses the write naming it, a `readonlyWhen` locks
453-
its field, a formula reads `null` (logged), a form shows a `visibleWhen` field.
451+
(`done` for `record.done`) faults: an `error` validation rule or `requiredWhen`
452+
refuses the write naming it, an option `visibleWhen` only a write picking the
453+
option (forms still offer it); a `readonlyWhen` field stays editable and the
454+
save succeeds without its change (logged); a formula reads `null` (logged).
454455
`os lint` is a *separate*
455456
pass that additionally checks the data model against the conventions in this
456457
skill (relationships, master-detail, roll-ups) — run it too.

0 commit comments

Comments
 (0)