testsAndMisc/python_pkg/token_audit
Krzysztof kuhy Rudnicki 11aea86920 Land the token_audit standing-cost checkup (116 tests, 100% branch coverage)
Answers "what is billed on every turn regardless of use" by measurement
instead of recall, which is the part earlier audits kept getting wrong.

A surface is reported dead only when unused in BOTH windows. One earlier
audit's seven-day dead list included six servers that had been used within
thirty days, so a single window is not evidence. Shares are weighted with
cache-read weight 0.1, so a cached surface is not billed as though it were
re-read in full each turn.

Verified by running it, not just by tests: the report renders over 44,311
turns, putting rules/ at 4,907 tokens (1.77%), MEMORY.md at 4,312 (1.55%),
memories/ at 3,758 (1.35%), skill descriptions at 3,279 (1.18%) and CLAUDE.md
at 2,057 (0.74%), with per-MCP 7d/30d call counts behind each verdict.

The files were found untracked in the tree from an earlier session; every
module is already under the 250-line cap, so nothing needed splitting, and
the package was already at 100% branch coverage, so nothing needed new tests.
This lands the instrument only -- no surface is unregistered on its say-so.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 14:33:03 +02:00
..
tests Land the token_audit standing-cost checkup (116 tests, 100% branch coverage) 2026-08-22 14:33:03 +02:00
__init__.py Add token_audit package: per-session token attribution and reporting 2026-08-14 22:20:44 +02:00
__main__.py Add token_audit package: per-session token attribution and reporting 2026-08-14 22:20:44 +02:00
attribute.py Add token_audit package: per-session token attribution and reporting 2026-08-14 22:20:44 +02:00
checkup.py Land the token_audit standing-cost checkup (116 tests, 100% branch coverage) 2026-08-22 14:33:03 +02:00
imagecost.py Add token_audit package: per-session token attribution and reporting 2026-08-14 22:20:44 +02:00
model.py Add token_audit package: per-session token attribution and reporting 2026-08-14 22:20:44 +02:00
parse.py Add token_audit package: per-session token attribution and reporting 2026-08-14 22:20:44 +02:00
probe.py Land the token_audit standing-cost checkup (116 tests, 100% branch coverage) 2026-08-22 14:33:03 +02:00
report.py Add token_audit package: per-session token attribution and reporting 2026-08-14 22:20:44 +02:00
surfaces.py Land the token_audit standing-cost checkup (116 tests, 100% branch coverage) 2026-08-22 14:33:03 +02:00
unused.py Land the token_audit standing-cost checkup (116 tests, 100% branch coverage) 2026-08-22 14:33:03 +02:00