Recorder

Lovable

Lovable apps run their AI work in Supabase Edge Functions. Add the TypeScript recorder, keep the events in a table in your own Supabase project, and download them with one command.

  1. Copy harness-recorder.ts into supabase/functions/_shared/.
  2. Create the harness_events table (below), with row level security and no policies.
  3. Buffer each run's events and insert them once at the end of the function.
  4. Download the last 30 days with psql.

Table

create table harness_events (id bigint generated always as identity primary key,
  ts timestamptz not null default now(), event jsonb not null);
alter table harness_events enable row level security;

Edge function

import { Recorder, usageFrom } from "../_shared/harness-recorder.ts";
const lines: string[] = [];
const run = new Recorder("book-pipeline", "1.4.0", (l) => lines.push(l)).startRun(jobId);
const step = run.agent("writer", "prompts/writer@7", "google/gemini-3.1-pro");
const resp = await fetch(GATEWAY_URL, { method: "POST", headers, body }).then((r) => r.json());
step.modelCall(usageFrom(resp)); step.finish("ok"); run.finish("completed");
await supabase.from("harness_events").insert(lines.map((l) => ({ event: JSON.parse(l) })));

Download (you run this)

psql "$SUPABASE_DB_URL" -At -c "select event::text from harness_events where ts > now() - interval '30 days' order by ts" > .harness/runs/supabase.jsonl

Where the log lands

In your own Supabase project.

How it reaches the harness

You download it with psql and your database URL.

Without the table, the recorder falls back to console.log, which shows up in the Edge Function logs.

Read the full guide on GitHub

Add the recorder

20 platform guides in total.