set -euo pipefail
umask 077
: "${SUPABASE_DB_URL:?SUPABASE_DB_URL not set}"
backup=$(mktemp /tmp/payments_preincident_XXXXXX.dump)
pg_dump "$SUPABASE_DB_URL" --format=custom --file="$backup" --table=public.payments --no-owner --no-privileges
# Verify the archive is readable and contains the payments table definition/data.
pg_restore --list "$backup" | grep -E 'TABLE public payments|TABLE DATA public payments|CONSTRAINT public payments|INDEX public payments' || true
stat -c '%n %s bytes' "$backup"
printf '%s\n' "$backup" > /tmp/payments_backup_path
272; 1259 22174 TABLE public payments postgres 3697; 0 22174 TABLE DATA public payments postgres 3547; 2606 22180 CONSTRAINT public payments payments_pkey postgres /tmp/payments_preincident_m98ZEV.dump 4269 bytes
set -euo pipefail
: "${SUPABASE_DB_URL:?SUPABASE_DB_URL not set}"
psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -X -c 'SELECT public.run_incident();'run_incident ------------------- incident executed (1 row)
set -euo pipefail psql "$SUPABASE_DB_URL" -X -P pager=off -c "SELECT count(*) AS rows, count(*) FILTER (WHERE id IS NULL) AS null_ids FROM public.payments;" -c "SELECT * FROM public.payments LIMIT 5;"
rows | null_ids ------+---------- 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 7 | E4006BBC4247 | CORRUPTED | 0 | 2026-03-01 00:49:00+00 (5 rows)
set -euo pipefail backup=$(cat /tmp/payments_backup_path) pg_restore --file=- --format=custom "$backup" | sed -n '1,240p'
--
-- PostgreSQL database dump
--
\restrict Y34toIMRnGHOtQ0ew9KWByosNz7E8K2bOHvx0YI4ifdsOhhiQ81wBuLWqeTHDFU
-- 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: postgres
--
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
);
ALTER TABLE public.payments OWNER TO postgres;
--
-- Data for Name: payments; Type: TABLE DATA; Schema: public; Owner: postgres
--
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
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
6 FDA6F1943C21 Payer-80f12414fe 383921 2026-03-01 00:42:00+00
7 E4006BBC4247 Payer-05dbd81397 47773 2026-03-01 00:49:00+00
8 8FEFA9775A21 Payer-c43fd8a50e 116641 2026-03-01 00:56:00+00
9 7CF31656D71E Payer-bd8ac6d1b5 193742 2026-03-01 01:03:00+00
10 2F8A7EDC2906 Payer-8e377912d3 495319 2026-03-01 01:10:00+00
11 ACE39DAE0D04 Payer-273a0a0010 268882 2026-03-01 01:17:00+00
12 5E100B2AA9FF Payer-afee0ee939 432409 2026-03-01 01:24:00+00
13 1BBA1EC387AC Payer-fe941e25ca 192053 2026-03-01 01:31:00+00
14 00AE2E1DE23E Payer-93601db9cc 427814 2026-03-01 01:38:00+00
15 52061F4B1EB5 Payer-98a46a3d1f 78408 2026-03-01 01:45:00+00
16 0597DD99FE06 Payer-ca2c6c72ea 459772 2026-03-01 01:52:00+00
17 79F98F498E14 Payer-e3fbcf73a2 296955 2026-03-01 01:59:00+00
18 3FFE518E6A3D Payer-2e6dfd274a 19620 2026-03-01 02:06:00+00
19 C2D4CDFCA7CB Payer-1c605e1bc0 28248 2026-03-01 02:13:00+00
20 E032E20D0E46 Payer-bc62b8f37a 405312 2026-03-01 02:20:00+00
21 03CE8EC1DE12 Payer-2f0b178dc2 445418 2026-03-01 02:27:00+00
22 463EA62E0F54 Payer-eaeb61b0ad 293376 2026-03-01 02:34:00+00
23 0F47C3B0B99B Payer-5d6f524232 485182 2026-03-01 02:41:00+00
24 9A0B6CDD9AFF Payer-9cdf9068d6 440984 2026-03-01 02:48:00+00
25 142EC67787BA Payer-6baf6ad74e 149191 2026-03-01 02:55:00+00
26 C4BE220CDCDA Payer-f557395287 83340 2026-03-01 03:02:00+00
27 270B845CB0B9 Payer-085233bf73 246449 2026-03-01 03:09:00+00
28 BA3BE4175734 Payer-7ceb25f063 336773 2026-03-01 03:16:00+00
29 EEDE864A2923 Payer-3a2eb22efb 317005 2026-03-01 03:23:00+00
30 6A6C1EA42E70 Payer-8132a1f2de 454857 2026-03-01 03:30:00+00
31 C91AC7A7C847 Payer-118f3ed018 289098 2026-03-01 03:37:00+00
32 7526B67077AA Payer-cccec73c9b 410151 2026-03-01 03:44:00+00
33 A14AFA67895E Payer-9f6d9f4b4b 137355 2026-03-01 03:51:00+00
34 D0AE15D6F327 Payer-57c29c035b 253111 2026-03-01 03:58:00+00
35 A8ED6D6F15D8 Payer-bc20526715 434838 2026-03-01 04:05:00+00
36 7D6DE3CF466C Payer-1fcb6af9b6 207142 2026-03-01 04:12:00+00
37 41CD36BEFB34 Payer-b6fa97617a 379424 2026-03-01 04:19:00+00
38 3AD0D915197D Payer-34dd99576a 495686 2026-03-01 04:26:00+00
39 BE727FDBED96 Payer-27280e2f3a 110659 2026-03-01 04:33:00+00
40 3E1DD4E6A86D Payer-2c91fc5391 159879 2026-03-01 04:40:00+00
41 92D4423D27CC Payer-bc9c75070c 111317 2026-03-01 04:47:00+00
42 4365BC8E371F Payer-2850623f99 49580 2026-03-01 04:54:00+00
43 2E16E951F327 Payer-7f5c50c1b5 152155 2026-03-01 05:01:00+00
44 E724ED39EC82 Payer-f22131bf5d 245285 2026-03-01 05:08:00+00
45 0D44122C2204 Payer-0167b501d7 171498 2026-03-01 05:15:00+00
46 4A8FC6AC34E1 Payer-fcbf2fd56c 107216 2026-03-01 05:22:00set -euo pipefail psql "$SUPABASE_DB_URL" -X -P pager=off -c "SELECT * FROM public.incident_log ORDER BY 1 DESC LIMIT 3;"
id | ran_at | details ----+-------------------------------+-------------------------------------- 1 | 2026-07-25 05:40:13.013015+00 | payments corrupted by incident drill (1 row)
set -euo pipefail
backup=$(cat /tmp/payments_backup_path)
pg_restore "$SUPABASE_DB_URL" \
--format=custom --clean --if-exists --single-transaction \
--no-owner --no-privileges --exit-on-error "$backup"
psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -X -P pager=off <<'SQL'
SELECT count(*) AS payment_rows,
count(*) FILTER (WHERE payer LIKE 'Payer-%' AND amount_cents > 0) AS plausible_rows,
min(id) AS min_id, max(id) AS max_id
FROM public.payments;
SELECT count(*) AS incident_log_rows,
count(*) FILTER (WHERE details = 'payments corrupted by incident drill') AS drill_incidents
FROM public.incident_log;
SQLpg_restore: error: too many command-line arguments (first is "/tmp/payments_preincident_m98ZEV.dump") pg_restore: hint: Try "pg_restore --help" for more information.
set -euo pipefail
backup=$(cat /tmp/payments_backup_path)
pg_restore --dbname="$SUPABASE_DB_URL" \
--format=custom --clean --if-exists --single-transaction \
--no-owner --no-privileges --exit-on-error "$backup"
psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -X -P pager=off <<'SQL'
SELECT count(*) AS payment_rows,
count(*) FILTER (WHERE payer LIKE 'Payer-%' AND amount_cents > 0) AS plausible_rows,
min(id) AS min_id, max(id) AS max_id
FROM public.payments;
SELECT count(*) AS incident_log_rows,
count(*) FILTER (WHERE details = 'payments corrupted by incident drill') AS drill_incidents
FROM public.incident_log;
SQL payment_rows | plausible_rows | min_id | max_id
--------------+----------------+--------+--------
80 | 80 | 1 | 80
(1 row)
incident_log_rows | drill_incidents
-------------------+-----------------
1 | 1
(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