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

Promotion gates

A bot does not advance to the next readiness state until every gate below is green. Gates are observable from production data — no subjective sign-off, no "looks good to me".

State diagram

Idea only → Spec started → Parameters defined → Thresholds defined → Tests defined → Ready to build → Built → Shadow → Limited live → General live → Deprecated.

Gates by transition

Built → Shadow

GateHow measuredThreshold
Checklist 27/27 greenGenerator output100%
All unit + integration + property tests passCI100% on main for 7 consecutive days
Wire examples replay cleanlymake replay against last 7d of staging fixtures0 unexpected reason codes
Reason-code stability checkCI lint vs registryNo reword of existing codes

Shadow → Limited live

GateHow measuredThreshold
Shadow agreement with current live decisionSide-by-side replay of last 30 days≥ 99% identical decision; divergences manually reviewed
P99 latencyPrometheus≤ documented SLO
Error ratePrometheus< 0.1% over 7 days
No P0 alerts in shadowAlertmanager0 over 7 days
Failure-injection recipes passChaos suiteAll 5 standard scenarios pass

Limited live → General live

GateHow measuredThreshold
Time in limited liveCalendar≥ 30 days
User-facing incidents attributed to this botIncident log0 P1, ≤ 2 P2
False-positive rate (Risk bots)Manual review of 100 random REJECT/RESHAPE≤ 5% incorrect
Reconciliation driftBuilderAttribution + on-chainWithin tolerance for 30 days
Plain-English coverageEvery emitted reason code has a user_message100%

Demotion

A bot in General live is demoted to Limited live (and stops affecting users) when any of the following holds for 24 consecutive hours: P0 alert active, error rate > 1%, reconciliation drift outside tolerance, or a security finding above CVSS 7.0. Demotion is automatic and on-call cannot disable it.