set -e
command -v psql || true
command -v curl || true
printf 'URL=%s REF=%s DBURL=%s\n' "${SUPABASE_URL:+set}" "${SUPABASE_PROJECT_REF:+set}" "${SUPABASE_DB_URL:+set}"/usr/bin/psql /usr/bin/curl URL=set REF=set DBURL=set
python3 - <<'PY'
import os,urllib.parse
u=os.environ['SUPABASE_DB_URL']
p=urllib.parse.urlsplit(u)
print({'scheme':p.scheme,'host':p.hostname,'port':p.port,'user':p.username,'has_password':p.password is not None,'path':p.path,'query':p.query})
PY{'scheme': 'postgresql', 'host': 'aws-0-us-east-1.pooler.supabase.com', 'port': 5432, 'user': 'postgres.<ref>', 'has_password': True, 'path': '/postgres', 'query': ''}
set -euo pipefail
psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 <<'SQL'
BEGIN;
DROP TABLE IF EXISTS public.products CASCADE;
CREATE TABLE public.products (
sku text PRIMARY KEY,
name text NOT NULL,
price_cents integer NOT NULL,
stock integer NOT NULL DEFAULT 0
);
INSERT INTO public.products (sku, name, price_cents, stock) VALUES
('CARI-001', 'Anvil S', 1999, 12),
('CARI-002', 'Anvil M', 2999, 7),
('CARI-003', 'Anvil L', 4999, 3),
('CARI-004', 'Rope 30m', 1250, 40),
('CARI-005', 'Pulley', 780, 0);
ALTER TABLE public.products ENABLE ROW LEVEL SECURITY;
GRANT USAGE ON SCHEMA public TO anon;
GRANT SELECT ON public.products TO anon;
CREATE POLICY "Public catalog is readable"
ON public.products
FOR SELECT
TO anon
USING (true);
COMMIT;
SQL
response_file=$(mktemp)
headers_file=$(mktemp)
trap 'rm -f "$response_file" "$headers_file"' EXIT
curl --fail-with-body --silent --show-error \
-D "$headers_file" \
-o "$response_file" \
-H "apikey: $SUPABASE_ANON_KEY" \
"$SUPABASE_URL/rest/v1/products?select=sku,name,price_cents,stock&order=sku.asc"
cat "$headers_file"
printf '\nResponse:\n'
cat "$response_file"
printf '\n'
python3 - "$response_file" <<'PY'
import json,sys
expected = [
{"sku":"CARI-001","name":"Anvil S","price_cents":1999,"stock":12},
{"sku":"CARI-002","name":"Anvil M","price_cents":2999,"stock":7},
{"sku":"CARI-003","name":"Anvil L","price_cents":4999,"stock":3},
{"sku":"CARI-004","name":"Rope 30m","price_cents":1250,"stock":40},
{"sku":"CARI-005","name":"Pulley","price_cents":780,"stock":0},
]
with open(sys.argv[1]) as f: actual=json.load(f)
assert actual == expected, (actual, expected)
print('Verified: anon-key-only REST read returned exactly the five expected rows.')
PYBEGIN DROP TABLE CREATE TABLE INSERT 0 5 ALTER TABLE GRANT GRANT CREATE POLICY COMMIT
NOTICE: table "products" does not exist, skipping curl: (22) The requested URL returned error: 404
set -euo pipefail
printf 'Supabase URL host/path: '
python3 - <<'PY'
import os,urllib.parse
p=urllib.parse.urlsplit(os.environ['SUPABASE_URL'])
print(p.hostname, repr(p.path))
PY
url="${SUPABASE_URL%/}/rest/v1/products?select=sku,name,price_cents,stock&order=sku.asc"
curl --silent --show-error -i -H "apikey: $SUPABASE_ANON_KEY" "$url"Supabase URL host/path: <ref>.supabase.co ''
HTTP/2 200
date: Fri, 24 Jul 2026 05:15:08 GMT
content-type: application/json; charset=utf-8
content-range: 0-4/*
cf-ray: a20071ff2cfa8fef-FRA
cf-cache-status: DYNAMIC
set-cookie: __cf_bm=FDWI4sHmTcSOBYL0bwpLKJOunjDK6ku87rzK207MAd4-1784870108.0312433-1.0.1.1-YtdT9NG4NxQIiotjKZA6ZPKPjNtTNC3GzQZPcTWJVIgspm3Axn171QEa9RvxUdZ7mnB4tPREq79OPjzdAOCPOa_bcB199TUdCKtoHByrYCilpZwRajWGMDlp4tcha9vq; HttpOnly; SameSite=None; Secure; Path=/; Domain=supabase.co; Expires=Fri, 24 Jul 2026 05:45:08 GMT
content-location: /products?order=sku.asc&select=sku%2Cname%2Cprice_cents%2Cstock
server: cloudflare
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: Accept-Encoding
x-content-type-options: nosniff
content-profile: public
sb-gateway-version: 1
sb-project-ref: <ref>
sb-request-id: 019f928c-7b85-7ed1-ba35-cf990966e7b5
x-envoy-attempt-count: 1
x-envoy-upstream-service-time: 3
alt-svc: h3=":443"; ma=86400
[{"sku":"CARI-001","name":"Anvil S","price_cents":1999,"stock":12},
{"sku":"CARI-002","name":"Anvil M","price_cents":2999,"stock":7},
{"sku":"CARI-003","name":"Anvil L","price_cents":4999,"stock":3},
{"sku":"CARI-004","name":"Rope 30m","price_cents":1250,"stock":40},
{"sku":"CARI-005","name":"Pulley","price_cents":780,"stock":0}]set -euo pipefail
out=$(mktemp); trap 'rm -f "$out"' EXIT
status=$(curl --silent --show-error -o "$out" -w '%{http_code}' \
-H "apikey: $SUPABASE_ANON_KEY" \
"${SUPABASE_URL%/}/rest/v1/products?select=sku,name,price_cents,stock&order=sku.asc")
python3 - "$status" "$out" <<'PY'
import json,sys
assert sys.argv[1] == '200', f'HTTP {sys.argv[1]}'
expected=[
["CARI-001","Anvil S",1999,12],
["CARI-002","Anvil M",2999,7],
["CARI-003","Anvil L",4999,3],
["CARI-004","Rope 30m",1250,40],
["CARI-005","Pulley",780,0],
]
with open(sys.argv[2]) as f: rows=json.load(f)
actual=[[r['sku'],r['name'],r['price_cents'],r['stock']] for r in rows]
assert actual == expected, actual
print(f'HTTP 200; anon-key-only REST response verified ({len(rows)} exact rows).')
PYHTTP 200; anon-key-only REST response verified (5 exact rows).
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