Skip to content

fix(db): supabase-target checks vs platform-managed state - #109

Merged
iamjr15 merged 1 commit into
mainfrom
fix/target-platform-parity
Jul 31, 2026
Merged

fix(db): supabase-target checks vs platform-managed state#109
iamjr15 merged 1 commit into
mainfrom
fix/target-platform-parity

Conversation

@iamjr15

@iamjr15 iamjr15 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Two checker corrections found by the first post-Wave-B --apply against production (the assertion had not run since the contract was tightened). Both live-probe-verified on production AND a fresh 2026 project:

  1. 63-byte truncation: the runtime-ACL union's first branch selected relname (type name), so the union resolved object_name to name and truncated every function signature past 63 bytes — the six long-signature webhooks_* functions could never match the expected set. One-line ::text cast.
  2. supautils auto-membership: every role postgres creates is granted back to postgres (grantor supabase_admin) on every Supabase project — verified by creating a probe role on a fresh project. The zero-membership check now exempts exactly app_* → postgres and flags all else.

Verification notes

  • pnpm lint / pnpm typecheck
  • Live pnpm db:migrate -- --dry-run against production with the fixed checker: "Production schema contract verified." with 0000 baselined and 0001/0002/0003 applied.

(DB-state note recorded in the PR trail: the one-time 0000 ledger-hash update documented in #108 was executed before the apply; two stale max-tier entitlement rows were normalized to premium to satisfy 0001's CHECK constraint.)

Two checker corrections surfaced by the first post-contract apply against
production, both verified with live probes on production and on a fresh
project:

- the runtime ACL union resolved object_name to type name (63-byte limit)
  because the first branch selected relname bare, silently truncating any
  function signature longer than 63 characters so it could never match the
  expected set; the six long-signature webhooks functions were falsely
  flagged. Casting the first branch to text fixes resolution for the whole
  union.
- supautils grants every role that postgres creates back to postgres
  (grantor supabase_admin) on every Supabase project, including fresh ones
  (probe-verified). The zero-membership check now exempts exactly that
  platform-managed membership and still flags everything else.
@iamjr15
iamjr15 merged commit 2daed6d into main Jul 31, 2026
4 checks passed
@iamjr15
iamjr15 deleted the fix/target-platform-parity branch July 31, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant