Bring your own trace

Westering reads any JSON file in the trace format. This walkthrough writes one by hand and runs the detectors over it.

1. Write the trace

Record each tool call your agent made as one event, in step order. Set progress to true on a call that moved the goal forward and false on one that did not. Westering does not infer progress, so this field is the judgment you bring.

$ cat examples/bring_your_own_trace.json
{
  "trace_id": "byo-trace-001",
  "goal": "Make the failing unit test pass",
  "tools_available": [
    "read",
    "edit",
    "test",
    "finish"
  ],
  "events": [
    {
      "step": 0,
      "tool": "read",
      "call": "read(path=src/parse.rs)",
      "progress": true
    },
    {
      "step": 1,
      "tool": "test",
      "call": "test(name=parse_empty)",
      "progress": false
    },
    {
      "step": 2,
      "tool": "edit",
      "call": "edit(path=src/parse.rs, line=40)",
      "progress": false
    },
    {
      "step": 3,
      "tool": "test",
      "call": "test(name=parse_empty)",
      "progress": false
    },
    {
      "step": 4,
      "tool": "edit",
      "call": "edit(path=src/parse.rs, line=40)",
      "progress": false
    },
    {
      "step": 5,
      "tool": "test",
      "call": "test(name=parse_empty)",
      "progress": false
    },
    {
      "step": 6,
      "tool": "edit",
      "call": "edit(path=src/parse.rs, line=40)",
      "progress": false
    },
    {
      "step": 7,
      "tool": "test",
      "call": "test(name=parse_empty)",
      "progress": false
    }
  ],
  "synthetic": true
}

The agent read the file, then ran the same test and the same edit in turn, four test runs and three edits, without progress.

2. Run detect

$ ./target/debug/westering detect --trace examples/bring_your_own_trace.json
{
  "detections": [
    {
      "detail": "call pattern of length 2 repeated 3 times with no progress",
      "evidence_span": {
        "end_step": 6,
        "start_step": 1
      },
      "pattern": [
        "test(name=parse_empty)",
        "edit(path=src/parse.rs, line=40)"
      ],
      "shape": "looping",
      "trace_id": "byo-trace-001"
    }
  ],
  "trace_id": "byo-trace-001"
}

The looping detector found the two call cycle. The evidence span covers the steps where the cycle repeated, and detail says how long the cycle was and how many times it repeated.

3. Fix what the detector refuses

A field with the wrong type is refused with one line naming it.

$ printf '{"trace_id":"x","goal":"g","tools_available":["read"],"events":[{"step":1,"tool":"read","call":"read()","progress":"no"}]}' > target/bad_trace.json && ./target/debug/westering detect --trace target/bad_trace.json; echo "exit $?"
error: event progress is not a boolean
exit 2

Where traces come from

Westering reads OpenAI and Anthropic tool call logs directly, Codex session files and Claude Code transcripts among them, as the importing agent logs page shows. For a log in any other shape, convert it into this shape with a short script, and decide per call what counts as progress for your task. Keep real traces out of this repository, as the contributing guide asks.