core: add the reset history, API list prices and window series

The developer wants figures for every reset: how long an instance lasted,
its tokens, its final use, its API value, what it left unused and what an
early reset handed out (D12, D13). Instances come from one window series,
so a Codex limit that moves between the primary and secondary slot stays
one history (D7).

Building the spans once also fixes two D7 cases: the hour in which one
instance ends and the next starts goes to the new instance instead of
being lost, and a late sample of an old instance no longer places it after
a newer one.

Refs #14
Refs #9
This commit is contained in:
Florian Schmidt
2026-10-18 10:07:40 +02:00
parent f9027e8a27
commit 1c3f857a2c
10 changed files with 554 additions and 90 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ public static partial class LimitAnalysis
{
/// <summary>D7: minute-rounded probe resets may drift within 15 minutes in either direction.</summary>
public static bool SameInstance(LimitWindow first, LimitWindow second) =>
first.Provider == second.Provider && first.Id == second.Id &&
WindowSeries.For(first) == WindowSeries.For(second) &&
first.ResetsAt is { } firstReset && second.ResetsAt is { } secondReset &&
(firstReset - secondReset).Duration() <= TimeSpan.FromMinutes(15);