The reset history builds on #13's panel and day budgets, so its PR stacks on #15. Conflicts: D8 lists both the per-day budgets and the reset history. The weight helper from #13 now takes the instance's exclusive token end, so the day baseline counts tokens like its instance does, without the boundary hour a later instance owns (D7). Refs #14
This commit is contained in:
+48
-20
@@ -154,18 +154,27 @@ probe.
|
||||
`t + (100 − u) · e·W / u`, is shown; it always comes before `r`. A second forecast uses the
|
||||
recent rate: the rise of `u` over the window's samples from the last 24 h, when they span at
|
||||
least 3 h. It is shown beside the average forecast, never instead of it. Forecasts start once
|
||||
10 % of the window has passed (30 min of a session, about 17 h of a week), or as soon as the
|
||||
window is ahead. Before either, one hour at 1 % already "reaches" 100 % within days, which is
|
||||
noise. Until forecasts start, the tile and the window chart say when they will.
|
||||
2 % of the window has passed (6 min of a session, about 3 h 22 min of a week), or as soon as
|
||||
the window is ahead. Before either, a few minutes of use already "reach" 100 % within days,
|
||||
which is noise. Early forecasts are rough and firm up as the window goes on. Until forecasts
|
||||
start, the tile and the window chart say when they will.
|
||||
- **Window instance.** The samples of one window whose reset times lie within 15 minutes of each
|
||||
other. Claude reports resets to the minute and drifts by a minute between probes ("8pm", then
|
||||
"7:59pm"), so exact equality would split one week. A reset starts a new instance at 0 %.
|
||||
- **Days of a long window.** For a window longer than a day: today's use is `u` now minus `u` at
|
||||
the local start of today (the last sample of the same instance at or before it, or 0 when the
|
||||
instance began today). The use of each local day of the instance is computed the same way.
|
||||
The even pace per day is `100 · 1 d / W`. The daily budget is `(100 − u)` divided by the days
|
||||
left until `r`. A 7-day instance that resets at another time than midnight touches 8 local
|
||||
dates; the first and the last are partial days and both are shown.
|
||||
A day's share is the time of that day inside the instance. A 7-day instance that resets at
|
||||
another time than midnight touches 8 local dates; the first and the last have shorter shares,
|
||||
and both are shown. The even pace of a day is `100 · share / W`. The daily budget plans the
|
||||
rest of the instance from the start of today. With `s` the local start of today, or the
|
||||
instance start when that is later, and `u₀` the use at `s`, today's budget is
|
||||
`(100 − u₀) · today's share / (r − s)`; use during the day does not change it. A later day's
|
||||
budget is `(100 − max(u, u₀ + today's budget)) · its share / (r − end of today)`, so later days
|
||||
lose budget only once today's use passes today's budget. `u₀` is measured, or estimated as
|
||||
below and then marked. An estimated `u₀` takes `k` from the first sample at or after `s`, not
|
||||
the newest, and counts only the whole hours before that sample's hour, so later samples and
|
||||
tokens do not move it. Without `u₀` there is no budget.
|
||||
- **Estimates from tokens.** Where samples do not cover a span, its use is estimated from the
|
||||
token history. Tokens are weighted by the provider's API price ratios: Claude input 1,
|
||||
output 5, cache write 1.25, cache read 0.1; Codex uncached input 1, cached input 0.1,
|
||||
@@ -200,19 +209,29 @@ is a marked calculation from measured tokens, not a guess.
|
||||
**Why.** R5. A straight line from the window's start to its reset is a pace the user can check
|
||||
by hand. A user over pace by less than the threshold still runs out before the reset, so the
|
||||
date shows from the first point over pace. The day figures answer "how much of the week did I
|
||||
use today" and "how much may I use per day from now on" (developer feedback, 2026-10-14).
|
||||
use today" and "how much may I use per day from now on" (developer feedback, 2026-10-14). A
|
||||
budget computed from `u` and the time now fell with every use, even within the day's plan, and
|
||||
held a partial first day to a full day's pace; a budget set at the start of the day can be
|
||||
compared with the day's bar (developer feedback, 2026-10-18). An estimated `u₀` with the newest
|
||||
`k` moved whenever use from the web or another device changed the scale, and the budget moved
|
||||
with it; the token hour that holds the first sample keeps growing after it.
|
||||
Measured samples alone left the day chart empty until the app had run for a whole week, while the
|
||||
token history already covers it; the estimate fills it at once and agrees with the measured use
|
||||
of the instance by construction (developer feedback, 2026-10-15). A window that is ahead in
|
||||
its first 10 % is no noise: a Codex week at 39 % ten hours after its reset reaches 100 % within
|
||||
a day, and that is the warning the user needs (developer feedback, 2026-10-15).
|
||||
of the instance by construction (developer feedback, 2026-10-15). A window that is ahead early is
|
||||
no noise: a Codex week at 39 % ten hours after its reset reaches 100 % within a day, and that is
|
||||
the warning the user needs (developer feedback, 2026-10-15). Starting at 10 % hid every forecast
|
||||
for the first 17 h of a week, and Codex weeks that reset early spent much of their time there;
|
||||
the developer prefers a rough forecast that firms up with data (developer feedback, 2026-10-18).
|
||||
|
||||
**Gives up.** Weekday and working-hour patterns. Forecasts assume a constant rate; early in a
|
||||
window, a burst that puts it ahead gives a reach date that a quiet hour moves out again.
|
||||
window, a burst that puts it ahead gives a reach date that a quiet hour moves out again, and in
|
||||
the first hours a forecast can move by days.
|
||||
Measured day figures are only as fine as the samples (D5 keeps one per hour while the value
|
||||
stands still). Estimates miss use from other devices and from claude.ai or the web, which
|
||||
counts against the limit but leaves no local tokens; they also miss changes in model mix within
|
||||
an instance and any weighting the provider applies beyond the price ratios.
|
||||
an instance and any weighting the provider applies beyond the price ratios. An estimated `u₀`
|
||||
keeps the first sample's scale for the whole day, even when later samples would estimate it
|
||||
better, and overstates `u₀` by the use in that sample's hour before the sample.
|
||||
|
||||
## D8 — Desktop app
|
||||
|
||||
@@ -229,10 +248,15 @@ an instance and any weighting the provider applies beyond the price ratios.
|
||||
running in the tray. Starting the app opens the stats panel (R4). Start with the OS is an
|
||||
opt-in setting.
|
||||
- **Panel (R4).** It leads with one tile per limit window: used percent, pace, the forecasts of
|
||||
[D7](#d7--pace) and, for windows longer than a day, today's use and the daily budget. Then
|
||||
follow the per-day use of the long windows, token totals and charts, one window chart per limit
|
||||
window, the reset history of each long window ([D12](#d12--reset-history)), and the top
|
||||
entries by model and by project, with the rest folded into an expandable
|
||||
[D7](#d7--pace) and, for windows longer than a day, today's use and the daily budget. Tiles of
|
||||
one window kind show the same rows in the same order; a value that is not known yet shows a
|
||||
muted placeholder that says why or from when. Then follow the per-day use of the long
|
||||
windows, with each day's even pace and budget for its share and the instance start and reset
|
||||
marked on the first and last day; token totals for today, the current session and the week of
|
||||
[D9](#d9--the-snapshot-file-is-the-apps-only-output-to-other-processes), each saying since
|
||||
when; charts, one window chart per limit window; the reset history of each long window
|
||||
([D12](#d12--reset-history)); and the top entries by model and by project, with the rest folded
|
||||
into an expandable
|
||||
"Other". A window chart is a burn-up of one instance from its start to its reset: the used
|
||||
percent as a line (measured, or estimated before the first sample), the even-pace diagonal
|
||||
from 0 % to 100 %, the forecast to the reset and the previous instance faintly behind, with no
|
||||
@@ -260,15 +284,19 @@ chart library would add reflection and size for three chart types.
|
||||
([D5](#d5--own-history-store)). It carries a schema version `v` (1 to begin with), the time it
|
||||
was made, the refresh interval, the path of the app's executable and, per provider, its status
|
||||
and reason, its limit windows (used percent, reset, length, pace state, delta and projection)
|
||||
and its token totals for today, the current session window and the current week. The DTOs and
|
||||
their source-generated JSON context live in `FinalToken.Core`, shared by the app, the CLI and the
|
||||
Stream Deck plugin. Nothing listens on a socket or runs an HTTP server. A reader treats a
|
||||
and its token totals for today, the current session window and the current week, with the
|
||||
week's start and the id of the limit window it follows (`weekStart`, `weekWindow`). The week is
|
||||
the current instance of the provider's weekly limit: its longest window over a day whose label
|
||||
names no model family. Without one, it is the local calendar week from Monday, and `weekWindow`
|
||||
is absent. The DTOs and their source-generated JSON context live in `FinalToken.Core`, shared by
|
||||
the app, the CLI and the Stream Deck plugin. Nothing listens on a socket or runs an HTTP server. A reader treats a
|
||||
snapshot older than three refresh intervals as stale. The app gives the engine its own path; a
|
||||
CLI refresh keeps the path already in the snapshot, and a snapshot without one has none, so a
|
||||
reader never mistakes its own path for the app's.
|
||||
|
||||
**Why.** R6 needs the stats outside the app. A file has no network surface, and it survives a
|
||||
restart of either side.
|
||||
restart of either side. Beside the limit tiles, "this week" reads as the limit's week, not the
|
||||
calendar week (developer feedback, 2026-10-18).
|
||||
|
||||
**Gives up.** Updates faster than the reader's poll interval.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user