docs: count only whole hours before the first sample for an estimated baseline

Token history is kept per hour, and the hour that holds the day's first
sample keeps growing after it, so use in that hour still moved the budget
(second review of #15). The developer chose another round with this rule
on 2026-10-18.

Refs #13
This commit is contained in:
Florian Schmidt
2026-10-18 10:23:32 +02:00
parent 09f7633eb5
commit d2cf2c282a
+4 -3
View File
@@ -173,7 +173,8 @@ probe.
budget is `(100 − max(u, u₀ + today's budget)) · its share / (r − end of today)`, so later days 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 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 below and then marked. An estimated `u₀` takes `k` from the first sample at or after `s`, not
the newest, so later samples do not move it. Without `u₀` there is no budget. 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 - **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, 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, output 5, cache write 1.25, cache read 0.1; Codex uncached input 1, cached input 0.1,
@@ -205,7 +206,7 @@ budget computed from `u` and the time now fell with every use, even within the d
held a partial first day to a full day's pace; a budget set at the start of the day can be 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 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 `k` moved whenever use from the web or another device changed the scale, and the budget moved
with it. 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 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 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 early is of the instance by construction (developer feedback, 2026-10-15). A window that is ahead early is
@@ -222,7 +223,7 @@ stands still). Estimates miss use from other devices and from claude.ai or the w
counts against the limit but leaves no local tokens; they also miss changes in model mix within 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 estimated `u₀` 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 keeps the first sample's scale for the whole day, even when later samples would estimate it
better. better, and overstates `u₀` by the use in that sample's hour before the sample.
## D8 — Desktop app ## D8 — Desktop app