Commit 486d526
* fix(spec): the RLS check clause's enumerated-values @example is CEL, and compiles (#6641)
`RowLevelSecurityPolicySchema.check` documented set membership as
`status IN ('draft', 'pending')`, which does not compile. The deprecated
SQL bridge (ADR-0058 D1) rewrites the word `IN` to `in` and never the
parentheses, and CEL's list literal is bracketed, so the bridged
`status in ('draft', 'pending')` is a parse error. `compileExpression`
then returns null, `compileFilter` sees `filters.length === 0`, and a
single-policy object falls to `RLS_DENY_FILTER` — an author copying the
schema's own example gets a policy that denies every row, plus a lint
error from `validateRlsPredicateEnforceability`.
Route 1 (document side): the example now reads the canonical CEL
`status in ['draft', 'pending']`. The deprecated bridge is deliberately
NOT widened. The `using` examples and the neighbouring single-element
`IN (current_user.<array>)` form were measured compilable and are
unchanged.
`@objectstack/formula`'s `rls-predicate.test.ts` gains the guard this
defect class never had: every `@example` on `using` / `check` is read out
of the spec source and pushed through the ADR-0056 D4 shape gate, plus a
substance pin that the enumerated-values idiom compiles to a set
membership and, under CHECK semantics, admits exactly the values it names.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ffcE95NaMJcL9XJ9VDYgk
* fix(formula): resolve this test file's directory once, keeping TEST_DEBT at 17
The new #6641 pin introduced a SECOND `import.meta.url` in
`rls-predicate.test.ts`. This package's `tsconfig.json` excludes
`*.test.ts`, so `pnpm typecheck` never reads the file — but
`check-type-check-coverage --re-measure` reads it with the exclusion
lifted and holds the count to a shrink-only TEST_DEBT ledger (#5278).
Under the package's CommonJS-targeted config each `import.meta` costs two
raw errors (TS1470 + TS2339), so the second occurrence took the entry
from its recorded 17 to 19 and tripped the ratchet.
Hoisted to one module-level `HERE` constant, read by both the existing
import-graph assertion and the new `@example` pin. Measured with the
gate's own method (formula's tsconfig, test exclusion lifted, its `spec`
closure built): 19 before, 17 after — exactly the ledger's number, so no
ledger edit is needed and no debt is being laundered.
No pin was weakened: the `@example` extraction, the shape-gate round
trip, the anti-vacuity guard and the post-image semantics all stand, and
restoring the old example still turns both new tests red.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ffcE95NaMJcL9XJ9VDYgk
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent c308064 commit 486d526
3 files changed
Lines changed: 154 additions & 5 deletions
File tree
- .changeset
- packages
- formula/src
- spec/src/security
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
22 | 38 | | |
23 | 39 | | |
24 | 40 | | |
| |||
130 | 146 | | |
131 | 147 | | |
132 | 148 | | |
133 | | - | |
134 | | - | |
| 149 | + | |
135 | 150 | | |
136 | 151 | | |
137 | 152 | | |
138 | | - | |
| 153 | + | |
139 | 154 | | |
140 | 155 | | |
141 | 156 | | |
142 | 157 | | |
143 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
0 commit comments