Skip to content

Commit 87e83df

Browse files
committed
docs(skills): a bare field ref in a predicate faults, it does not read null
Three skills said a bare field ref (`done` instead of `record.done`) evaluates to null and silently hides an action or never fires a rule. On main it faults: an error validation rule, requiredWhen and an option visibleWhen refuse the write naming the rule, readonlyWhen holds its field locked, a formula reads null with a warning, and in the console an action's visible hides it, disabled greys it out and a field visibleWhen shows the field, each with a console warning. RLS / sharing predicates read a bare name as the column, so the data skill no longer lists them. Growth is paid by deleting restated prose in the same files. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAjPD6BESVmRJphXXyw
1 parent bcf8a37 commit 87e83df

4 files changed

Lines changed: 26 additions & 16 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): three skills describe a bare field ref in a predicate as the fault it is today, not a silent `null`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
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.

‎skills/objectstack-data/SKILL.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,14 @@ os validate # Zod schema + CEL predicates (record.<field> existence) + bindi
447447
# or: os build # the same gates, plus emits dist/
448448
```
449449

450-
It catches what otherwise fails **silently at runtime**: a bare field ref in a
451-
`requiredWhen` / `readonlyWhen` / `visibleWhen`, a validation rule, a formula, or
452-
a row-level-security/sharing predicate (`done` instead of `record.done`) that
453-
evaluates to `null` and never fires. `os lint` is a *separate*
450+
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.
454+
`os lint` is a *separate*
454455
pass that additionally checks the data model against the conventions in this
455-
skill (relationships, master-detail, roll-ups) — run it too, but it does **not**
456-
replace `os validate`. In a scaffolded project the gate is `npm run validate`.
456+
skill (relationships, master-detail, roll-ups) — run it too.
457+
In a scaffolded project the gate is `npm run validate`.
457458

458459
---
459460

‎skills/objectstack-platform/references/operations.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424

2525
## Verify your work
2626

27-
ObjectStack metadata mistakes fail **silently at runtime**, not at edit time:
28-
a bare field ref in a predicate (`done` instead of `record.done`) evaluates to
29-
`null` and silently hides an action/validation on every record; a
30-
dangling dashboard widget binding renders an empty chart (ADR-0021). Both are
31-
caught at author time by one command:
27+
Metadata mistakes surface at runtime, not at edit time: a bare field ref in a
28+
predicate (`done` for `record.done`) faults, so an `error` validation rule
29+
refuses each write naming the rule and an action's `visible` hides it; a
30+
dangling dashboard widget binding renders an empty chart. Both are caught at
31+
author time by one command:
3232

3333
```bash
3434
os validate # Zod schema + CEL predicates + widget bindings — no artifact

‎skills/objectstack-ui/SKILL.md‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,17 @@ os validate # CEL predicates (record.<field>) + widget bindings + schema
264264
# or: os build # the same gates, plus emits dist/
265265
```
266266

267-
Two UI-specific traps it catches, both **silent at runtime** otherwise:
267+
Two UI-specific traps it catches, otherwise met only at runtime:
268268

269269
- **Action / field predicate** — a bare field ref in an action `visible` /
270270
`disabled` or a field `visibleWhen` (`done` instead of `record.done`)
271-
evaluates to `null` and hides the control on *every* record (the
272-
"button never shows" trap).
271+
faults on *every* record: the action hides (`visible`) or greys out
272+
(`disabled`), the field shows; the console logs the fault.
273273
- **Dashboard widget binding** — a widget `dataset` / `dimensions` / `values`
274274
that doesn't resolve to a declared dataset/field renders an empty chart
275275
(ADR-0021).
276276

277-
Don't report a view/action/dashboard done until `os validate` passes. In a
278-
scaffolded project the gate is `npm run validate`.
277+
In a scaffolded project the gate is `npm run validate`.
279278

280279
---
281280

0 commit comments

Comments
 (0)