All articles

Reliability

Passing Tests Is Not Enough: The SlopCodeBench Lesson

Agent-generated code can pass today and still erode tomorrow. Teams need systems that measure maintainability, semantic fit, architecture drift, and proof of review.

By Brandon W. Lee · Published · Updated

SlopCodeBench is useful because it names a failure mode many engineers already recognize: code can pass the tests and still become worse software.

The benchmark does not prove that all agent-written code is bad. It does not prove that AI coding tools are useless. It does something narrower and more valuable. It measures what happens when coding agents repeatedly extend their own prior solutions across evolving specifications, then tracks whether the resulting code remains maintainable.

The result is uncomfortable. In the paper's Python track, no evaluated agent solved any problem end to end across the full set of checkpoints. The highest checkpoint solve rate was 17.2%. More importantly for working engineering teams, quality degraded over time. Structural erosion increased in 80% of trajectories and verbosity increased in 89.8%. Against maintained open-source Python repositories, agent code was reported as 2.2x more verbose and more structurally eroded.

Those numbers should not be turned into a universal law. Benchmarks are shaped by their task design, model set, harnesses, cost constraints, language choices, and scoring methods. But the pattern matters because it matches the practical experience of many teams adopting coding agents: the first diff looks impressive, the second diff is acceptable, the fifth diff is harder to reason about, and eventually reviewers are cleaning up a codebase the agent has learned to patch rather than design.

That is the SlopCodeBench lesson. Passing tests are necessary. They are not sufficient.

The benchmark is really about extension pressure

Most coding benchmarks ask whether a model can produce a correct answer for a known task. That is useful, but it misses the central property of software work: the first version is rarely the final version.

Real systems evolve. A CLI gains another mode. A parser needs a new language. A service that started with one tenant needs many. A component that worked in one product surface becomes shared infrastructure. The original design decision does not disappear when the next requirement arrives. It becomes the terrain every future change must cross.

SlopCodeBench tries to isolate that dynamic. Agents implement an initial specification, then receive later checkpoints that require extending the same workspace. The benchmark avoids prescribing internal interfaces, so the agent has to choose a structure and then live with the consequences. That design is the important part.

If an agent hardcodes the first behavior into a single function, the tests can pass. When the next checkpoint requires a second behavior, the agent may patch another branch into the same function. When the third checkpoint requires a new abstraction, the agent may wrap the old branch tree instead of extracting the right boundary. Each step is locally rational. Each step can be test-passing. The trajectory still erodes.

This is not an "AI is uniquely sloppy" story. Humans do the same thing under deadline pressure. The difference is scale and speed. Agents can generate more code, faster, with less friction. That means the old technical debt problem becomes easier to manufacture and harder to notice before it reaches review.

The hidden failure is semantic fit

Tests usually ask whether the code satisfies observable behavior. They rarely ask whether the code fits the system.

Semantic fit is the difference between "this works" and "this belongs here." It includes naming, boundaries, data flow, dependency direction, error handling style, operational assumptions, security posture, and the way a change composes with future work.

An agent can satisfy a feature request while violating semantic fit in subtle ways:

  • It adds a helper in the wrong layer because that is where the nearby code was easiest to edit.
  • It duplicates validation logic because the existing policy object was not loaded into context.
  • It creates a generic abstraction for a one-off path because the prompt asked for "clean code."
  • It threads a new option through seven call sites instead of recognizing a missing domain concept.
  • It preserves a bad early decision because rewriting it would require more architectural confidence than the agent has.

None of those failures has to break a unit test immediately. Some will pass integration tests too. The cost appears later, when the next engineer or agent tries to extend the system and finds that the code is technically correct but structurally misleading.

This is why "the agent passed CI" is too small a definition of done. CI is a behavioral gate. It is not a design review, an architecture check, a context audit, or a maintainability evaluation.

Prompting helps, but it is not a control system

One of the most interesting parts of SlopCodeBench is the prompt intervention result. The authors tested quality-aware prompts, including instructions to avoid slop and to plan first. These prompts improved initial quality, but they did not stop degradation from accumulating across iterations. The slope of erosion and verbosity persisted.

That should change how teams talk about agent quality.

The obvious reaction to sloppy agent output is to write a better instruction: "keep the code clean," "avoid duplication," "use best practices," "do not create god functions." Those instructions are not useless. They can improve the starting point. But they are weak as an operating model because they depend on a model applying broad taste words correctly inside a specific codebase under changing requirements.

"Clean" is not a contract. "Maintainable" is not a gate. "Follow best practices" is not a measurable workflow.

The deeper problem is that prompts ask the agent to hold the whole quality system in its head. Teams need to move that quality system into the workspace.

That means code quality needs to be represented as artifacts, checks, routing, and review stages:

  • Architecture notes that define the intended boundaries.
  • Context maps that tell the agent which files are authoritative.
  • Stage contracts that separate planning, implementation, review, and verification.
  • Review checklists that look for semantic fit, not just syntax and tests.
  • Static signals for complexity concentration, duplication, and large-diff risk.
  • Human or agent review gates that compare the diff against the original design intent.

This is the Geist Labs thesis in practical form: agent quality is a systems design problem.

Code volume is not delivery

The industry evidence around AI-assisted development is mixed in exactly the way engineering leaders should expect. There are credible signs that AI tools can increase throughput and individual productivity. Jellyfish reported benchmark data across hundreds of companies, hundreds of thousands of engineers, and millions of pull requests, with high-adoption companies showing much higher PR throughput than low adopters. DORA's 2025 reporting also points to broad adoption and productivity gains.

But throughput is not the same as durable delivery.

DORA's generative AI research found that increased AI adoption can create downstream pressure when teams generate code faster than their delivery systems can absorb it. In that report, a 25% increase in AI adoption was associated with lower delivery throughput and lower delivery stability, with larger batch sizes offered as one explanation. The later 2025 DORA report appears more optimistic on throughput, but still emphasizes the same systems point: AI amplifies the organization around it. Strong feedback loops, small batches, version control discipline, internal platforms, and quality practices determine whether acceleration turns into better outcomes or instability.

This is the right frame for engineering leaders. The question is not "does AI make developers faster?" The better question is:

delivery system question

Can our engineering system absorb faster code generation without degrading maintainability, review quality, and production stability?

If the answer is no, agent adoption will create an illusion of progress. More code will move. More PRs will open. More tests may pass. But review queues, incident load, architectural drift, and rework will rise quietly in the background.

The agent did not create that weakness. It exposed it.

What erosion looks like in a real codebase

Erosion rarely arrives as one catastrophic diff. It shows up as small concessions that make the next concession easier.

A feature starts with a direct implementation because the task is small. The next task adds a flag. The third task adds a conditional for a customer edge case. The fourth task adds a second data shape. The fifth task needs a new interface, but now the interface has to be extracted from logic that already knows too much.

The dangerous part is that every step can have a plausible review story:

  • The diff is small.
  • The tests pass.
  • The deadline is real.
  • The agent followed the local pattern.
  • A refactor feels out of scope.

Over time, the system pays for this through slower future work. Reviewers need more context to evaluate each change. Agents need more tokens to understand tangled code. Tests become more expensive to update because they encode accidental structure. New engineers copy the wrong pattern because it is the pattern they can see.

This is the compounding effect SlopCodeBench makes visible. It is not just redundant lines. It is the concentration of decision-making load in the wrong places.

The review gate has to change

Most teams review AI-generated code with a human code review process designed for human-written code. That is a mismatch.

Human review assumes the author has context, intent, and accountability. The reviewer can ask why a boundary was chosen, why a dependency was introduced, why a test is shaped a certain way. With agent-generated code, those assumptions weaken. The agent may not have read the architecture note. It may not know which local pattern is deprecated. It may preserve a bad structure because the cost of questioning it was too high.

The review gate has to compensate.

A practical agent-code review should ask four questions before it asks whether the code is clever:

  • Did the agent read the right context?
  • Does the implementation match the intended architecture?
  • Did the diff preserve or improve future extensibility?
  • What evidence proves the answer?

That evidence can be lightweight. It does not require a committee or a giant process. For many teams it can be a short review artifact attached to the PR:

Agent Review Evidence

## Agent Review Evidence

- Context loaded: service architecture, API contract, test conventions

- Main boundary touched: billing export service

- Semantic fit check: no new dependency direction, reused existing policy object

- Erosion check: no function over complexity threshold, no duplicated validation

- Verification: unit tests, integration test, focused manual scenario

- Reviewer note: follow-up issue created for pre-existing parser split

The point is not ceremony. The point is to force the workflow to produce proof that the change fits the system.

Build an anti-erosion operating loop

Teams do not need to wait for perfect benchmarks or perfect tools. They can install a better operating loop now.

Start with context routing. Agents should not wander the repository and infer the operating model from whatever files they happen to open. Use `AGENTS.md`, `CONTEXT.md`, architecture notes, and task-specific instructions to define what must be read and what can be ignored. The folder and file system become the control plane. The agent is the runtime.

Add a planning gate. Before implementation, require the agent to state the intended boundary, the files it expects to touch, the tests it will update, and the architectural risk it sees. This catches many failures before code generation begins.

Add an implementation constraint. For changes with extension pressure, require the agent to preserve or introduce a clear interface before adding feature branches. This is especially important for parsers, policy logic, workflow engines, authorization paths, data transformations, and shared UI primitives.

Add a review gate for erosion. Track simple signals:

  • Large functions getting larger.
  • Cyclomatic complexity concentrating in a few callables.
  • Duplicate logic across files.
  • New wrappers around already-confused abstractions.
  • Diff size growing faster than behavior.
  • Tests that assert incidental structure instead of user-visible behavior.

Add a verification gate. The agent is not done when it says done. It is done when it produces evidence: command output, focused tests, screenshots where applicable, static analysis results, review notes, and a clear statement of remaining risk.

Finally, feed repeated review corrections back into the source system. If reviewers keep telling agents not to use a deprecated helper, the fix is not to type that reminder forever. Update the context map, coding standard, or review checklist. Human edits are diagnostic signals. Treat them as source material for improving the agent operating system.

What leaders should measure

Engineering leaders should not measure AI adoption only by seats, prompt usage, accepted completions, or PR volume. Those are activity metrics. They may correlate with value, but they do not prove it.

For agent-generated code, measure the system's ability to absorb change:

  • Review cycle time for AI-heavy PRs versus human-heavy PRs.
  • Rework rate after review.
  • Defects linked to AI-assisted changes.
  • Change failure rate and rollback rate.
  • Batch size and PR size.
  • Complexity concentration over time.
  • Duplication trends in areas touched by agents.
  • Number of review findings caught before merge.
  • Percentage of agent tasks with recorded context, plan, and verification evidence.

The goal is not to punish teams for using agents. It is to create observability around the new failure modes. If AI increases throughput while review quality, stability, and maintainability stay flat or improve, the system is working. If AI increases throughput while erosion rises, the team is borrowing against the future.

The real lesson

SlopCodeBench should not be read as a reason to avoid coding agents. It should be read as a warning against shallow adoption.

Agents are powerful enough to make local progress without global understanding. That is exactly why teams need stronger workflow architecture. The more code an agent can generate, the more important it becomes to define what good code means inside this repository, at this stage of work, under these architectural constraints.

Passing tests answer one question:

test-passing scope

Does this behavior work right now?

Engineering teams need additional questions:

engineering review questions

Does this change fit the system?

Will it be easier or harder to extend next month?

Did the agent use the right context?

What evidence proves the review was real?

What source instruction should improve because of this run?

That is AI Systems Engineering. Not tool hype. Not prompt folklore. Not pretending benchmarks can settle every practical question.

It is the discipline of turning faster code generation into reliable, repeatable engineering systems.

The teams that win with coding agents will not be the teams that accept the most suggestions. They will be the teams that build the best operating loops around them: routed context, stage contracts, architecture-aware review, verification evidence, and feedback paths that improve the system after every run.

Passing tests are still required. They are just no longer enough.

keep going

This article covers one part of a larger system. The AI Systems Engineering Handbook is the whole operating model — fourteen chapters on context, stage contracts, validation, evaluation, cost, and governance.