arborist/arborist
russell@unturf.com 459060c774
fix(#000057): real token usage + cost per input/output separately
fox 2026-05-21: (1) use REAL API token usage, not len//4; (2) the
substrate prefills a large retrieved CONTEXT as INPUT while solo feeds
~nothing, so per-completion-token over-charges the substrate — and per-
TOTAL-token UNDER-charges it (its mix is ~98% cheap prefill tokens).
Measured n=30 qwen-nothink/4090: substrate prefills ~6.6k input tok/query
(claim_lattice) vs solo ~52 — ~127x. Neither single per-token denominator
is honest; prefill (parallel, cheap/tok) and decode (autoregressive,
dear/tok) must be costed separately.

- OpenAICompatibleClient stashes data['usage'] as .last_usage (non-
  invasive; return type unchanged).
- watt_bench captures real prompt_tokens + completion_tokens per call
  (both arms), aggregates per cell, and energy_cogs reports gross +
  marginal per BOTH 1k-total-tok and 1k-completion-tok plus the context
  size. Prints the prompt/completion split.
- 12 tests incl. the prompt-context artifact (per-total cheap, per-
  completion dear). Full suite 2540 passed.

The clean per-input-tok / per-output-tok split rides bench/watt_calibrate
(slope calibration; separate commit once validated live).
2026-05-21 11:41:01 -04:00
..
capital capital: land ticket #000020 (8-capital-form cost ledger) 2026-05-07 16:41:48 -04:00
concepts #000054 Phase 2: synonym_expand cap-aware + strict view + retrieval-route surfacing 2026-05-13 10:23:36 -04:00
distill capital: land ticket #000020 (8-capital-form cost ledger) 2026-05-07 16:41:48 -04:00
memory memory: land ticket #000017 (memory-root lifelong learning summary) 2026-05-07 16:46:41 -04:00
mesh modified: CLAUDE.md 2026-05-07 09:24:46 -04:00
pi_star ticket #000032: combinatorics@v1 π* (pure-integer counting kernel) 2026-05-09 13:20:29 -04:00
qa fix(#000057): real token usage + cost per input/output separately 2026-05-21 11:41:01 -04:00
search ticket #000039: --quant {float32,int8} + int8 head-to-head 2026-05-11 13:16:51 -04:00
selfmodel selfmodel: land ticket #000014 (identity record + falsification) 2026-05-07 16:36:34 -04:00
sources ticket #000031 follow-ups B-1 + B-2: alias attribution + source-side title author 2026-05-10 09:35:49 -04:00
substrate #000047 — close: delta_aggregator knob on ForkScore (Option D) 2026-05-11 08:27:38 -04:00
world #000013 closed: v7-W spatial-temporal substrate paper + namespace 2026-05-09 15:00:05 -04:00
__init__.py modified: CLAUDE.md 2026-05-07 09:24:46 -04:00
cli.py feat: cross-language Q&A (Operation Sandwich) + Windows quickstart — all default-OFF 2026-05-18 12:12:23 -04:00
compress.py modified: CLAUDE.md 2026-05-07 09:24:46 -04:00
document.py modified: CLAUDE.md 2026-05-07 09:24:46 -04:00
evict.py docs: clear all 39 cold-build Sphinx warnings (truly green) 2026-05-09 18:00:15 -04:00
ingest.py loss_report: land ticket #000022 (adapter LossReport sidecar) 2026-05-07 17:58:50 -04:00
journal.py modified: CLAUDE.md 2026-05-07 09:24:46 -04:00
merkle.py modified: CLAUDE.md 2026-05-07 09:24:46 -04:00
progress.py modified: CLAUDE.md 2026-05-07 09:24:46 -04:00
snapshot.py modified: CLAUDE.md 2026-05-07 09:24:46 -04:00
source.py modified: CLAUDE.md 2026-05-07 09:24:46 -04:00
store.py store: append_audit atomic head-read+insert — no audit-chain forks 2026-05-11 08:29:57 -04:00
wikitext.py loss_report: land ticket #000022 (adapter LossReport sidecar) 2026-05-07 17:58:50 -04:00