Open the app
Operations

Testing strategy

Unit, property-based, integration, replay and safety tests — the system must survive its own failure modes.

A trading system has to survive its own failure modes. Testing spans five layers — from pure formulas to full-system replays of historical market events.

The layers

LayerCovers
UnitScoring formulas, indicators, position sizing, risk rules, exchange normalization, memory ops
Property-based (Hypothesis)Unexpected values, boundary conditions, invariants, order-sizing, score ranges
IntegrationConvex↔FastAPI, agent↔memory, collector events, execution adapters, Redis Streams, Compose
ReplayHistorical events through the whole pipeline — normalization → features → scoring → decision → sim
SafetyFailure modes (below)

Safety tests

The system is deliberately broken to prove it fails safely:

ScenarioExpected behavior
Duplicate ordersIdempotency key prevents a second fill
Stale signals / broken feedsDecisions blocked, alert raised
Unavailable exchangeGraceful degradation, no phantom orders
Extreme slippage / insufficient balanceOrder rejected deterministically
LLM malformed outputSchema validation rejects it
Redis outage / restart mid-executionReconciliation on boot, no duplicates
Replay is the integration backbone
Replaying real historical market events through the complete system validates collector normalization, feature computation, scoring, agent reasoning, decision output and execution simulation in one pass — the closest thing to a dress rehearsal before capital.