Skip to content

fix(db): repair Supabase Preview migration replay failures - #305

Merged
BigSimmo merged 3 commits into
mainfrom
cursor/fix-supabase-preview-migration-7890
Jul 6, 2026
Merged

fix(db): repair Supabase Preview migration replay failures#305
BigSimmo merged 3 commits into
mainfrom
cursor/fix-supabase-preview-migration-7890

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes failing Supabase Preview checks caused by two migration replay issues.

1. match_document_chunks_text return type change (SQLSTATE 42P13)

PostgreSQL rejects CREATE OR REPLACE when OUT columns differ from the live database. Added the same DROP FUNCTION IF EXISTS guard used in phase-7 migrations before recreating match_document_chunks_text.

2. Promote migration references non-existent updated_at columns (SQLSTATE 42703)

20260706120000_promote_remaining_indexed_documents_public.sql (merged via #294) attempted to set updated_at on document_table_facts and document_embedding_fields, which only have created_at. Removed the invalid column updates.

Changes

  • supabase/migrations/20260705210000_retrieval_owner_filter_sentinel.sql — drop before recreate
  • supabase/migrations/20260706120000_promote_remaining_indexed_documents_public.sql — omit updated_at on tables without it
  • supabase/schema.sql — drop before recreate
  • tests/supabase-schema.test.ts — replay guard test

Verification

  • npm run verify:cheap — pass
  • npm run test -- tests/supabase-schema.test.ts — pass
Open in WebOpen in Cursor

…nel rewrite
Supabase Preview branches fail with SQLSTATE 42P13 when this migration
attempts CREATE OR REPLACE on a function whose OUT signature differs
from the live database. Drop first, matching the phase-7 migration pattern.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@supabase

supabaseBot commented Jul 5, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy due to reaching the limit of concurrent preview branches.
Go to Project Integrations Settings ↗︎ if you wish to update this limit.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursorcursorBot changed the title fix(db): drop match_document_chunks_text before retrieval owner sentinel rewritefix(db): repair Supabase Preview migration replay failuresJul 5, 2026
…lumn
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo marked this pull request as ready for review July 5, 2026 23:50
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@BigSimmo
BigSimmo merged commit 4adb6f0 into mainJul 6, 2026
6 checks passed
@BigSimmo
BigSimmo deleted the cursor/fix-supabase-preview-migration-7890 branch July 8, 2026 16:25
BigSimmo pushed a commit that referenced this pull request Aug 12, 2026
… issues, contract pins
Review of the RAG canary infrastructure (2026-08-12) found the mechanism sound
but with manual/silent gaps. This change mechanizes and pins them; no retrieval
behaviour changes.
- compare-retrieval-eval: new per-case rr@10/contentRR@10 diff with
--fail-on-regression, mechanizing the canary-pair protocol's 'zero per-case
rr regressions' gate that was previously eyeballed from tee'd logs; fails
closed on summary-only artifacts and non-identical case sets.
- eval-canary.yml: open the failure issue on failed dispatches too (a red
dispatch is usually half a canary pair), and feed answer-targeting.log,
validate_override and answer_targeting outcomes into the issue body.
- build-ranking-snapshot: fail loudly when a hardNegativeTemplates caseId
matches no artifact case (a renamed golden case previously dropped its hard
negatives silently); CLI guarded so tests can import convertArtifact.
- New contract tests: hard-negative attachment guard, and a strict/wide
alias-tier pin so a bulk merge of src/lib/eval-document-matching.ts into
scripts/lib/clinical-aliases.ts can no longer pass CI.
- docs/rag-behaviour: fix stale claims that the canary has workflow_dispatch /
a ref input (both deliberately absent); document the per-case compare command.
- outstanding-issues: capture the snapshot-freshness dispatch handoff (#304)
and deferred canary observations (#305).
RAG impact: no retrieval behaviour change — canary tooling, docs, and
contract-test hardening only; golden fixture and ranking code untouched.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UoHPMZ1FinSYzH7rJ42xTo
BigSimmo pushed a commit that referenced this pull request Aug 12, 2026
…d rows
The conflict was one hunk. Resolved by keeping this branch's #302 (re-measured
2026-08-12, newer than main's) and all four of main's genuinely new rows
(#304, #305, #306, #307), dropping only main's older #302 and its #303, which
this branch had already archived as delivered after probing the CLI.
Correcting an earlier claim in this branch's history: #302 and #303 were NOT
lost by main. Main renumbered them to #306 and #307 after the id collision,
which is exactly what the guard advises. Both are re-filings of work already
done, and both are archived here with evidence — style-contracts.ts:352-354 is
clean, and the marker reads 308 against a highest declared id of 307.
The derived loss detector reports one exception, #262, which is intentional:
main's version of that row is newer than this branch's.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017paT42ZVMf8jaLtkjFxdy5
Sign up for freeto 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.

2 participants

@BigSimmo@cursoragent