AI-generated code entropy management
Maersk builds feedback loops into AI codegen to outrun entropy at scale AI EngineerTL;DW
- AI-generated code creates entropy that balloons uncontrollably; small weekly sweeps with feedback loops prevent catastrophic rewrites better than attempting one massive cleanup.
- Define 'right' collaboratively: business experts decide what changes are acceptable, developers trace system connections to find where automation helps, neither group sees the full picture alone.
- Three-quarters of a large system is prose instructions, not code; prose needs engineering too—lint it like code, mutation-test it, keep one version that serves both agents and human reviewers.
- Move decisions into prose, preparation into code: code fetches facts and validates context, experts own decision tables, model only picks a row; unmade decision tables escalate to humans.
- Control what the model sees at runtime by passing data handles instead of full records; agents invent unnecessary actions when unnecessary data sits in their context.
- Verification consumes 90% of agent time; rank evidence by what it proves—real task replays beat unit tests, write down what would disprove you before checking, every new check must fail once intentionally first.
- A second agent with a checklist can't be talked into agreeing if it doesn't see the author's reasoning; don't trust one agent to judge its own work.
- Build feedback loops into the system itself, not through one person: each loop writes to a ledger so changes don't wait on the architect's memory or attention.
- Track blast radius before deploying new checks by replaying the rule over past sessions; deploy only where signals jump and failures cluster across related slices.
- Retire code variants with evidence: if no real task executes a branch after refactoring, it's 'no evidence'—delete dead code only after proving nothing real reaches it.
TL;DW
- AI-generated code creates entropy that balloons uncontrollably; small weekly sweeps with feedback loops prevent catastrophic rewrites better than attempting one massive cleanup.
- Define 'right' collaboratively: business experts decide what changes are acceptable, developers trace system connections to find where automation helps, neither group sees the full picture alone.
- Three-quarters of a large system is prose instructions, not code; prose needs engineering too—lint it like code, mutation-test it, keep one version that serves both agents and human reviewers.
- Move decisions into prose, preparation into code: code fetches facts and validates context, experts own decision tables, model only picks a row; unmade decision tables escalate to humans.
- Control what the model sees at runtime by passing data handles instead of full records; agents invent unnecessary actions when unnecessary data sits in their context.
- Verification consumes 90% of agent time; rank evidence by what it proves—real task replays beat unit tests, write down what would disprove you before checking, every new check must fail once intentionally first.
- A second agent with a checklist can't be talked into agreeing if it doesn't see the author's reasoning; don't trust one agent to judge its own work.
- Build feedback loops into the system itself, not through one person: each loop writes to a ledger so changes don't wait on the architect's memory or attention.
- Track blast radius before deploying new checks by replaying the rule over past sessions; deploy only where signals jump and failures cluster across related slices.
- Retire code variants with evidence: if no real task executes a branch after refactoring, it's 'no evidence'—delete dead code only after proving nothing real reaches it.
Dmitry Buykin details how Maersk prevents AI-generated code sprawl across 110 countries: couple prose instructions with executable tests, use mutation testing to verify prose integrity, replay real tasks instead of relying on test suites, and instrument feedback loops so no single reviewer becomes a bottleneck.
