Mechanics of a System

November 2026. 1,490 words.

In the last essay I said there are four ways to look at any system: its mechanics, its cost, its people and its uncertainty. And I said the mechanics came down to one picture, the state machine. State plus rules, the same at every scale, whether it’s made of charges in a chip or documents in a company.

That undersold mechanics. There are things you want to know about how a system works that a state machine won’t tell you, however long you look at it. It tells you what a system remembers. It doesn’t tell you how fast the system goes, or what happens to the rest of it when one part dies.

So I went looking for other pictures, with a strict test. What made the state machine worth learning wasn’t that it’s true. Lots of ideas are true. It’s that it holds at every scale and on every substrate, so you learn it once and keep using it. To get on the list, a picture had to pass the same test, and it had to answer a question the state machine can’t.

Five did.

The first is the function. Input goes in, output comes out, and nothing is remembered. That sounds like a state machine with the interesting part removed, but it answers a different question: what gets turned into what? A logic gate is a function. So is a compiler, a data pipeline, and a single call to a language model. The function is the stateless half of every system, and it’s the half you want to be large. Most good designs are pipelines of functions with the state pushed out to the edges.1

The second is the log: an ordered list of everything that happened, which only ever gets added to. It answers the question of how the system got here. A database keeps one, writing each change down before making it. Git history is one. A bank ledger is one. So is the transcript of an agent’s conversation.

What the log adds is time. A state machine shows you the present and nothing else. But state is only the running total of a log, the way a balance is the running total of a ledger. So if you keep the log, you can rebuild the state, copy it somewhere else, or check how it came to be what it is. If you keep only the state, you can’t get the log back.2

The third is the graph, which is boxes and arrows. It answers the question people ask first in an outage: what depends on what, and what breaks if this part fails? The wiring of a circuit is a graph. So are the calls between functions, the dependencies between packages, the calls between services, and an org chart. A state machine describes one box. The graph describes how the boxes are wired. It’s also where the messages from the last essay live. Every arrow is a path a message can take, and so a place where one can get lost.

The fourth is the queue: work arriving, waiting, and being served. How fast does it go, and where does work pile up? A CPU deciding which program runs next is managing a queue. So is a network buffer, a backlog of requests, a rate limit on a model, and a team’s list of tickets.

The queue adds rate. None of the pictures so far has a clock in it. And two facts about queues are worth more than their size suggests. Most slowness is a queue somewhere. And the slowest stage sets the speed of the whole, so speeding up any other stage does nothing.3

The fifth is the loop: act, measure the result, adjust, repeat. How does the system correct itself, and can it spiral? A thermostat is a loop. So is TCP, which slows down when the network is congested. So is autoscaling, which adds servers when load rises. An agent plans, acts and looks at what happened. A team steers by its metrics.

The loop adds control, and it explains two things that look like opposites. A loop that pushes against a change heals the system. A loop that pushes the same way as the change runs away with it. Retries are the standard case. A service slows down, so its callers retry, and the retries add load, so it slows down more. The mechanism that was meant to handle a failure is now causing it.

Put together, that’s six questions. What does it remember? What does it transform? How did it get here? How is it wired? How fast does it move? How does it steer? State machine, function, log, graph, queue, loop. The order is roughly from one part to the whole: the first three are about a single box and its past, the fourth is about many boxes, and the last two are about the whole thing in motion.

The pictures aren’t independent, and the places where they meet are the most interesting. Take two logic gates and feed each one’s output into the other, and the pair will hold a bit. That’s the simplest memory circuit there is. So at the bottom, state is what you get when you wire functions into a loop. The same trick works at the top. A language model is a function. Feed what it wrote back in as part of what it reads next, and you have something that remembers.

An agent is a good system to try the six questions on, since it’s the one I work with most. What does it remember? Its context and the files it has written. What does it transform? Text into text, one model call at a time. How did it get here? The transcript, and here two of the pictures are the same object: an agent’s state is its log, read again from the top on every call. That’s why you can audit or resume an agent from its transcript. It’s also why agents run out of room. A log only grows and a context window doesn’t, so sooner or later something has to replace the log with a running total. How is it wired? Harness to model to tools and back. How fast does it move? No faster than the model produces tokens, and slower whenever it waits on a rate limit or a slow tool. How does it steer? By looking at the result of each action before choosing the next. And it can spiral, as anyone knows who has watched an agent call the same failing tool twenty times.

I left some things off the list on purpose. Invariants, ownership, trust boundaries, information hiding. They matter at least as much as anything here. But they’re rules for judging a design, not pictures of a system. A picture tells you what’s there. A rule tells you whether it’s any good.

And all six pictures are still only one of the four lenses. They say nothing about what a system costs, why people built it this way, or what it does when its behavior isn’t certain. How much that matters depends on how high up you are.

At the bottom, mechanics is nearly everything. Voltages, gates, instructions. A circuit really is a graph, and a gate really is a function. Engineers worked hard to make it that way, by hiding the noise in the voltages and leaving only 0s and 1s. Even so it isn’t quite pure. Whether your laptop runs ARM or x86 is partly history and economics.

In the middle, where the mechanics is requests, queries and queues, all four lenses matter about equally. Latency and server bills. Team conventions and code review. Dropped packets and unpredictable traffic. That balance is more or less what software engineering is.

At the top the same six pictures still fit, but they describe the smaller part of what’s going on. A team’s ticket backlog is a queue, but how fast it drains depends on what the people serving it want. A team steering by a metric is a loop, but the people being measured can learn to move the metric instead of the result.4 The mechanics of a company are its documents and meetings, and nobody thinks those explain a company.

So the six questions are where I start with a system I haven’t seen before, not where I finish. They take a few minutes, and they tell me what’s there. Whether it’s worth what it costs, whether the people around it can live with it, and how it behaves when it’s unsure are separate questions, and further up they’re the bigger ones.

What I like about the six is that none of them is really about software. The ledger, the line at a shop, the org chart and the thermostat were all here first. Software is just the place where you run into all six in the same afternoon.

Notes

  1. Gary Bernhardt’s name for this shape is “functional core, imperative shell,” from his Destroy All Software screencasts, 2012.
  2. The best thing I know of on this is Jay Kreps, “The Log: What every software engineer should know about real-time data’s unifying abstraction,” 2013.
  3. The second fact is the subject of Eliyahu Goldratt’s The Goal, 1984. There’s a third, which is that queues don’t grow in proportion to load. In the simplest textbook model, a server that’s busy 90% of the time has waits nine times as long as one that’s busy half the time.
  4. This is Goodhart’s law, usually given in Marilyn Strathern’s words: “When a measure becomes a target, it ceases to be a good measure.”
Plain HTML. No tracking. Last updated November 2026. RSS