Skip to content

Commit 1caf30c

Browse files
authored
docs(formula): say why the RLS check evaluator has no token axis (#4145)
The formula suite runs only literal filters while every other temporal-conformance consumer resolves tokens first. That is architectural, not a gap: an RLS `check` is a CEL expression where relative dates are the `today()` function evaluated at compile time, and `resolveFilterTokens` runs only on the ObjectQL read path — plugin-security never calls it. Comment records the reasoning and its invalidation condition.
1 parent d0d7464 commit 1caf30c

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

packages/formula/src/matches-filter-temporal-conformance.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,25 @@ describe('matchesFilterCondition — temporal conformance', () => {
2727
});
2828
}
2929
});
30+
31+
/**
32+
* Why the token axis is absent here.
33+
*
34+
* `TemporalCase` carries a `tokenFilter` — the same filter spelled with
35+
* `{today}` / `{current_month_end}` placeholders — which the driver and
36+
* analytics suites resolve through `resolveFilterTokens` before asserting. This
37+
* suite deliberately runs only `c.filter`, and that is an architectural fact
38+
* rather than a coverage hole:
39+
*
40+
* an RLS `check` is a **CEL expression** (`PermissionSet.check` is a string,
41+
* compiled by `rlsCompiler.compileFilter`), where a relative date is the
42+
* *function* `today()` evaluated during compilation. A `{token}` string never
43+
* reaches this evaluator — `resolveFilterTokens` runs on the ObjectQL **read**
44+
* path (`engine.ts` resolves `ast.where`), and the write-side check does not go
45+
* through it (`plugin-security` never calls the resolver).
46+
*
47+
* Asserting `tokenFilter` here would therefore test an input this backend
48+
* cannot be handed. If that ever changes — if a `check` gains a token-bearing
49+
* filter form — this comment is the thing to delete, and the axis is already
50+
* sitting in the shared table ready to be consumed.
51+
*/

0 commit comments

Comments
 (0)