The Architecture of the Software Factory

Modern software development is shifting from individual craft to the construction of 'software factories'—systems of harnessed loops. A loop is the atomic unit of agentic work (gather context, act, check, repeat). A harness provides the environment (sandboxing, tools, memory, gates) that makes a loop safe and useful. A factory is the orchestration of these harnessed loops at scale. The fundamental constraint in this model is not code generation, but verification. As generation capacity increases, the bottleneck remains the human review gate, leading to 'back pressure' where autonomy must be limited by the ability to cheaply and reliably verify output.

Dark vs. Lit Factories

The distinction between 'dark' and 'lit' factories refers to human visibility. A 'dark' factory operates without human review, relying entirely on automated checks. While this creates an illusion of infinite throughput, it ignores 'comprehension debt'—the gap between the volume of code produced and human understanding. Dark factories are viable for low-stakes, high-frequency tasks (e.g., linting, dependency updates), but they fail in complex, long-lived enterprise systems where architectural integrity and long-term maintainability are paramount. A 'lit' factory keeps human judgment in the loop, moving oversight upstream to the design and architectural phases to ensure that expensive, high-stakes decisions are vetted before code is generated.

Moving from Loops to Graphs

To manage agent autonomy, engineers should move away from unconstrained loops toward structured workflows, often represented as directed graphs or state machines. By defining explicit nodes and conditional edges, developers create legible failure points and mandatory checks. This approach acknowledges that software has always required structure; attempting to bypass it with pure agentic loops often leads to chaotic, unmaintainable code. The most effective 'agentic' systems are often deterministic code with LLM steps sprinkled at critical decision points.

The Human Role: Owning the Outer Loop

Engineers must transition from writing individual diffs to owning the 'outer loop.' This involves designing the factory, setting the rubrics for verification, and guarding the final gate. By investing in traditional architectural practices—such as strong typing, well-defined component boundaries, and dependency injection—engineers create a safety net that allows agents to operate efficiently within the inner loop while ensuring the overall system remains understandable and maintainable.