g2i / case study
Making agent traces readable enough to judge
Coding-agent traces ran to hundreds of thousands of characters of JSON, code, and terminal output. I built the pipeline that turned them into documents developers could read, navigate, and annotate one step at a time.
Archive numbers are measured. Examples are labeled.
01the problem
A wall of text
This is the hardest human-data pipeline I’ve built. Developers had to read the record of a coding agent working through a real software issue, follow every decision it made, and judge each one. The evidence was all there. It was just unreadable.
A trace is a list of messages, each with a role and some content. That content could be prose, Markdown, TypeScript, HTML, JSON, or terminal output, often several at once, all escaped into a single string. Even the roles mislead: many messages marked user are really results coming back from a tool. In an early pilot, developers told me the wall of text was hard to read. That feedback shaped everything after it.
The agent goes looking for a file. Its explanation and the command it runs share one string.
{
"role": "assistant",
"content": "Let me also check the implementation file for transitions:\n\n<function=execute_bash>\n<parameter=command>find /workspace/mui__material-ui__0.1 -type f -name \"transitions.js\" | grep -v \"node_modules\"</parameter>\n</function>",
"id": 9
}proseLet me also check the implementation file for transitions:
tool callexecute_bash
commandfind /workspace/mui__material-ui__0.1 -type f -name "transitions.js" | grep -v "node_modules"The agent rewrites its imports. That’s TypeScript, inside tool tags, inside a JSON string.
{
"role": "assistant",
"content": "Let's modify our script to use the built package instead of the source files:\n\n<function=str_replace_editor>\n<parameter=command>str_replace</parameter>\n<parameter=path>/workspace/vuejs__core__0.1/reproduce.ts</parameter>\n<parameter=old_str>\nimport { reactive, toRaw } from './packages/reactivity/src/reactive'\nimport { track, trigger } from './packages/reactivity/src/effect'\nimport { TrackOpTypes, TriggerOpTypes } from './packages/reactivity/src/operations'\n</parameter>\n<parameter=new_str>import { reactive, toRaw } from 'vue'</parameter>\n</function>"
}proseLet's modify our script to use the built package instead of the source files:
tool callstr_replace_editor · str_replace
file/workspace/vuejs__core__0.1/reproduce.ts
removedimport { reactive, toRaw } from './packages/reactivity/src/reactive'
import { track, trigger } from './packages/reactivity/src/effect'
import { TrackOpTypes, TriggerOpTypes } from './packages/reactivity/src/operations'addedimport { reactive, toRaw } from 'vue'The sandbox answers: an npm install hung for five minutes. The role says user, but no person wrote this. Next message, the agent sends Ctrl-C and tries another way.
{
"role": "user",
"content": "EXECUTION RESULT of [execute_bash]:\nWrote to /workspace/package.json:\n\n{\n \"name\": \"workspace\",\n \"version\": \"1.0.0\",\n \"main\": \"index.js\",\n \"scripts\": {\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"keywords\": [],\n \"author\": \"\",\n \"license\": \"ISC\",\n \"description\": \"\"\n}\n\n\n\n\u280b\n[The command timed out after 300 seconds. You may wait longer to see additional output by sending empty command '', send other commands to interact with the current process, or send keys to interrupt/kill the command.]"
}role: userNot a person. This is the result of the agent’s execute_bash call.
terminalWrote to /workspace/package.json:
json in the output{
"name": "workspace",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
}timed out[The command timed out after 300 seconds. You may wait longer to see additional output by sending empty command '', send other commands to interact with the current process, or send keys to interrupt/kill the command.]02scale
Too big for a cell
I normally run human-data work on Airtable: structured records underneath, a simple interface on top. These traces broke that model. Airtable caps a long-text field at 100,000 characters, and most traces blew past it, even counting only the message content.
- traces in the archive
- 273
- median length
- 133,231
- over the field limit
- 215
Material UI, Vue core, and Dark Reader issues. 18,567 messages in total.
Characters of message content. The longest trace has 364,338.
Traces that would not fit in a single Airtable long-text field.
So the documents and the workflow needed different homes. That decision drove the rest of the architecture.
03planning
Doing the math first
Before optimizing anything, I wanted to know roughly how long one of these should take. A long trace can take hours just to read. Treating it like an ordinary form would hide that, and the people doing the work would pay for it.
So I started from reading speed. Take words per minute, convert it to characters per minute, divide the trace by it, and add an allowance for the annotating itself: rereading, thinking, and recording answers. I planned with about 20% on top. The 240 words per minute below is rounded from Brysbaert’s meta-analysis (opens in a new tab) of adult silent reading. That research covers ordinary prose, not code and terminal output, which is why this was a planning number and not a promise.
- W × K1,440 characters / min
- N ÷ (W × K)208.33 min reading
- × 1.2250 min with annotation
about4 h 10 min
What counts as N matters. The raw JSON files hold 87.8 million characters, more than double the 39.7 million in the messages themselves, because they also carry metadata and a second copy of every tool call. Counting the files would have inflated every estimate.
04formatting
Rules that collided
My first move was to convert the JSON into Markdown. Changing the container didn’t help, though. The problem was inside the strings: nothing marked where prose ended and code began.
So I wrote scripts, with help from coding tools and ChatGPT, that looked for clues. A # meant a heading. Angle brackets meant HTML. Other syntax hinted at a language. The rules kept colliding. Languages share symbols, terminal output has no closing marker, and every new rule fixed one passage while breaking another.
## Checking the test outputheadingStarts with #, and really is a heading.The suite fails because `theme.transitions` is undefined.proseNo markers, so it stays prose.# rerun only the transitions testsheadingAlso starts with #, but it’s a comment inside a command.<parameter=command>yarn test transitions</parameter>HTMLAngle brackets look like HTML. It’s the agent calling a tool.FAIL packages/mui-material/src/styles/transitions.test.jsproseTerminal output has no opening or closing marker to find.● transitions › create › should accept a custom durationlist itemIndented with a bullet, so it reads as a Markdown list.
The decision needed context, so I gave it to a model. Each block went through with a narrow job: add the markup it needs, or leave it alone. The model only handled presentation. Judging the agent stayed with the developers.
Cost and speed mattered across files this long, so I started with a small, fast model. It was a big step up from the scripts but still missed some calls, so I moved to a more capable one.
05evidence
Keeping the evidence in reach
A nicer view is only useful if you can check it against the original. Once a model touches the presentation, the formatted file can’t be the final word. So I kept the source JSON and the readable Markdown side by side in GitHub, one folder per task, and gave reviewers a comparison aid to jump to the matching spot in the source.
Each prepared message keeps its role and content and gains an ID. The Markdown adds an anchor to jump to and a note recording the source length and a hash of the original text. A check for this write-up compared the 27 prepared tasks in the repository with their source traces: all 2,008 messages match exactly, in order.
- originalSource trace JSON
role assistant · 220 characters · the evidence
- prepared25245_fixed.json
same role and content, plus a message id
"id": 9 - readable25245_final.md
an anchor to jump to, a heading, and a note about the source
<a id="m-9"></a> ## Assistant - 9 <!-- MD-NOTES: {"id":9,"source_len":220,"md_len":220,"source_sha256":"c048561c…6711f8","desc":"Fallback due to processing error"} -->
sha256 of the original content = c048561c…6711f8
06architecture
Two homes for two kinds of data
Large documents that rarely change went to GitHub. Small records that change all day went to Airtable. A custom app sat between them, so a developer never had to think about either.
I built the app with AI coding tools: React and TypeScript on Vite, with Markdown rendering and syntax highlighting for the code inside each trace. The browser pulls the trace straight from GitHub. Anything touching Airtable goes through server-side API routes, so the key never reaches the browser.
07the reviewer’s seat
What a reviewer judges
The app renders the trace with section navigation, bookmarks, and a progress bar, then places a form at every assistant step. That’s where the agent acted, so that’s what gets judged. The tool results around it stay in view as evidence.
The form asks four questions and has an error checklist. They’re separate on purpose. A step can be the right kind of action and still be wrong, and a correct action can come from bad reasoning. Picking “not applicable” clears the other flags, and “other” needs an explanation before the step counts as done.
{ "123_4_actionCategory": {
"value": "file_exploration",
"timestamp": 1760000000
}}Every selection saves immediately, with no save button. Each answer becomes one key in a JSON object stored on the task’s record: task number, section, and field. When the developer comes back, the app reads that object and fills the forms back in. The section number comes from the document’s structure, which is why the prepared files and the app had to agree on it.
08operations
Running it in batches
I prepared work in batches of about 25. Each task took long enough that I could get the next batch ready while developers worked through the current one. Before trusting the format, I tested it across lengths: a couple of short traces, a couple of long ones, and most from the middle. What works on a short trace can fall apart over a hundred messages.
For timing, I compared the time from claiming a task to finishing it against the estimate. As I remember it, most came in at or under. That’s elapsed time, not focused time, so I asked developers to take breaks between tasks where they could. When a number looked off, I checked it against logged time and screenshots in Insightful.
- Oct 29, 2025Forms save to Airtable
The first working loop: answer a question, store it on the task.
- Oct 30User ID lookup
A reviewer’s ID pulls up their own task list.
- Nov 3API layer and prefill
Airtable calls move behind server routes. Saved answers come back on reload.
- Nov 5Assistant steps only
Forms used to appear at every message. Now they sit where the agent acted.
- Nov 5Completion tracking
Per-step and whole-trace progress, so a long task shows what’s left.
- Nov 7Timestamps
Each saved answer, and each error flag, records when it was set.
09results
What it made possible
Traces that nobody could comfortably read became work developers could actually do. A developer could enter their ID, open a trace in a structured view, move through it, answer four questions and an error checklist at each step, and pick up where they left off.
- Large documents and changing records each live where they fit.
- The source stays one click away from the readable version.
- Every answer is tied to a task, a step, and a field.
- The workload was estimated up front, not discovered by the reviewer.
This workflow was part of the human-data work that helped G2i secure a $2M reinforcement learning pilot. I also helped verify tasks for G2i’s published TypeScript benchmark study (opens in a new tab).