Kill-Switch Fire Drill — 2026-04-12
GAP-003 Closure
Drill Summary
| Item | Result |
|---|---|
| Date | 2026-04-12 |
| Operator | Agent DR (automated) |
| Test file | tests/test_killswitch_drill.py |
| Tests run | 19 |
| Tests passed | 19 |
| Tests failed | 0 |
| Duration | 0.87s |
What Was Tested
- Property-based state machine invariants (Hypothesis, 200+ examples)
- Escalation is monotonic (never goes down automatically)
- Daily loss thresholds map correctly to tiers
-
Throttle factor is always consistent with current tier
-
Tier restriction enforcement
- NORMAL: all signals allowed
- WARN: trading continues, alert logged
- THROTTLE: position sizes halved (factor=0.5)
- NO_NEW: new positions blocked, reducing allowed
-
FLATTEN: ALL trades blocked
-
FLATTEN triggers
- Max drawdown breach escalates directly to FLATTEN
-
Event recorded in kill history with timestamp and reason
-
De-escalation controls
- Improving PnL does NOT de-escalate automatically
- Reset requires named approver (audit trail)
-
Two-person reset flow verified (combined approver string)
-
State persistence (mock Redis)
- Kill tier survives simulated daemon restart
- FLATTEN state preserved
-
Full history preserved across restart
-
Full escalation ladder
- Complete walk-through: NORMAL -> WARN -> THROTTLE -> NO_NEW -> FLATTEN
Findings
- All 5 tiers enforce restrictions correctly.
- Automatic escalation works as designed. De-escalation is manual-only.
- The two-person reset is currently implemented as a single
reset_kill_switch(approver="name1+name2")call. Production should validate two distinct API calls from two different sessions. - State persistence requires external infrastructure (Redis). The serialization/deserialization pattern works correctly.
Gaps Remaining
- Production enhancement:
reset_kill_switchshould reject single-person resets at FLATTEN tier (requires code change, not a test issue). - Integration: No live Redis test. Mock Redis proves the pattern works.
Verdict
GAP-003: CLOSED. The kill-switch state machine is verified to work correctly under all tested conditions.