{% extends "base.html" %} {% block title_suffix %} — {{ session.session_id[:12] }}{% endblock %} {% block content %} {# ── Session header ──────────────────────────────────────────────── #}
{{ session.task_type }} · {{ session.scored_at[:19] | replace("T", " ") }} UTC · {{ session.source_path }}
{% if is_legacy %}tracegauge rescore replaces the stored
figures when the transcript still exists.
| Bucket | Cost | Share |
|---|---|---|
| {{ b.label }} | ${{ "%.2f"|format(b.usd) }} | {% if b.share_pct is not none %}{{ "%.1f"|format(b.share_pct) }}%{% else %}n/a{% endif %} |
| Total (priced) | ${{ "%.2f"|format(cost_breakdown.total_usd) }} |
{{ cost_breakdown.note }}
{% endif %}{{ breakdown_note }}
| Bucket | Cost% ▼ | Tok% | Cost ($) | |
|---|---|---|---|---|
| {{ row.bucket }} {{ row.label }} | {{ row.cost_pct }}% | {{ row.tok_pct }}% | {% if session.unpriced_models and row.usd == 0 %}unpriced{% else %}${{ "%.4f" | format(row.usd) }}{% endif %} | |
| TOTAL (billed) | 100% | 100% | {{ attribution.total_usd | cost_display(session.unpriced_models, 4) }} |
Basis: {{ "{:,}".format(attribution.total_billed_tokens) }} total billed tokens (includes cached re-reads). real_tokens (verdict basis): {{ "{:,}".format(attribution.real_tokens) }} — cached re-reads are excluded from the verdict axis but included in this chart; do not compare attribution cost% directly to the real_tokens verdict.
Source file not accessible — attribution requires the original JSONL log.
Ensure source_path is reachable, or re-run tracegauge score <path>.
Source file not accessible — cache churn is computed from the original JSONL log (nothing is stored).
{% elif cache_churn.events == 0 %}No cache churn detected: 0 events in {{ cache_churn.by_scope.main.chains + cache_churn.by_scope.subagent.chains }} transcript chain(s).
{% else %}{{ cache_churn.events }} event(s) re-wrote cached context: ${{ "%.2f"|format(cache_churn.churn_usd) }} more than reading it would have cost{% if not cache_churn.priced %} (priced part only: {{ cache_churn.unpriced_events }} unpriced event(s) excluded){% endif %}. Main chain ${{ "%.2f"|format(cache_churn.by_scope.main.churn_usd) }} ({{ cache_churn.by_scope.main.events }}), subagents ${{ "%.2f"|format(cache_churn.by_scope.subagent.churn_usd) }} ({{ cache_churn.by_scope.subagent.events }}).
| Cause | Events | Cost |
|---|---|---|
| {{ label }} | {{ b.events }} | ${{ "%.2f"|format(b.churn_usd) }}{% if b.unpriced_events %} +{{ b.unpriced_events }} unpriced{% endif %} |
Plausibly avoidable (a judgement): ${{ "%.2f"|format(cache_churn.avoidable_usd) }} · not avoidable by a setting (idle over an hour, compaction): ${{ "%.2f"|format(cache_churn.unavoidable_usd) }}.
| Where | Turns | Cause | Gap / TTL | Read before → after | Written | Cost |
|---|---|---|---|---|---|---|
| {{ "main" if e.scope == "main" else "subagent " ~ e.chain }} | {{ e.previous_turn.turn_index }}→{{ e.current_turn.turn_index }} | {{ e.cause }} | {% if e.gap_s is not none %}{{ "{:,.0f}".format(e.gap_s) }}s / {% if e.ttl_s is not none %}{{ "{:,.0f}".format(e.ttl_s) }}s{% else %}unknown{% endif %}{% else %}n/a{% endif %} | {{ "{:,}".format(e.previous_turn.cache_read) }} → {{ "{:,}".format(e.current_turn.cache_read) }} | {{ "{:,}".format(e.churn_tokens) }} | {% if e.priced %}${{ "%.2f"|format(e.churn_usd) }}{% else %}unpriced{% endif %} |
Showing the {{ cache_churn.events_listed|length }} largest of {{ cache_churn.events }}.
{% endif %} {% for a in cache_churn.advice %}{{ a.setting }}=1h (env {{ a.env_var }}) would save about
${{ "%.2f"|format(a.net_usd) }} net (${{ "%.2f"|format(a.saved_usd) }} of avoided re-writes minus ${{ "%.2f"|format(a.premium_usd) }}
higher write rate on {{ a.scope }} chains). {{ a.assumptions }}| Real Tokens | {{ "{:,}".format(session.real_tokens) }} |
| Band Verdict | {% if session.band_verdict == "above_p75" %} above_p75 {% elif session.band_verdict == "below_p25" %} below_p25 {% elif session.band_verdict == "within_band" %} within_band {% else %} {{ session.band_verdict }} {% endif %} |
| Baseline | {% set bs = session.get("baseline_source", "b2_corpus") %} {% if bs == "self" %} self vs your own lean waste-free runs {% if session.p25 is not none and session.p75 is not none %} ({{ "{:,}".format(session.p25) }}–{{ "{:,}".format(session.p75) }} token band) {% endif %} {% elif bs == "building" %} building self-baseline not yet active {% elif bs == "corpus" %} corpus infra-heavy fallback — your own baseline pending {% else %} b2 B2 reference corpus (infra-heavy single-developer; self-baseline not yet scored) {% endif %} |
| Band | p25 {{ "{:,}".format(session.p25) if session.p25 is not none else "—" }} · median {{ "{:,}".format(session.median) if session.median is not none else "—" }} · p75 {{ "{:,}".format(session.p75) if session.p75 is not none else "—" }} |
| Scope | {{ session.scope_status }} |
| Interpretation | {{ session.interpretation }} |
UNAVAILABLE
Token and waste axes ran. Trajectory scoring is optional — enable with one of:
qwen3:30b-a3b
(~18 GB VRAM), then re-run tracegauge score <path> --judge
tracegauge score <path> --api-judge --api-judge-key YOUR_KEY
API judge note: sends session data — including 300-char snippets that may contain your code — to your configured provider. Explicit consent required at the CLI before any data is sent.
{% elif traj_state == TrajectoryRenderState.STALE %}{{ session.judge_verdict }} {% if session.judge_score is not none %} score {{ "%.2f" | format(session.judge_score) }} {% endif %}
{% if session.judge_reasoning %}{{ session.judge_reasoning }}
{% endif %}Verdict from an earlier version of this session (session grew after judging). Re-run tracegauge score <path> to update.
{{ session.judge_verdict }} {% if session.judge_score is not none %} score {{ "%.2f" | format(session.judge_score) }} {% endif %}
{% if session.judge_reasoning %}{{ session.judge_reasoning }}
{% endif %} {% endif %} {# Honesty element 1: trajectory DOV — visible #}No waste detected.
{% else %} {# Compute total waste cost for collapsed-state signal (honesty element 7) #} {% set wns = namespace(total=0.0) %} {% for ev in session.waste_events %} {% set wc = ev.get("wasted_cost_usd") %} {% if wc is not none and wc > 0 %}{% set wns.total = wns.total + wc %}{% endif %} {% endfor %} {# Honesty element 7: collapsed state SHOWS count + cost; one click reveals evidence #}| Detector | Proof Turns | Wasted Cost | Evidence |
|---|---|---|---|
| {{ event.get("detector", "—") }} | {% set turns = event.get("turns", []) %} {% if turns %}{{ turns | join(", ") }}{% else %}—{% endif %} | {% set wc = event.get("wasted_cost_usd") %} {% if wc is not none and wc > 0 %} ~${{ "%.3f" | format(wc) }} {% else %} — {% endif %} |
{% set evidence = event.get("evidence", {}) %}
{% if evidence %}{{ evidence | tojson(indent=2) }}{% else %}—{% endif %}
|
| Session Cost | {{ session.session_cost_usd | cost_display(session.unpriced_models) }} {% if session.get("subagent_count") %} includes {{ session.subagent_count }} subagent transcript(s): {{ session.subagent_cost_usd | cost_display([], 2) }} {% endif %} {% if session.get("cost_approximate") %} [~] approximate {% endif %} |
| vs Your Baseline | {% if cost_vs_baseline_pct is not none %} {% if cost_vs_baseline_pct >= 0 %} +{{ cost_vs_baseline_pct }}% above your typical efficient run (~${{ "%.2f" | format(baseline_cost_median) }}) {% else %} {{ cost_vs_baseline_pct }}% below your typical efficient run (~${{ "%.2f" | format(baseline_cost_median) }}) {% endif %} {% elif is_legacy %} {{ legacy_label }}: not compared {% else %} no baseline yet {% endif %} |
| Price Basis | {{ price_provenance }} |
Cost is not a score. It annotates the token axis at API-equivalent rates. Flat-plan users: marginal cost differs; token consumption is the honest metric.
{% if session.get("cost_domain_of_validity") %}