Polytraders Dev Guide
internal
v3 spine Phase 1 · Shared contracts 9 demo-wired · 0 shadow-ready · 0 production-live · 100 pending · 109 total 15/33 infra tasks the plan status board

← Principles & schemas

Failure-injection recipes

Standard scenarios every bot is exercised against before it can leave shadow. The chaos suite runs them nightly in staging and weekly in production-canary.

Five standard scenarios

  1. Stale market data. Freeze the CLOB book channel for the bot's longest staleness threshold + 5 seconds. Expect: HARD_REJECT with STALE_MARKET_DATA on every decision; no silent approvals.
  2. Dependency outage. Hard-stop a declared dependency (PortfolioGuard, KillSwitch, etc.) for 2 minutes. Expect: bot enters safe-fallback (per its Failure-mode block); no decisions emitted that depend on the missing service.
  3. Schema drift. Inject a payload with an extra unknown field and a renamed-but-similar field on every input. Expect: bot tolerates extras (forward-compatible), rejects unknown renames with a clear schema error.
  4. Time-skew. Skew local clock by ±90 seconds vs WebSocket server clock. Expect: bot uses server-time when computing staleness; alerts on local-vs-server skew > 30s.
  5. Replay storm. Replay the same intent 1000× within 5s. Expect: idempotency holds — exactly one effect per intent_id; no duplicated orders; no duplicated GovernanceLog entries.

Bot-specific scenarios

Each bot lists its own additional scenarios in the Failure-injection recipes section of its page. Examples:

Authoring rules