AI app builder
Foundry
Describe an app, watch an agent build it in a Docker sandbox, and review the preview and diff before anything becomes real.
Foundry is an app builder where you describe an app and an agent builds it inside a Docker sandbox. You review a live preview and a diff, and nothing becomes real or billable until you accept it.
01 / 06 · prompt
Motivation
I started with a prior-art study of 13 builders, from Lovable and Replit to Bolt.new, v0 and OpenHands. My first feature list read like capability areas, not a product. It had no single lifecycle from prompt to export, no real state machines, and no acceptance criteria that forced runtime proof instead of an agent saying it worked.
So I rewrote the spec around one lifecycle (prompt, task, run, diff, preview, verification, checkpoint, deploy, export) and seven product laws. The ones I care about most come from the complaints people have about incumbents. Failed generations never bill. Checkpoint equals commit, so there's one history. Secrets never land in chat, code or commits.
The code is written by agents under a spec-first process, with each claim reviewed by a second model. The point was to see how far that discipline carries a product this size.
Capabilities
- Prompt-first projects home that creates a project and drops you into a three-pane builder: agent timeline, Files, Diff and Preview, and a task and checkpoint column.
- Agent runs through Oh My Pi, one
omp --mode rpcprocess per task inside the sandbox, with streamed prose and grouped tool calls in the timeline. - Seven task modes as a closed type. Discuss and plan structurally can't hold mutating capabilities, and a sensitive capability marked
autois a compile error. - Tool approval in the timeline with Approve and Reject, under a permission mode of Ask, Accept edits, Approve all or Auto.
- Docker sandboxes by default, Firecracker opt-in, behind a preview proxy that strips headers and upgrades WebSockets.
- Checkpoints are real git commits, with scoped restore: code only, preview, deploy config, or everything.
- Cost ledger with credit events, budget caps and settlement. Debits only happen after accept.
- A keyless inference gateway, so sandboxes never hold real provider keys.
Key decisions
Effect everywhere
Why
A browser-safe domain and RPC layer plus a node-only conductor built from Effect services. Typed errors, dependency injection and tracing run end to end, and one Schema decodes at every boundary.
What it cost
The learning curve is steep, and the planned move to Effect v4 starts with about 966 language-service findings to clear.
The sandbox is the wall, accept is the gate
Why
Oh My Pi gave me a full harness (MCP, todos, model roles) without building one. Tools run freely inside the sandbox and nothing becomes real until the diff is accepted.
What it cost
Oh My Pi doesn't expose Foundry's own test and build results, which breaks the golden-path live gate.
Billing boundary equals acceptance boundary
Why
One pure predicate decides whether a task is billable, and the only debit call site sits behind diff accept. That makes "failed generations never bill" code instead of pricing copy.
What it cost
Spend from a turn that dies partway through isn't recorded yet.
Checkpoint equals commit
Why
An internal git store holds the one history. Restore is a checkout and there are no two-way sync conflicts.
What it cost
GitHub sync is manual-first and still a stand-in, so GitHub operations return 501.
SQLite and Drizzle, no raw SQL
Why
git clone && pnpm dev with zero infrastructure, which matters when an agent sets up the stack.
What it cost
Postgres for production is a stated requirement with no driver wired in.
Architecture
The conductor owns every state change. The sandbox talks to models only through the keyless gateway, and the browser reaches the running app only through the preview proxy.
Limits and what's next
- This write-up reflects the project as of 2026-10-12.
- Narrow live specs passed against real models, at about 3 minutes and 45 cents per run. Running the full golden-path spec live needs the agent harness to report test and build results.
- It runs as a single replica. Multi-replica needs a distributed config invalidator.
- Each preview sandbox gets its own Docker network, which caps the default pool at about 31 concurrent previews. A startup reaper keeps the pool clean.
- The Costs screen and line-level diff rendering are next on the UI list.
- Moving restart-time deploys and migrations behind the action executor is fully specced at 51 tasks and is the next big change.