## _metric_qualify
{"event":"x","task_id":"T-1"}
{"event":"x","task_id":"T-1","story_id":"STORY-7"}
{"event":"x","bug_id":"BUG-1","story_id":"STORY-7"}
{"event":"x","task_id":"T-1","story_id":"STORY-1"}
{"event":"x"}
{"event":"x","task_id":"T-1"}
## emit_metric
## record_dispatch_cost: reported
LOG   $ T-1 has spent $0.5000 (warn threshold $0.40)
RUN_COST_USD=0.5000 RUN_COST_DISPATCHES=1
## record_dispatch_cost: unreported, estimated from the role's history
ERR   ! T-1 has spent $1.5000 — past the $1.00 escalation threshold.
ERR     Advisory: runner-reported, not metered billing. Worth a look at whether it is converging.
## record_dispatch_cost: reported again (crosses the escalation threshold)
RUN_COST_USD=1.7000 RUN_COST_DISPATCHES=3
## record_dispatch_cost: unavailable (no event, no estimate)
## queries
_role_cost_rate implementer=0.01000000
_role_cost_rate planner=[]
task_spend_usd T-1=2.7000
task_spend_usd T-none=0.0000
run_spend_metrics=1.7000	3	1	1.0000
run_spend_summary=$1.7000 across 3 priced dispatch(es), 1 dispatch(es) reported nothing (~$1.0000 more estimated for those, from this role's own history — order of magnitude, not a bill) — runner-reported spend from metrics.jsonl (advisory, not metered billing); dispatches on an adapter without `cost.report` are excluded, so this is a floor.
run_spend_metrics(from line 2)=1.2000	2	1	1.0000
## the ledger as written
{"v":2,"run_id":"run-golden","event":"task_started","task_id":"T-1","at":"2026-10-17T00:00:00Z","story_id":"STORY-7"}
{"v":2,"run_id":"run-golden","event":"runner_cost","role":"implementer","task_id":"T-1","story_id":"STORY-7","adapter":"stub","model":"stub-model","prompt_version":"unreported","usd":0.5000,"tokens_in":100,"tokens_out":20,"cache_read":5,"duration_s":50,"source":"runner","at":"2026-10-17T00:00:00+00:00"}
{"v":2,"run_id":"run-golden","event":"task_cost_warning","task_id":"T-1","usd":0.5000,"threshold_usd":0.40,"at":"2026-10-17T00:00:00+00:00"}
{"v":2,"run_id":"run-golden","event":"runner_cost_unreported","role":"implementer","task_id":"T-1","story_id":"STORY-7","adapter":"stub","model":"stub-model","prompt_version":"unreported","reason":"no-cost-in-log","duration_s":100,"exit_code":124,"estimated_usd":1.0000,"estimate_basis":"role-mean-usd-per-second","at":"2026-10-17T00:00:00+00:00"}
{"v":2,"run_id":"run-golden","event":"task_cost_escalation","task_id":"T-1","usd":1.5000,"threshold_usd":1.00,"at":"2026-10-17T00:00:00+00:00"}
{"v":2,"run_id":"run-golden","event":"runner_cost","role":"reviewer","task_id":"T-1","adapter":"stub","model":"stub-model","prompt_version":"unreported","usd":0.6000,"tokens_in":100,"tokens_out":20,"cache_read":5,"duration_s":60,"source":"runner","at":"2026-10-17T00:00:00+00:00"}
{"v":2,"run_id":"run-golden","event":"runner_cost","role":"reviewer","task_id":"T-1","adapter":"stub","model":"stub-model","prompt_version":"unreported","usd":0.6000,"tokens_in":100,"tokens_out":20,"cache_read":5,"duration_s":60,"source":"runner","at":"2026-10-17T00:00:00+00:00"}
## aggregate queries over the status fixture ledger
status_metrics_summary=2 1 1 1 300 1
status_cost_summary:
STORY	(unattributed)	0.1000	1
STORY	STORY-998	1.2500	1
STORY	STORY-999	0.7500	1
TOTAL	2.1000	3	1	1
status_lane_cost_summary:
LANE	1	0.7500	1	1	1
LANE	2	1.3500	2	0	1
TASK	T-A-001	1	0.7500	1	1
TASK	T-B-001	2	1.3500	2	0
lane_tuning_summary:
UTILISATION	50.0	300	300	2
SEMWAIT	30.0	1	30
CONFLICTRATE	100.0	1	1
lane_tuning_summary(missing file):
UTILISATION	0	0	0	0
SEMWAIT	0	0	0
CONFLICTRATE	0	0	0
status_metrics_summary(missing)=0 0 0 0 0 0
status_cost_summary(missing)=TOTAL	0.0000	0	0	0
status_lane_cost_summary(missing)=[]
run_spend_metrics(missing)=0.0000	0	0	0.0000
task_spend_usd(missing)=0.0000
