env | grep -i supa | sed 's/\(KEY=.\{12\}\).*/\1.../' ; which pg_dump psql; pg_dump --version; psql --versionSUPABASE_DB_PASSWORD=<redacted:SUPABASE_DB_PASSWORD> SUPABASE_DB_URL=<redacted:SUPABASE_DB_URL> SUPABASE_URL=https://<ref>.supabase.co SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJI... SUPABASE_PROJECT_REF=<ref> SUPABASE_ANON_KEY=eyJhbGciOiJI... /usr/bin/pg_dump /usr/bin/psql pg_dump (PostgreSQL) 18.4 (Debian 18.4-1.pgdg12+1) psql (PostgreSQL) 18.4 (Debian 18.4-1.pgdg12+1)
echo "$SUPABASE_DB_URL" | sed 's/:[^:@]*@/:***@/'
postgresql://postgres.<ref>:***@aws-0-us-east-1.pooler.supabase.com:5432/postgres
cd /tmp && psql "$SUPABASE_DB_URL" -c "select version();" -c "select current_user, current_database();" 2>&1 | head -20
version ------------------------------------------------------------------------------ PostgreSQL 17.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 15.2.0, 64-bit (1 row) current_user | current_database --------------+------------------ postgres | postgres (1 row)
cd /tmp && psql "$SUPABASE_DB_URL" -c "\d+ public.payments" 2>&1 | head -60
Table "public.payments"
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
--------------+--------------------------+-----------+----------+---------+----------+-------------+--------------+-------------
id | integer | | not null | | plain | | |
ref_code | text | | not null | | extended | | |
payer | text | | not null | | extended | | |
amount_cents | integer | | not null | | plain | | |
paid_at | timestamp with time zone | | not null | | plain | | |
Indexes:
"payments_pkey" PRIMARY KEY, btree (id)
Access method: heap
cd /tmp && psql "$SUPABASE_DB_URL" -c "select count(*), sum(case when 1=1 then 1 else 0 end) from public.payments;" -c "select * from public.payments order by 1 limit 5;" 2>&1 | head -40
count | sum
-------+-----
80 | 80
(1 row)
id | ref_code | payer | amount_cents | paid_at
----+--------------+------------------+--------------+------------------------
1 | 6C8935605030 | Payer-caffc0dc43 | 30036 | 2026-03-01 00:07:00+00
2 | 300351D74397 | Payer-b964e8caa9 | 101426 | 2026-03-01 00:14:00+00
3 | 381DA59BBE42 | Payer-77e253b14e | 484618 | 2026-03-01 00:21:00+00
4 | FD441D715532 | Payer-e8610229a5 | 470397 | 2026-03-01 00:28:00+00
5 | 49C2E5E745B1 | Payer-9719c24260 | 193265 | 2026-03-01 00:35:00+00
(5 rows)
cd /tmp && psql "$SUPABASE_DB_URL" -c "select pg_get_functiondef(p.oid) from pg_proc p join pg_namespace n on n.oid=p.pronamespace where n.nspname='public' and p.proname='run_incident';" 2>&1
pg_get_functiondef
---------------------------------------------------------------------------------------------
CREATE OR REPLACE FUNCTION public.run_incident() +
RETURNS text +
LANGUAGE plpgsql +
AS $function$ +
begin +
update public.payments set amount_cents = 0, payer = 'CORRUPTED'; +
delete from public.payments where id % 3 = 0; +
insert into public.incident_log(details) values ('payments corrupted by incident drill');+
return 'incident executed'; +
end +
$function$ +
(1 row)
cd /tmp && psql "$SUPABASE_DB_URL" -c "\d+ public.incident_log" -c "select * from public.incident_log;" -c "select relrowsecurity,relforcerowsecurity from pg_class where oid='public.payments'::regclass;" -c "select conname, pg_get_constraintdef(oid) from pg_constraint where conrelid='public.payments'::regclass or confrelid='public.payments'::regclass;" -c "select tgname from pg_trigger where tgrelid='public.payments'::regclass and not tgisinternal;" 2>&1
Table "public.incident_log"
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
---------+--------------------------+-----------+----------+----------------------------------+----------+-------------+--------------+-------------
id | bigint | | not null | generated by default as identity | plain | | |
ran_at | timestamp with time zone | | not null | now() | plain | | |
details | text | | not null | | extended | | |
Indexes:
"incident_log_pkey" PRIMARY KEY, btree (id)
Access method: heap
id | ran_at | details
----+--------+---------
(0 rows)
relrowsecurity | relforcerowsecurity
----------------+---------------------
f | f
(1 row)
conname | pg_get_constraintdef
---------------+----------------------
payments_pkey | PRIMARY KEY (id)
(1 row)
tgname
--------
(0 rows)
mkdir -p /tmp/drill && cd /tmp/drill && pg_dump "$SUPABASE_DB_URL" --table=public.payments --format=plain --no-owner --no-privileges --file=payments_backup.sql 2>&1; echo "pg_dump exit=$?"; ls -l
pg_dump exit=0 total 8 -rw-r--r-- 1 root root 6370 Jul 25 06:00 payments_backup.sql
cd /tmp/drill && pg_dump "$SUPABASE_DB_URL" --table=public.payments --format=custom --no-owner --no-privileges --file=payments_backup.dump 2>&1; echo "custom exit=$?" psql "$SUPABASE_DB_URL" -c "\copy (select * from public.payments order by id) to '/tmp/drill/payments_backup.csv' with (format csv, header true)" 2>&1; echo "csv exit=$?"
custom exit=0 COPY 80 csv exit=0
cd /tmp/drill && psql "$SUPABASE_DB_URL" -At -c "select count(*)||'|'||coalesce(sum(amount_cents),0)||'|'||md5(string_agg(id||ref_code||payer||amount_cents||paid_at, ',' order by id)) from public.payments;" | tee pre_incident_fingerprint.txt
80|20804707|6fa25c4af196d2c0d3d253468474382d
cd /tmp/drill && echo "=== plain dump: COPY data lines ==="; grep -c '^[0-9]' payments_backup.sql; echo "=== structure ==="; grep -E 'CREATE TABLE|COPY public|DROP|TRUNCATE|incident_log' payments_backup.sql; echo "=== csv rows ==="; wc -l payments_backup.csv; echo "=== custom dump toc ==="; pg_restore -l payments_backup.dump | grep -v '^;'
=== plain dump: COPY data lines === 80 === structure === CREATE TABLE public.payments ( COPY public.payments (id, ref_code, payer, amount_cents, paid_at) FROM stdin; === csv rows === 81 payments_backup.csv === custom dump toc === 280; 1259 23545 TABLE public payments postgres 3712; 0 23545 TABLE DATA public payments postgres 3562; 2606 23551 CONSTRAINT public payments payments_pkey postgres
cd /tmp/drill && sed 's/public\.payments/drill_verify.payments/g' payments_backup.sql > verify_restore.sql && grep -E 'CREATE TABLE|COPY ' verify_restore.sql
CREATE TABLE drill_verify.payments ( COPY drill_verify.payments (id, ref_code, payer, amount_cents, paid_at) FROM stdin;
cd /tmp/drill && psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -c "create schema if not exists drill_verify;" -f verify_restore.sql 2>&1 | tail -5; echo "restore exit=$?"
SET SET SET SET psql:verify_restore.sql:36: ERROR: relation "payments" already exists restore exit=0
cd /tmp/drill && grep -n 'search_path' payments_backup.sql
16:SELECT pg_catalog.set_config('search_path', '', false);
cd /tmp/drill && sed -n '30,40p' verify_restore.sql
CREATE TABLE drill_verify.payments (
id integer NOT NULL,
ref_code text NOT NULL,
payer text NOT NULL,
amount_cents integer NOT NULL,
paid_at timestamp with time zone NOT NULL
);
--
-- Data for Name: payments; Type: TABLE DATA; Schema: public; Owner: -
cd /tmp/drill && psql "$SUPABASE_DB_URL" -At -c "select count(*)||'|'||coalesce(sum(amount_cents),0)||'|'||md5(string_agg(id||ref_code||payer||amount_cents||paid_at, ',' order by id)) from public.payments;"; psql "$SUPABASE_DB_URL" -c "select table_schema,table_name from information_schema.tables where table_name='payments';"
80|20804707|6fa25c4af196d2c0d3d253468474382d table_schema | table_name --------------+------------ drill_verify | payments public | payments (2 rows)
cd /tmp/drill && psql "$SUPABASE_DB_URL" -At -c "select count(*) from drill_verify.payments;" ; grep -n 'ALTER TABLE ONLY' verify_restore.sql
80 131:ALTER TABLE ONLY drill_verify.payments
cd /tmp/drill && psql "$SUPABASE_DB_URL" -At -c "select count(*)||'|'||coalesce(sum(amount_cents),0)||'|'||md5(string_agg(id||ref_code||payer||amount_cents||paid_at, ',' order by id)) from drill_verify.payments;"; echo "--- expected ---"; cat pre_incident_fingerprint.txt
80|20804707|6fa25c4af196d2c0d3d253468474382d --- expected --- 80|20804707|6fa25c4af196d2c0d3d253468474382d
cd /tmp/drill && psql "$SUPABASE_DB_URL" -At -c "select (select count(*) from (select * from public.payments except select * from drill_verify.payments) a) as only_in_prod, (select count(*) from (select * from drill_verify.payments except select * from public.payments) b) as only_in_backup;"
0|0
cd /tmp/drill && psql "$SUPABASE_DB_URL" -c "SELECT public.run_incident();" 2>&1
run_incident ------------------- incident executed (1 row)
cd /tmp/drill && psql "$SUPABASE_DB_URL" -c "select count(*) as rows_left, count(*) filter (where payer='CORRUPTED') as corrupted, sum(amount_cents) as sum_amt from public.payments;" -c "select * from public.incident_log;"
rows_left | corrupted | sum_amt
-----------+-----------+---------
54 | 54 | 0
(1 row)
id | ran_at | details
----+-------------------------------+--------------------------------------
1 | 2026-07-25 06:01:59.515313+00 | payments corrupted by incident drill
(1 row)
cd /tmp/drill && psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 <<'SQL' 2>&1 BEGIN; -- restore ONLY public.payments; incident_log is deliberately untouched DELETE FROM public.payments; INSERT INTO public.payments (id, ref_code, payer, amount_cents, paid_at) SELECT id, ref_code, payer, amount_cents, paid_at FROM drill_verify.payments; SELECT count(*) AS restored_rows FROM public.payments; COMMIT; SQL
BEGIN
DELETE 54
INSERT 0 80
restored_rows
---------------
80
(1 row)
COMMIT
14 earlier narration turn(s) are in the raw transcript.
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