Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

TML-2503: the complete, faithful Supabase contract — introspected from a reference instance - #960

Merged
wmadden-electric merged 12 commits into
mainfrom
tml-2503-supabase-complete-contract
Jul 15, 2026
Merged

wmadden-electric merged 12 commits into
mainfrom
tml-2503-supabase-complete-contract

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

The @prisma-next/extension-supabase contract is now the complete, faithful description of everything Supabase owns in the database — all 23 auth and 10 storage tables of the reference platform version, 10 native enum types, and the three roles — generated by introspection, not hand-authored:

pnpm contract:generate
  → restore test/fixtures/supabase-reference/ (complete pg_dump of supabase/postgres:17.6.1.106, ALL schemas) into fresh PGlite
  → introspect auth + storage per schema
  → infer PSL, assemble `namespace auth { … } namespace storage { … }` + `namespace unbound { role … }` (the PSL role surface from #957, written from SupabaseRole.values)
  → emit contract.json / contract.d.ts

Reruns are byte-identical; the round-trip is pinned in CI. Builds on Slice C (#957, merged) — the roles this contract carries. Decision C8/C16 background in projects/supabase-integration/decisions.md.

Why a checked-in complete dump

A user's Supabase database contains far more than the pack declares (realtime, vault, pgsodium, extensions, graphql*, …). Both halves of that split now have teeth:

  • Declared-but-external (auth/storage): db verify against the restored fixture is clean, and dropping one declared table makes it fail naming that table (reference-fixture-verify.integration.test.ts).
  • Present-but-undeclared (everything else): tolerated by verify as extras, and proven never to leak into a user's inferred contract — the brownfield test restores the full fixture, adds user tables in public, runs contract infer with the pack in the stack, and asserts the output contains only the user's models (with the FK into auth.users rewritten to supabase:auth.AuthUser) and no element of any owned or undeclared schema.

The fixture header records the version pins and every PGlite-restore trim. bootstrapSupabaseShim now restores this fixture instead of a hand-authored 5-table subset, so every composed-verify test runs against the real shape.

Fidelity has an explicit, auditable boundary

Everything the pipeline cannot faithfully express is omitted, never approximated — under external, verify fails on declared-but-missing and tolerates undeclared extras, so under-declaring is safe and wrong-declaring is not. The full inventory (2 nullable text[] columns — PSL has no nullable-list syntax; 8 defaults; 2 USING hash indexes; 8 partial uniques) lives in src/contract/CONTRACT-FIDELITY.md with machine-readable omission configs in the generation script.

Framework fixes the real schema smoked out

First time a large externally-owned schema round-tripped through db verify; it found real bugs, each fixed with unit tests:

  • The postgres target gains a pg/inet@1 codec (transparent string carrier like pg/uuid@1), so auth.sessions.ip and auth.mfa_challenges.ip_address are declared instead of omitted, and contract infer maps introspected inet columns to String @db.Inet instead of Unsupported("inet").
  • PSL @relation gains an optional index argument lowering onto the FK IR's existing index flag, and contract infer emits index: false for FKs introspected without a live backing index — 16 real Supabase FK columns have none, and the derived index expectation previously made any such inferred contract fail verify against its own source database. Verify and inference now share one backing predicate (foreign-key-index-backing.ts) so they cannot disagree.
  • Array columns round-trip: contractToSchemaIR kept "text[]" in nativeType instead of bare element type + many: true, so every list column verified not-equal.
  • Introspection fidelity: expression-keyed indexes (e.g. on lower(email)) no longer collapse into colliding column lists; a legitimate unique + non-unique pair over identical columns no longer collides in the differ; a non-default index access method carries through as @@index(..., type: …).
  • Canonicalizer preserves value: false in resolved defaults (previously stripped as an "empty" value, so @default(false) never survived emit).
  • The pg_dump preamble's SET row_security = off is neutralized with RESET ALL after fixture restore — it leaked into the shared test session and broke non-owner queries on RLS-enabled tables.

Surface

db.asServiceRole().supabase.{sql,orm} now exposes the full owned set — integration + type tests read auth.refresh_tokens through both. The five legacy model handles (AuthUser, AuthIdentity, AuthSession, StorageBucket, StorageObject) keep their names (examples and cross-space FKs depend on them); other models take the standard infer naming. Extension-author upgrade entries cover the contract expansion and each framework change.

Alternatives considered

  • Hand-authoring the ~33 tables — toil, and drifts from the platform (decision C8 chose introspection).
  • Extending the PSL writer to emit namespace blocks — the inferrer's single-namespace limitation is worked around by per-schema inference + AST assembly in the generation script; the writer extension remains available to whoever needs it generically (TML-2958).
  • Declaring realtime/vault/… too — platform-internal machinery with no user-facing data surface; recorded in projects/supabase-integration/deferred.md.
  • Verifying against a live cloud project in CI — the checked-in fixture is the CI form (hermetic, version-pinned); a live project remains the manual acceptance lane.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added PostgreSQL inet support, mapping to String @db.Inet``.
    • Added index?: boolean on relation fields so foreign keys can opt out of emitting a backing index via index: false (including inference when no matching backing index exists).
    • Regenerated the Supabase extension contract with expanded auth/storage coverage and service-role surfaces.
  • Bug Fixes
    • Improved Postgres index introspection by excluding expression indexes and deduplicating by column tuples.
    • Improved array (many) handling and ensured relation outputs include index: false when applicable.
    • Invalid index options are now rejected for backrelation list fields with clearer diagnostics.
  • Documentation
    • Updated Supabase generation/fidelity docs, added contract completeness guidance, and refreshed upgrade/architecture notes.

@wmadden-electric
wmadden-electric requested a review from a team as a code owner July 12, 2026 20:33
@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@wmadden-electric, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 6 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 783ebb0a-db9e-43a7-95cb-e026f80277fe

📥 Commits

Reviewing files that changed from the base of the PR and between 6ae74de and cc4b5af.

⛔ Files ignored due to path filters (5)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • projects/extension-supabase/plan.md is excluded by !projects/**
  • projects/psl-ambient-declarations/spec.md is excluded by !projects/**
  • projects/supabase-integration/decisions.md is excluded by !projects/**
  • projects/supabase-integration/deferred.md is excluded by !projects/**
📒 Files selected for processing (55)
  • docs/architecture docs/adrs/ADR 161 - Explicit foreign key constraint and index configuration.md
  • docs/architecture docs/subsystems/1. Data Contract.md
  • examples/supabase/vitest.config.ts
  • packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.ts
  • packages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.ts
  • packages/2-sql/2-authoring/contract-psl/src/interpreter.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.ts
  • packages/2-sql/9-family/src/core/foreign-key-index-backing.ts
  • packages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/printer-config.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/relation-inference.ts
  • packages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.ts
  • packages/3-extensions/supabase/README.md
  • packages/3-extensions/supabase/package.json
  • packages/3-extensions/supabase/scripts/generate-contract.ts
  • packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md
  • packages/3-extensions/supabase/src/contract/contract.d.ts
  • packages/3-extensions/supabase/src/contract/contract.json
  • packages/3-extensions/supabase/src/contract/contract.prisma
  • packages/3-extensions/supabase/src/contract/roles.ts
  • packages/3-extensions/supabase/test/brownfield-infer.integration.test.ts
  • packages/3-extensions/supabase/test/contract-completeness.test.ts
  • packages/3-extensions/supabase/test/contract-handles.test.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/restore.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sql
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sql
  • packages/3-extensions/supabase/test/reference-fixture-verify.integration.test.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts
  • packages/3-extensions/supabase/test/supabase-bootstrap.ts
  • packages/3-extensions/supabase/tsconfig.json
  • packages/3-targets/3-targets/postgres/src/core/codec-ids.ts
  • packages/3-targets/3-targets/postgres/src/core/codec-type-map.ts
  • packages/3-targets/3-targets/postgres/src/core/codecs.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/infer-psl-contract.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.ts
  • packages/3-targets/3-targets/postgres/src/exports/codecs.ts
  • packages/3-targets/3-targets/postgres/test/codecs-class.test.ts
  • packages/3-targets/3-targets/postgres/test/codecs.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.ts
  • packages/3-targets/6-adapters/postgres/src/core/control-adapter.ts
  • packages/3-targets/6-adapters/postgres/src/core/descriptor-meta.ts
  • packages/3-targets/6-adapters/postgres/test/control-adapter.test.ts
  • packages/3-targets/6-adapters/postgres/test/descriptor-meta.test.ts
  • skills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md
  • skills/upgrade/prisma-next-upgrade/upgrades/0.14-to-0.15/instructions.md
  • test/integration/vitest.config.ts
  • test/integration/vitest.journeys.config.ts
  • test/utils/src/exports/index.ts
📝 Walkthrough

Walkthrough

This change adds PostgreSQL inet support, relation-index and array metadata, deterministic index introspection, and an introspection-generated Supabase contract with reference fixtures, validation tests, and upgrade documentation.

Changes

PostgreSQL contract fidelity

Layer / File(s) Summary
Relation indexes and schema representation
packages/2-sql/..., packages/3-targets/...
Relation index options, backing-index detection, array metadata, index access methods, and index deduplication are updated across authoring, inference, IR, and introspection.
PostgreSQL inet codec
packages/2-sql/2-authoring/..., packages/3-targets/3-targets/postgres/...
inet is registered as pg/inet@1, mapped to String @db.Inet``, and exposed through PostgreSQL codec registries and metadata.

Supabase contract generation

Layer / File(s) Summary
Contract generation and artifacts
packages/3-extensions/supabase/scripts/*, packages/3-extensions/supabase/src/contract/*
A generator introspects Supabase auth/storage schemas, applies normalization rules, emits PSL, and regenerates expanded contract artifacts.
Reference fixtures and validation
packages/3-extensions/supabase/test/*, skills/extension-author/...
Reference SQL restoration, contract completeness, brownfield inference, verification, service-role access, handle checks, and upgrade guidance are added or updated.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Generator
  participant SupabaseFixture
  participant Postgres
  participant ContractEmitter
  Generator->>SupabaseFixture: restore reference roles and schema
  Generator->>Postgres: introspect auth and storage
  Postgres-->>Generator: tables, indexes, types, and RLS metadata
  Generator->>ContractEmitter: emit normalized PSL and contract artifacts
  ContractEmitter-->>Generator: contract.prisma, contract.json, and contract.d.ts
Loading

Possibly related PRs

Suggested reviewers: wmadden

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 48.72% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: a complete, faithful Supabase contract generated from a reference instance.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tml-2503-supabase-complete-contract

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jul 12, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@prisma-next/extension-author-tools

npm i https://pkg.pr.new/@prisma-next/extension-author-tools@960

@prisma-next/mongo-runtime

npm i https://pkg.pr.new/@prisma-next/mongo-runtime@960

@prisma-next/family-mongo

npm i https://pkg.pr.new/@prisma-next/family-mongo@960

@prisma-next/sql-runtime

npm i https://pkg.pr.new/@prisma-next/sql-runtime@960

@prisma-next/family-sql

npm i https://pkg.pr.new/@prisma-next/family-sql@960

@prisma-next/extension-arktype-json

npm i https://pkg.pr.new/@prisma-next/extension-arktype-json@960

@prisma-next/middleware-cache

npm i https://pkg.pr.new/@prisma-next/middleware-cache@960

@prisma-next/mongo

npm i https://pkg.pr.new/@prisma-next/mongo@960

@prisma-next/extension-paradedb

npm i https://pkg.pr.new/@prisma-next/extension-paradedb@960

@prisma-next/extension-pgvector

npm i https://pkg.pr.new/@prisma-next/extension-pgvector@960

@prisma-next/extension-postgis

npm i https://pkg.pr.new/@prisma-next/extension-postgis@960

@prisma-next/postgres

npm i https://pkg.pr.new/@prisma-next/postgres@960

@prisma-next/sql-orm-client

npm i https://pkg.pr.new/@prisma-next/sql-orm-client@960

@prisma-next/sqlite

npm i https://pkg.pr.new/@prisma-next/sqlite@960

@prisma-next/extension-supabase

npm i https://pkg.pr.new/@prisma-next/extension-supabase@960

@prisma-next/target-mongo

npm i https://pkg.pr.new/@prisma-next/target-mongo@960

@prisma-next/adapter-mongo

npm i https://pkg.pr.new/@prisma-next/adapter-mongo@960

@prisma-next/driver-mongo

npm i https://pkg.pr.new/@prisma-next/driver-mongo@960

@prisma-next/contract

npm i https://pkg.pr.new/@prisma-next/contract@960

@prisma-next/utils

npm i https://pkg.pr.new/@prisma-next/utils@960

@prisma-next/config

npm i https://pkg.pr.new/@prisma-next/config@960

@prisma-next/errors

npm i https://pkg.pr.new/@prisma-next/errors@960

@prisma-next/framework-components

npm i https://pkg.pr.new/@prisma-next/framework-components@960

@prisma-next/operations

npm i https://pkg.pr.new/@prisma-next/operations@960

@prisma-next/ts-render

npm i https://pkg.pr.new/@prisma-next/ts-render@960

@prisma-next/contract-authoring

npm i https://pkg.pr.new/@prisma-next/contract-authoring@960

@prisma-next/ids

npm i https://pkg.pr.new/@prisma-next/ids@960

@prisma-next/psl-parser

npm i https://pkg.pr.new/@prisma-next/psl-parser@960

@prisma-next/psl-printer

npm i https://pkg.pr.new/@prisma-next/psl-printer@960

@prisma-next/cli

npm i https://pkg.pr.new/@prisma-next/cli@960

@prisma-next/cli-telemetry

npm i https://pkg.pr.new/@prisma-next/cli-telemetry@960

@prisma-next/config-loader

npm i https://pkg.pr.new/@prisma-next/config-loader@960

@prisma-next/emitter

npm i https://pkg.pr.new/@prisma-next/emitter@960

@prisma-next/language-server

npm i https://pkg.pr.new/@prisma-next/language-server@960

@prisma-next/migration-tools

npm i https://pkg.pr.new/@prisma-next/migration-tools@960

prisma-next

npm i https://pkg.pr.new/prisma-next@960

@prisma-next/vite-plugin-contract-emit

npm i https://pkg.pr.new/@prisma-next/vite-plugin-contract-emit@960

@prisma-next/mongo-codec

npm i https://pkg.pr.new/@prisma-next/mongo-codec@960

@prisma-next/mongo-contract

npm i https://pkg.pr.new/@prisma-next/mongo-contract@960

@prisma-next/mongo-value

npm i https://pkg.pr.new/@prisma-next/mongo-value@960

@prisma-next/mongo-contract-psl

npm i https://pkg.pr.new/@prisma-next/mongo-contract-psl@960

@prisma-next/mongo-contract-ts

npm i https://pkg.pr.new/@prisma-next/mongo-contract-ts@960

@prisma-next/mongo-emitter

npm i https://pkg.pr.new/@prisma-next/mongo-emitter@960

@prisma-next/mongo-schema-ir

npm i https://pkg.pr.new/@prisma-next/mongo-schema-ir@960

@prisma-next/mongo-query-ast

npm i https://pkg.pr.new/@prisma-next/mongo-query-ast@960

@prisma-next/mongo-orm

npm i https://pkg.pr.new/@prisma-next/mongo-orm@960

@prisma-next/mongo-query-builder

npm i https://pkg.pr.new/@prisma-next/mongo-query-builder@960

@prisma-next/mongo-lowering

npm i https://pkg.pr.new/@prisma-next/mongo-lowering@960

@prisma-next/mongo-wire

npm i https://pkg.pr.new/@prisma-next/mongo-wire@960

@prisma-next/sql-contract

npm i https://pkg.pr.new/@prisma-next/sql-contract@960

@prisma-next/sql-errors

npm i https://pkg.pr.new/@prisma-next/sql-errors@960

@prisma-next/sql-operations

npm i https://pkg.pr.new/@prisma-next/sql-operations@960

@prisma-next/sql-schema-ir

npm i https://pkg.pr.new/@prisma-next/sql-schema-ir@960

@prisma-next/sql-contract-psl

npm i https://pkg.pr.new/@prisma-next/sql-contract-psl@960

@prisma-next/sql-contract-ts

npm i https://pkg.pr.new/@prisma-next/sql-contract-ts@960

@prisma-next/sql-contract-emitter

npm i https://pkg.pr.new/@prisma-next/sql-contract-emitter@960

@prisma-next/sql-lane-query-builder

npm i https://pkg.pr.new/@prisma-next/sql-lane-query-builder@960

@prisma-next/sql-relational-core

npm i https://pkg.pr.new/@prisma-next/sql-relational-core@960

@prisma-next/sql-builder

npm i https://pkg.pr.new/@prisma-next/sql-builder@960

@prisma-next/target-postgres

npm i https://pkg.pr.new/@prisma-next/target-postgres@960

@prisma-next/target-sqlite

npm i https://pkg.pr.new/@prisma-next/target-sqlite@960

@prisma-next/adapter-postgres

npm i https://pkg.pr.new/@prisma-next/adapter-postgres@960

@prisma-next/adapter-sqlite

npm i https://pkg.pr.new/@prisma-next/adapter-sqlite@960

@prisma-next/driver-postgres

npm i https://pkg.pr.new/@prisma-next/driver-postgres@960

@prisma-next/driver-sqlite

npm i https://pkg.pr.new/@prisma-next/driver-sqlite@960

commit: cc4b5af

@github-actions

github-actions Bot commented Jul 12, 2026 •

Copy link
Copy Markdown

size-limit report 📦

Path Size
postgres / no-emit 157.93 KB (+0.12% 🔺)
postgres / emit 131.71 KB (+0.12% 🔺)
mongo / no-emit 98.71 KB (0%)
mongo / emit 89.43 KB (0%)
cf-worker / no-emit 184.61 KB (+0.08% 🔺)
cf-worker / emit 155.81 KB (+0.12% 🔺)

@wmadden-electric
wmadden-electric force-pushed the tml-2501-supabase-roles-contract branch from 4827891 to 7d37273 Compare July 13, 2026 07:42
@wmadden-electric
wmadden-electric force-pushed the tml-2503-supabase-complete-contract branch from dfd282d to 9407d12 Compare July 13, 2026 07:42
@wmadden-electric
wmadden-electric force-pushed the tml-2501-supabase-roles-contract branch from 7d37273 to 55257eb Compare July 13, 2026 08:10
@wmadden-electric
wmadden-electric force-pushed the tml-2503-supabase-complete-contract branch from 9407d12 to 06a2b13 Compare July 13, 2026 08:10
@wmadden-electric
wmadden-electric force-pushed the tml-2501-supabase-roles-contract branch from 55257eb to 94870cc Compare July 13, 2026 08:55
@wmadden-electric
wmadden-electric force-pushed the tml-2503-supabase-complete-contract branch from ed8da49 to 506d8d5 Compare July 13, 2026 08:55
@wmadden-electric
wmadden-electric force-pushed the tml-2501-supabase-roles-contract branch 3 times, most recently from 92cd08d to 5a2a6ce Compare July 13, 2026 11:14
Base automatically changed from tml-2501-supabase-roles-contract to main July 13, 2026 13:49
@wmadden-electric
wmadden-electric force-pushed the tml-2503-supabase-complete-contract branch from 506d8d5 to bcf34ca Compare July 13, 2026 14:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts (1)

29-36: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Use a direct contract type in this type-level test.

Derive AppContract structurally or from shared emitted types instead of invoking defineContract; runtime builders can widen types and allow type assertions to pass for the wrong reason.

Based on learnings, *.test-d.ts files should avoid runtime builders such as defineContract during type-level evaluation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts`
around lines 29 - 36, Replace the runtime defineContract call used to create
appContract with a direct structural AppContract type or the appropriate shared
emitted contract type. Keep the existing SupabaseDb<AppContract> assertion
intact, and ensure the type-level test no longer depends on defineContract’s
inferred or widened runtime-builder types.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/3-extensions/supabase/README.md`:
- Line 7: Revise the README description near the Supabase extension pack
overview to replace the “complete, faithful contract of everything Supabase
owns” claim with a complete object inventory for the pinned fixture. Explicitly
acknowledge the documented omissions of columns, defaults, and indexes while
preserving the statements about auth/storage tables, enum types, platform roles,
external ownership, migration behavior, and verification.
- Line 9: Update the project-reference links in the Supabase package README,
including the link near the role-binding runtime description and the
additionally flagged section, to point to stable package documentation,
CONTRACT-FIDELITY.md, or the relevant ADR instead of delivery-plan or
deferred-project files. Preserve the surrounding integration description.

In `@packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md`:
- Line 34: Replace the transient projects/supabase-integration/deferred.md
reference in CONTRACT-FIDELITY.md with a stable package or architecture
documentation link, or summarize the scope decision directly in this paragraph.
Preserve the existing list of intentionally undeclared schemas and its ownership
rationale.

---

Nitpick comments:
In `@packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts`:
- Around line 29-36: Replace the runtime defineContract call used to create
appContract with a direct structural AppContract type or the appropriate shared
emitted contract type. Keep the existing SupabaseDb<AppContract> assertion
intact, and ensure the type-level test no longer depends on defineContract’s
inferred or widened runtime-builder types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 641ef16d-eb7a-4d6f-84ec-cdcab2ea728a

📥 Commits

Reviewing files that changed from the base of the PR and between 05467c0 and bcf34ca.

⛔ Files ignored due to path filters (5)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • projects/extension-supabase/plan.md is excluded by !projects/**
  • projects/psl-ambient-declarations/spec.md is excluded by !projects/**
  • projects/supabase-integration/decisions.md is excluded by !projects/**
  • projects/supabase-integration/deferred.md is excluded by !projects/**
📒 Files selected for processing (48)
  • packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.ts
  • packages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.ts
  • packages/2-sql/2-authoring/contract-psl/src/interpreter.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.ts
  • packages/2-sql/9-family/src/core/foreign-key-index-backing.ts
  • packages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/printer-config.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/relation-inference.ts
  • packages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.ts
  • packages/3-extensions/supabase/README.md
  • packages/3-extensions/supabase/package.json
  • packages/3-extensions/supabase/scripts/generate-contract.ts
  • packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md
  • packages/3-extensions/supabase/src/contract/contract.d.ts
  • packages/3-extensions/supabase/src/contract/contract.json
  • packages/3-extensions/supabase/src/contract/contract.prisma
  • packages/3-extensions/supabase/src/contract/roles.ts
  • packages/3-extensions/supabase/test/brownfield-infer.integration.test.ts
  • packages/3-extensions/supabase/test/contract-completeness.test.ts
  • packages/3-extensions/supabase/test/contract-handles.test.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/restore.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sql
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sql
  • packages/3-extensions/supabase/test/reference-fixture-verify.integration.test.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts
  • packages/3-extensions/supabase/test/supabase-bootstrap.ts
  • packages/3-extensions/supabase/tsconfig.json
  • packages/3-targets/3-targets/postgres/src/core/codec-ids.ts
  • packages/3-targets/3-targets/postgres/src/core/codec-type-map.ts
  • packages/3-targets/3-targets/postgres/src/core/codecs.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/infer-psl-contract.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.ts
  • packages/3-targets/3-targets/postgres/src/exports/codecs.ts
  • packages/3-targets/3-targets/postgres/test/codecs-class.test.ts
  • packages/3-targets/3-targets/postgres/test/codecs.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.ts
  • packages/3-targets/6-adapters/postgres/src/core/control-adapter.ts
  • packages/3-targets/6-adapters/postgres/src/core/descriptor-meta.ts
  • packages/3-targets/6-adapters/postgres/test/control-adapter.test.ts
  • packages/3-targets/6-adapters/postgres/test/descriptor-meta.test.ts
  • skills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have this script? I thought the idea was to use prisma-next contract infer for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does use the contract infer engine — the script calls the same inferPostgresPslContract. What it cannot use is the CLI command, because the PSL writer only emits a single flat namespace bucket today (TML-2958 stopgap — infer-psl-contract.ts:335; it throws on a same-named table across two schemas). The Supabase contract needs three namespaces: auth, storage, and namespace unbound for the roles. So the script calls the inferrer per-schema and assembles the multi-namespace document itself. When TML-2958 teaches the writer multi-namespace output, this script collapses into prisma-next contract infer and is deleted. It is orchestration around the same engine, not a second inference path.

@wmadden-electric
wmadden-electric force-pushed the tml-2503-supabase-complete-contract branch from 4dc3d7b to 4a4e134 Compare July 15, 2026 11:31
@wmadden-electric
wmadden-electric force-pushed the tml-2503-supabase-complete-contract branch from 4a4e134 to cf3f134 Compare July 15, 2026 11:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md (1)

34-34: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Replace the transient projects/ documentation link.

This still links durable docs to projects/supabase-integration/deferred.md. A previous review already flagged this exact reference, and retrieved learnings say durable package docs must not reference transient projects/ artifacts (specs/plans/milestones). Link a stable package/architecture doc instead, or inline the scope-decision summary.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md` at line 34,
Replace the transient projects/supabase-integration/deferred.md link in
CONTRACT-FIDELITY.md with a stable package or architecture documentation link,
or inline the relevant scope-decision summary. Preserve the existing explanation
that the listed schemas are intentionally undeclared.

Source: Learnings

🧹 Nitpick comments (1)
packages/3-extensions/supabase/scripts/generate-contract.ts (1)

19-19: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use pathe instead of node:path.

This script reads/writes fixture and generated-contract files from disk (restoreSupabaseReference, writeFileSync at Line 634, the bin path at Line 637). Based on learnings, prefer pathe over node:path for such tooling/fixture-touching files in this repo.

♻️ Proposed fix
-import { dirname, join } from 'node:path';
+import { dirname, join } from 'pathe';

Also applies to: 47-47, 633-633, 637-637

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/3-extensions/supabase/scripts/generate-contract.ts` at line 19,
Replace the node:path dependency with pathe throughout generate-contract.ts,
updating dirname, join, and any related path usage in restoreSupabaseReference,
writeFileSync, and the bin path handling while preserving existing behavior.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md`:
- Line 22: Correct the “Column defaults” count in CONTRACT-FIDELITY.md from 8 to
7 so it matches the seven entries listed and the DEFAULT_OMISSIONS definition in
generate-contract.ts. Leave the listed columns and surrounding explanation
unchanged.

In `@packages/3-extensions/supabase/src/contract/contract.d.ts`:
- Around line 4950-4982: Update deriveBackRelationFieldName in
name-transforms.ts to avoid appending a plural suffix when the model name is
already plural, while preserving pluralization for singular names. Regenerate
the Supabase contract so back-relation fields use corrected names such as
mfaAmrClaims, identities, and sessions instead of double-pluralized variants.

---

Duplicate comments:
In `@packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md`:
- Line 34: Replace the transient projects/supabase-integration/deferred.md link
in CONTRACT-FIDELITY.md with a stable package or architecture documentation
link, or inline the relevant scope-decision summary. Preserve the existing
explanation that the listed schemas are intentionally undeclared.

---

Nitpick comments:
In `@packages/3-extensions/supabase/scripts/generate-contract.ts`:
- Line 19: Replace the node:path dependency with pathe throughout
generate-contract.ts, updating dirname, join, and any related path usage in
restoreSupabaseReference, writeFileSync, and the bin path handling while
preserving existing behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: aaf6348b-34dd-4683-9f4d-f3c9fe045a7a

📥 Commits

Reviewing files that changed from the base of the PR and between bcf34ca and cf3f134.

⛔ Files ignored due to path filters (5)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • projects/extension-supabase/plan.md is excluded by !projects/**
  • projects/psl-ambient-declarations/spec.md is excluded by !projects/**
  • projects/supabase-integration/decisions.md is excluded by !projects/**
  • projects/supabase-integration/deferred.md is excluded by !projects/**
📒 Files selected for processing (48)
  • packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.ts
  • packages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.ts
  • packages/2-sql/2-authoring/contract-psl/src/interpreter.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.ts
  • packages/2-sql/9-family/src/core/foreign-key-index-backing.ts
  • packages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/printer-config.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/relation-inference.ts
  • packages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.ts
  • packages/3-extensions/supabase/README.md
  • packages/3-extensions/supabase/package.json
  • packages/3-extensions/supabase/scripts/generate-contract.ts
  • packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md
  • packages/3-extensions/supabase/src/contract/contract.d.ts
  • packages/3-extensions/supabase/src/contract/contract.json
  • packages/3-extensions/supabase/src/contract/contract.prisma
  • packages/3-extensions/supabase/src/contract/roles.ts
  • packages/3-extensions/supabase/test/brownfield-infer.integration.test.ts
  • packages/3-extensions/supabase/test/contract-completeness.test.ts
  • packages/3-extensions/supabase/test/contract-handles.test.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/restore.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sql
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sql
  • packages/3-extensions/supabase/test/reference-fixture-verify.integration.test.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts
  • packages/3-extensions/supabase/test/supabase-bootstrap.ts
  • packages/3-extensions/supabase/tsconfig.json
  • packages/3-targets/3-targets/postgres/src/core/codec-ids.ts
  • packages/3-targets/3-targets/postgres/src/core/codec-type-map.ts
  • packages/3-targets/3-targets/postgres/src/core/codecs.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/infer-psl-contract.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.ts
  • packages/3-targets/3-targets/postgres/src/exports/codecs.ts
  • packages/3-targets/3-targets/postgres/test/codecs-class.test.ts
  • packages/3-targets/3-targets/postgres/test/codecs.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.ts
  • packages/3-targets/6-adapters/postgres/src/core/control-adapter.ts
  • packages/3-targets/6-adapters/postgres/src/core/descriptor-meta.ts
  • packages/3-targets/6-adapters/postgres/test/control-adapter.test.ts
  • packages/3-targets/6-adapters/postgres/test/descriptor-meta.test.ts
  • skills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md
🚧 Files skipped from review as they are similar to previous changes (42)
  • packages/3-targets/3-targets/postgres/src/exports/codecs.ts
  • packages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.ts
  • packages/3-extensions/supabase/tsconfig.json
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.ts
  • packages/3-extensions/supabase/src/contract/roles.ts
  • packages/3-targets/3-targets/postgres/src/core/codec-ids.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.ts
  • packages/3-extensions/supabase/package.json
  • packages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/printer-config.ts
  • packages/2-sql/9-family/src/core/foreign-key-index-backing.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/restore.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.ts
  • packages/3-targets/6-adapters/postgres/test/descriptor-meta.test.ts
  • packages/3-targets/3-targets/postgres/src/core/codec-type-map.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sql
  • packages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.ts
  • packages/3-extensions/supabase/test/supabase-bootstrap.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.ts
  • packages/3-extensions/supabase/README.md
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.ts
  • packages/2-sql/2-authoring/contract-psl/src/interpreter.ts
  • packages/3-extensions/supabase/test/contract-handles.test.ts
  • packages/3-targets/3-targets/postgres/test/codecs.test.ts
  • packages/3-targets/6-adapters/postgres/src/core/control-adapter.ts
  • packages/3-extensions/supabase/test/contract-completeness.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.ts
  • packages/3-targets/3-targets/postgres/src/core/codecs.ts
  • packages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.ts
  • packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.ts
  • packages/3-targets/6-adapters/postgres/src/core/descriptor-meta.ts
  • packages/3-extensions/supabase/test/reference-fixture-verify.integration.test.ts
  • packages/3-targets/6-adapters/postgres/test/control-adapter.test.ts
  • packages/3-targets/3-targets/postgres/test/codecs-class.test.ts
  • skills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md
  • packages/3-extensions/supabase/src/contract/contract.json
  • packages/3-extensions/supabase/src/contract/contract.prisma
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sql

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/architecture docs/adrs/ADR 161 - Explicit foreign key constraint and index configuration.md (1)

34-36: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Move emitter-lowering mechanics out of the ADR.

“Emit materializes…” and “lowered at emit” describe implementation mechanics. Keep the ADR focused on the architectural decision and invariants, and move lowering details to the relevant subsystem documentation.

As per retrieved guidance, ADRs should document design decisions and constraints rather than implementation algorithms.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture` docs/adrs/ADR 161 - Explicit foreign key constraint and
index configuration.md around lines 34 - 36, Revise the “The corrected model”
section to state only the architectural entities and invariants, removing
emitter-specific wording such as “Emit materializes,” “lowered at emit,” and
references to contract.json representation. Move those lowering mechanics to the
relevant emitter or subsystem documentation, while retaining the distinction
between foreign-key constraints, discrete indexes, and authoring-only
configuration.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/architecture` docs/adrs/ADR 161 - Explicit foreign key constraint and
index configuration.md:
- Around line 9-23: Update the JSON examples in the ADR to use the canonical
contract shape under storage.tables, with foreignKeys entries containing columns
and references; ensure both indexed and non-indexed examples are valid contract
JSON. If retaining the simplified top-level source/target notation, explicitly
label it as conceptual rather than canonical.
- Line 7: Revise the ADR statements around the foreign-key and index contract to
distinguish an omitted indexes entry from verified physical absence in the
database. Preserve the rule that each is an independent contract entity, and
explicitly state that under control: 'external', undeclared live indexes are
tolerated rather than treated as missing.

---

Nitpick comments:
In `@docs/architecture` docs/adrs/ADR 161 - Explicit foreign key constraint and
index configuration.md:
- Around line 34-36: Revise the “The corrected model” section to state only the
architectural entities and invariants, removing emitter-specific wording such as
“Emit materializes,” “lowered at emit,” and references to contract.json
representation. Move those lowering mechanics to the relevant emitter or
subsystem documentation, while retaining the distinction between foreign-key
constraints, discrete indexes, and authoring-only configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: a1241cfa-f624-427a-875d-b0139a1b05ae

📥 Commits

Reviewing files that changed from the base of the PR and between cf3f134 and 20e4cfc.

📒 Files selected for processing (2)
  • docs/architecture docs/adrs/ADR 161 - Explicit foreign key constraint and index configuration.md
  • docs/architecture docs/subsystems/1. Data Contract.md

@wmadden-electric
wmadden-electric added this pull request to the merge queue Jul 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 15, 2026
@wmadden
wmadden added this pull request to the merge queue Jul 15, 2026
@wmadden
wmadden removed this pull request from the merge queue due to a manual request Jul 15, 2026
@wmadden-electric
wmadden-electric force-pushed the tml-2503-supabase-complete-contract branch from 20e4cfc to cd87beb Compare July 15, 2026 13:42
@wmadden-electric

Copy link
Copy Markdown
Contributor Author

Post-approval changes (CodeRabbit round + merge-readiness), for reviewer awareness:

  • Fidelity doc / ADR nits (851cfa3a1): corrected the column-defaults count (8→7), inlined the scope rationale in place of a transient projects/ link, and labelled the ADR 161 FK JSON as conceptual notation.
  • Double-pluralized relation names (4d32dcad7): the inferrer double-pluralized Supabase's already-plural table names, so the generated contract shipped sessionses/identitieses/… as public relation fields. Fixed in the pack's own generator via a declarative DOUBLE_PLURALIZED_FIELD_NAMES correction (same pattern as DEFAULT_OMISSIONS/MODEL_RENAMES) + regeneration — now sessions/identities/…. The general inflection fix in contract infer is tracked as TML-3024. This changes generated public names in contract.d.ts/contract.json.
  • CI retry (6ae74de23): added retry: process.env['CI'] ? 2 : 0 to the Supabase example + the two test/integration vitest configs, mirroring the e2e framework config. Absorbs the known intermittent PGlite (WASM) abort that --no-memory-protection-keys only partially suppresses — it was ejecting this PR from the merge queue.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/3-extensions/supabase/scripts/generate-contract.ts (2)

17-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Prefer pathe over node:path in this script.

This is a tooling script (not a test file), where the repo convention is pathe for path operations. Based on learnings, "prefer importing and using 'pathe' over the built-in 'node:path' module for path operations across the codebase (including CLI commands and tooling files)."

♻️ Proposed fix
-import { dirname, join } from 'node:path';
+import { dirname, join } from 'pathe';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/3-extensions/supabase/scripts/generate-contract.ts` around lines 17
- 20, Replace the node:path import used by the generate-contract script with the
repository’s pathe path utilities, preserving the existing dirname and join
behavior wherever those symbols are used.

Source: Learnings


166-201: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the repeated namespace-reconstruction boilerplate.

applyIndexOmissions, applyDoublePluralizationFix, applyDefaultOmissions, applyRlsEnablement, renameModels, and rewriteFieldTypeNames all end with the identical makePslNamespace({ kind: 'namespace', name: namespace.name, entries: makePslNamespaceEntries(models, namespace.compositeTypes, namespacePslExtensionBlocks(namespace)), span: namespace.span }) block. A small withModels(namespace, models) helper would remove this duplication across six call sites.

♻️ Proposed helper
+function withModels(namespace: PslNamespace, models: readonly PslModel[]): PslNamespace {
+  return makePslNamespace({
+    kind: 'namespace',
+    name: namespace.name,
+    entries: makePslNamespaceEntries(
+      models,
+      namespace.compositeTypes,
+      namespacePslExtensionBlocks(namespace),
+    ),
+    span: namespace.span,
+  });
+}

Then each of the six functions above collapses its trailing block to return withModels(namespace, models);.

Also applies to: 239-265, 336-366, 382-403, 462-499, 502-528

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/3-extensions/supabase/scripts/generate-contract.ts` around lines 166
- 201, Extract the repeated namespace reconstruction into a shared
withModels(namespace, models) helper that preserves the existing kind, name,
composite types, extension blocks, and span. Replace the identical
makePslNamespace boilerplate at the ends of applyIndexOmissions,
applyDoublePluralizationFix, applyDefaultOmissions, applyRlsEnablement,
renameModels, and rewriteFieldTypeNames with calls to this helper, leaving each
function’s transformation and unchanged-namespace behavior intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/3-extensions/supabase/scripts/generate-contract.ts`:
- Around line 17-20: Replace the node:path import used by the generate-contract
script with the repository’s pathe path utilities, preserving the existing
dirname and join behavior wherever those symbols are used.
- Around line 166-201: Extract the repeated namespace reconstruction into a
shared withModels(namespace, models) helper that preserves the existing kind,
name, composite types, extension blocks, and span. Replace the identical
makePslNamespace boilerplate at the ends of applyIndexOmissions,
applyDoublePluralizationFix, applyDefaultOmissions, applyRlsEnablement,
renameModels, and rewriteFieldTypeNames with calls to this helper, leaving each
function’s transformation and unchanged-namespace behavior intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: eba6acc9-fff2-4356-9abf-0678319bf0b8

📥 Commits

Reviewing files that changed from the base of the PR and between 20e4cfc and 6ae74de.

⛔ Files ignored due to path filters (5)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • projects/extension-supabase/plan.md is excluded by !projects/**
  • projects/psl-ambient-declarations/spec.md is excluded by !projects/**
  • projects/supabase-integration/decisions.md is excluded by !projects/**
  • projects/supabase-integration/deferred.md is excluded by !projects/**
📒 Files selected for processing (53)
  • docs/architecture docs/adrs/ADR 161 - Explicit foreign key constraint and index configuration.md
  • docs/architecture docs/subsystems/1. Data Contract.md
  • examples/supabase/vitest.config.ts
  • packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.ts
  • packages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.ts
  • packages/2-sql/2-authoring/contract-psl/src/interpreter.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.ts
  • packages/2-sql/9-family/src/core/foreign-key-index-backing.ts
  • packages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/printer-config.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/relation-inference.ts
  • packages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.ts
  • packages/3-extensions/supabase/README.md
  • packages/3-extensions/supabase/package.json
  • packages/3-extensions/supabase/scripts/generate-contract.ts
  • packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md
  • packages/3-extensions/supabase/src/contract/contract.d.ts
  • packages/3-extensions/supabase/src/contract/contract.json
  • packages/3-extensions/supabase/src/contract/contract.prisma
  • packages/3-extensions/supabase/src/contract/roles.ts
  • packages/3-extensions/supabase/test/brownfield-infer.integration.test.ts
  • packages/3-extensions/supabase/test/contract-completeness.test.ts
  • packages/3-extensions/supabase/test/contract-handles.test.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/restore.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sql
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sql
  • packages/3-extensions/supabase/test/reference-fixture-verify.integration.test.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts
  • packages/3-extensions/supabase/test/supabase-bootstrap.ts
  • packages/3-extensions/supabase/tsconfig.json
  • packages/3-targets/3-targets/postgres/src/core/codec-ids.ts
  • packages/3-targets/3-targets/postgres/src/core/codec-type-map.ts
  • packages/3-targets/3-targets/postgres/src/core/codecs.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/infer-psl-contract.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.ts
  • packages/3-targets/3-targets/postgres/src/exports/codecs.ts
  • packages/3-targets/3-targets/postgres/test/codecs-class.test.ts
  • packages/3-targets/3-targets/postgres/test/codecs.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.ts
  • packages/3-targets/6-adapters/postgres/src/core/control-adapter.ts
  • packages/3-targets/6-adapters/postgres/src/core/descriptor-meta.ts
  • packages/3-targets/6-adapters/postgres/test/control-adapter.test.ts
  • packages/3-targets/6-adapters/postgres/test/descriptor-meta.test.ts
  • skills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md
  • test/integration/vitest.config.ts
  • test/integration/vitest.journeys.config.ts
🚧 Files skipped from review as they are similar to previous changes (47)
  • packages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.ts
  • packages/3-targets/3-targets/postgres/src/exports/codecs.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts
  • packages/3-extensions/supabase/tsconfig.json
  • packages/3-targets/3-targets/postgres/src/core/codec-ids.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/printer-config.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.ts
  • packages/3-targets/3-targets/postgres/test/codecs-class.test.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.ts
  • packages/3-targets/3-targets/postgres/test/codecs.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.ts
  • packages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/restore.ts
  • skills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md
  • packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.ts
  • packages/3-targets/6-adapters/postgres/src/core/descriptor-meta.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.ts
  • packages/3-targets/6-adapters/postgres/test/descriptor-meta.test.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.ts
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sql
  • packages/3-extensions/supabase/src/contract/roles.ts
  • packages/3-extensions/supabase/README.md
  • packages/2-sql/2-authoring/contract-psl/src/interpreter.ts
  • packages/2-sql/9-family/src/core/foreign-key-index-backing.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-infer/infer-psl-contract.ts
  • packages/3-extensions/supabase/package.json
  • packages/3-extensions/supabase/test/reference-fixture-verify.integration.test.ts
  • packages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.ts
  • packages/2-sql/9-family/src/core/psl-contract-infer/relation-inference.ts
  • packages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.ts
  • packages/3-targets/6-adapters/postgres/test/control-adapter.test.ts
  • packages/3-targets/6-adapters/postgres/src/core/control-adapter.ts
  • packages/3-targets/3-targets/postgres/src/core/codec-type-map.ts
  • packages/3-extensions/supabase/test/supabase-bootstrap.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.ts
  • packages/3-extensions/supabase/test/contract-handles.test.ts
  • packages/3-extensions/supabase/test/contract-completeness.test.ts
  • docs/architecture docs/adrs/ADR 161 - Explicit foreign key constraint and index configuration.md
  • packages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.ts
  • packages/3-targets/3-targets/postgres/src/core/codecs.ts
  • docs/architecture docs/subsystems/1. Data Contract.md
  • packages/3-extensions/supabase/src/contract/contract.d.ts
  • packages/3-extensions/supabase/src/contract/contract.prisma
  • packages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sql
  • packages/3-extensions/supabase/src/contract/contract.json

Round-tripping the first large externally-owned schema (Supabase)
through db verify exposed gaps this fixes:

- PSL @relation gains an optional boolean index argument lowering onto
  the foreign key IR flag that already existed; contract infer emits
  index: false for FKs introspected without a live backing index. Both
  sides share one predicate (foreign-key-index-backing.ts) so verify
  and inference cannot disagree about what backs an FK.
- The postgres target gains pg/inet@1 — a transparent string carrier
  modeled on pg/uuid@1; inet columns are authorable as String @db.Inet
  and contract infer maps them instead of printing Unsupported("inet").
- contractToSchemaIR keeps an array column nativeType as the bare
  element type with many: true instead of baking in "[]", so list
  columns compare equal against live introspection.
- Postgres introspection excludes expression-keyed indexes and no
  longer collides a unique and non-unique index over identical columns;
  infer carries a non-default index access method as @@index(type:).
- The contract canonicalizer preserves value: false in resolved
  defaults instead of stripping it as an empty value.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… contract

The pack contract now describes everything Supabase owns — all 23 auth
and 10 storage tables of the reference version, 10 native enum types,
and the three roles — generated, not hand-authored: pnpm
contract:generate restores the checked-in reference fixture
(pg_dump of every schema from supabase/postgres:17.6.1.106, version
pins recorded) into fresh PGlite, introspects auth and storage,
assembles named PSL namespace blocks plus the top-level role blocks
from SUPABASE_ROLES, and emits. Reruns are byte-identical. The five
legacy model names (AuthUser, AuthIdentity, AuthSession, StorageBucket,
StorageObject) are preserved; everything the pipeline deliberately does
not declare (2 nullable array columns, 8 defaults, 2 hash indexes) is
recorded in CONTRACT-FIDELITY.md and omission is verify-safe under
external.

bootstrapSupabaseShim now restores the reference fixture instead of a
hand-authored 5-table subset (RESET ALL afterwards — the pg_dump
preamble sets row_security=off, which must not leak into the caller
session).

Tests: round-trip verify against the restored fixture (clean, with
realtime/vault present as tolerated extras; dropping a declared table
fails naming it), contract completeness, brownfield contract infer
(user tables in public survive, FK resolves to supabase:auth.AuthUser,
no owned or undeclared-schema element leaks), and the service_role
.supabase surface reading auth.refresh_tokens through sql and orm.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ries

Slice F marked done with the as-built pipeline; the undeclared-schemas
scope decision lands in deferred.md; extension-author upgrade entries
cover the pack contract expansion, the @relation index argument and
pg/inet codec, the false-default canonicalization change, and the
array/introspection round-trip fixes.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The environment-block design from the Slice C review, written down so
it is findable when the second ambient entity kind arrives: grammar
sketch, pack-contributed contents, the two storage-shape options, the
managed-CREATE EXTENSION growth path, migration from the shipped
top-level role blocks, and the open keyword/refs questions. Linked
from offcut OC4.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Adapts the generator, completeness test, and fidelity notes to the
merged Slice C shape: roles.ts is the SupabaseRole enumType handle, and
the generator emits the three roles inside an explicit
`namespace unbound { role … }` block (required by the merged placement
check) sourced from SupabaseRole.values, replacing the earlier
top-level role blocks. Regenerates the contract artifacts: the role
entities serialize under the __unbound__ slot (postgres-unbound-schema)
with their entity namespaceId unchanged.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
FK1: foreign keys and indexes as discrete contract entities — supersedes
ADR 161 (which deliberately put the constraint/index booleans on the FK).
Argued on facts-not-instructions plus the new point that Slice F's
introspection/verify reconciliation broke ADR 161's self-contained
claim; framed narrowly, not as "the contract is unambiguous". FK2: the
auth/storage contract split for opt-in composition. Both are their own
slices; recorded so they are not lost.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…entities

The per-FK constraint/index booleans are emission directives, not facts.
The index boolean cannot name the index it asserts exists (it can only
mean "the deterministically-named index"), and ADR 161's own §5
("if no covering index") contradicts its §1 self-containment claim. Lead
ADR 161 with the corrected decision — a foreign key and its backing index
are discrete contract entities, each stating a fact — using the concrete
index-name example, and keep the original boolean design below as the
superseded record. Illustrate the same point on the Data Contract
"facts, not instructions" principle.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…DR 161

- CONTRACT-FIDELITY.md: correct the column-defaults count (8 → 7, matching
  DEFAULT_OMISSIONS), and replace the transient projects/ link with the scope
  rationale inline.
- ADR 161: label the discrete-entity JSON example as conceptual notation for
  the proposed model, not a literal of the current contract.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The framework inferrer pluralizes back-relation field names unconditionally,
so Supabase's already-plural table names (sessions, identities, …) came out
double-pluralized in the generated contract (sessionses, identitieses, …) —
public relation names a consumer would type. Correct the 20 affected names in
the pack's generator via a declarative field-name table, mirroring the
existing DEFAULT_OMISSIONS/MODEL_RENAMES corrections, and regenerate. The
general inflection fix in the inferrer is tracked as a separate follow-up.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…M abort

The PGlite (WASM) suites intermittently abort on the slower CI runners even
with --no-memory-protection-keys ("Connection terminated unexpectedly"). The
Supabase example is the acute case — restoring the full 33-table reference
fixture is the heaviest single WASM op — but the integration suites hit it too.
Mirror the CI-gated retry the e2e framework config already uses (retry twice on
CI, never locally so real flakes stay visible).

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The upgrade-coverage gate requires any PR touching examples/ to record intent in
the in-flight instructions.md. This PR's examples/ diff is the supabase
walking-skeleton test plus a CI-only vitest retry config, over the additive
complete-contract regeneration — no user upgrade action.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The PGlite (WASM) suites re-run the crashed test via each suite's `retry`
config, but the retry alone did not clear CI: when the dev server aborts, the
pg client emits an asynchronous 'error' event, and with no listener Node
surfaces it as an *unhandled* error that fails the whole run even though the
test already passed on retry. Attach an 'error' listener (queries still
reject on their own, so nothing real is masked) and swallow a cleanup-time
end() rejection on the already-dropped connection.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric force-pushed the tml-2503-supabase-complete-contract branch from 880717d to cc4b5af Compare July 15, 2026 15:20
@wmadden-electric
wmadden-electric added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit a8c9ae7 Jul 15, 2026
20 checks passed
@wmadden-electric
wmadden-electric deleted the tml-2503-supabase-complete-contract branch July 15, 2026 15:46
wmadden-electric added a commit that referenced this pull request Jul 16, 2026
… promoted doc

Four files referenced projects/supabase-integration/ or projects/
extension-supabase/: the package and example READMEs (links to decisions.md /
the umbrella README -> the promoted "Supabase Integration" design-history
doc), native-postgres-enums (plan link -> merged PR #960), and
psl-ambient-declarations (OC1/OC4/deferred links -> the promoted doc).

The README touches trip the upgrade-coverage gate, so this also opens the
0.15-to-0.16 transition dirs in both upgrade skills with changes: [] and an
incidental scope note.

Part of the Supabase integration close-out (TML-2503).

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants