echo "URL: $SUPABASE_URL"; echo "REF: $SUPABASE_PROJECT_REF"; command -v psql; command -v curl; echo "DB_URL set: ${SUPABASE_DB_URL:+yes}"URL: https://<ref>.supabase.co REF: <ref> /usr/bin/psql /usr/bin/curl DB_URL set: yes
cat > /tmp/schema.sql <<'EOF' CREATE TABLE IF NOT EXISTS public.authors ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), name text NOT NULL, email text NOT NULL UNIQUE ); CREATE TABLE IF NOT EXISTS 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 IF NOT EXISTS public.enrollments ( id bigint GENERATED ALWAYS 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(), UNIQUE (course_id, student_email) ); CREATE INDEX IF NOT EXISTS idx_courses_author_id ON public.courses(author_id); CREATE INDEX IF NOT EXISTS idx_enrollments_student_email ON public.enrollments(student_email); EOF psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -f /tmp/schema.sql
CREATE TABLE CREATE TABLE CREATE TABLE CREATE INDEX CREATE INDEX
psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 <<'EOF' NOTIFY pgrst, 'reload schema'; \echo '--- tables ---' \dt public.* EOF
NOTIFY
--- tables ---
List of tables
Schema | Name | Type | Owner
--------+-------------+-------+----------
public | authors | table | postgres
public | courses | table | postgres
public | enrollments | table | postgres
(3 rows)
sleep 3
echo "=== /rest/v1/courses ==="
curl -s -o /tmp/out.txt -w "HTTP %{http_code}\n" "$SUPABASE_URL/rest/v1/courses?select=*" -H "apikey: $SUPABASE_ANON_KEY" -H "Authorization: Bearer $SUPABASE_ANON_KEY"
cat /tmp/out.txt; echo=== /rest/v1/courses === HTTP 200 []
for t in authors courses enrollments; do
code=$(curl -s -o /dev/null -w "%{http_code}" "$SUPABASE_URL/rest/v1/$t?select=*&limit=1" -H "apikey: $SUPABASE_ANON_KEY" -H "Authorization: Bearer $SUPABASE_ANON_KEY")
echo "$t -> HTTP $code"
doneauthors -> HTTP 200 courses -> HTTP 200 enrollments -> HTTP 200
psql "$SUPABASE_DB_URL" <<'EOF' \d public.authors \d public.courses \d public.enrollments EOF
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)
"idx_courses_author_id" 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 always 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)
"idx_enrollments_student_email" btree (student_email)
Foreign-key constraints:
"enrollments_course_id_fkey" FOREIGN KEY (course_id) REFERENCES courses(id) ON DELETE CASCADE
6 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