K1a-Testabdeckung: Cleanup schont aktive Leiter (Floor-Deadlock)

Verifiziert den kritischen K1a-Fix mit Integrationstests statt nur per Review
(nach dem K3-Fehlplatzierungs-Fund):
- TraderMonitorService._clob -> IClobClient (verhaltensneutral); CleanupStaleOpenOrdersAsync
  internal. FakeCopyTradeLogRepository ergaenzt.
- 2 Tests: Stale Order mit aktiver Leiter wird NICHT gecancelt; ohne Leiter WIRD sie
  storniert (Kontrast, beweist Nicht-Vacuositaet).

Build 0 Fehler, 244 Tests gruen, --smoke-ui ok.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-07-09 19:41:09 +02:00
co-authored by Claude Opus 4.8
parent f4045f08e1
commit 2377dc7adb
3 changed files with 95 additions and 3 deletions
@@ -18,7 +18,7 @@ namespace PolyTraderSharp.Services
private readonly TradingState _state;
private readonly CopyTradingState _copyState;
private readonly PolymarketApiService _api;
private readonly PolymarketClobClient _clob;
private readonly IClobClient _clob;
private readonly ChannelWriter<CopySignal> _signalWriter;
private readonly ChannelWriter<ClosedTrade> _closedTradeWriter;
private readonly TerminalLogger _logger;
@@ -47,7 +47,7 @@ namespace PolyTraderSharp.Services
TradingState state,
CopyTradingState copyState,
PolymarketApiService api,
PolymarketClobClient clob,
IClobClient clob,
ChannelWriter<CopySignal> signalWriter,
ChannelWriter<ClosedTrade> closedTradeWriter,
TerminalLogger logger,
@@ -1148,7 +1148,7 @@ namespace PolyTraderSharp.Services
}
}
private async Task CleanupStaleOpenOrdersAsync(CancellationToken ct)
internal async Task CleanupStaleOpenOrdersAsync(CancellationToken ct)
{
var keysToProcess = _copyState.PendingOrderTimestamps.ToArray();
if (keysToProcess.Length == 0) return;