Architecture

Giving a codebase a memory

Documentation rots, and what your product does ends up in a few developers' heads. So I stopped writing docs and started extracting them: small, typed, linked notes pulled from the codebase, written for product, with every claim traced back to the line it came from.

From template tag to hydrated component

A React island inside a Django page needs three things: a template tag that records rather than renders, one batched call to a render sidecar, and a browser that hydrates only the IDs the server named. Shared state then lives outside React, in a small store or the URL.

One screen doesn't need a rewrite

You don't need a front-end rewrite to make one screen feel like an app. A small render sidecar lets an existing back-end server render React components, hydrate only the islands that need to be interactive, and leave auth, the ORM, and your templates exactly where they are.

Server actions aren't a React feature

Server actions look like React compiler magic, but underneath they are a name mapped to a function behind one endpoint. You can build the same shape in Django, call it from React or a plain HTML form, and keep validation at the boundary.

AI needs more uncertainty

AI has a confidence problem. Human intelligence was shaped by an uncertain world, and uncertainty is exactly the ingredient AI is missing.

Three Codexes walk into a codebase: The return of the king

Two agents implemented and reviewed a full architecture refactor across five iterations, with zero lines of production code written by hand. What neither agent caught was four innocent lines in a coordinator that had quietly started making policy decisions.

Three Codexes walk into a codebase: The two agents

Codex got the same god class Claude had failed to remove, plus one thing Claude never had: a target architecture. An implementing agent and an independent reviewer then took three rounds to converge, because agents renovate around bad architecture rather than delete it.

A dial, not a switch: staging a risky migration with hash-bucket cohorts

A boolean feature flag starts a risky migration everywhere at once. Hashing a stable tenant ID into 100 buckets turns the flag into a dial that only ever widens, and the thresholds matter: percent-of-tenants is not percent-of-work.

Three Codexes walk into a codebase: The fellowship of the god class

Handing an AI your engineering conventions cleans up the code without fixing the architecture. A 5,000-line god class shrank to 500 lines across tidy domain files, and an independent reviewing agent still returned FAIL: authority never left the central object.

The architecture diagram is dead

Infrastructure documentation goes stale because it is a second thing to maintain. Terraform plus cloud discovery plus a few query tools describes the system better than any diagram, and leaves humans to document only the why behind the odd decisions.

The query that was correct but broke everything else

17 lock-wait timeouts in two hours. The SELECT was doing exactly what it was supposed to. The problem was what InnoDB did silently in addition: a gap lock on the write path, invisible in logs, invisible in EXPLAIN, visible only in production.

Residuality Theory: a different way to think about architecture

Most architecture methods try to predict which failures will hit. Residuality Theory does the opposite: it throws random stressors at a design and keeps whatever survives. The randomness is the point, because resilience that depends on predicting the future is not resilience at all.

Architecture always leaks

Auditing data-heavy companies reveals the same pattern: asynchronous data processing crammed into the synchronous web stack. The contention shows in performance, delivery, and team dynamics. Isolation fixes all three.

LLMs everywhere, even in cars

LLMs are no longer a tab you open. They're the interface layer between intent and every system underneath. This post maps what ambient AI, edge inference, and agent-as-infrastructure mean for how you design modern software.

Your codebase is a palimpsest

Every legacy codebase is a palimpsest: layers of decisions written on top of each other, none fully erased. Geoffrey Dhuyvetters argues that what looks like technical debt is often stratigraphy, and you read it before you rewrite it.

Subscribe