Commit 09ae32e
feat(lint): judge docs-corpus
`os:check` type-checks a CEL string as `string`, so a `visibleWhen` calling a
function that exists nowhere (`user.hasRole('admin')`) type-checked perfectly —
and a field-level `visibleWhen` fault is fail-OPEN, so the copied example shows
the element to everyone.
Extends `check-doc-formula-expressions` with a third scan surface rather than
minting a second opinion about one contract. The verdict is imported whole:
`validateExpression` (syntax, unknown-function, bare reference) plus the
newly-extracted `fieldRuleRootIssue` (the closed-root rule) — the same two the
metadata walk applies to the same slot.
Admission is structural and schema-backed, never keyed on the key: a `Field.*()`
factory call, or a raw field def carrying `type:` inside an object-literal
`fields:` MAP (`ObjectSchema.fields` is `z.record`; `FormFieldSchema` and
`ScreenFieldConfigSchema` are `z.array`). A site whose layer is not determinable
is skipped, and the skip list is printed and counted on every run — including
green ones — because a gate that skips in silence is the false-green this
surface exists to prevent, one level up.
`fieldRuleRootIssue` / `FIELD_RULE_BOUND_ROOTS` were a closure inside
`validateStackExpressions`; hoisted and exported so both callers stand on the
rule rather than a dialect of it. Behaviour unchanged — 2271 lint tests pass.
Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx
Co-authored-by: Claude <noreply@anthropic.com>*When predicates as CEL, where the layer is determinable (#11652)1 parent 781cc0b commit 09ae32e
4 files changed
Lines changed: 967 additions & 295 deletions
File tree
- .changeset
- packages/lint
- scripts
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
0 commit comments