Closes #ISSUE-027-REGIME-UI - Implement regime indicator badge and dynamic meta-learner threshold

This commit is contained in:
Antigravity Agent
2026-06-17 19:59:37 +02:00
parent dcb59c17f0
commit 1dc637aaf6
11 changed files with 103 additions and 26 deletions

View File

@@ -393,6 +393,25 @@ This document tracks all modifications, npm packages, active compilation states,
* **Active Bugs**: None.
* **Type Checker Status**: Verified 100% clean type verification (`npx tsc --noEmit` returns exit code 0).
---
## [2026-06-17] - Volatility Regime Badging & Selective Inference Calibrator (#ISSUE-027-REGIME-UI)
### Added
* **Vol Regime Status Badges (CryptoDemo.tsx)**: Mounted high-visibility, glassmorphic conditional status badges adjacent to the "Explain Calibration" button in the Walk-Forward Ensemble Radar header. Dynamically renders:
* `🟢 REGIME: CALM (MICROSTRUCTURE MODE)` for Regime 1 (Calm).
* `🚨 REGIME: TURBULENT (LIQUIDATION CASCADE)` (flashing/pulsing) for Regime 2 (Turbulent).
* `🟡 REGIME: MEAN-REVERTING CHURN` for Regime 3 (Mean-Reverting Churn).
* **Ensemble Active Regime Ingestion**: Bound `activeRegime` in the `fetchEnsemble` routine of [CryptoDemo.tsx](file:///c:/Users/jannr/.gemini/antigravity/scratch/investment-sandbox/components/modules/crypto/CryptoDemo.tsx) to read `"activeRegime"` from the JSON output of the python pipeline.
* **Active Volatility Regime Export**: Overhauled [pipeline.py](file:///c:/Users/jannr/.gemini/antigravity/scratch/investment-sandbox/backend/core/pipeline.py) to return `active_regime` from `train_and_forecast()` and write `"activeRegime": int(active_regime) + 1` (re-indexing Calm=0 to 1, Turbulent=1 to 2) inside the main JSON output payload (`ensemble_predictions.json`).
* **High-Alpha Feature Selector Prioritization**: Configured the Boruta & PIMP feature selection filters in [pipeline.py](file:///c:/Users/jannr/.gemini/antigravity/scratch/investment-sandbox/backend/core/pipeline.py) to explicitly prioritize and bypass pruning for all high-alpha metrics (`v_supply`, `asopr`, `sth_sopr`, `lth_sopr`, `theta`, `squeeze_risk`, `d_liq`, `f_comp`, `z_f`, `z_f_squeeze_trigger`, `cvd_inst`, `cvd_ret`, `div_cvd`, `lambda_kyle`), ensuring they are always routed to the estimators.
* **Dynamic Meta-Learner Calibrator**: Calibrated the Stage 2 Reliability Meta-Learner execution threshold ($\theta_{\text{conf}}$) dynamically against the empirical mean training correctness probability (`np.mean(train_r_probs)`) inside each model loop, successfully resolving the 50.0% zero-exposure entropy block.
* **Defensive Class Array Check**: Guarded against `IndexError` in the Meta-Learner confidence calculator by checking `len(meta_clf.classes_) >= 2`, providing stable execution fallbacks if the training correctness labels are uniform.
### Active Bugs / Compile Status
* **Active Bugs**: None.
* **Type Checker Status**: Verified 100% clean type verification (`npx tsc --noEmit` returns exit code 0).