set -euo pipefail
printf 'URL=%s\nREF=%s\n' "${SUPABASE_URL:-}" "${SUPABASE_PROJECT_REF:-}"
for v in SUPABASE_DB_URL SUPABASE_DB_PASSWORD SUPABASE_SERVICE_ROLE_KEY SUPABASE_ANON_KEY; do if [ -n "${!v:-}" ]; then echo "$v=set"; else echo "$v=missing"; fi; done
psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -Atc "select current_database(), current_user; select count(*) from public.payments; select to_regclass('public.payments');"URL=https://<ref>.supabase.co REF=<ref> SUPABASE_DB_URL=set SUPABASE_DB_PASSWORD=set SUPABASE_SERVICE_ROLE_KEY=set SUPABASE_ANON_KEY=set postgres|postgres 80 payments
set -euo pipefail
umask 077
backup=/tmp/payments_pre_incident_$(date -u +%Y%m%dT%H%M%SZ).dump
pg_dump "$SUPABASE_DB_URL" --format=custom --file="$backup" --table=public.payments --no-owner --no-privileges
pg_restore --list "$backup" > "${backup}.list"
sha256sum "$backup"
printf 'BACKUP=%s\n' "$backup"
cat "${backup}.list"fa672648318f08b43c630a7faeabd0fdceae76510d9b42226c99fdc2ea11b4fc /tmp/payments_pre_incident_20260725T054059Z.dump BACKUP=/tmp/payments_pre_incident_20260725T054059Z.dump ; ; Archive created at 2026-07-25 05:40:59 UTC ; dbname: postgres ; TOC Entries: 9 ; Compression: gzip ; Dump Version: 1.16-0 ; Format: CUSTOM ; Integer: 4 bytes ; Offset: 8 bytes ; Dumped from database version: 17.6 ; Dumped by pg_dump version: 18.4 (Debian 18.4-1.pgdg12+1) ; ; ; Selected TOC Entries: ; 272; 1259 22207 TABLE public payments postgres 3697; 0 22207 TABLE DATA public payments postgres 3547; 2606 22213 CONSTRAINT public payments payments_pkey postgres
set -euo pipefail psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -Atc "select public.run_incident();"
incident executed
set -euo pipefail psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -P pager=off -c "select count(*) as rows from public.payments; select column_name,data_type,is_nullable,column_default from information_schema.columns where table_schema='public' and table_name='payments' order by ordinal_position; select indexname,indexdef from pg_indexes where schemaname='public' and tablename='payments'; select count(*) as incident_records from public.incident_log;"
rows
------
54
(1 row)
column_name | data_type | is_nullable | column_default
--------------+--------------------------+-------------+----------------
id | integer | NO |
ref_code | text | NO |
payer | text | NO |
amount_cents | integer | NO |
paid_at | timestamp with time zone | NO |
(5 rows)
indexname | indexdef
---------------+-----------------------------------------------------------------------
payments_pkey | CREATE UNIQUE INDEX payments_pkey ON public.payments USING btree (id)
(1 row)
incident_records
------------------
1
(1 row)
set -euo pipefail backup=/tmp/payments_pre_incident_20260725T054059Z.dump # Restore only the backed-up table definition/data/constraint. Existing table is dropped/recreated; incident_log is untouched. pg_restore --clean --if-exists --exit-on-error --single-transaction --no-owner --no-privileges --dbname="$SUPABASE_DB_URL" "$backup" psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -P pager=off -c "select count(*) as restored_rows from public.payments; select count(*) as incident_records from public.incident_log; select count(*) as distinct_ids from (select distinct id from public.payments) s;"
restored_rows
---------------
80
(1 row)
incident_records
------------------
1
(1 row)
distinct_ids
--------------
80
(1 row)
A shell script executed against the live project and asserted on the state the agent left behind. No model judged another model.
Raw transcript · Task definition and verifier · Every attempt