Problem
A programmatically built session with all tokens=0 yields zero waste and ratio 0.0 with no warning, since profiling is a separate manual step direct callers can forget (engine.py always pairs them).
Where
src/ctxlens/analysis/waste.py + duplication.py (no un-tokenized guard).
Acceptance
Add a failing test first calling build_waste_report on an un-tokenized session with large repeated bodies, expecting a raise or auto-count instead of silent zeros. Then fix.
Problem
A programmatically built session with all
tokens=0yields zero waste and ratio0.0with no warning, since profiling is a separate manual step direct callers can forget (engine.pyalways pairs them).Where
src/ctxlens/analysis/waste.py+duplication.py(no un-tokenized guard).Acceptance
Add a failing test first calling
build_waste_reporton an un-tokenized session with large repeated bodies, expecting a raise or auto-count instead of silent zeros. Then fix.