docs(docs): real-stack verification notes; BLK-006 resolved, EVAL-007, LRN-037

This commit is contained in:
bchanot committed 2026-10-08 23:04:22 +02:00
1 parent 8b233e5cf0
commit fcdcfb53b2
6 files changed
+24 -5

No files matched your search

+7
View File
@@ -281,3 +281,10 @@ Apply: any Supabase project needing SQL tests in CI without Docker.
Hosted/local Supabase: `alter default privileges … grant all on tables/functions to anon, authenticated, service_role`. New table or RPC = anon can SELECT/EXECUTE until revoked (RLS still filters rows, but RPC runs). Pattern per migration: `revoke all on <table> from public, anon, authenticated;` then exact grants (column-level for partial UPDATE); `revoke all on function … from public, anon`. Also Postgres default EXECUTE to PUBLIC on functions in own schemas → `alter default privileges in schema private revoke execute on functions from public`. Shim replicates defaults so pgTAP `has_table_privilege('anon',…)` catches omissions.
Apply: every migration; pin with pgTAP privilege checks.
---
## LRN-037 | 2026-10-08 | SQL tests seed-agnostic; generated files through a deterministic formatter
Real stack applies `seed.sql` before `supabase test db`; PGlite harness applies migrations only → absolute `count(*)` and "last owner" assertions passed on PGlite, failed on real stack (6/81). Fix: filter every count by fixture ids; neutralise foreign rows inside the rolled-back tx before invariants like "last owner". `supabase gen types` (CLI 2.120) emits unformatted TS and suggests oxfmt → pipe through project prettier in both `db:types` and `db:types:check`, else CI diff flaps.
Apply: any dual-runner test setup (shim vs real); any CI diff on generated code.