Supervisor S-0a/b: Entscheidungsjournal, Order-Events, SignalId, JSONL-Logs

Datenfundament fuer die KI-Analyse (docs/konzepte/KONZEPT-Modul-Supervisor.md, Phase S-0).
Sofortnutzen auch ohne KI: abfragbare Rejects, rekonstruierbare Order-Ketten.

- core_decision_journal (DecisionRecord): JEDE Handelsentscheidung strukturiert -
  Decision (Executed/Rejected/Skipped/Failed) + ReasonCode-Enum (als String, erweiterbar)
  + Kontext-JSON (kulturinvariant) + MarketSlug/EndDate (counterfactual-ready).
- core_order_events (OrderEventRecord): Order-Lifecycle als Daten (Placed/PlaceFailed/
  LadderStart/LadderStep/FloorReplaced/DustAbort ...) inkl. CLOB-Response.
- SignalId (GUID) auf CopySignal, durchgereicht bis ClosedTrade + Core-TradeRecord
  (Dual-Write) und in die Leiter (ExitLadderState.SignalId) -> Dossier-Korrelation.
- CopyTradingEngine: ~20 Entscheidungs-Sites journalisieren zusaetzlich zum Freitext-Log
  (Mode/SellOnly/H3/MaxBuyPrice/PerMaster/TimeLimit/Budget/Balance/Minimum/SpamBlock/
  Leiter/Ownership/NotFound/Teilverkauf/Inkonsistenz/Grace/Demo-Fill/-Close/Live-BUY).
- SellLadderService: Order-Events fuer Start/Step/Floor-Replace/Dust; IOrderEventLog injiziert.
- TerminalLogger: JSONL-Sink (eine Datei/Tag, LogJson pur) + CorrelationId-Support. Dual-Sink.
- Journal-Writes fehlertolerant (brechen den Geld-Pfad nie).
- Migrationen offline generiert UND angewendet (rein additiv): Core (Widen F1 + Journal),
  CopyTrading (SignalId), RF (Initial) - DB war bis AddMarketTakerFeeBps migriert, verifiziert.
- Launcher-Designer: Account-Spalten-Instanziierung wiederhergestellt (war bei Designer-
  Reserialisierung verloren gegangen -> NullReference im Smoke).

Tests: +5 (LogJson, Journal-Roundtrips, SignalId) + Journal-Assertions in Engine-Tests.
Build 0 Fehler, 336 Tests gruen, --smoke-ui komplett gruen (alle Views inkl. RF gegen echte Tabellen).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-07-16 18:48:25 +02:00
co-authored by Claude Opus 4.8
parent eac47369f0
commit bf3e012f8b
28 changed files with 1796 additions and 39 deletions
+29 -22
View File
@@ -25,6 +25,8 @@ namespace PolyTraderSharp.Ui
btn_settings = new ToolStripButton();
btn_terminal = new ToolStripButton();
btn_jobs = new ToolStripButton();
btn_accounting = new ToolStripButton();
toolStripSeparator1 = new ToolStripSeparator();
toolstrip_quickbar = new ToolStrip();
btn_liveTrading = new ToolStripButton();
btn_demoTrading = new ToolStripButton();
@@ -40,8 +42,6 @@ namespace PolyTraderSharp.Ui
colAccPnl3d = new DataGridViewTextBoxColumn();
colAccWin3d = new DataGridViewTextBoxColumn();
colAccOverall = new DataGridViewTextBoxColumn();
btn_accounting = new ToolStripButton();
toolStripSeparator1 = new ToolStripSeparator();
menuStrip.SuspendLayout();
toolstrip_windows.SuspendLayout();
toolstrip_quickbar.SuspendLayout();
@@ -122,6 +122,21 @@ namespace PolyTraderSharp.Ui
btn_jobs.Text = "Server Jobs";
btn_jobs.TextImageRelation = TextImageRelation.ImageAboveText;
//
// btn_accounting
//
btn_accounting.Image = Properties.Resources.coins_in_hand;
btn_accounting.ImageScaling = ToolStripItemImageScaling.None;
btn_accounting.ImageTransparentColor = Color.Magenta;
btn_accounting.Name = "btn_accounting";
btn_accounting.Size = new Size(106, 65);
btn_accounting.Text = "Accounting";
btn_accounting.TextImageRelation = TextImageRelation.ImageAboveText;
//
// toolStripSeparator1
//
toolStripSeparator1.Name = "toolStripSeparator1";
toolStripSeparator1.Size = new Size(6, 70);
//
// toolstrip_quickbar
//
toolstrip_quickbar.ImageScalingSize = new Size(24, 24);
@@ -179,10 +194,9 @@ namespace PolyTraderSharp.Ui
//
dgv_accountlist.AllowUserToAddRows = false;
dgv_accountlist.AllowUserToDeleteRows = false;
dgv_accountlist.AutoGenerateColumns = false;
dgv_accountlist.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
dgv_accountlist.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dgv_accountlist.Columns.AddRange(new DataGridViewColumn[] {
colAccName, colAccModules, colAccPoly, colAccBalance, colAccPnl3d, colAccWin3d, colAccOverall });
dgv_accountlist.Columns.AddRange(new DataGridViewColumn[] { colAccName, colAccModules, colAccPoly, colAccBalance, colAccPnl3d, colAccWin3d, colAccOverall });
dgv_accountlist.Dock = DockStyle.Fill;
dgv_accountlist.Location = new Point(0, 139);
dgv_accountlist.Name = "dgv_accountlist";
@@ -192,11 +206,12 @@ namespace PolyTraderSharp.Ui
dgv_accountlist.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dgv_accountlist.Size = new Size(2599, 498);
dgv_accountlist.TabIndex = 6;
//
//
// colAccName
//
colAccName.DataPropertyName = "Name";
colAccName.HeaderText = "Account";
colAccName.MinimumWidth = 8;
colAccName.Name = "colAccName";
colAccName.ReadOnly = true;
colAccName.Width = 200;
@@ -205,6 +220,7 @@ namespace PolyTraderSharp.Ui
//
colAccModules.DataPropertyName = "Modules";
colAccModules.HeaderText = "Module";
colAccModules.MinimumWidth = 8;
colAccModules.Name = "colAccModules";
colAccModules.ReadOnly = true;
colAccModules.Width = 220;
@@ -212,15 +228,18 @@ namespace PolyTraderSharp.Ui
// colAccPoly
//
colAccPoly.HeaderText = "Polymarket";
colAccPoly.MinimumWidth = 8;
colAccPoly.Name = "colAccPoly";
colAccPoly.ReadOnly = true;
colAccPoly.Text = "Öffnen";
colAccPoly.UseColumnTextForButtonValue = true;
colAccPoly.Width = 100;
colAccPoly.Width = 106;
//
// colAccBalance
//
colAccBalance.DataPropertyName = "Balance";
colAccBalance.HeaderText = "Wallet (USDC)";
colAccBalance.MinimumWidth = 8;
colAccBalance.Name = "colAccBalance";
colAccBalance.ReadOnly = true;
colAccBalance.Width = 130;
@@ -229,6 +248,7 @@ namespace PolyTraderSharp.Ui
//
colAccPnl3d.DataPropertyName = "Pnl3d";
colAccPnl3d.HeaderText = "3T PnL";
colAccPnl3d.MinimumWidth = 8;
colAccPnl3d.Name = "colAccPnl3d";
colAccPnl3d.ReadOnly = true;
colAccPnl3d.Width = 110;
@@ -237,6 +257,7 @@ namespace PolyTraderSharp.Ui
//
colAccWin3d.DataPropertyName = "WinRate3d";
colAccWin3d.HeaderText = "3T Winrate %";
colAccWin3d.MinimumWidth = 8;
colAccWin3d.Name = "colAccWin3d";
colAccWin3d.ReadOnly = true;
colAccWin3d.Width = 110;
@@ -245,24 +266,10 @@ namespace PolyTraderSharp.Ui
//
colAccOverall.DataPropertyName = "OverallPnl";
colAccOverall.HeaderText = "Overall P/L";
colAccOverall.MinimumWidth = 8;
colAccOverall.Name = "colAccOverall";
colAccOverall.ReadOnly = true;
colAccOverall.Width = 130;
//
// btn_accounting
//
btn_accounting.Image = Properties.Resources.coins_in_hand;
btn_accounting.ImageScaling = ToolStripItemImageScaling.None;
btn_accounting.ImageTransparentColor = Color.Magenta;
btn_accounting.Name = "btn_accounting";
btn_accounting.Size = new Size(106, 65);
btn_accounting.Text = "Accounting";
btn_accounting.TextImageRelation = TextImageRelation.ImageAboveText;
//
// toolStripSeparator1
//
toolStripSeparator1.Name = "toolStripSeparator1";
toolStripSeparator1.Size = new Size(6, 70);
//
// LauncherForm
//