core: plan the daily budget per day, start forecasts at 2 % and follow the limit week (#15)
The developer's feedback of 2026-10-18 named four problems at the top of the panel: late forecasts, a daily budget that shrank with every use, unequal Claude and Codex tiles, and an unclear "This week". - Core: forecasts start at 2 % of a window (D7). Each day of a long instance has a share, an even pace and a budget. Today's budget starts from the use at the start of the day and stays put while today is spent. An estimated start-of-day use counts only the whole hours before the first sample's hour, so later samples and tokens do not move it. Week token totals follow the provider's limit week, with the calendar week as the named fallback; the snapshot carries `weekStart` and `weekWindow` (D9). - App: tiles of one window kind show the same rows, with muted placeholders that say why (D8). The stale warning sits in the Used row. Week charts draw even pace and budget as steps per day, mark the instance start and reset, and label full-day rates. Token tiles say since when. - CLI: prints which week it uses and since when. Closes #13
This commit was merged in pull request #15.
This commit is contained in:
@@ -3,9 +3,11 @@ namespace FinalToken.Core;
|
||||
public sealed record RateForecast(double PercentPerDay, double UseAtReset, DateTimeOffset? ReachesLimit,
|
||||
double Increase = 0, TimeSpan Span = default);
|
||||
public sealed record LimitDay(DateTimeOffset Start, DateTimeOffset End, double? Used, double? Cumulative,
|
||||
bool IsToday, bool IsFuture, UseOrigin Origin = UseOrigin.Measured);
|
||||
bool IsToday, bool IsFuture, UseOrigin Origin = UseOrigin.Measured, TimeSpan Share = default, double EvenPace = 0, double? Budget = null,
|
||||
bool IsPartial = false, UseOrigin? BudgetOrigin = null);
|
||||
public sealed record WindowDays(IReadOnlyList<LimitDay> Current, IReadOnlyList<LimitDay> Previous,
|
||||
double? Today, double EvenPace, double? DailyBudget, UseOrigin TodayOrigin = UseOrigin.Measured);
|
||||
double? Today, double EvenPace, double? TodayBudget, double? LaterBudget = null, UseOrigin TodayOrigin = UseOrigin.Measured,
|
||||
UseOrigin? BudgetOrigin = null, DateTimeOffset? InstanceStart = null, DateTimeOffset? Reset = null);
|
||||
|
||||
/// <summary>Pure D7 calculations. Missing baselines use marked token estimates when calibration is available.</summary>
|
||||
public static partial class LimitAnalysis
|
||||
|
||||
Reference in New Issue
Block a user