Files
rune/docs
Nick 785c033af2 feat(p0-07): durable inference traces — served tokens, output, latency, per-block visibility (#23)
- OllamaChatTransport: additive usage accumulators (usage_calls,
  usage_prompt_tokens, usage_output_tokens, usage_total_duration_ns)
  summed from the /api/chat response envelope; last_prompt_eval_count
  behavior unchanged (calibration pin). provider = 'ollama' class attr.
- new rune.inference_trace: frozen InferenceTrace dataclass (schema v1),
  record_trace JSONL store under <rune_home>/state/inference_traces.jsonl
  with 10MB x 3 rotation, price_for (empty map -> None / local-unpriced).
- RuneOperator._execute_on_model: one trace per RUN on the final response
  (run_started covers the whole tier-escalation attempt), task_id +
  channel from TaskState, built FROM the broker trace + transport
  counters — never re-measures. Degrade-not-crash: trace failure records
  a tier=2 'inference_trace' failure and never fails the turn.
- canary_p0_07 (registered in ci.yml same commit): scripted trace ->
  record -> read back -> every issue-listed field asserted; rotation
  probe; no live model.
- docs/inference-trace.md: schema v1, field sources, cost basis,
  cloud/local comparison, consumers #25/#28/#29.
- v1_authority_map: inference_trace entry under context_construction.

Tests: 11 new frozen tests (tests/test_p0_07_inference_trace.py),
red-first; full suite 513 passed + 84 subtests (baseline 501).
2026-09-05 17:06:02 +01:00
..