Skip to content

Completion Report: ANU-7 - Migrate Supabase Postgres data and verify local cutover

Implementation summary

ANU-7 migrated the application-owned Supabase PostgreSQL data into a fresh database in the accepted local Postgres/pgvector named volume and switched the containerized CMS to that restored target. The source stayed read-only and its URI remains unchanged in ignored .env for rollback.

Tracked implementation adds a pinned Supabase CLI, redacted inventory/export evidence, checksum verification, hosted ownership/ACL removal, fresh-target and loopback guards, transactional restore, semantic parity, targeted application probes, and a durable migration/recovery runbook. Dump contents, credentials, row contents, and machine-local reports remain ignored and absent from Git.

Acceptance review additionally verified that fresh-target creation connects through the always-present local postgres maintenance database, restore file paths remain positional arguments rather than shell source, and semantic parity returns a failing process status on mismatch.

Acceptance evidence

Acceptance check Result Redacted evidence
Source inventory covers required database state without secrets or rows Passed Read-only inventory recorded PostgreSQL 17.6, installed extension names/versions, application and managed schemas, required role names, 102 public application tables, constraints, sequences, Payload state, 27 Mastra tables, RAG tables, and vector indexes.
Schema and data exports use Supabase CLI, checksums, and ignored storage Passed Pinned Supabase CLI 2.109.1 dry run and export completed for public; schema was 206,471 bytes and data was 36,471,404 bytes. SHA-256 verification passed, logs contain no URI/credential component, .local-data/** is ignored, and git ls-files returned no artifacts.
Restore excludes unreviewed managed schemas and privilege weakening Passed No managed-schema DDL/data or blanket public grants were accepted. Prepared schema removed only 178 ownership, 340 grant, and 12 default-privilege statements and had no residual hosted-role reference. Restore ran as one transaction into fresh loopback database anuvax_anu7; role import was disabled.
Automated and targeted parity covers data and schema Passed Semantic comparison matched 102 table counts, 99 primary-key hashes, 283 constraints, 482 indexes, nine sequences, workspace-null counts, Payload migration state, Mastra tables, RAG counts, and vector-index state. PostgreSQL and pgvector patch-version differences were reviewed separately.
Workspace, Mastra, RAG, and vector behavior pass Passed Zero presentation-scene or RAG source/chunk workspace mismatches; 27 Mastra tables and 51 workflow snapshots; 786 RAG chunks and 786 vectors; migrated vector index present; nearest-neighbor query returned one result.
CMS, workers, admin/login, and primary runtime pass locally Passed All three services healthy; stack:verify initialized Payload/Mastra, sampled one migrated user, completed vector insert/query/delete, and returned worker API 200. Payload migration status passed; /, /admin, /login, and pgAdmin returned 200; all three workers passed bounded empty-queue startup. The current Chromium project passed all six presentation flows against the migrated database.
Restart persistence and rollback pass without deleting accepted volume Passed stack:restart and stack:down/stack:up both preserved data and repeated smoke. The targeted probe matched after volume reattachment. A separate no-schema-push Payload status process succeeded through the untouched Supabase URI; the live service then still resolved postgres/anuvax_anu7.

Verification commands and results

  • pnpm exec supabase --version: passed with 2.109.1.
  • Guarded source inventory: passed in a read-only transaction.
  • Supabase CLI public-schema dump plan, --dry-run, and --execute: passed after credential-component redaction was added.
  • pnpm local-stack:db -- verify ...: passed for schema.sql and data.sql.
  • Artifact credential scan, managed-schema scan, ignore checks, and Git absence: passed.
  • pnpm local-stack:db -- prepare ...: passed; exact hosted ownership/ACL removals recorded above.
  • Guarded target creation, empty-target pgvector alignment, and transactional restore: passed. Two failed attempts rolled back and left zero tables before the accepted retry.
  • Semantic parity: passed with matches: true.
  • Targeted cutover probe: passed with zero workspace mismatches and queue counts, exact migrated RAG counts, vector index presence, and successful vector query.
  • pnpm stack:up, stack:status, and repeated stack:verify: passed.
  • Payload migration status: all three checked-in migrations reported Ran: Yes.
  • HTTP probes: public root, Payload admin, login, and pgAdmin returned 200.
  • Bounded rag:worker, presentation:worker, and anuva:worker startup probes: passed with all migrated queues empty.
  • pnpm stack:restart and volume-preserving stack:down/stack:up: passed; post-cycle targeted probe matched.
  • Rollback-connectivity Payload migration status with PAYLOAD_DB_PUSH=0: passed through the retained source URI; the live service remained local.
  • Focused Biome check: passed for all six ANU-7 TypeScript/config/test files.
  • pnpm typecheck: passed.
  • tests/unit/local-stack.test.ts: 17 tests passed, including fresh-target maintenance derivation and restore path argument-safety coverage.
  • pnpm lint: failed with exit code 1 after checking 441 files. Biome 2.3.9 reported exactly six errors and six warnings across five files unchanged by ANU-7: formatter errors in docs/_stale/archive/globals.css, docs/stylesheets.css, and src/payload-types.ts; organize-imports errors in src/app/(payload)/admin/importMap.js and src/mastra/tools/presentation/index.ts; one additional formatter error in src/app/(payload)/admin/importMap.js; and six noImportantStyles warnings in docs/stylesheets.css. The repository runs Biome 2.3.9, unchanged from main; its package specification, lock entry, and biome.json configuration are unchanged. This failed repository-wide result is accepted as an out-of-scope baseline exception for ANU-7 only; it is not a passing lint result. No ANU-7 file failed the focused check.
  • pnpm test:int: all 103 integration and unit tests passed after the stale orchestration action assertion was aligned with the current split actions.
  • Chromium Playwright project: all six presentation flows passed against anuvax_anu7 after stale setup, assistant, hydration, and preview-readiness expectations were aligned with the current UI. The server still prints non-fatal Better Auth 401 diagnostics under the explicit E2E bypass.
  • Recursive documentation index validation: passed with no missing or empty indexes or directories.
  • Strict MkDocs build: passed.
  • git diff --check: passed after the final documentation update.

Documentation and preview URLs

  • Change overview: https://web1.girishd.com/changes/2026-07-21-anu-7-supabase-local-cutover/
  • Implementation plan: https://web1.girishd.com/changes/2026-07-21-anu-7-supabase-local-cutover/ImplementationPlan/
  • Implementation log: https://web1.girishd.com/changes/2026-07-21-anu-7-supabase-local-cutover/ImplementationLog/
  • Completion report: https://web1.girishd.com/changes/2026-07-21-anu-7-supabase-local-cutover/CompletionReport/

These URLs are preview-only. Product Main owns canonical publication.

Product Main synchronization

Product Main should record:

  • ANU-7 restored the accepted logical snapshot into local PostgreSQL and cut the containerized CMS over successfully.
  • Source PostgreSQL 17.6/vector 0.8.0 and local PostgreSQL 17.10/vector 0.8.2 have application-semantic parity despite reviewed patch differences.
  • The source URI remains intact and rollback connectivity is demonstrated; the accepted local volume was not deleted.
  • Repository-wide pnpm lint remains failed: Biome 2.3.9, unchanged from main, reports exactly six errors and six warnings across the five unchanged files listed above. Its locked version and configuration are unchanged from main; the result is an accepted out-of-scope baseline exception for ANU-7 only, not a passing lint result. Integration/unit and Chromium verification pass; the mocked E2E server's non-fatal Better Auth diagnostics remain a separate harness cleanup.
  • Canonical docs are not published from this repository; use the preview links and linked draft PR for completion review.

Remaining risks and skipped checks

  • No production deployment, Python render, or Unity render was run; those are outside this repository child. Worker API compatibility passed from the CMS.
  • No real provider-backed presentation generation was executed because it would spend provider resources and mutate accepted migrated data. Existing primary runtime, migrated records, worker startup, and mocked E2E boundary were tested.
  • The Playwright project passed all six selected flows with provider behavior mocked. Its non-fatal Better Auth diagnostics do not change those assertions but should be cleaned up separately.
  • Repository-wide pnpm lint remains failed with the exact unchanged-file baseline recorded above. The exception applies only to ANU-7 and does not waive or reclassify those findings for other work.
  • The logical export is a point-in-time snapshot. Any later writes to Supabase require a new export, restore, and parity cycle before another accepted cutover.