Put cyclomatic complexity in the agent's context and it refactors on its own — tests passing was never the whole signal
A paper presented at the Agent Evaluation Science Symposium targets a gap every team running coding agents eventually hits: passing tests alone does not reveal accumulating complexity or gaps in test coverage, so an agent can stay green for an entire session while the code it leaves behind becomes progressively harder to maintain. The proposal, metrics-in-the-loop, is to inject automatic code metrics into the agent's context during development rather than reporting them afterward. After each code modification the harness returns two kinds of feedback: a complexity signal when cyclomatic complexity crosses a threshold, and a coverage signal identifying untested lines. That gives the agent the opportunity to refactor and strengthen tests inside the same run, while the change is still fresh in context. The authors report that the intervention reduces what they call erosion — the buildup of complexity concentration — without degrading correctness on held-out tests, and frame it as a practical form of agent re-railing: redirecting the model before technical debt compounds rather than auditing for it later.
Why it matters
Almost every agentic coding harness in production uses a green test suite as its sole acceptance signal, which encodes the assumption that correct and maintainable are the same property. They are not, and the gap compounds silently across a long session — the agent has no reason to refactor because nothing in its feedback loop ever mentions complexity. The design insight is about timing more than metrics: a complexity report delivered after the run is a code review nobody does, while the same number delivered after the edit is something the model can act on immediately and cheaply. It also costs almost nothing to adopt, since the tools that compute cyclomatic complexity and line coverage already run in your CI; the change is moving them from the end of the pipeline into the agent loop.
What to do
Wire your existing complexity and coverage tooling into the agent loop as post-edit feedback rather than post-run reporting — this is a harness change, not a model change, and the tools are already in your repo. Set a threshold that triggers a message rather than a hard failure, since the goal is to give the agent a chance to refactor in the same turn, not to block it. Track complexity concentration across a session, not just per file, because the finding is about erosion accumulating over a long run. And add these metrics to whatever you use to accept agent output, so "tests pass" stops being the entire bar for merging work you did not write.
More from November 20, 2026
- Gemini 4 Neon takes the coding agent top spot at $3/$15 — and 32% lower cost per task than Carbon
- OpenAI publishes its own agent numbers: 46% on two-to-four-hour tasks, 79% on monitoring, 25% on serving code
- OpenAI models rewrote AMD GPU circuits for up to 14% PPA — and one multiplier went from two clock cycles to one
- Genie 4 reaches developers at roughly ten cents a second — 720p interactive worlds with native audio, capped at two minutes
- Google Labs ships an agent that watches your live metrics and opens PRs — three default loops, 180+ integrations, human approval required
- Open OCR now costs under ten cents per thousand pages — a million pages for $65 on a rented GPU
- OpenAI opens Daybreak to NATO and European CERTs — 95% of 88 reported issues across 27 projects were real bugs
- Five of the largest US banks now say an AI agent's losses are yours — including when the agent is the thing that got hacked
- The bipartisan SAFE AI Act outline: government-run pre-deployment evaluations, civil penalties, and a federal floor states can exceed
Related
- Self-Improvement Memory: when the benchmark or the model changes, keep why the edits were made, not just the edits November 19, 2026
- Token caps cost 20 points of task resolution — and telling the agent about its budget buys nothing at all November 19, 2026
- SPLICE optimizes your agent prompt without quietly deleting the clauses you cannot remove November 19, 2026