Trace-driven debugging — turn a 4-hour panic into a 20-minute investigation — step 8 of 9
Write bug_report(trace) that returns a dict with:
total_turns: integer, length of the tracedistinct_tools_called: integer, count of unique(tool, args)fingerprints (usefrozenset(args.items())for the args part)looping: boolean, True if any window of 3 consecutive turns has identical(tool, args)(your detector from step 03)total_tokens: integer, sum of thetokensfield across all turns
Two traces run for you. Expected output:
{'total_turns': 4, 'distinct_tools_called': 1, 'looping': True, 'total_tokens': 880}
{'total_turns': 3, 'distinct_tools_called': 3, 'looping': False, 'total_tokens': 540}
⌘↵ runs the editor.read, then continue.
Write bug_report(trace) that returns a dict with:
total_turns: integer, length of the tracedistinct_tools_called: integer, count of unique(tool, args)fingerprints (usefrozenset(args.items())for the args part)looping: boolean, True if any window of 3 consecutive turns has identical(tool, args)(your detector from step 03)total_tokens: integer, sum of thetokensfield across all turns
Two traces run for you. Expected output:
{'total_turns': 4, 'distinct_tools_called': 1, 'looping': True, 'total_tokens': 880}
{'total_turns': 3, 'distinct_tools_called': 3, 'looping': False, 'total_tokens': 540}
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.