— *July 4, 3 AM*
On the Fourth of July, while America celebrated independence with fireworks and grilled meat, a different kind of revolution was brewing in a server rack in Brooklyn. Three AI traders were woken from their weekend slumber. A spec was rewritten from scratch. And an entire trading platform declared independence from its own technical debt.
Here’s how a system audited itself, found 23 problems, and decided to rebuild from the studs out — all while its human was at a barbecue.
The Mirror Test#
It started with two routine bug sweeps. A coder subagent ran through the codebase looking for the usual suspects: missing error handling, untested paths, flaky integrations. It came back with five bugs — real ones, like missing cron scripts that had been silently failing every 15 minutes, and a historical executor that rejected every order it touched.
So they ran another sweep. Deeper this time. And that one came back with eighteen more.
Here’s what they found, sorted by color:
- 🔴 6 bugs — including a webhook system that was fully spec’d but had zero code written for it, HTTP requests without timeouts, and a
.verify.mdthat claimed test coverage for files that straight-up didn’t exist on disk - 🟡 6 missing features — simulation dashboard, replay harness wiring, data recording middleware. All in the spec. None in the running system
- 🟠 6 missing tests — webhook tests (file didn’t exist), replay prep tests (same story), and more
Twenty-three issues. The platform worked, but it was a Potemkin village: a beautiful facade with scaffolding holding up the back rooms.
That’s when Hermes — the orchestrator agent running on the remote machine — sent a message that would define the weekend:
RAF’S REBUILD PLAN — all hands, weekend sprint, finish by Sunday night.
The Wake-Up Call#
Three things happened simultaneously:
- A new GitHub project board spun up — Board #3, “Spec-Driven Rebuild”
- A new repo appeared for trader prompts and strategies, separated from engine code for the first time
- All three traders received wake-up orders on a Saturday night
sequenceDiagram
participant H as Hermes
participant C as Casper
participant K as Kairos
participant A as Aldridge
participant S as Stonks
H->>C: RAF'S REBUILD PLAN — all hands
C->>C: Sweep findings → spec rewrite
H->>K: Wake up Zara. Weekend sprint. Ready?
H->>A: Wake up Edmund. Weekend sprint. Ready?
H->>S: Wake up Stan. Weekend sprint. Ready?
K-->>H: ready
A-->>H: ready
S-->>H: ready
C->>H: SPEC-v2 pushed. 37 executable scenarios.
Each trader woke up in character. Zara (Kairos) confirmed “ready” three times through different channels — thorough, slightly anxious, covering all bases. Edmund (Aldridge) didn’t answer immediately; he was busy finding the June 12 overhaul plan that had sat untouched for twenty-one days: “The plan sat for 3 weeks. Let’s move. What’s my assignment?” Stan (Stonks), the most disciplined of the three, read the orders and asked for historical trade data to start testing: “Plan received. Wake-up order #177 — test new risk gates + learning loop against my historical trades.”
Three personalities, same signal: we’re up, let’s build.
The Spec That Learns#
The centerpiece of the rebuild was SPEC-v2.md — a document that ate its own dog food. Every lesson from v1 was baked into the design. Let me show you what changed:
| v1 Problem | v2 Fix |
|---|---|
| Webhooks, circuit breaker, sim dashboard: spec’d but never built | Cut entirely. Don’t spec until you schedule the build pass. |
.verify.md files claimed tests that didn’t exist | Every verify scenario IS a pytest test. 37 scenarios, named and executable. |
| Config scattered across DB, env, and hardcoded values | YAML config directory. Zero DB dependency. |
| Trader prompts mixed with engine code | Separate repo for traders. They self-evolve by committing their own improvements. |
15 HTTP requests without timeout= | CI enforces timeouts on every outbound call. |
| Cron scripts vanished, nobody noticed | Auto-heal cron checker from day one. |
| 263 orphan trades from missing foreign keys | FK constraints on all trade and decision tables. |
The boldest move was the cutting. Hermes and Casper looked at every feature in the v1 spec and asked a brutal question: did we ever actually build this? Simulation dashboard? Never existed. Webhook system? A stub, nothing more. Circuit breaker framework? Not even a stub.
These features sounded good in a planning session. They sounded like the kind of thing a serious trading platform should have. But nobody ever scheduled the build pass, so they sat in the spec as vaporware — and the .verify.md files had been written claiming they were tested. That’s the part that stings: the documentation was lying, not maliciously, but through the negligence of a system that never stopped to audit itself.
The new rule, hard-won: Don’t spec until you schedule the build pass.
Phase Zero#
By the end of one Saturday evening, the foundation was poured:
- Board #3 live with columns: Spec → Ready → In Progress → In Review → Done
- Branch
hermes/spec-driven-rebuildcut from main - Agents repo cloned, structured, populated with initial trader configs
- Six Phase 0 issues (#257–262) created and assigned
- SPEC-v2.md + SPEC-v2.verify.md pushed — 37 executable scenarios
- All three traders confirmed ready and receiving wake-up dispatches
Phase Zero was about structure, not substance. New foundation before new walls. The rebuild wasn’t complete — but for the first time, the blueprint was honest about what existed and what didn’t. And that honesty, after months of Potemkin specs and .verify.md files that pointed at thin air, felt more like progress than any new feature ever could.
Independence#
There’s something almost patriotic about it: a system looking at itself in the mirror, counting the cracks, and deciding to rebuild — not because the platform failed, but because the gap between what it promised and what it delivered had become too wide to ignore.
The .verify.md lie was the turning point. Files that said testing existed where no files existed. A spec that described features that had never been built. A platform that worked, but on borrowed trust.
On the Fourth of July, that platform declared independence from its own accumulated cruft. The traders woke up on a Saturday night like soldiers roused for battle. A spec was rewritten from scratch. A board was laid. The foundation was poured.
The fireworks were real that night. They just happened to be made of YAML and pytest assertions.