The telemetry store shared by all three patterns — the durable record the viewer reads, and the span sink the agent loop writes through.
Three tables (see schema.sql): reviews, findings, spans.
DATABASE_URLset → Postgres (durable; required for multi-process queue-agents, where web and worker share state).DATABASE_URLunset → in-memory (keyless, zero-setup local dev).
The public functions have the same shape regardless of backend; the pg path keeps
an optional pool parameter for test injection.
migrate()— create the tables (no-op on the in-memory backend).- Reviews:
createReview,setReviewResult,getReview,listReviews. - Findings:
addFinding,getFindings. - Spans:
getSpans, andstoreTracer()— aTracer(from@workshop/agent) that records agent/LLM/tool spans against a run id. - Row types:
ReviewRow,FindingRow,SpanRow,ReviewResultUpdate.
schema.sql reviews / findings / spans
src/
index.ts public functions; routes to the active backend
memory.ts in-memory backend (per-process)
types.ts row shapes shared by both backends