malkhut(e2e): 100-opponent swarm + empty book fix + error handling

- 100 diverse opponents (randomized params within each type)
- Risk gate: empty book guard in _post_only_would_cross
- CMA-ES: only every 5 cycles, 3 evals, robust error handling
- Main loop: try/except prevents silent crashes
- Profiling: 11.7 steps/sec with 100 opponents
This commit is contained in:
Codex
2026-07-15 00:11:57 +02:00
parent 956c650171
commit d72323a6c5
2 changed files with 485 additions and 0 deletions

View File

@@ -147,6 +147,8 @@ class RiskGate:
price = materialize_price_from_action(state, action)
if price is None:
return False
if not state.book.bids or not state.book.asks:
return False
if action.side == Side.BUY and price >= state.book.best_ask:
return True
if action.side == Side.SELL and price <= state.book.best_bid: