Files
GoldRegime_X/tests
Luke Mosoti 14987fb1e1 feat: sensitivity analysis mode — sweep Bull/Bear Z-Score cutoffs on trained models
Signal pipeline audit + diagnostic instrumentation:

signal_evaluator.py:
- calculate_z_score: adds logger.debug per-bar Z trace + logger.warning on
  fallback stats (helps confirm per-regime stats are being used in live logs)
- evaluate_signal_fast: refactored to collect sig before returning; adds
  three ERROR-level audit assertions (BUY in non-Bull, SELL in non-Bear,
  MR in non-Chop) — non-crashing, safe in live trading
- evaluate_signal: same three assertions before final return

tests/audit_signal_pipeline.py (new):
- 13 deterministic unit tests covering:
  T01-T03: Bull only fires BUY, never SELL
  T04-T06: Bear only fires SELL, never BUY
  T07-T09: Chop only fires MR_BUY/MR_SELL, never trend signals
  T10:     per-state Z-Scores are distinct (regime_stats used correctly)
  T11:     tiered promotes a sub-threshold trade into BUY
  T12:     tiered floor of 1.0 respected regardless of config cutoff
  T13:     backtester collapses MR_BUY→+1, MR_SELL→-1 (unified encoding)
  All 13 pass: exit 0

Result: 13/13 passed — pipeline is correct
2026-04-23 20:47:20 +03:00
..