core: add limit forecasts, week days and per-model series (D7)

LimitAnalysis computes the use at reset at the average rate, a
recent-rate forecast from the last 24 h of samples, and for windows
longer than a day the use of each local day, today's use, the even
pace and the daily budget. Pace now projects the date of reaching
100 % whenever usage is over pace, not only past the threshold.
Samples whose resets lie within 15 minutes form one window instance,
because Claude's reset times drift by a minute between probes.
TokenSeriesByModel replaces one query per chart point, and a missing
settings.json on first start is no longer a diagnostic.

Refs #5
This commit is contained in:
Florian Schmidt
2026-10-14 22:59:24 +02:00
parent c7086e9760
commit a20d0ab9dc
8 changed files with 292 additions and 5 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ public class StorageTests
using var directory = new TestDirectory();
var log = new DiagnosticLog();
Assert.Equal(new Settings(), SettingsFile.Load(directory.Path, log));
Assert.Single(log.Recent);
Assert.Empty(log.Recent);
var settings = new Settings { StreamDeckInstallMode = InstallMode.Automatic, Claude = new() { Enabled = false } };
await SettingsFile.SaveAsync(directory.Path, settings, cancellationToken: TestContext.Current.CancellationToken);
Assert.Equal(settings, SettingsFile.Load(directory.Path, new()));