Skip to content

v0.20.0: the waste ledger — see what you paid for and didn't use - #6

Open
lroolle wants to merge 4 commits into
mainfrom
feat/waste-ledger
Open

v0.20.0: the waste ledger — see what you paid for and didn't use#6
lroolle wants to merge 4 commits into
mainfrom
feat/waste-ledger

Conversation

@lroolle

@lroolle lroolle commented Jul 29, 2026

Copy link
Copy Markdown
Member

What

statusline.sh report [--days N] — replay the usage log the statusline has been writing all along, and ledger every closed window: what you used, what expired.

usage report - work (last 28d, 79 samples)

7d windows closed: 1
  Tue 07-28 00:00  used 51%  expired 49% (~4.7 x 5h windows unused)

5h windows closed: 3   avg 95% at close   2 hit the cap
exchange rate: one full 5h window = ~10.46% of the week (~9.6 windows/week, learned)

week in progress: 5% used, resets Mon 08-03 23:59

That expired 49% line is the subscription math nobody shows you. The advisor (v0.19) prevents waste prospectively; this proves it retroactively — both read the same learned pct_per_window ratio and the same weekday walk, so the surfaces cannot disagree.

Also in here

  • Widened snapshots: every usage line now logs limits[] (scoped weekly caps), model, and predicted_end (the learned walk's projection at sample time — the calibration seed: once windows close, predictions can be scored against observed finals). Learning lags logging by weeks; fields absent today are patterns that can't be learned next month.
  • Bugfix, found on real data: jq's catch . yields the error message, not the input — every empty/unparseable resets_at normalized to one shared fake window identity and could pair across real windows in the ratio learner (phantom closes, skewed ratio: 9.91 → 10.06 on the same log). Both norm sites fixed.
  • Subcommand dispatch: after all function definitions, no stdin, read-only against the state dir.

Verification

  • 327/327 bats (315 statusline incl. 6 new + 12 installer), shellcheck at main's baseline (54 pre-existing warnings, 0 new)
  • Live-verified on two real accounts; the ledger example above is a real (tag-anonymized) run
  • state-dir.md contract updated; report documented as its reference consumer

Merge order note: two follow-up PRs stack on this branch (check/session-summary, then the agent skill). Tag + GitHub release after merge.

🤖 Generated with Claude Code

lroolle and others added 3 commits July 28, 2026 22:53
…input

jq's `catch .` binds the error MESSAGE as the value, not the original
input. Snapshots with an empty or unparseable five_hour.resets_at all
normalized to the same error string — one shared fake window identity —
so the pct_per_window pair walk could pair samples across real windows.
Observed on real data: phantom window transitions and a skewed ratio
(9.91 -> 10.06 after the fix on the same log).

Normalize via a named def that treats empty as empty and falls back to
the raw string on parse failure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`statusline.sh report [--days N]` replays usage.jsonl and ledgers every
closed window: 7d closes as used%/expired% (converted to 5h-windows-worth
via the learned pct_per_window ratio), 5h closes as count/avg/capped,
plus the week in progress projected with the same learned walk the
advisor uses — the surfaces cannot disagree. A window closes when
consecutive samples disagree on resets_at, normalized to the minute
(the ratio learner's identity rule). The advisor prevents waste
prospectively; this proves it retroactively.

Every usage snapshot now also logs limits[] (scoped weekly caps,
verbatim), model (id active in the logging session), and predicted_end —
the learned walk's projection at sample time, the calibration seed that
lets closed windows score the forecast later. Learning lags logging by
weeks; a field absent today is a pattern that can't be learned next
month.

Subcommands dispatch after all function definitions, take no stdin, and
are read-only against the state dir.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CHANGELOG entry, README section with a real ledger example, state-dir
contract gains the widened usage.jsonl fields (limits, model,
predicted_end) and names report as the reference consumer, counts
synced to 327 tests across README / llms.txt / site.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Stacked PRs (base = a feature branch) got no checks under the
branches:[main] filter; judgment should not depend on where a PR
points. Push triggers stay main-only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant