Skip to content
STUB

Control Loops

The pattern: observe current state, compare to desired state, take action to reduce the difference, repeat forever. Every K8s controller works this way. Every IaC tool works this way. Thermostats work this way. BGP convergence works this way. The loop is the abstraction — once you see it, you see it everywhere.

The trade-off pair: imperative scripts (you tell the system the exact sequence — fragile to partial failures) vs. control loops (you declare desired state, the loop converges — eventually consistent, self-healing, but harder to reason about timing). Control loops trade explicitness for resilience: you don’t always know when the system will converge, but you know it will. The cost is operational opacity (“why hasn’t it reconciled yet?”) and the discipline of writing idempotent actions, since the loop will re-run them.

[Deepen this entry when first hit in Phase 7. This is one of the most load-bearing patterns in the whole library — it shows up at every layer from Year 1 to Year 5.]