Back to Blog
The test passed. You still don't know what happened.
AI & Machine Learning
10 min read
38 views

The test passed. You still don't know what happened.

System Admin

November 17, 2026

Table of Contents (9)Expand ↓

The test passed. You still don't know what happened.

Your coding agent opened a pull request. The test suite is green. You skim the diff, it looks plausible, and you merge it. Say something breaks two days later, in a part of the codebase the diff never touched.

The agent did something during that run that the final answer did not show you. Maybe it edited a config file, ran one test, and stopped. Maybe it searched for ten minutes and then guessed. The pass/fail score collapsed all of that into a single bit.

A recent paper analyzes the process instead of the score. In one large study, the authors analyzed a corpus of 143,209 execution trajectories from 125 agent configurations spanning 117 unique models. They used a rule-based parser to map raw traces onto high-level actions like repository search, file editing, and test execution (arXiv:2611.17440). A trajectory here just means the ordered log of what the agent did, step by step. The point is to treat agent behavior as something you can observe and compare, not a black box that emits a score.

This article is about doing that in practice: reading an action log, knowing what healthy looks like, and knowing when to stop the run.

What an execution trace actually is

An execution trace is the record of every tool call the agent made, in order, with its inputs and outputs. If your agent can search files, read files, edit files, and run commands, the trace is the sequence of those calls.

The paper's contribution is a parser. It is a rule-based program that maps raw, messy traces onto a small set of high-level action labels. The authors name repository search, file editing, and test execution as examples. Rule-based means the mapping is deterministic: same input, same labels, no model in the loop. That matters because you want to compare runs without the comparison itself drifting.

You do not need their parser to start. You need the same idea: reduce each run to a short sequence of verbs, then read the sequence.

A healthy sequence looks boring

For a typical bug fix, a healthy trace tends to follow a shape:

  1. Search. Find where the relevant code lives.
  2. Read. Open the files the search surfaced.
  3. Edit. Change the smallest set of lines that addresses the problem.
  4. Test. Run something that exercises the change.

It is not a strict law. A tiny typo fix might skip search. A refactor might loop through read and edit several times. That is my reasoning about typical runs, not a finding from the paper. But the shape gives you a baseline. When a trace deviates, you have a question to ask.

The paper found that agents with similar solve rates can differ substantially in how they explore, modify, and verify code. Two agents can both pass the same task. One searched broadly and tested twice. The other edited first and never ran a test. Same score, different process, different risk.

That is the whole argument for auditing process. The outcome is a summary. The sequence is the evidence.

A suspicious sequence looks like this

The pattern worth flagging first is edit before read, test never. The agent changes a file it has not opened, or opens it only after editing. Then it declares done without running anything.

Why is that suspicious? An edit without a read is a guess about surrounding code. A finish without a test is an unverified claim. Neither is proof of a bad change, but both raise the cost of your review.

Other patterns to notice:

  • Search thrash. Many searches, few reads. The agent is scanning names, not understanding code.
  • Edit sprawl. A one-line bug fix touches nine files. Sometimes correct, often not.
  • Test theater. The agent runs a test that cannot fail, such as one that asserts nothing or was skipped or marked pending. Or it runs the whole suite once at the end after a dozen edits. This is my heuristic, not an evidenced finding.
  • Silent retries. The same edit applied, reverted, and applied again. That is often a sign the agent is fighting a failing check it does not understand.

The paper also reports that scaffold choice and reasoning effort systematically shift an agent's search, editing, and testing behavior. Scaffold means the harness around the model: the tools, the loop, the prompts. So the same model under two harnesses can produce different traces. When you compare agents, hold the scaffold fixed or you are measuring the wrong thing.

Turning a trace into a readable summary

Here is a small Node.js script that reads a JSON trace and prints the action sequence. It assumes each entry has a tool name and a path or command field. That is a common shape, but check your own logs first.

🟨JavaScript
import { readFile } from "node:fs/promises";

function classify(step) {
  const tool = (step.tool || "").toLowerCase();
  if (tool.includes("search") || tool.includes("grep") || tool.includes("glob")) return "search";
  if (tool.includes("read") || tool.includes("open") || tool.includes("view")) return "read";
  if (tool.includes("edit") || tool.includes("write") || tool.includes("patch")) return "edit";
  if (tool.includes("test")) return "test";
  if (tool.includes("exec") || tool.includes("bash") || tool.includes("shell")) return "shell";
  return "other";
}

function summarize(steps) {
  const counts = { search: 0, read: 0, edit: 0, test: 0, shell: 0, other: 0 };
  const order = [];
  for (const step of steps) {
    const kind = classify(step);
    counts[kind] += 1;
    if (order[order.length - 1] !== kind) order.push(kind);
  }
  const firstEdit = order.indexOf("edit");
  const firstRead = order.indexOf("read");
  const warnings = [];
  if (firstEdit !== -1 && (firstRead === -1 || firstEdit < firstRead)) {
    warnings.push("edited before reading any file");
  }
  if (counts.edit > 0 && counts.test === 0) {
    warnings.push("made edits but never ran a labeled test");
  }
  if (counts.search > 10 && counts.read < 2) {
    warnings.push("searched a lot, read almost nothing");
  }
  return { counts, order, warnings };
}

async function main() {
  const file = process.argv[2];
  if (!file) {
    console.error("usage: node audit.mjs <trace.json>");
    process.exit(1);
  }
  let steps;
  try {
    steps = JSON.parse(await readFile(file, "utf8"));
  } catch (err) {
    console.error(`could not read ${file}: ${err.message}`);
    process.exit(1);
  }
  if (!Array.isArray(steps)) {
    console.error("trace must be a JSON array of steps");
    process.exit(1);
  }
  const result = summarize(steps);
  console.log("sequence:", result.order.join(" -> "));
  console.log("counts:", result.counts);
  for (const w of result.warnings) console.log("warning:", w);
}

main();

Run it with node audit.mjs trace.json. Tested on Node 18+; no dependencies. The output is a single line like search -> read -> edit -> test, plus any warnings. That line is the thing you read.

The classifier is deliberately crude. String matching on tool names will misfile tools with unusual names. Note one specific trap: shell and exec calls are counted separately, not as tests. A generic bash call that runs ls or git status will not suppress the missing-test warning. If you fold shell calls into test, you can mask a run that never actually ran a test. Keep them apart and read the shell count yourself. You should also log the other bucket so you notice when it grows.

When to intervene, and how

You do not need to watch every run live. You need a few cheap tripwires that fire before the diff gets expensive.

Stop on edit-before-read. If the first edit lands before any read, pause the run and ask for a read. This is the highest-value check because it is early and cheap.

Stop on edit-without-test. If the run ends with edits and zero test executions, do not merge on the agent's word. Run the tests yourself or send it back.

Stop on edit sprawl. Set a threshold for touched files relative to the task. A one-line fix that touches more than a handful of files is worth a human look before the run continues.

Stop on repeated identical edits. If the same file is edited the same way three times, the agent is often stuck in a retry loop. A retry loop rarely fixes the underlying failure. Note that this check requires comparing edit arguments, and the sample script above does not implement it.

These are heuristics, not proofs. A legitimate change can trip all of them. The point is to convert a silent run into a question you can answer in seconds.

If you already run checks on agent output in CI, this slots in beside them. See Testing What Your LLM Agent Actually Did in CI for the surrounding harness. For where review fits in the wider loop, see Agentic Engineering: Planning, Review and Production Triage.

The tradeoff: process signals are noisy

Trusting process over outcome has real costs. Be honest about them.

Signal β€” What it catches β€” What it misses Β· Edit before read β€” Guessing at surrounding code β€” A correct edit to a file the agent already knew Β· No test run β€” Unverified claims β€” A change verified by a check the parser did not label as a test Β· Edit sprawl β€” Overreach β€” A genuinely broad refactor Β· Search thrash β€” Shallow exploration β€” A large repo where search is legitimately expensive

Each row is a heuristic with a false positive. The parser in the paper is rule-based and was audited against a six-model consensus reference on 500 events. That is a validation step against a consensus reference, though the abstract does not report the resulting agreement rate. It does not tell you your parser is accurate on your tools.

There is a second cost. A passing test is a hard signal. A "suspicious sequence" is a soft one. If you gate merges on soft signals, you will block good changes. Treat process warnings as a prompt to look, not an automatic reject.

And a third: the paper notes that task composition was not fully controlled in its cross-repository comparison. In their experiments, aggregate behavioral profiles can retrieve an agent stack across repos and languages. But that does not mean the profile is a clean fingerprint. Your own logs will have the same confound. A run on a huge repo looks different from a run on a small one for reasons that have nothing to do with the agent.

What to log so you can audit later

You cannot read a trace you did not keep. Before you build any analysis, make sure your harness records, for every step: the tool name, its arguments, a timestamp, and whether it succeeded.

The authors release the deterministic parser together with the full annotation and analysis pipeline and an annotated trajectory subset. That is useful as a reference for what a labeled trace looks like. It is not a drop-in for your stack, because your tool names and schemas differ.

Start smaller. Log the raw steps. Write the small summarizer above. Read the sequence line for your next ten agent runs by hand. In my experience, reading ten traces by hand teaches you more than a dashboard would. Treat that as advice, not a measured result.

Once you trust the labels, you can automate the tripwires. Until then, keep a human on the sequence line. If you want to go deeper on harness design, Engineering Practices for Long-Horizon Coding Agents covers the surrounding practices.

Sources

Share

About the Author

Comments (0)

Loading comments...