Unione dell'ondata 2 (motore M3, raccolta M0/M2): il Governatore fa da vista dei tetti per le ricette; un solo ItalianText; decisioni consolidate
verifica / prove (push) Successful in 3m46s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mzbb6zeFTjT6Rp8b92AVkA
This commit is contained in:
Claude committed 2026-10-13 17:39:16 +00:00
1 parent 2d1ea572ca
commit 6ff11ac8e3
3 files changed
+50 -17

No files matched your search

+8 -1
View File
@@ -18,7 +18,7 @@ namespace Febe.Core.Engine;
/// <para>CDN downloads are not site actions: <see cref="ActionKind.DataDownload"/> only checks the daily byte budget, also
/// during a stop (spec §7.6: queued downloads may complete), and bytes are recorded with <see cref="RecordAsync"/>.</para>
/// </remarks>
public sealed class Governor : IGovernor, IDataBudget
public sealed class Governor : IGovernor, IDataBudget, Febe.Core.Collection.Recipes.IBudgetView
{
private static readonly TimeSpan Hour = TimeSpan.FromMinutes(60);
@@ -149,6 +149,13 @@ public sealed class Governor : IGovernor, IDataBudget
return Math.Max(0, Math.Min(budget.PerDay - today, budget.PerHour - lastHour));
}
/// <summary>Budget view used by the recipes (e.g. «at least ten stories» before opening the viewer).</summary>
async Task<int> Febe.Core.Collection.Recipes.IBudgetView.RemainingAsync(ActionKind kind, long? accountId, CancellationToken ct)
{
var remaining = await RemainingAsync(kind, ct).ConfigureAwait(false);
return (int)Math.Min(remaining, int.MaxValue);
}
/// <summary>Use of every category with the limits in force (spec §7.4, §7.9).</summary>
public async Task<IReadOnlyList<BudgetStatus>> GetBudgetStatusAsync(CancellationToken ct = default)
{