architecture notes · software factory
A field note on designing an agentic software factory: the architecture, the lessons that shaped it, and one request traced from intent to evidence.
The useful unit is not an agent. It is a controlled flow of intent, work, and proof.— the design constraint behind this repository
01 · the architecture
The system has four boundaries. Product files define what should exist. A deterministic roadmap defines what may start. Isolated workers change code. Tests and an independent audit produce proof before delivery.
Design choice: models propose and implement inside boundaries; small programs own state transitions, dependency calculation, ports, and handoffs.
watch · then argue with me
A useful provocation before the architecture: why skip a development process that already works? The player includes sound and the native timeline, so jump to the part you want.
Andrej Karpathy and Stephanie Zhan on From Vibe Coding to Agentic Engineering. Use the timeline to skip ahead.
02 · follow one request
Select a step. The highlighted message shows what moves, who owns it, and why the next boundary exists.
Step 1 — intent: the product owner’s request becomes a durable PRD. Later agents read the same meaning instead of reconstructing it from chat history.
03 · the support layer
Agentic work becomes useful when the surrounding system handles the boring certainty. A model can reason about a bounded task. A program can dispatch that task, enforce its prerequisites, isolate its files, record its state, and decide what happens next.
Architecture · the control plane around the agents
04 · what changed my thinking
Software development life cycle (SDLC) is the old, boring, unkillable term for "how software actually gets from idea to production": requirements, design, build, test, deploy, maintain. It's been the known-working system for decades. Somewhere in the last two years, a chunk of the industry decided the large language model (LLM) era means skipping every step of it and just typing vibes into a chat box until something compiles.
That's fine for a weekend toy. It is not fine for a codebase you'll still be reading in six months. The people who actually run agents at scale for a living say the same thing, on the record, with receipts:
Andrej Karpathy
Co-founder, OpenAI · ex-Tesla AI · coined the term
"There's a new kind of coding I call 'vibe coding', where you fully give in to the vibes... and forget that the code even exists."
This is the actual lifecycle this repo runs, taken straight from its own README. Every
card below is the same shape: what happens, why it's built that way, and what the raw-vibes version
of that same step usually looks like.
Before any code, the coordinator interviews you for the real product requirements document
(PRD) and outcomes. It gets written to docs/product/PRD.md as the one source of
truth every later agent reads from.
This is Horthy's RPI loop's "Research" step, forced out of your head and into a file. It matters because of the Dumb Zone: dump a vague idea straight into an agent's context and by the time you're 60% through the window, recall is already degrading. Write the distilled version once, and every downstream builder reads that instead of the mess.
docs/architecture/overview.md gets drawn once against the full PRD, before any
feature work starts.
"Own your context window" — one of Horthy's 12 factors. Architecture decided once and referenced by every feature, instead of re-decided inside whatever context window happens to be open that day.
Each feature gets its own mini-PRD and architecture note. roadmap.json encodes the
dependency graph as a directed acyclic graph (DAG), computed by a script, not guessed by a model.
"Own your control flow." Ordering is deterministic code, so it cannot hallucinate a dependency that doesn't exist or forget one that does.
bin/roadmap-sync computes the
DAG and refuses to sync a roadmap that doesn't resolve.bin/kanban-dispatch spins up one low-cost builder subagent per ready ticket, each
in its own Git worktree, running in parallel up to a concurrency cap.
Isolation is the exact guardrail Horthy's failed "dark factory" experiment was missing. Parallel agents stepping on the same files is how a codebase measurably degrades over three to six months, even with strong prompts. Worktrees make interference structurally impossible instead of policy-enforced.
The builder writes structured observability and runs its own deterministic tests against the live app before it's allowed to signal done. It can also write an after-action review (AAR) flagging what to optimize next time.
Anything with an objective pass/fail belongs to the agent that wrote the code, with evidence correlated to the exact commit, not to a person's memory of "yeah I clicked through it and it seemed fine."
bin/prepare-for-test rebases the candidate onto current main and
reruns the whole-project check (bin/project-test) after the rebase, not
before.
This structurally rules out "worked in isolation, broke on integration" — the same failure Horthy names as the reason lights-off factories rot: nobody re-checks after the world underneath them moved.
main actually looks like right now.A separate validator worker checks the builder's claimed criteria and events, without touching product code and without reading the builder's own tests.
The auditor never wrote the code it's auditing, so it's structural independence instead of trust in a self-report. This is Horthy's leverage-point factory in one stage: automate the check, keep a real verification step that isn't graded by the thing being graded.
For anything that needs a human reaction rather than a pass/fail, execution pauses in the browser UI and hands you a scenario card: setup, what to do, what to judge, what's already verified.
Objective checks are automatable. "Does this feel right" is not. Encoding that split instead of asking a model to guess at your taste is the whole point of this stage.
bin/ticket-integrate pushes the literal commit that passed every prior check, not
a re-generated one, and opens the pull request (PR) automatically.
Horthy calls the PR "a batch artifact from the email-patch era" and wants it dead in favor of real-time review. This factory keeps the PR — audit trail and compliance still matter — but automates everything upstream of it, so review collapses toward his ~20-minutes-not-hours number instead of vanishing entirely.
Once GitHub merges into remote main, local main fast-forwards and
bin/github-sync automatically dispatches the next roadmap-ready ticket from the DAG.
The loop closes on its own. Throughput compounds because dispatch doesn't wait on a human to notice a ticket got unblocked — this is the automation Horthy credits for a 2–3x speedup once the upfront planning hour is paid.
None of this is done cooking. Here's what's getting wired into the factory next, not bolted on the side, actually dispatched through the same lifecycle above.
None of this is invented in a vacuum. There's a live cluster of open-source projects attacking "coordinate a fleet of coding agents" from different angles. Worth naming, so it's clear what's already adopted versus what's still being weighed.
Every claim above is a script or a doc path in this repo, not marketing copy. Start with the
README, or go straight to the source.