Terraform challenge/infra/
SQL challenge/sql/
Agent challenge/prototype/agent.py
One Postgres in the middle, with a separate role for each thing that touches it.
The agent reads the semantic layer. Reviewers write their decisions. A daily job logs new OPM files. Only the build on the laptop writes the tables the agent reads.
Postgres roles4Owner, agent, reviewer, pipeline.
Agent tools9Eight governed functions and one read-only query.
Scheduled jobs1The OPM watcher, daily at 06:00 UTC.
AWS per month~$14Almost all of it the RDS instance.
How the pieces connect
Every line runs today. The table below names every box.
challenge/infra/main.tf, pipeline.tf · challenge/sql/00_roles, 03_semantic, 04_decisions, 05_pipeline.pg.sql
Every box, where it runs, and what it may touch
| Part | Runs on | Talks to | Note |
|---|---|---|---|
| Workshop app | Lambda, from the repo's one container image | Anthropic API and SSM over IPv6. RDS as agent and as reviewer. | No state on the server. The browser sends the transcript with each turn, and the answer streams back as server-sent events. A ping every 15 s keeps the stream open while the model thinks. A cold start takes about 5 s. |
| Agent | Inside the app process | Eight governed functions, one read-only query tool | claude-haiku-5-5 at xhigh effort, 64,000-token cap. A fresh agent per request. |
| RDS Postgres | AWS, db.t4g.micro, 20 GB | Nothing outbound | Reachable from one laptop address and two security groups, the app's and the loader's. About $14 a month. |
| semantic | RDS | Read by the agent role | Eight views and eight table functions. Read-only transactions, 60 s statement timeout, no other schema. |
| app.decisions | RDS | Written by the reviewer role | One row per Accept, Edit, or Dismiss click. The agent has no grant here, so a decision is always a person's. |
| silver, synthetic | RDS | Owner only | Shipped from the DuckDB build. The eval's truth SQL reads these tables and never the semantic layer. |
| DuckDB build | The laptop | Public files. RDS as owner. | pull_sources.py, then load_postgres.py --ship. 25 acceptance checks pass before anything ships. The window is pinned to September 2025 through August 2026. |
| Eval harness | The laptop | The same agent. RDS as owner for truth. | Every graded run goes to experiments.jsonl, which the metrics dashboard reads. |
| OPM watcher | Two Lambdas, daily 06:00 UTC | OPM API, S3, RDS as pipeline | The fetch Lambda runs outside the VPC to reach OPM. The load Lambda runs inside it to reach RDS. It never touches the agent's tables. About $0.10 a month. |
| Public URL | Cloudflare Worker, free plan | The Lambda Function URL | frontier-lab-challenge.ryanprasad.ai. The Worker passes each request through and streams the answer back. The function leaves the VPC over IPv6, so there is no NAT gateway. |
DECISIONS.md · challenge/prototype/agent.py · challenge/scripts/load_postgres.py · challenge/pipeline/