Skip to content

docs(formula): say why the RLS check evaluator has no token axis - #4145

Merged
os-zhuang merged 2 commits into
mainfrom
claude/dashboard-date-range-data-loss-b7qt5o
Jul 30, 2026
Merged

docs(formula): say why the RLS check evaluator has no token axis#4145
os-zhuang merged 2 commits into
mainfrom
claude/dashboard-date-range-data-loss-b7qt5o

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

#4109 之后的一条小补充——仅注释,无行为改动

问题

#4109 给温度一致性矩阵的每个 case 都加了 tokenFilter(同一 filter 的 token 拼写),driver 与 analytics 的套件都会先 resolveFilterTokens 再断言。formula 的套件只跑字面量 filter,且没有任何说明

这样读起来像疏漏。下一个看到的人只有两种反应,都是错的:把它当漏测去"补"(会写出一个这个后端根本收不到的输入的测试),或者默认它已被覆盖(而那种覆盖不可能存在)。

为什么它不可能有 token 轴(实查,非推断)

RLS checkCEL 表达式——PermissionSet.check 是字符串,经 rlsCompiler.compileFilter 编译,其中相对日期是函数 today(),在编译期求值。{token} 字符串到不了这个求值器:resolveFilterTokens 只在 ObjectQL 路径运行(engine.ts 解析 ast.where),写侧 check 不经过它——plugin-security 全文没有调用该解析器,这一点我 grep 确认过。

注释里同时写了失效条件:若将来 check 支持带 token 的 filter 形态,删掉这段注释即可,轴已在共享表里备好。

出处

本来是 #4125 的一部分。#4109 在评审期间落地了同一个 token 轴且更全(7 个消费者、16 个 case、tokenFilter+dateRange 两种拼写、writerForm 混合写入形态、pre-epoch 行、legacy-storage sweep),所以 #4125关闭为 superseded,不做重复实现。这段说明是那轮里 #4109 没有覆盖到的唯一增量,单独带过来。

测试

formula 该套件 13/13 不变(纯注释);eslint 干净。

🤖 Generated with Claude Code

https://claude.ai/code/session_01EkL3RGJrzjLEGURsLxfS2f


Generated by Claude Code

The temporal conformance matrix (#4109) gives every case a `tokenFilter`
spelling, and the driver + analytics suites resolve it before asserting.
This suite runs only the literal `filter`, with nothing saying why — so
the absence reads as an omission, and the next person either "fixes" a
non-gap or assumes coverage that cannot exist.

It is architecture: an RLS `check` is a CEL expression (`check` is a
string, compiled by rlsCompiler.compileFilter) where a relative date is
the function today() evaluated at compile time. A {token} string never
reaches this evaluator — resolveFilterTokens runs on the ObjectQL read
path and the write-side check does not go through it; verified that
plugin-security never calls the resolver.

Comment only; the suite is unchanged and still 13/13.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EkL3RGJrzjLEGURsLxfS2f
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 30, 2026 11:45am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

No hand-written docs reference the 0 changed package(s). ✅

@os-zhuang os-zhuang added documentation Improvements or additions to documentation skip-changeset PR has no user-facing published change; bypasses the changeset gate and removed size/s tests labels Jul 30, 2026 — with Claude
The changeset gate is `if: !contains(labels, 'skip-changeset')`, so the
label only takes effect on a fresh run. This PR is comment-only in a
published package: a changeset would ship a patch CHANGELOG entry that
describes no user-facing change, which is what the label exists for.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EkL3RGJrzjLEGURsLxfS2f
@os-zhuang
os-zhuang marked this pull request as ready for review July 30, 2026 12:08
@os-zhuang
os-zhuang merged commit 1caf30c into main Jul 30, 2026
17 checks passed
@os-zhuang
os-zhuang deleted the claude/dashboard-date-range-data-loss-b7qt5o branch July 30, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants