The page reported numbers but never analysed them: six near-identical stat
tiles, three raw histograms, and bar charts with no interpretation — and the
environmental cost lived on a separate page, so the two prices of a
conversation were never seen together.
It is now organised as questions. Each panel states its question, answers it
in a sentence computed from the data, and puts the chart underneath as
evidence, with a table twin behind a toggle.
- new lib/costAnalysis.ts: pure aggregations carrying both currencies —
token-type flow (cost reconstructed from the backend's own pricing rules,
normalised to the recorded total), per-activity carbon via each
conversation's cache mix, model mix with carbon intensity, Lorenz
concentration, lifecycle outcome, rolling-window deltas, plan pro-rating
- new dashboards/components/viz.tsx: chart primitives with the house rules
baked in (one measure per axis, 2px surface gaps, 4px data-ends, hover
read-out, table twin, colour by entity)
- headline pairs equivalent API spend with kg eqCO2 and four per-unit rates
- the signature panel shows tokens / dollars / eqCO2 as three 100% bars:
cache reads are 97% of tokens and 56% of the bill but 35% of the carbon,
output is 0.6% of tokens and 54% of the carbon
- trend is three small multiples (spend, eqCO2, carbon intensity) rather
than one dual-axis plot
- deltas are limited to rolling ranges; comparing 'since subscription' to
the window before it only measured when the history started
- fix: footprint sig() stripped an integer's own trailing zeros, printing
110 kg eqCO2 as '11 kg' and 1000 as '1'