# Maria Gorinova: Feedback Loops That Fix Your Codebase

## Executive summary

The video details the concept of a 'software factory,' defining it as a system built upon repeatable workflows, a shared execution environment, and, critically, agent feedback loops. These loops allow the system to self-maintain and improve by analyzing data streams (e.g., PR comments, agent session logs) to identify inefficiencies and automatically request fixes. The discussion distinguishes between three types of loops—inner, middle, and outer—and emphasizes that success hinges on defining clear intent and treating the codebase, context, and data as integral parts of the factory itself.

## Key takeaways

- Software Factory Definition: A software factory is defined by three components: repeatable workflows, a shared execution environment, and agent feedback loops, which enable the system to maintain and improve its own quality over time. (00:02:36)
- The Three Stages of a Feedback Loop: A feedback loop operates in three distinct stages: 1) Analyzing a data stream (e.g., past PR comments); 2) Identifying potential problems or inefficiencies; and 3) Suggesting or requesting a fix (which can be code, refactor, or context improvement). (00:09:15)
- Types of Feedback Loops: Loops are categorized by scope: Inner loops operate on a single change (e.g., Verifiers triggered on every PR/CI); Middle loops generalize from many changes (e.g., analyzing agent logs across many sessions); and Outer loops monitor production signals (e.g., service failure or declining DAU) for self-healing. (00:13:16)
- Importance of Clear Intent: Vague intent is the biggest risk; the loop must be highly specific (e.g., a 'comment diet' loop focusing only on reducing comment lines) to avoid becoming a 'god loop' that attempts to fix everything without depth. (00:18:35)

## Technical details

- Agent Context Evolution: Agent capabilities progressed from V1 (agent only) to V2 (agent + context, skills, and hooks). Context allows control over the agent's behavior within a specific repository, defining how the team wants the agent to operate. (00:05:38)
- Verifiers (Inner Loop): Verifiers allow defining specific criteria that code must meet, using an LLM-as-a-judge approach. They are tightly scoped and run on every change (e.g., during CI) to enforce rules not easily covered by standard tests or linting. (00:13:16)
- Drift and Abstraction: Drift is defined as the difference between the expected ideal state and the reality in the codebase. The 'Rule of Three' (writing code three times necessitates an abstraction) is cited as a human pattern that agents must learn to generalize and correct via middle loops. (00:27:45)
- Advanced Loop Concepts: The concept of a 'Meta Feedback Loop' is introduced, which analyzes the performance of the primary feedback loop itself, making the system capable of managing and improving its own processes. (00:27:45)

## Practical implications

- Shift the mindset: Treat your code, context, and data as integral, controllable parts of the software factory, not external entities.
- When building a loop, focus on a specific, observable pain point (e.g., comment bloat) rather than attempting broad, vague improvements.
- For initial implementation, start by analyzing agent session logs or PR review data, as these sources concisely display friction points for improvement.
- Understand the human roles: The 'Operator' manages the factory's main loops (infra role), while the 'Steward' acts as the code owner, ensuring the factory operates correctly within a specific repository.

## Topics

Agentic Workflow, Build Engineering, Software Factories, Feedback Loops, CI/CD, LLM Governance, Tessl

Source: https://www.youtube.com/watch?v=wrRxw15s31k
