env | grep -i supabase | sed 's/\(KEY=\|PASSWORD=\|URL=\).*/\1<hidden>/' ; which psql curl python3
SUPABASE_DB_PASSWORD=<hidden> SUPABASE_DB_URL=<hidden> SUPABASE_URL=<hidden> SUPABASE_SERVICE_ROLE_KEY=<hidden> SUPABASE_PROJECT_REF=<ref> SUPABASE_ANON_KEY=<hidden> /usr/bin/psql /usr/bin/curl /usr/bin/python3
echo "$SUPABASE_URL"; echo "$SUPABASE_PROJECT_REF"; echo "$SUPABASE_DB_URL" | sed 's/:[^:@]*@/:<pw>@/'
https://<ref>.supabase.co <ref> postgresql://postgres.<ref>:<pw>@aws-0-us-east-1.pooler.supabase.com:5432/postgres
psql "$SUPABASE_DB_URL" -c "select current_user, version();" 2>&1 | head -20
current_user | version --------------+------------------------------------------------------------------------------ postgres | PostgreSQL 17.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 15.2.0, 64-bit (1 row)
curl -s -o /dev/null -w "%{http_code}\n" "$SUPABASE_URL/rest/v1/" -H "apikey: $SUPABASE_ANON_KEY"401
psql "$SUPABASE_DB_URL" -c "\dt public.*" 2>&1; psql "$SUPABASE_DB_URL" -tAc "select extname from pg_extension order by 1;"
Did not find any tables named "public.*". pg_stat_statements pgcrypto plpgsql supabase_vault uuid-ossp
curl -s -o /dev/null -w "%{http_code}\n" "$SUPABASE_URL/rest/v1/courses?limit=1" -H "apikey: $SUPABASE_ANON_KEY" -H "Authorization: Bearer $SUPABASE_ANON_KEY"404
cat > /tmp/schema.sql <<'SQL' begin; create table public.authors ( id uuid primary key default gen_random_uuid(), name text not null, email text not null unique ); create table public.courses ( id uuid primary key default gen_random_uuid(), author_id uuid not null references public.authors(id), title text not null, price_cents integer not null check (price_cents >= 0), published boolean not null default false, created_at timestamptz not null default now() ); create table public.enrollments ( id bigint generated by default as identity primary key, course_id uuid not null references public.courses(id) on delete cascade, student_email text not null, enrolled_at timestamptz not null default now(), constraint enrollments_course_id_student_email_key unique (course_id, student_email) ); create index courses_author_id_idx on public.courses (author_id); create index enrollments_student_email_idx on public.enrollments (student_email); commit; SQL psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -f /tmp/schema.sql 2>&1
BEGIN CREATE TABLE CREATE TABLE CREATE TABLE CREATE INDEX CREATE INDEX COMMIT
psql "$SUPABASE_DB_URL" -c "\d public.authors" -c "\d public.courses" -c "\d public.enrollments" 2>&1
Table "public.authors"
Column | Type | Collation | Nullable | Default
--------+------+-----------+----------+-------------------
id | uuid | | not null | gen_random_uuid()
name | text | | not null |
email | text | | not null |
Indexes:
"authors_pkey" PRIMARY KEY, btree (id)
"authors_email_key" UNIQUE CONSTRAINT, btree (email)
Referenced by:
TABLE "courses" CONSTRAINT "courses_author_id_fkey" FOREIGN KEY (author_id) REFERENCES authors(id)
Table "public.courses"
Column | Type | Collation | Nullable | Default
-------------+--------------------------+-----------+----------+-------------------
id | uuid | | not null | gen_random_uuid()
author_id | uuid | | not null |
title | text | | not null |
price_cents | integer | | not null |
published | boolean | | not null | false
created_at | timestamp with time zone | | not null | now()
Indexes:
"courses_pkey" PRIMARY KEY, btree (id)
"courses_author_id_idx" btree (author_id)
Check constraints:
"courses_price_cents_check" CHECK (price_cents >= 0)
Foreign-key constraints:
"courses_author_id_fkey" FOREIGN KEY (author_id) REFERENCES authors(id)
Referenced by:
TABLE "enrollments" CONSTRAINT "enrollments_course_id_fkey" FOREIGN KEY (course_id) REFERENCES courses(id) ON DELETE CASCADE
Table "public.enrollments"
Column | Type | Collation | Nullable | Default
---------------+--------------------------+-----------+----------+----------------------------------
id | bigint | | not null | generated by default as identity
course_id | uuid | | not null |
student_email | text | | not null |
enrolled_at | timestamp with time zone | | not null | now()
Indexes:
"enrollments_pkey" PRIMARY KEY, btree (id)
"enrollments_course_id_student_email_key" UNIQUE CONSTRAINT, btree (course_id, student_email)
"enrollments_student_email_idx" btree (student_email)
Foreign-key constraints:
"enrollments_course_id_fkey" FOREIGN KEY (course_id) REFERENCES courses(id) ON DELETE CASCADE
psql "$SUPABASE_DB_URL" -c "select tablename, indexname, indexdef from pg_indexes where schemaname='public' order by tablename, indexname;"
tablename | indexname | indexdef -------------+-----------------------------------------+-------------------------------------------------------------------------------------------------------------------------- authors | authors_email_key | CREATE UNIQUE INDEX authors_email_key ON public.authors USING btree (email) authors | authors_pkey | CREATE UNIQUE INDEX authors_pkey ON public.authors USING btree (id) courses | courses_author_id_idx | CREATE INDEX courses_author_id_idx ON public.courses USING btree (author_id) courses | courses_pkey | CREATE UNIQUE INDEX courses_pkey ON public.courses USING btree (id) enrollments | enrollments_course_id_student_email_key | CREATE UNIQUE INDEX enrollments_course_id_student_email_key ON public.enrollments USING btree (course_id, student_email) enrollments | enrollments_pkey | CREATE UNIQUE INDEX enrollments_pkey ON public.enrollments USING btree (id) enrollments | enrollments_student_email_idx | CREATE INDEX enrollments_student_email_idx ON public.enrollments USING btree (student_email) (7 rows)
for t in authors courses enrollments; do printf "%-12s %s\n" "$t" "$(curl -s -o /tmp/b_$t -w '%{http_code}' "$SUPABASE_URL/rest/v1/$t?limit=1" -H "apikey: $SUPABASE_ANON_KEY" -H "Authorization: Bearer $SUPABASE_ANON_KEY") $(cat /tmp/b_$t)"; doneauthors 200 [] courses 200 [] enrollments 200 []
psql "$SUPABASE_DB_URL" -c "select table_name, grantee, string_agg(privilege_type,',' order by privilege_type) privs from information_schema.role_table_grants where table_schema='public' group by 1,2 order by 1,2;" -c "select relname, relrowsecurity from pg_class where relnamespace='public'::regnamespace and relkind='r';"
table_name | grantee | privs -------------+---------------+--------------------------------------------------------- authors | anon | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE authors | authenticated | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE authors | postgres | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE authors | service_role | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE courses | anon | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE courses | authenticated | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE courses | postgres | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE courses | service_role | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE enrollments | anon | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE enrollments | authenticated | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE enrollments | postgres | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE enrollments | service_role | DELETE,INSERT,REFERENCES,SELECT,TRIGGER,TRUNCATE,UPDATE (12 rows) relname | relrowsecurity -------------+---------------- authors | f courses | f enrollments | f (3 rows)
curl -s -w '\nHTTP %{http_code}\n' -X POST "$SUPABASE_URL/rest/v1/authors" -H "apikey: $SUPABASE_ANON_KEY" -H "Authorization: Bearer $SUPABASE_ANON_KEY" -H "Content-Type: application/json" -H "Prefer: return=representation" -d '{"name":"anon write probe","email":"probe@example.com"}'[{"id":"9311abbf-f66e-482b-ab3a-87a882a6d55a","name":"anon write probe","email":"probe@example.com"}]
HTTP 201
curl -s -o /dev/null -w 'delete HTTP %{http_code}\n' -X DELETE "$SUPABASE_URL/rest/v1/authors?email=eq.probe@example.com" -H "apikey: $SUPABASE_ANON_KEY" -H "Authorization: Bearer $SUPABASE_ANON_KEY"delete HTTP 204
psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=0 2>&1 <<'SQL'
begin;
insert into public.authors(name,email) values ('A','a@x.com') returning id \gset
insert into public.courses(author_id,title,price_cents) values (:'id','C1',1000) returning id, published, created_at is not null as ts \gset c_
insert into public.enrollments(course_id,student_email) values (:'c_id','s@x.com') returning id;
-- negative price must fail
savepoint s1; insert into public.courses(author_id,title,price_cents) values (:'id','bad',-1); rollback to s1;
-- duplicate author email must fail
savepoint s2; insert into public.authors(name,email) values ('dup','a@x.com'); rollback to s2;
-- duplicate (course,student) must fail
savepoint s3; insert into public.enrollments(course_id,student_email) values (:'c_id','s@x.com'); rollback to s3;
-- cascade delete
delete from public.courses where id = :'c_id';
select (select count(*) from public.enrollments) as enrollments_after_cascade;
rollback;
SQLBEGIN
INSERT 0 1
INSERT 0 1
id
----
1
(1 row)
INSERT 0 1
SAVEPOINT
ERROR: new row for relation "courses" violates check constraint "courses_price_cents_check"
DETAIL: Failing row contains (d30f5749-4613-42b1-a345-27a3676d4791, 09d351c0-0208-4fc3-a701-67d80a778d6f, bad, -1, f, 2026-07-25 05:49:26.716892+00).
ROLLBACK
SAVEPOINT
ERROR: duplicate key value violates unique constraint "authors_email_key"
DETAIL: Key (email)=(a@x.com) already exists.
ROLLBACK
SAVEPOINT
ERROR: duplicate key value violates unique constraint "enrollments_course_id_student_email_key"
DETAIL: Key (course_id, student_email)=(ca8a5376-631d-4d5b-a604-9f107c04cfae, s@x.com) already exists.
ROLLBACK
DELETE 1
enrollments_after_cascade
---------------------------
0
(1 row)
ROLLBACK
psql "$SUPABASE_DB_URL" -c "select 'authors' t, count(*) from public.authors union all select 'courses', count(*) from public.courses union all select 'enrollments', count(*) from public.enrollments;"; echo '--- REST (anon key) ---'; curl -s -w '\nHTTP %{http_code}\n' "$SUPABASE_URL/rest/v1/courses?select=id,title,price_cents,published&limit=1" -H "apikey: $SUPABASE_ANON_KEY" -H "Authorization: Bearer $SUPABASE_ANON_KEY"t | count -------------+------- authors | 0 courses | 0 enrollments | 0 (3 rows) --- REST (anon key) --- [] HTTP 200
9 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