zenstack/packages
ymc9 9cd6c8ec0b refactor(policy): overhaul auth CTE system
- Fix currentModel()/currentOperation() in auth collection predicates by
  removing them from EVALUATOR_BUILTIN_FUNCTIONS (forces SQL path) and
  using context.thisType instead of context.modelOrType in transformCall
- Move auth CTE analysis from constructor-level (all policies) to
  per-operation (only the filter being injected), via on-the-fly AST
  scanning with new AuthCteUsageCollector/collectAuthCteUsageFromQuery
- Replace mutable requiresAuthCte/authCteFieldsNeeded class fields with
  ShallowColumnCollector that stops at SelectQueryNode boundaries
- Merge four identical injectAuthCtes conditions into one compound check
- Treat absent to-many auth relations as empty lists instead of null,
  making every/none predicates vacuously true for unprovided collections;
  removes the ABSENT_SENTINEL/AUTH_ABSENT_COL mechanism entirely

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 19:33:18 -07:00
..
auth-adapters/better-auth chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
cli chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
clients chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
common-helpers chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
config chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
create-zenstack chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
ide chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
language chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
orm refactor(policy): overhaul auth CTE system 2026-04-16 19:33:18 -07:00
plugins/policy refactor(policy): overhaul auth CTE system 2026-04-16 19:33:18 -07:00
schema chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
sdk chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
server chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
testtools chore: migrate from tsup to tsdown (#2580) 2026-04-15 12:13:34 -07:00
zod feat(zod): enforce literal true for select/include/omit options + exclude relation fields from makeModelSchema by default + add "optionality" setting to control runtime optionality of fields (#2525) 2026-04-15 12:24:07 -07:00