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

@@ -383,19 +383,3 @@ public sealed partial class RecipeRunner
private static PageInfo? LastPage(IEnumerable<CapturedRead> reads) =>
reads.Where(r => r.Result.Page is not null).Select(r => r.Result.Page).LastOrDefault();
}
/// <summary>Italian formatting for messages: thousands with a dot (spec: «48.212 elementi»).</summary>
public static class ItalianText
{
public static string Number(long value)
{
var digits = Math.Abs(value).ToString(CultureInfo.InvariantCulture);
var groups = new List<string>();
for (var end = digits.Length; end > 0; end -= 3)
{
groups.Insert(0, digits[Math.Max(0, end - 3)..end]);
}
return (value < 0 ? "-" : string.Empty) + string.Join('.', groups);
}
}
+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)
{