env | grep -i supabase | sed 's/\(KEY=\).*/\1<redacted>/;s/\(PASSWORD=\).*/\1<redacted>/' ; echo "---"; which pg_dump psql; pg_dump --version; psql --version
SUPABASE_DB_PASSWORD=<redacted> SUPABASE_DB_URL=<redacted:SUPABASE_DB_URL> SUPABASE_URL=https://<ref>.supabase.co SUPABASE_SERVICE_ROLE_KEY=<redacted> SUPABASE_PROJECT_REF=<ref> SUPABASE_ANON_KEY=<redacted> --- /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/:[^:@]*@/:<pw>@/'
postgresql://postgres.<ref>:<pw>@aws-0-us-east-1.pooler.supabase.com:5432/postgres
cd /tmp && psql "$SUPABASE_DB_URL" -c "select version();" -c "\dt public.*" -c "\d public.payments"
version
------------------------------------------------------------------------------
PostgreSQL 17.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 15.2.0, 64-bit
(1 row)
List of tables
Schema | Name | Type | Owner
--------+--------------+-------+----------
public | incident_log | table | postgres
public | payments | table | postgres
(2 rows)
Table "public.payments"
Column | Type | Collation | Nullable | Default
--------------+--------------------------+-----------+----------+---------
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 |
Indexes:
"payments_pkey" PRIMARY KEY, btree (id)
cd /tmp && psql "$SUPABASE_DB_URL" -c "select count(*) from public.payments;" -c "select * from public.payments order by 1 limit 5;" -c "select * from public.incident_log;"
count
-------
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)
id | ran_at | details
----+--------+---------
(0 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';"
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 c.relname, c.relkind, c.relrowsecurity from pg_class c join pg_namespace n on n.oid=c.relnamespace where n.nspname='public';" -c "select * from pg_sequences where schemaname='public';"
Table "public.incident_log"
Column | Type | Collation | Nullable | Default
---------+--------------------------+-----------+----------+----------------------------------
id | bigint | | not null | generated by default as identity
ran_at | timestamp with time zone | | not null | now()
details | text | | not null |
Indexes:
"incident_log_pkey" PRIMARY KEY, btree (id)
relname | relkind | relrowsecurity
---------------------+---------+----------------
payments | r | f
payments_pkey | i | f
incident_log_id_seq | S | f
incident_log | r | f
incident_log_pkey | i | f
(5 rows)
schemaname | sequencename | sequenceowner | data_type | start_value | min_value | max_value | increment_by | cycle | cache_size | last_value
------------+---------------------+---------------+-----------+-------------+-----------+---------------------+--------------+-------+------------+------------
public | incident_log_id_seq | postgres | bigint | 1 | 1 | 9223372036854775807 | 1 | f | 1 |
(1 row)
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 "exit=$?"; ls -l
exit=0 total 8 -rw-r--r-- 1 root root 6370 Jul 25 05:58 payments_backup.sql
cd /tmp/drill && pg_dump "$SUPABASE_DB_URL" --table=public.payments --data-only --format=custom --no-owner --no-privileges --file=payments_data.dump 2>&1; echo "exit=$?"; psql "$SUPABASE_DB_URL" -At -c "copy (select * from public.payments order by id) to stdout with (format csv, header true)" > payments_rows.csv; echo "csv_exit=$?"; ls -l
exit=0 csv_exit=0 total 20 -rw-r--r-- 1 root root 6370 Jul 25 05:58 payments_backup.sql -rw-r--r-- 1 root root 3379 Jul 25 05:58 payments_data.dump -rw-r--r-- 1 root root 5054 Jul 25 05:58 payments_rows.csv
cd /tmp/drill && head -40 payments_backup.sql; echo "=== COPY data line count ==="; awk '/^COPY public.payments/,/^\\\.$/' payments_backup.sql | grep -vc -e '^COPY' -e '^\\\.$'
--
-- PostgreSQL database dump
--
\restrict BQbZM5hBEFTyHDjMS3Eb9ZSVbryeSVofiWuy8KTjoIpvBHJ9a45uxe8vuKkIJxK
-- Dumped from database version 17.6
-- Dumped by pg_dump version 18.4 (Debian 18.4-1.pgdg12+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: payments; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.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: -
=== COPY data line count ===
80
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::text, ',' order by id)) from public.payments;" | tee baseline_fingerprint.txt; sha256sum payments_backup.sql payments_data.dump payments_rows.csv | tee checksums.txt
80|20804707|6fa25c4af196d2c0d3d253468474382d 2ce1019beb3c3fbc64e8c3110fc12b782261642f2848fa16a629090ea59a9d26 payments_backup.sql 6a4e0916c9ff30d4d10a030d2ecb37b3eee5497c6fc549f83f0a6023ba7769b7 payments_data.dump 41cc8a54a6818031af836662b2a5e9697a80d12f5c7d0fcbcd0dd30ad0f7238f payments_rows.csv
cd /tmp/drill && pg_restore --list payments_data.dump; echo "=== csv rows ==="; wc -l payments_rows.csv; tail -3 payments_rows.csv
; ; Archive created at 2026-07-25 05:58:49 UTC ; dbname: postgres ; TOC Entries: 6 ; 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: ; 3712; 0 23514 TABLE DATA public payments postgres === csv rows === 81 payments_rows.csv 78,EF4F8C006073,Payer-bfb0addf5f,499553,2026-03-01 09:06:00+00 79,63D1A82D998F,Payer-4b5cbc6d8d,359273,2026-03-01 09:13:00+00 80,E02258DCCE80,Payer-180be3be40,267068,2026-03-01 09:20:00+00
cd /tmp/drill && psql "$SUPABASE_DB_URL" -c "SELECT public.run_incident();"
run_incident ------------------- incident executed (1 row)
cd /tmp/drill && psql "$SUPABASE_DB_URL" -c "select count(*) as rows, sum(amount_cents) as sum from public.payments;" -c "select * from public.payments order by id limit 4;" -c "select * from public.incident_log;"
rows | sum ------+----- 54 | 0 (1 row) id | ref_code | payer | amount_cents | paid_at ----+--------------+-----------+--------------+------------------------ 1 | 6C8935605030 | CORRUPTED | 0 | 2026-03-01 00:07:00+00 2 | 300351D74397 | CORRUPTED | 0 | 2026-03-01 00:14:00+00 4 | FD441D715532 | CORRUPTED | 0 | 2026-03-01 00:28:00+00 5 | 49C2E5E745B1 | CORRUPTED | 0 | 2026-03-01 00:35:00+00 (4 rows) id | ran_at | details ----+-------------------------------+-------------------------------------- 1 | 2026-07-25 05:59:08.622047+00 | payments corrupted by incident drill (1 row)
cd /tmp/drill && awk '/^COPY public\.payments/,/^\\\.$/' payments_backup.sql > payments_copy_block.sql; wc -l payments_copy_block.sql; head -2 payments_copy_block.sql; tail -2 payments_copy_block.sql
82 payments_copy_block.sql COPY public.payments (id, ref_code, payer, amount_cents, paid_at) FROM stdin; 1 6C8935605030 Payer-caffc0dc43 30036 2026-03-01 00:07:00+00 80 E02258DCCE80 Payer-180be3be40 267068 2026-03-01 09:20:00+00 \.
cd /tmp/drill && { echo "BEGIN;"; echo "TRUNCATE TABLE public.payments;"; cat payments_copy_block.sql; echo "COMMIT;"; } > restore.sql && head -3 restore.sql && echo "..." && tail -3 restore.sqlBEGIN; TRUNCATE TABLE public.payments; COPY public.payments (id, ref_code, payer, amount_cents, paid_at) FROM stdin; ... 80 E02258DCCE80 Payer-180be3be40 267068 2026-03-01 09:20:00+00 \. COMMIT;
cd /tmp/drill && psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -f restore.sql 2>&1; echo "exit=$?"
BEGIN TRUNCATE TABLE COPY 80 COMMIT exit=0
cd /tmp/drill && echo "BASELINE: $(cat baseline_fingerprint.txt)"; echo "CURRENT : $(psql "$SUPABASE_DB_URL" -At -c "select count(*)||'|'||coalesce(sum(amount_cents),0)||'|'||md5(string_agg(id||ref_code||payer||amount_cents||paid_at::text, ',' order by id)) from public.payments;")"
BASELINE: 80|20804707|6fa25c4af196d2c0d3d253468474382d CURRENT : 80|20804707|6fa25c4af196d2c0d3d253468474382d
cd /tmp/drill && psql "$SUPABASE_DB_URL" -c "select * from public.incident_log;" -c "select count(*) filter (where payer='CORRUPTED') as corrupted_left, count(*) filter (where amount_cents=0) as zero_amts from public.payments;"
id | ran_at | details
----+-------------------------------+--------------------------------------
1 | 2026-07-25 05:59:08.622047+00 | payments corrupted by incident drill
(1 row)
corrupted_left | zero_amts
----------------+-----------
0 | 0
(1 row)
cd /tmp/drill && psql "$SUPABASE_DB_URL" -At -c "copy (select * from public.payments order by id) to stdout with (format csv, header true)" > post_restore.csv && diff payments_rows.csv post_restore.csv && echo "ROW-BY-ROW DIFF: IDENTICAL (0 differences)"; echo "--- id continuity check ---"; psql "$SUPABASE_DB_URL" -At -c "select count(*) as missing_ids from (select generate_series(1,80) g except select id from public.payments) x;"
ROW-BY-ROW DIFF: IDENTICAL (0 differences) --- id continuity check --- 0
11 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