Foundry: the architecture of a software company run by AI agents

Yuchao Cao · October 2026 · LinkedIn · GitHub · also on LinkedIn as an article

With AI as the workforce, one person with the right architecture and enough experience can build a system that used to take a team. That is what this project showed me.

Foundry is the engineering system I designed to build and run Tide Wave, an intraday trading assistant. Claude agents write the code. My part is the architecture: how work is specified, handed out, tested, merged, released and watched. Most of it comes from what I learned in twelve years at Microsoft leading test and engineering teams. The tools are new; the discipline is the same. The agents supplied the typing speed, and the experience supplied the structure that makes their output trustworthy.

This note describes that architecture. It contains no trading logic.

From Microsoft practice to agent scaffolding

What I did at MicrosoftWhat it became in Foundry
A build verification tool so each developer could test on their own box before submittingCrucible, a gated check-in farm: no change reaches master without passing the full suite on a clean machine
Stress tests on idle dev boxes, with a daily stress scoreIdle machines pull work from a shared queue; dashboards show the system's rhythm, so a part that has gone quiet stands out
Model-based testingMinute-by-minute replay of stored market days; every real incident is pinned as a regression case that must fail before the fix and pass after it
Find bugs as early as possibleThe bug database is the centre of the system; every finding from every source becomes a tracked bug with its origin recorded
Building and running a team: hiring, roles, test plansTen AI manager roles with separate authority, written specs as the contract, and capacity treated as headcount

The parts

1. The bug database and its lifecycle

Every unit of work is a bug: a defect, a feature step, a study. A bug moves through a guarded state machine (open, claimed, in Crucible, resolved, reviewing, closed), and every transition is written to an audit trail and published as an event. Agents subscribe to events instead of polling. One bug is one step. Bigger work is split into steps linked by dependencies, so each agent gets a task it can finish and verify.

2. The Project Manager and the workforce

A Project Manager agent reads the open bugs, decides what to do next and dispatches a coding agent into its own isolated git worktree. The workforce is outsourced AI from more than one vendor (Claude, MiniMax). A lesson I learned the hard way: the quality of the spec decides who can do the work. An agent builds from what the bug said when it started and shares none of the context the author had. A quality gate rejects a bug that is not specific, measurable and testable before any agent picks it up.

3. Ten roles, non-overlapping authority

Each decision has one owner: the Project Manager decides what work to do, the Release Manager what ships, the Test Manager what is adequately tested, and the Risk Manager what size the system trades, within limits I set. Further roles cover what the operator sees, client communication, infrastructure, expenses, tax, and compliance and security. Keeping authority separate is what stops agents from overruling one another.

4. Crucible: the gated check-in farm

  1. An agent finishes a fix on a feature branch and submits it. It does not wait; it moves on to its next task.
  2. An idle farm machine claims the candidate from a shared queue. The claim is atomic, so each machine tests one candidate at a time in its own checkout.
  3. The machine rebases the candidate onto the current master and runs the full test suite, with static gates first.
  4. A failure, a rebase conflict, or a test slower than its time budget rejects the candidate. The bug reopens with the failing tests attached. Master is untouched.
  5. A pass goes to a single, serialized integrator that fast-forward merges it into the protected master. Testing runs in parallel; merging happens one candidate at a time.

There is no central dispatcher. Each machine runs a small service that pulls from the queue, so a machine that reboots simply resumes. I chose this design after many agents running the suite on one machine kept colliding and producing flaky results.

Diagram and measured numbers: Crucible: the machine farm and its distributed tasks.

5. Shipping: switches, evidence, and a human in the loop

Every feature ships behind a live switch that can be flipped without a deploy. A trading change ships on only after a recorded before-and-after study on real recent days, judged against fixed release criteria. The machine proposes trade entries and keeps the record; a person approves entries and owns exits. Safety checks stay mechanical, never left to a model's judgment.

6. Replay and simulation

Strategies are replayed minute by minute against stored market history on a Ray cluster. Each of the twelve strategies has its own regression gate. Every run is stamped with its code version and parameters, so a result can be traced to the exact code that produced it.

From hand-coded to AI-coded

The project did not start with AI. I wrote the first trading bots by hand in March 2020, and for almost six years every commit was mine; in 2024 I also built my own code generator that wrote Python from historic trading scenarios, which is why that year has the most commits. The first AI-written commits appear in August 2025; from January 2026 the agents took over most of the writing, and by October 2026 they made more than 80% of the commits. The git history records the shift:

Commits per year: hand-coded 2020 to 2025, AI agents from 2026

Scale (measured November 4, 2026, and still growing)

33,156commits since March 8, 2020; 12,601 by AI agents in 2026
40,480automated tests, run by Crucible on every change
9,959Crucible check-ins since July 10, 2026: 5,932 merged, 3,790 stopped before master
743full-suite runs in one week on 4 machines in parallel, about 8 days of serial testing
20,121bugs tracked; 5,226 resolved with a deployed fix
12Mac minis on one shelf run the farm; 12 trading strategies, each with its own regression gate

The Foundry build farm: 12 Mac minis on one shelf

What I learned

What it shows

I did not write Foundry's code by hand. I built it through architecture: I decided how the work flows, where the gates are, who owns which decision, and what counts as evidence, and then I directed AI agents to build inside that frame. The numbers above are the result of that design, not of typing. Without the experience, the agents would have produced a large amount of code that nobody could trust. With it, they produced a working system.

Why this matters for the work I want next

As a Forward Deployed or AI Platform engineer, the job is the same one I have been doing here: put reliable scaffolding around LLMs so a team can trust what they produce. That means clear specs, isolated work, gated testing, evidence before release, and a human where judgment matters.

More: the Foundry design page (diagrams of the bug lifecycle, a check-in's path through Crucible and the machine farm), the Tide Wave repository, and my LinkedIn profile.

Figures are taken from the system's own records (git history, the Crucible queue and the bug database) on 28 October 2026.