Show what the model knows on its own screen and let the user set it aside

The Apprendimento screen says in plain words whether the model counts, how
well its probabilities hold, which clues it weighs, how the challenger is
doing and what it has learned. Thresholds, set-aside and the undo of a
promotion live in Impostazioni; anything that shrinks less with real money
asks for the phrase. The new tests also caught a wrong column name that
broke the Panoramica as soon as the first model existed.

refs #66

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-01 12:44:37 +01:00
1 parent 14e8a872dc
commit f69943f70a
22 files changed
+1680 -27

No files matched your search

+3 -7
View File
@@ -14,8 +14,6 @@ internal sealed record AccountTrend(decimal Month, IReadOnlyList<decimal> Points
internal sealed record PanoramaNews(string When, string About, string Title, string Effect, bool Active);
/// <summary>The model at a glance: signals counted toward the 300, precision on unseen cases, training and next check.</summary>
internal sealed record PanoramaLearning(int Signals, int Needed, int Precision, string Trained, string NextCheck);
/// <summary>One of the four limits of the Panoramica (SPEC 13.6): value, threshold, share used and, for the fall, the worst so far.</summary>
internal sealed record PanoramaLimit(string Label, string Value, string Threshold, decimal Share, decimal? Worst = null);
@@ -39,7 +37,7 @@ internal sealed record PanoramaView(
IReadOnlyList<LastAction>? DemoLast,
string? NextDecision,
IReadOnlyList<PanoramaNews>? News,
PanoramaLearning? Learning,
LearningSummary Learning,
DateTimeOffset? FractionStops)
{
private static readonly CultureInfo _it = CultureInfo.InvariantCulture;
@@ -93,12 +91,13 @@ internal sealed record PanoramaView(
// The daily stops of the fractions come back with the orders after the open (SPEC 7.2).
DateTimeOffset? fractions = accounts.MarketOpen ? null : accounts.MarketNext + (services.Trading?.Engine.Options.OrdersAfterOpen ?? new LiveEngineOptions().OrdersAfterOpen);
var learning = await LearningView.SummaryAsync(host, shell, cancellationToken).ConfigureAwait(false);
using var aggregates = shell.Aggregates();
if (aggregates is null)
{
var board = await new Anubis.News.NewsBoard(services.Db, clock, services.Settings).LoadAsync(cancellationToken).ConfigureAwait(false);
return new PanoramaView(accounts, trends, limits, kept, cards, anyLive, system, null, null, Decision(overview.NextDecision, shell.Now, shell.Zone),
services.MarketData is null && board.Rows.Count == 0 ? null : Matters(board, shell), null, fractions);
services.MarketData is null && board.Rows.Count == 0 ? null : Matters(board, shell), learning, fractions);
}
var root = aggregates.RootElement;
@@ -108,9 +107,6 @@ internal sealed record PanoramaView(
var last = demo.GetProperty("ultime_azioni").EnumerateArray().Select(a => new LastAction(a.GetProperty("quando").GetString()!, a.GetProperty("testo").GetString()!)).ToList();
var news = root.GetProperty("notizie").GetProperty("panoramica").EnumerateArray().Select(n => new PanoramaNews(n.GetProperty("quando").GetString()!,
n.GetProperty("riguarda").GetString()!, n.GetProperty("titolo").GetString()!, n.GetProperty("effetto").GetString()!, n.GetProperty("in_corso").GetBoolean())).ToList();
var model = root.GetProperty("apprendimento");
var learning = new PanoramaLearning(model.GetProperty("segnali").GetInt32(), model.GetProperty("necessari").GetInt32(), model.GetProperty("precisione_pct").GetInt32(),
model.GetProperty("ultimo_addestramento").GetString()!, model.GetProperty("prossima_verifica").GetString()!);
// The 30-day results of appendix F.2: the generated daily series of each account only ends on its total.
var month = root.GetProperty("conti").EnumerateArray().ToDictionary(c => c.GetProperty("nome").GetString()!,