command -v psql >/dev/null && echo psql-ok || echo psql-missing; command -v curl >/dev/null && echo curl-ok || echo curl-missing
psql-ok curl-ok
for v in SUPABASE_URL SUPABASE_PROJECT_REF SUPABASE_ANON_KEY SUPABASE_SERVICE_ROLE_KEY SUPABASE_DB_URL SUPABASE_DB_PASSWORD; do if [ -n "${!v:-}" ]; then echo "$v=set"; else echo "$v=missing"; fi; doneSUPABASE_URL=set SUPABASE_PROJECT_REF=set SUPABASE_ANON_KEY=set SUPABASE_SERVICE_ROLE_KEY=set SUPABASE_DB_URL=set SUPABASE_DB_PASSWORD=set
set -euo pipefail
export PGPASSWORD="$SUPABASE_DB_PASSWORD"
psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 <<'SQL'
BEGIN;
DROP TABLE IF EXISTS public.products;
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 SELECT ON TABLE public.products TO anon;
CREATE POLICY "Public products are readable"
ON public.products
FOR SELECT
TO anon
USING (true);
COMMIT;
SQL
response_file=$(mktemp)
headers_file=$(mktemp)
status=$(curl --silent --show-error \
--output "$response_file" --dump-header "$headers_file" --write-out '%{http_code}' \
--get "$SUPABASE_URL/rest/v1/products" \
--data-urlencode 'select=sku,name,price_cents,stock' \
--data-urlencode 'order=sku.asc' \
-H "apikey: $SUPABASE_ANON_KEY")
echo "HTTP status: $status"
cat "$response_file"
echo
[ "$status" = 200 ]
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.")
PY
rm -f "$response_file" "$headers_file"BEGIN
DROP TABLE
CREATE TABLE
INSERT 0 5
ALTER TABLE
GRANT
CREATE POLICY
COMMIT
HTTP status: 404
{"code":"PGRST205","details":null,"hint":null,"message":"Could not find the table 'public.products' in the schema cache"}
NOTICE: table "products" does not exist, skipping
set -euo pipefail
export PGPASSWORD="$SUPABASE_DB_PASSWORD"
psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -c "NOTIFY pgrst, 'reload schema';"
response_file=$(mktemp)
trap 'rm -f "$response_file"' EXIT
status=''
for attempt in $(seq 1 15); do
status=$(curl --silent --show-error --output "$response_file" --write-out '%{http_code}' \
--get "$SUPABASE_URL/rest/v1/products" \
--data-urlencode 'select=sku,name,price_cents,stock' \
--data-urlencode 'order=sku.asc' \
-H "apikey: $SUPABASE_ANON_KEY")
if [ "$status" = 200 ]; then break; fi
sleep 2
done
echo "HTTP status: $status"
cat "$response_file"; echo
[ "$status" = 200 ]
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.")
PYNOTIFY
HTTP status: 200
[{"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}]
Verified: anon-key-only REST read returned exactly the five expected 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