The developer's feedback of 2026-10-18 named four problems in the top of the panel:
The dotted forecast line and "≈ X % at reset" came too late. Codex had none, because its week reset early and was 6.4 % in, under the old 10 % start. Forecasts now start at 2 % of a window.
The daily budget was the rest of the week over the time left. Every use today lowered it, and a week that starts at 22:40 held its first two hours to a full day. Each day of the instance now has a share, an even pace for that share and a budget. Today's budget starts from the use at the start of the day and stays put while today is spent. Later days share what is left after today's budget, or after today's real use when that is higher.
The Claude and Codex tiles had different rows. Tiles of one window kind now 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.
"This week" was the Monday calendar week. Week token totals now follow the provider's limit week and say since when ("Limit week · since Sa 22:40"). The calendar week stays as the fallback and is named so.
The week chart draws even pace and budget as steps per day, marks the instance start and reset under the first and last day, and draws a dashed line at the reset time. Its labels name the same full-day rates as the tile's plan row. Day tooltips show the share, the even pace and the budget. finaltoken-cli prints which week it uses and since when.
Decisions
D7: the 2 % forecast start and the day shares, even pace and budget, as committed in a8785fa.
D8: equal tile rows with placeholders, per-day steps, start and reset marks, token totals that say since when.
D9: weekStart and weekWindow in the snapshot. Both are optional, so an older snapshot.json still reads (v stays 1).
dotnet test --solution FinalToken.slnx -c Release: 338 total, 0 failed. This was before the chart label fix; after it, dotnet test --project tests/FinalToken.App.Tests -c Release gave 68 total, 0 failed.
python -B tools/docs/check_docs.py: 0 errors.
New Core tests: day shares over 8 dates and on 23 h and 25 h DST days, the budget on a partial first day, on a middle day with a measured and with an estimated baseline, a later budget that stays put within today's budget and drops past it, the last day, no baseline, a past reset, the forecast at exactly 2 % and one tick before, and the Codex case at 6.4 %. Week totals: the limit week, the calendar fallback, a model-family week that is skipped, and snapshot JSON with and without the new fields.
New App tests: Claude and Codex tiles of each kind have the same row names in the same order, including placeholders. Chart axis labels show the start and reset. Token tiles show "Limit week" and "Calendar week" at one height.
Headless screenshots in dark and light (limit tiles, week chart, token tiles), checked by eye for overlap, clipping and step alignment.
Not checked: the published NativeAOT build, Linux, and the panel on the real data directory.
Closes #13
## What and why
The developer's feedback of 2026-10-18 named four problems in the top of the panel:
- The dotted forecast line and "≈ X % at reset" came too late. Codex had none, because its week reset early and was 6.4 % in, under the old 10 % start. Forecasts now start at 2 % of a window.
- The daily budget was the rest of the week over the time left. Every use today lowered it, and a week that starts at 22:40 held its first two hours to a full day. Each day of the instance now has a share, an even pace for that share and a budget. Today's budget starts from the use at the start of the day and stays put while today is spent. Later days share what is left after today's budget, or after today's real use when that is higher.
- The Claude and Codex tiles had different rows. Tiles of one window kind now 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.
- "This week" was the Monday calendar week. Week token totals now follow the provider's limit week and say since when ("Limit week · since Sa 22:40"). The calendar week stays as the fallback and is named so.
The week chart draws even pace and budget as steps per day, marks the instance start and reset under the first and last day, and draws a dashed line at the reset time. Its labels name the same full-day rates as the tile's plan row. Day tooltips show the share, the even pace and the budget. `finaltoken-cli` prints which week it uses and since when.
## Decisions
- D7: the 2 % forecast start and the day shares, even pace and budget, as committed in a8785fa.
- D8: equal tile rows with placeholders, per-day steps, start and reset marks, token totals that say since when.
- D9: `weekStart` and `weekWindow` in the snapshot. Both are optional, so an older `snapshot.json` still reads (`v` stays 1).
## How it was tested
On 941a597, in the worktree root:
- `dotnet build FinalToken.slnx -c Release`: 0 warnings, 0 errors.
- `dotnet test --solution FinalToken.slnx -c Release`: 338 total, 0 failed. This was before the chart label fix; after it, `dotnet test --project tests/FinalToken.App.Tests -c Release` gave 68 total, 0 failed.
- `python -B tools/docs/check_docs.py`: 0 errors.
- New Core tests: day shares over 8 dates and on 23 h and 25 h DST days, the budget on a partial first day, on a middle day with a measured and with an estimated baseline, a later budget that stays put within today's budget and drops past it, the last day, no baseline, a past reset, the forecast at exactly 2 % and one tick before, and the Codex case at 6.4 %. Week totals: the limit week, the calendar fallback, a model-family week that is skipped, and snapshot JSON with and without the new fields.
- New App tests: Claude and Codex tiles of each kind have the same row names in the same order, including placeholders. Chart axis labels show the start and reset. Token tiles show "Limit week" and "Calendar week" at one height.
- Headless screenshots in dark and light (limit tiles, week chart, token tiles), checked by eye for overlap, clipping and step alignment.
Not checked: the published NativeAOT build, Linux, and the panel on the real data directory.
schmidt.florian
self-assigned this 2026-10-18 09:55:57 +02:00
The developer wants forecasts earlier, a daily budget that today's use
does not shrink, and week totals that follow the limit week (D7, D8, D9).
Refs #13
The budget was the rest of the week over the time left, so each use today
lowered it and a partial first day was held to a full day. Now each day of
the instance has its share, its even pace and its budget. Today's budget
starts from the use at the day start and does not move with today's use
(D7). Forecasts start at 2 % of a window, so an early reset no longer hides
them for most of a day.
Limit tiles of one kind show the same rows, with placeholders that say why
a value is missing. The week chart draws per-day steps and marks the
instance start and reset (D8). Week token totals follow the provider's
limit week and say since when, with the calendar week as fallback (D9).
Refs #13
src/FinalToken.Core/LimitDays.cs:18: The estimated midnight baseline is recalculated from today.Cumulative - today.Used on every refresh. Those day estimates use the newest sample's token calibration, so today's spending can change the baseline and lower both budgets before today exceeds its plan. Reproduction: a seven-day window starts 2026-10-10 22:40 at UTC+02; on October 13 there are 100 weighted tokens before midnight and 100 afterward, with no sample before midnight. A 02:00 sample at 20% gives estimated today use 10% and today/later budgets 18.202247%. Add a 12:00 sample at 22% with the same local tokens (use elsewhere is allowed): estimated today use is 11%, and both budgets drop to 18%. Both today values are below their budgets. This violates issue #13 point 3 and D7's fixed daily budget. Anchor the budget's estimated day-start baseline to a stable observation for that day/instance instead of recalibrating it from every newest sample, keep its estimated marker, and add a regression covering successive refreshes with an estimated baseline.
src/FinalToken.App/PanelWindow.cs:236: The conditional Stale row still gives tiles of the same window kind different rows. With a five-minute probe interval, a fresh Claude week tile has nine rows ending in Plan, while a Codex week sample fifteen minutes old has those rows plus Stale. This is a normal case when one provider's probe fails, and it breaks issue #13 point 2 and D8's equal-row requirement. Include sample freshness in an existing fixed row or reserve the same freshness row in every tile of that kind. Extend the row test to cover mixed sample ages.
Notes
None.
Checked
Reviewed head 941a597680bd891e5ba7137b5b0ebb6ca2958a41 in a separate detached worktree, D:/Projects/CSharp/FinalToken-wt/review-15-941a597.
Read PR #15, linked issue #13 and its comments, the root and all six touched projects' AGENTS.md files, the project mind, requirements R1-R7, relevant decisions D1, D2 and D5-D9, and the complete diff from origin/master. There were no earlier PR comments or reviews.
dotnet run --project ../runs/review-15/ReviewProbes.csproj -c Release: an isolated synthetic probe reproduced both findings above using the public Core API and an Avalonia headless panel. It printed Budget holds while under plan: False with both today values under budget, and Equal rows: False for fresh/stale week tiles. Probe source is outside the repository; production and test source are unchanged.
Inspected all six generated budget-1280x1000-{Dark,Light}-{limits,week,tokens}.png screenshots. No clipping or overlap was apparent in those fixture views. NativeAOT publishing, Linux, and real provider data were not exercised.
**Agent review: fail** on 941a597680bd891e5ba7137b5b0ebb6ca2958a41
## Blocking
1. `src/FinalToken.Core/LimitDays.cs:18`: The estimated midnight baseline is recalculated from `today.Cumulative - today.Used` on every refresh. Those day estimates use the newest sample's token calibration, so today's spending can change the baseline and lower both budgets before today exceeds its plan. Reproduction: a seven-day window starts 2026-10-10 22:40 at UTC+02; on October 13 there are 100 weighted tokens before midnight and 100 afterward, with no sample before midnight. A 02:00 sample at 20% gives estimated today use 10% and today/later budgets 18.202247%. Add a 12:00 sample at 22% with the same local tokens (use elsewhere is allowed): estimated today use is 11%, and both budgets drop to 18%. Both today values are below their budgets. This violates issue #13 point 3 and D7's fixed daily budget. Anchor the budget's estimated day-start baseline to a stable observation for that day/instance instead of recalibrating it from every newest sample, keep its estimated marker, and add a regression covering successive refreshes with an estimated baseline.
2. `src/FinalToken.App/PanelWindow.cs:236`: The conditional `Stale` row still gives tiles of the same window kind different rows. With a five-minute probe interval, a fresh Claude week tile has nine rows ending in `Plan`, while a Codex week sample fifteen minutes old has those rows plus `Stale`. This is a normal case when one provider's probe fails, and it breaks issue #13 point 2 and D8's equal-row requirement. Include sample freshness in an existing fixed row or reserve the same freshness row in every tile of that kind. Extend the row test to cover mixed sample ages.
## Notes
None.
## Checked
Reviewed head `941a597680bd891e5ba7137b5b0ebb6ca2958a41` in a separate detached worktree, `D:/Projects/CSharp/FinalToken-wt/review-15-941a597`.
Read PR #15, linked issue #13 and its comments, the root and all six touched projects' AGENTS.md files, the project mind, requirements R1-R7, relevant decisions D1, D2 and D5-D9, and the complete diff from `origin/master`. There were no earlier PR comments or reviews.
Commands run from the review worktree root:
- `dotnet build FinalToken.slnx -c Release`: passed, 0 warnings, 0 errors.
- `dotnet test --solution FinalToken.slnx -c Release`: passed, 338 tests, 0 failed, 0 skipped.
- `python -B tools/docs/check_docs.py`: passed, 0 errors.
- `dotnet run --project ../runs/review-15/ReviewProbes.csproj -c Release`: an isolated synthetic probe reproduced both findings above using the public Core API and an Avalonia headless panel. It printed `Budget holds while under plan: False` with both today values under budget, and `Equal rows: False` for fresh/stale week tiles. Probe source is outside the repository; production and test source are unchanged.
Inspected all six generated `budget-1280x1000-{Dark,Light}-{limits,week,tokens}.png` screenshots. No clipping or overlap was apparent in those fixture views. NativeAOT publishing, Linux, and real provider data were not exercised.
With the newest sample's scale, use from the web or another device moved
an estimated day baseline, and the daily budget moved with it while today
stayed within its plan (review of #15).
Refs #13
Estimated baseline. D7 took k from the newest sample, which contradicts its own "use during the day does not change it". 158572c changes D7: an estimated u₀ takes k from the first sample at or after the day start. That sample is fixed once it exists. The code fix and a regression test for the review's case follow.
Stale row. The warning moves into the existing "used" caption, so every tile keeps the same rows. A test with mixed sample ages follows.
A gpt-6.1-sol worker is making both fixes. A new review starts after the push.
Answer to the [first review](https://git.finalfactory.de/FinalFactory/FinalToken/pulls/15#issuecomment-18008). Both findings hold.
1. **Estimated baseline.** D7 took `k` from the newest sample, which contradicts its own "use during the day does not change it". `158572c` changes D7: an estimated `u₀` takes `k` from the first sample at or after the day start. That sample is fixed once it exists. The code fix and a regression test for the review's case follow.
2. **Stale row.** The warning moves into the existing "used" caption, so every tile keeps the same rows. A test with mixed sample ages follows.
A `gpt-6.1-sol` worker is making both fixes. A new review starts after the push.
An estimated day baseline took its scale from the newest sample, so use
from the web lowered the budget while today stayed within it. It now takes
the scale from the first sample at or after the day start (D7). The stale
sample warning moves into the "used" caption, so tiles of one kind keep the
same rows (D8). Both answer the first review of #15.
Refs #13
Both findings of the first review are fixed in 09f7633:
An estimated day baseline takes k from the first sample at or after the day start (D7, 158572c). A regression test covers the review's case: a 02:00 sample at 20 %, then a 12:00 sample at 22 % without new local tokens. The budget stays at 18.2022 %. Two more tests cover a first sample without tokens before it (no budget) and a measured baseline that still wins.
The stale warning is part of the "used" caption (used · ⚠ sample 15 min old), so tiles keep the same rows. The row test now covers mixed sample ages.
Checks on 09f7633:
Build: 0 warnings, 0 errors.
Tests: 342 total, 0 failed.
Docs check: 0 errors.
A second review is running.
Both findings of the first review are fixed in `09f7633`:
1. An estimated day baseline takes `k` from the first sample at or after the day start (D7, `158572c`). A regression test covers the review's case: a 02:00 sample at 20 %, then a 12:00 sample at 22 % without new local tokens. The budget stays at 18.2022 %. Two more tests cover a first sample without tokens before it (no budget) and a measured baseline that still wins.
2. The stale warning is part of the "used" caption (`used · ⚠ sample 15 min old`), so tiles keep the same rows. The row test now covers mixed sample ages.
Checks on `09f7633`:
- Build: 0 warnings, 0 errors.
- Tests: 342 total, 0 failed.
- Docs check: 0 errors.
A second review is running.
src/FinalToken.Core/LimitDays.cs:30: Fixing the first sample does not fix its token calibration. WeightedTokens includes the whole hourly bucket containing first.SampleTime, and that bucket keeps growing after the sample. The new code recalculates the denominator from those updated counts on every refresh, so ordinary use still moves the estimated midnight baseline and both budgets. Reproduction through HistoryStore and TokenSeriesByModel: a seven-day Codex window starts 2026-10-10 22:40 at UTC+02. On October 13, the first sample is at 02:05 with 20% used; there are 100 input tokens at October 12 23:30 and 100 at October 13 02:01. Today's use is 10%, and today's/later budgets are 18.202247%. Add 100 input tokens at 02:20 and a 02:30 sample at 22%. The same first sample now calibrates against 300 tokens instead of 200, moving the day baseline from 10% to 6.666667%; today's/later budgets become 18.876404%, although today's use (14.666667%) is still under budget. This leaves the first review's fixed-budget finding unresolved and violates D7's rule that use during the day does not change today's budget. Retain an immutable calibration or day baseline for the instance/day, including the token counts used to establish it; recomputing against a growing boundary-hour bucket is insufficient. Add a regression that appends tokens into the first sample's hour between refreshes and checks that today's and later budgets stay fixed while under plan.
Notes
The previous stale-row finding is fixed: the warning occupies the existing Used row. The mixed-age headless regression passes, and both themes keep the same rows without visible clipping in the generated fixture views.
This is the second failed agent review. Under docs/agents/review.md, the author must stop the review loop, report the remaining finding on issue #13, add status/needs-decision, and leave the next step to the developer.
Checked
Reviewed head 09f7633eb5dfdfdddbb0861930379df014b7273b in a separate detached worktree, D:/Projects/CSharp/FinalToken-wt/review-15-09f7633.
Read PR #15, linked issue #13 and its comments, the earlier failed review and both author responses, the root and all six touched projects' AGENTS.md files, the project mind, requirements R1-R7, relevant decisions including D7-D9, and the complete diff from origin/master. Applied the re-review scope: checked the previous blockers and the author's commits 158572c and 09f7633 since reviewed commit 941a597680bd891e5ba7137b5b0ebb6ca2958a41, excluding origin/master.
dotnet run --project ../runs/review-15-09f7633/probe/ReviewProbe.csproj -c Release: the isolated synthetic probe reproduced the remaining blocker through public Core APIs. It printed Both under budget: True and Budget holds with new tokens in first sample hour: False, with the numbers above. Source is outside the repository.
Inspected the newly generated budget-stale-1280x1000-Dark.png and budget-stale-1280x1000-Light.png screenshots. No visible clipping or row mismatch in those fixtures. NativeAOT publishing, Linux, and real provider data were not exercised. Production and test source are unchanged.
**Agent review: fail** on 09f7633eb5dfdfdddbb0861930379df014b7273b
## Blocking
1. `src/FinalToken.Core/LimitDays.cs:30`: Fixing the first sample does not fix its token calibration. `WeightedTokens` includes the whole hourly bucket containing `first.SampleTime`, and that bucket keeps growing after the sample. The new code recalculates the denominator from those updated counts on every refresh, so ordinary use still moves the estimated midnight baseline and both budgets. Reproduction through `HistoryStore` and `TokenSeriesByModel`: a seven-day Codex window starts 2026-10-10 22:40 at UTC+02. On October 13, the first sample is at 02:05 with 20% used; there are 100 input tokens at October 12 23:30 and 100 at October 13 02:01. Today's use is 10%, and today's/later budgets are 18.202247%. Add 100 input tokens at 02:20 and a 02:30 sample at 22%. The same first sample now calibrates against 300 tokens instead of 200, moving the day baseline from 10% to 6.666667%; today's/later budgets become 18.876404%, although today's use (14.666667%) is still under budget. This leaves the first review's fixed-budget finding unresolved and violates D7's rule that use during the day does not change today's budget. Retain an immutable calibration or day baseline for the instance/day, including the token counts used to establish it; recomputing against a growing boundary-hour bucket is insufficient. Add a regression that appends tokens into the first sample's hour between refreshes and checks that today's and later budgets stay fixed while under plan.
## Notes
- The previous stale-row finding is fixed: the warning occupies the existing `Used` row. The mixed-age headless regression passes, and both themes keep the same rows without visible clipping in the generated fixture views.
- This is the second failed agent review. Under `docs/agents/review.md`, the author must stop the review loop, report the remaining finding on issue #13, add `status/needs-decision`, and leave the next step to the developer.
## Checked
Reviewed head `09f7633eb5dfdfdddbb0861930379df014b7273b` in a separate detached worktree, `D:/Projects/CSharp/FinalToken-wt/review-15-09f7633`.
Read PR #15, linked issue #13 and its comments, the earlier failed review and both author responses, the root and all six touched projects' AGENTS.md files, the project mind, requirements R1-R7, relevant decisions including D7-D9, and the complete diff from `origin/master`. Applied the re-review scope: checked the previous blockers and the author's commits `158572c` and `09f7633` since reviewed commit `941a597680bd891e5ba7137b5b0ebb6ca2958a41`, excluding `origin/master`.
Commands run from the review worktree root:
- `dotnet build FinalToken.slnx -c Release`: passed, 0 warnings, 0 errors.
- `dotnet test --solution FinalToken.slnx -c Release`: passed, 342 tests, 0 failed, 0 skipped.
- `python -B tools/docs/check_docs.py`: passed, 0 errors.
- `git diff --check origin/master...HEAD`: passed.
- `dotnet run --project ../runs/review-15-09f7633/probe/ReviewProbe.csproj -c Release`: the isolated synthetic probe reproduced the remaining blocker through public Core APIs. It printed `Both under budget: True` and `Budget holds with new tokens in first sample hour: False`, with the numbers above. Source is outside the repository.
Inspected the newly generated `budget-stale-1280x1000-Dark.png` and `budget-stale-1280x1000-Light.png` screenshots. No visible clipping or row mismatch in those fixtures. NativeAOT publishing, Linux, and real provider data were not exercised. Production and test source are unchanged.
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
The second review found that the hour bucket holding the first sample
keeps growing after it, so use later in that hour still moved the
estimated baseline and both budgets. Following D7, the estimate now
counts only the whole hours before that sample's hour. No counted bucket
can grow after the sample, so later samples and tokens no longer move it.
Refs #13
The finding of the second review is fixed in 8bde2a3, following D7 as changed in d2cf2c2:
An estimated u₀ counts only the whole hours before the first sample's hour: u₀ = u(first) · W(start, min(s, H)) / W(start, H) with H that sample's hour. No counted hour can grow after the sample, so later samples and tokens do not move u₀ or the budgets. Without tokens before H there is no budget.
New tests: the review's case (tokens and a 22 % sample added in the 02:00 hour leave both budgets unchanged), a first sample in the day's first hour, a +05:30 zone where the first sample shares the UTC hour of local midnight, and no tokens before H.
Checks on 8bde2a3:
Build: 0 warnings, 0 errors.
Tests: 346 total, 0 failed.
Docs check: 0 errors.
A third review is running.
The finding of the second review is fixed in `8bde2a3`, following D7 as changed in `d2cf2c2`:
- An estimated `u₀` counts only the whole hours before the first sample's hour: `u₀ = u(first) · W(start, min(s, H)) / W(start, H)` with `H` that sample's hour. No counted hour can grow after the sample, so later samples and tokens do not move `u₀` or the budgets. Without tokens before `H` there is no budget.
- New tests: the review's case (tokens and a 22 % sample added in the 02:00 hour leave both budgets unchanged), a first sample in the day's first hour, a +05:30 zone where the first sample shares the UTC hour of local midnight, and no tokens before `H`.
Checks on `8bde2a3`:
- Build: 0 warnings, 0 errors.
- Tests: 346 total, 0 failed.
- Docs check: 0 errors.
A third review is running.
The remaining finding from the second review is fixed. LimitDays calibrates the estimated day baseline using only hours before the first sample's UTC hour, following the developer-approved D7 change. Replaying the previous failure through HistoryStore and TokenSeriesByModel keeps both today's and later-day budgets at 16.179775281% while today's estimated use rises from 10% to 14.666666667%, still below budget. The four new regressions cover tokens added within the first sample's hour, a sample in the day's first hour, a +05:30 zone, and no tokens in completed hours.
The earlier stale-row fix remains covered by the passing mixed-age headless regression. Both themes keep the same tile rows.
Checked
Reviewed head 8bde2a3b0eb6ca761763a4d78de3e1e57f894126 in a separate detached worktree, D:/Projects/CSharp/FinalToken-wt/review-15-8bde2a3.
Read PR #15, linked issue #13 and its comments, both failed reviews and the author responses, the root and all six touched projects' AGENTS.md files, the project mind, requirements R1-R7, relevant decisions including D7-D9, and the complete diff from origin/master. The issue records the developer's authorization for this third round. Applied the re-review scope: checked the previous blocker and the author's commits d2cf2c2 and 8bde2a3 since reviewed commit 09f7633eb5dfdfdddbb0861930379df014b7273b, excluding origin/master.
dotnet run --project ../runs/review-15-8bde2a3/probe/ReviewProbe.csproj -c Release: replayed the second review's synthetic reproduction through public Core APIs; printed Both under budget: True and Budget holds with new tokens in first sample hour: True. Probe source is outside the repository.
Inspected all eight newly generated budget-1280x1000-{Dark,Light}-{limits,week,tokens}.png and budget-stale-1280x1000-{Dark,Light}.png screenshots. No visible clipping, overlap, or tile-row mismatch in those fixtures. NativeAOT publishing, Linux, and real provider data were not exercised. Production and test source are unchanged.
**Agent review: pass** on 8bde2a3b0eb6ca761763a4d78de3e1e57f894126
## Blocking
None.
## Notes
- The remaining finding from the second review is fixed. `LimitDays` calibrates the estimated day baseline using only hours before the first sample's UTC hour, following the developer-approved D7 change. Replaying the previous failure through `HistoryStore` and `TokenSeriesByModel` keeps both today's and later-day budgets at 16.179775281% while today's estimated use rises from 10% to 14.666666667%, still below budget. The four new regressions cover tokens added within the first sample's hour, a sample in the day's first hour, a +05:30 zone, and no tokens in completed hours.
- The earlier stale-row fix remains covered by the passing mixed-age headless regression. Both themes keep the same tile rows.
## Checked
Reviewed head `8bde2a3b0eb6ca761763a4d78de3e1e57f894126` in a separate detached worktree, `D:/Projects/CSharp/FinalToken-wt/review-15-8bde2a3`.
Read PR #15, linked issue #13 and its comments, both failed reviews and the author responses, the root and all six touched projects' AGENTS.md files, the project mind, requirements R1-R7, relevant decisions including D7-D9, and the complete diff from `origin/master`. The issue records the developer's authorization for this third round. Applied the re-review scope: checked the previous blocker and the author's commits `d2cf2c2` and `8bde2a3` since reviewed commit `09f7633eb5dfdfdddbb0861930379df014b7273b`, excluding `origin/master`.
Commands run from the review worktree root:
- `dotnet build FinalToken.slnx -c Release`: passed, 0 warnings, 0 errors.
- `dotnet test --solution FinalToken.slnx -c Release`: passed, 346 tests, 0 failed, 0 skipped.
- `python -B tools/docs/check_docs.py`: passed, 0 errors.
- `git diff --check origin/master...HEAD`: passed.
- `dotnet run --project ../runs/review-15-8bde2a3/probe/ReviewProbe.csproj -c Release`: replayed the second review's synthetic reproduction through public Core APIs; printed `Both under budget: True` and `Budget holds with new tokens in first sample hour: True`. Probe source is outside the repository.
Inspected all eight newly generated `budget-1280x1000-{Dark,Light}-{limits,week,tokens}.png` and `budget-stale-1280x1000-{Dark,Light}.png` screenshots. No visible clipping, overlap, or tile-row mismatch in those fixtures. NativeAOT publishing, Linux, and real provider data were not exercised. Production and test source are unchanged.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #13
What and why
The developer's feedback of 2026-10-18 named four problems in the top of the panel:
The week chart draws even pace and budget as steps per day, marks the instance start and reset under the first and last day, and draws a dashed line at the reset time. Its labels name the same full-day rates as the tile's plan row. Day tooltips show the share, the even pace and the budget.
finaltoken-cliprints which week it uses and since when.Decisions
a8785fa.weekStartandweekWindowin the snapshot. Both are optional, so an oldersnapshot.jsonstill reads (vstays 1).How it was tested
On
941a597, in the worktree root:dotnet build FinalToken.slnx -c Release: 0 warnings, 0 errors.dotnet test --solution FinalToken.slnx -c Release: 338 total, 0 failed. This was before the chart label fix; after it,dotnet test --project tests/FinalToken.App.Tests -c Releasegave 68 total, 0 failed.python -B tools/docs/check_docs.py: 0 errors.Not checked: the published NativeAOT build, Linux, and the panel on the real data directory.
Agent review: fail on
941a597680## Blocking
src/FinalToken.Core/LimitDays.cs:18: The estimated midnight baseline is recalculated fromtoday.Cumulative - today.Usedon every refresh. Those day estimates use the newest sample's token calibration, so today's spending can change the baseline and lower both budgets before today exceeds its plan. Reproduction: a seven-day window starts 2026-10-10 22:40 at UTC+02; on October 13 there are 100 weighted tokens before midnight and 100 afterward, with no sample before midnight. A 02:00 sample at 20% gives estimated today use 10% and today/later budgets 18.202247%. Add a 12:00 sample at 22% with the same local tokens (use elsewhere is allowed): estimated today use is 11%, and both budgets drop to 18%. Both today values are below their budgets. This violates issue #13 point 3 and D7's fixed daily budget. Anchor the budget's estimated day-start baseline to a stable observation for that day/instance instead of recalibrating it from every newest sample, keep its estimated marker, and add a regression covering successive refreshes with an estimated baseline.src/FinalToken.App/PanelWindow.cs:236: The conditionalStalerow still gives tiles of the same window kind different rows. With a five-minute probe interval, a fresh Claude week tile has nine rows ending inPlan, while a Codex week sample fifteen minutes old has those rows plusStale. This is a normal case when one provider's probe fails, and it breaks issue #13 point 2 and D8's equal-row requirement. Include sample freshness in an existing fixed row or reserve the same freshness row in every tile of that kind. Extend the row test to cover mixed sample ages.Notes
None.
Checked
Reviewed head
941a597680bd891e5ba7137b5b0ebb6ca2958a41in a separate detached worktree,D:/Projects/CSharp/FinalToken-wt/review-15-941a597.Read PR #15, linked issue #13 and its comments, the root and all six touched projects' AGENTS.md files, the project mind, requirements R1-R7, relevant decisions D1, D2 and D5-D9, and the complete diff from
origin/master. There were no earlier PR comments or reviews.Commands run from the review worktree root:
dotnet build FinalToken.slnx -c Release: passed, 0 warnings, 0 errors.dotnet test --solution FinalToken.slnx -c Release: passed, 338 tests, 0 failed, 0 skipped.python -B tools/docs/check_docs.py: passed, 0 errors.dotnet run --project ../runs/review-15/ReviewProbes.csproj -c Release: an isolated synthetic probe reproduced both findings above using the public Core API and an Avalonia headless panel. It printedBudget holds while under plan: Falsewith both today values under budget, andEqual rows: Falsefor fresh/stale week tiles. Probe source is outside the repository; production and test source are unchanged.Inspected all six generated
budget-1280x1000-{Dark,Light}-{limits,week,tokens}.pngscreenshots. No clipping or overlap was apparent in those fixture views. NativeAOT publishing, Linux, and real provider data were not exercised.Answer to the first review. Both findings hold.
kfrom the newest sample, which contradicts its own "use during the day does not change it".158572cchanges D7: an estimatedu₀takeskfrom the first sample at or after the day start. That sample is fixed once it exists. The code fix and a regression test for the review's case follow.A
gpt-6.1-solworker is making both fixes. A new review starts after the push.Both findings of the first review are fixed in
09f7633:kfrom the first sample at or after the day start (D7,158572c). A regression test covers the review's case: a 02:00 sample at 20 %, then a 12:00 sample at 22 % without new local tokens. The budget stays at 18.2022 %. Two more tests cover a first sample without tokens before it (no budget) and a measured baseline that still wins.used · ⚠ sample 15 min old), so tiles keep the same rows. The row test now covers mixed sample ages.Checks on
09f7633:A second review is running.
Agent review: fail on
09f7633eb5## Blocking
src/FinalToken.Core/LimitDays.cs:30: Fixing the first sample does not fix its token calibration.WeightedTokensincludes the whole hourly bucket containingfirst.SampleTime, and that bucket keeps growing after the sample. The new code recalculates the denominator from those updated counts on every refresh, so ordinary use still moves the estimated midnight baseline and both budgets. Reproduction throughHistoryStoreandTokenSeriesByModel: a seven-day Codex window starts 2026-10-10 22:40 at UTC+02. On October 13, the first sample is at 02:05 with 20% used; there are 100 input tokens at October 12 23:30 and 100 at October 13 02:01. Today's use is 10%, and today's/later budgets are 18.202247%. Add 100 input tokens at 02:20 and a 02:30 sample at 22%. The same first sample now calibrates against 300 tokens instead of 200, moving the day baseline from 10% to 6.666667%; today's/later budgets become 18.876404%, although today's use (14.666667%) is still under budget. This leaves the first review's fixed-budget finding unresolved and violates D7's rule that use during the day does not change today's budget. Retain an immutable calibration or day baseline for the instance/day, including the token counts used to establish it; recomputing against a growing boundary-hour bucket is insufficient. Add a regression that appends tokens into the first sample's hour between refreshes and checks that today's and later budgets stay fixed while under plan.Notes
Usedrow. The mixed-age headless regression passes, and both themes keep the same rows without visible clipping in the generated fixture views.docs/agents/review.md, the author must stop the review loop, report the remaining finding on issue #13, addstatus/needs-decision, and leave the next step to the developer.Checked
Reviewed head
09f7633eb5dfdfdddbb0861930379df014b7273bin a separate detached worktree,D:/Projects/CSharp/FinalToken-wt/review-15-09f7633.Read PR #15, linked issue #13 and its comments, the earlier failed review and both author responses, the root and all six touched projects' AGENTS.md files, the project mind, requirements R1-R7, relevant decisions including D7-D9, and the complete diff from
origin/master. Applied the re-review scope: checked the previous blockers and the author's commits158572cand09f7633since reviewed commit941a597680bd891e5ba7137b5b0ebb6ca2958a41, excludingorigin/master.Commands run from the review worktree root:
dotnet build FinalToken.slnx -c Release: passed, 0 warnings, 0 errors.dotnet test --solution FinalToken.slnx -c Release: passed, 342 tests, 0 failed, 0 skipped.python -B tools/docs/check_docs.py: passed, 0 errors.git diff --check origin/master...HEAD: passed.dotnet run --project ../runs/review-15-09f7633/probe/ReviewProbe.csproj -c Release: the isolated synthetic probe reproduced the remaining blocker through public Core APIs. It printedBoth under budget: TrueandBudget holds with new tokens in first sample hour: False, with the numbers above. Source is outside the repository.Inspected the newly generated
budget-stale-1280x1000-Dark.pngandbudget-stale-1280x1000-Light.pngscreenshots. No visible clipping or row mismatch in those fixtures. NativeAOT publishing, Linux, and real provider data were not exercised. Production and test source are unchanged.The finding of the second review is fixed in
8bde2a3, following D7 as changed ind2cf2c2:u₀counts only the whole hours before the first sample's hour:u₀ = u(first) · W(start, min(s, H)) / W(start, H)withHthat sample's hour. No counted hour can grow after the sample, so later samples and tokens do not moveu₀or the budgets. Without tokens beforeHthere is no budget.H.Checks on
8bde2a3:A third review is running.
Agent review: pass on
8bde2a3b0e## Blocking
None.
Notes
LimitDayscalibrates the estimated day baseline using only hours before the first sample's UTC hour, following the developer-approved D7 change. Replaying the previous failure throughHistoryStoreandTokenSeriesByModelkeeps both today's and later-day budgets at 16.179775281% while today's estimated use rises from 10% to 14.666666667%, still below budget. The four new regressions cover tokens added within the first sample's hour, a sample in the day's first hour, a +05:30 zone, and no tokens in completed hours.Checked
Reviewed head
8bde2a3b0eb6ca761763a4d78de3e1e57f894126in a separate detached worktree,D:/Projects/CSharp/FinalToken-wt/review-15-8bde2a3.Read PR #15, linked issue #13 and its comments, both failed reviews and the author responses, the root and all six touched projects' AGENTS.md files, the project mind, requirements R1-R7, relevant decisions including D7-D9, and the complete diff from
origin/master. The issue records the developer's authorization for this third round. Applied the re-review scope: checked the previous blocker and the author's commitsd2cf2c2and8bde2a3since reviewed commit09f7633eb5dfdfdddbb0861930379df014b7273b, excludingorigin/master.Commands run from the review worktree root:
dotnet build FinalToken.slnx -c Release: passed, 0 warnings, 0 errors.dotnet test --solution FinalToken.slnx -c Release: passed, 346 tests, 0 failed, 0 skipped.python -B tools/docs/check_docs.py: passed, 0 errors.git diff --check origin/master...HEAD: passed.dotnet run --project ../runs/review-15-8bde2a3/probe/ReviewProbe.csproj -c Release: replayed the second review's synthetic reproduction through public Core APIs; printedBoth under budget: TrueandBudget holds with new tokens in first sample hour: True. Probe source is outside the repository.Inspected all eight newly generated
budget-1280x1000-{Dark,Light}-{limits,week,tokens}.pngandbudget-stale-1280x1000-{Dark,Light}.pngscreenshots. No visible clipping, overlap, or tile-row mismatch in those fixtures. NativeAOT publishing, Linux, and real provider data were not exercised. Production and test source are unchanged.