Codex: Supabase Schema Ingestion
Context: The spec-agentic-source-orchestrator requires a specific PostgreSQL schema in Supabase to function (tables: source_pages, source_chunks; function: match_documents). Manual SQL execution is to be avoided.
Mission for Codex
Ingest and apply the schema located at 02_System/vulture-ingest/schema.sql to the active Supabase instance.
Execution Strategy (PowerShell)
Use the following protocol to bridge the schema gap:
- Dependency Check: Check for the
supabaseCLI. If missing, favor a directInvoke-RestMethodapproach using theservice_rolekey. - SQL Execution:
-
- If a
run_sqlRPC or similar "God-mode" endpoint is available in the Supabase project settings, use it. - Otherwise, generate a
apply-schema.ps1script that utilizes thepg_queryor equivalent if available in the environment.
- If a
-
- Verification: After application, execute a
GETrequest to/rest/v1/source_pages?select=id&limit=1to confirm the table is visible to PostgREST.
Schema Reference
The authoritative DDL is maintained at: 02_System/vulture-ingest/schema.sql
Manual Bridge (The "One-Time Fight")
If the automated execution strategy is blocked by missing credentials (e.g., DATABASE_URL) or restricted API access, the following manual step is required to unblock the entire pipeline:
- Open the Supabase SQL Editor: https://supabase.com/dashboard/project/xvzuvsoeeznwmiopsoqj/sql/new
- Paste & Run the DDL: Copy the content from
02_System/vulture-ingest/schema.sqland click Run. - Signal Completion: Once the "Success" message appears, tell the agent: "Schema applied."
Status Update (2026-04-30)
Codex attempted the automated mission and confirmed:
PGRST205: Tables are missing from the schema cache.supabase-cliandpsqlare missing from the host environment.- No
DATABASE_URLis configured in the environment.
Blockage: Automation requires either a direct PostgreSQL connection string or the run_sql RPC to be enabled.
Next Seam
Once the "One-Time Fight" is complete, Gemini will resume Stage 4 (Index) from the cached crawl results in 02_System/.tmp/crawl_result.json.