Read Traces and Diagnose Failures¶
What you build¶
traces/ holds four real runs of the habit-tracker harness, recorded by make_traces.py. Each harness was missing something, so each trace contains one failure pattern. In exercise/trace_analysis.py you write:
summary: status, stop reason, iterations, tool calls and errors, blocked calls, verification results, tokensedits_per_file: the stuck-loop signalfirst_problem: where diagnosis startsfiles_read: what the agent saw
Then you diagnose each run.
Steps¶
- Look at a trace:
python -m harnesslab trace ../projects/07-traces-and-diagnosis/traces/run-b.jsonlfrom theharnesslab/folder, or open the JSONL directly. - Implement the four functions;
python -m pytest -q. - Fill in
DIAGNOSIS.mdfor runs A to D using the five questions. - Compare with
solution/ANSWERS.md.
Done when¶
All five tests pass and you have named, for each run, the pattern, the component and the cheapest fix.
Stretch goals¶
- Add a
cost_by_iterationfunction and plot it. - Export a trace to an OpenTelemetry backend (Jaeger, Phoenix) and compare the waterfall.