# Agents Made Code Free. Maintaining It Didn't Get Cheaper. - Dmitry Buykin, Maersk

## Executive summary

While AI coding agents have made generating code nearly free, maintaining large, complex production systems remains challenging. Dmitry Buykin outlines a process for managing this entropy, arguing that continuous, small-scale sweeps and robust feedback loops are necessary. The solution involves moving beyond simple code testing to establish human-owned decision tables (the 'pro' layer) and implementing rigorous runtime guardrails to prevent system drift and ensure that changes are validated against real-world tasks and expert consensus.

## Key takeaways

- Shift Focus from Code to Process (Pro): Code tests are insufficient for validating complex business logic. The 'pro' layer, which contains human-defined rules and decisions, must be treated as a first-class citizen, requiring specialized validation methods beyond traditional unit testing.
- Implement Runtime Guardrails and Context Management: To control AI agents, the system must limit the model's context (the 'mind' stone). The runtime environment must validate context for consistency and ensure the model only sees the necessary, verified facts, preventing over-generalization or hallucination.
- Establish a Single Source of Truth (Ledger): All changes and decisions must be recorded in a persistent ledger. This ledger tracks both 'what happened' and 'what is true now,' ensuring that the next session starts from a verified state and that every change is traceable to its root cause.
- Adopt Continuous, Incremental Auditing: Instead of large, infrequent rewrites, the system must operate through weekly, small sweeps. Gauges (like 'blast radius') and real-world task replaying are used to detect subtle drifts and ensure that every change is validated against live business outcomes.

## Technical details

- Pro vs. Code Validation: The system distinguishes between 'code' (which can be tested) and 'pro' (process/rules). Validation for 'pro' requires human expertise and specialized review, as agents can only fix what is easy to see, leading to potential consistency breaks.
- Mutation Testing: Initially, the team borrowed mutation testing to validate the 'pro' layer, but found that for complex agent instructions and tests, human judgment remains critical for determining what must survive a rewrite.
- Workflow Generation and State Management: When agents repeatedly follow the same path through the 'pro' layer (a 'walk'), that path is converted into a formal workflow tool. The system maintains a boundary where 'code prepares the facts and carries out the decision,' while 'experts own the decision table.'
- Context and Fact Validation: The runtime environment acts as a guardrail, limiting the model's context to verified facts. The model passes a handle (a short name) for data that the runtime already holds, ensuring the context remains small, consistent, and accurate.

## Practical implications

- Implement a dedicated 'pro' layer for business rules that is managed by human experts, separate from the executable code.
- Treat the system's state as a ledger, ensuring every change is logged and traceable to its root cause.
- Build automated 'gauges' (e.g., blast radius) that monitor change derivatives and signal when the system deviates from expected behavior, rather than relying solely on green status indicators.
- Structure the development process to mandate that every new feature or change must fail intentionally at least once before being trusted.

## Topics

AI Engineering, Code Maintenance, Build Process, System Architecture, Process Automation, Dmitry Buykin, Maersk

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