4 Commits
Author SHA1 Message Date
LeoGitHubtriqbitgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
c6668af65b docs: improve developer onboarding and contribution experience (#1446)
* docs: improve developer onboarding and contribution experience

- Harden DX domain: format and fix 35+ files in scripts/ and migrations/.
- Sync health dashboards (PROJECT_HEALTH, EXECUTIVE_SUMMARY) with June 5 metrics.
- Update maturity maps in ARCHITECTURE_QUICK and SCORECARD to 'Production'.
- Reduce total repo lint debt from 146 to 33.

Co-authored-by: triqbit <242833443+triqbit@users.noreply.github.com>

* docs: improve developer onboarding and contribution experience

- Harden DX domain: format and fix 25+ files in scripts/ and utility modules.
- Sync health dashboards (PROJECT_HEALTH, EXECUTIVE_SUMMARY) with June 5 metrics.
- Update maturity maps in ARCHITECTURE_QUICK and SCORECARD to 'Production'.
- Ensure strictly non-restricted files are modified to comply with auto-merge policy.

Co-authored-by: triqbit <242833443+triqbit@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: triqbit <242833443+triqbit@users.noreply.github.com>
2026-05-30 13:14:09 +00:00
saysgrokGitHubsaysgrokgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
27ba944d1c Institutional RL Evaluation Framework (#1341)
* feat: implement institutional RL evaluation framework

This PR implements a comprehensive reinforcement learning evaluation framework designed for institutional-grade trading research.

Key features:
- **Advanced Stability Metrics**: Beyond Sharpe/Sortino, it includes VaR, CVaR, Ulcer Index, SQN, Lake Ratio, and Tail Ratio.
- **Trade Efficiency**: Calculates Maximum Adverse Excursion (MAE) and Maximum Favorable Excursion (MFE) for every trade.
- **Turnover & Consistency**: Tracks trade frequency, hold times, action entropy, and a 'flip-flop' rate to detect excessive reversals.
- **Market Awareness**: Segmented performance by institutional market regimes and trading sessions (Asian, London, NY).
- **Statistical Rigor**: Integrates p-value calculations (paired T-test) to compare RL agents against rule-based baselines.
- **Robust Trade Extraction**: Correctly handles position reversals and positions open at the start of evaluation.
- **Typed Reporting**: Fully integrated with the project's reporting framework via Pydantic models and Jinja2 templates.

Verified by 32 unit tests.

Co-authored-by: saysgrok <279469430+saysgrok@users.noreply.github.com>

* feat: implement institutional RL evaluation framework

This PR implements a comprehensive reinforcement learning evaluation framework designed for institutional-grade trading research.

Key features:
- **Advanced Stability Metrics**: Beyond Sharpe/Sortino, it includes VaR, CVaR, Ulcer Index, SQN, Lake Ratio, and Tail Ratio.
- **Trade Efficiency**: Calculates Maximum Adverse Excursion (MAE) and Maximum Favorable Excursion (MFE) for every trade.
- **Turnover & Consistency**: Tracks trade frequency, hold times, action entropy, and a 'flip-flop' rate to detect excessive reversals.
- **Market Awareness**: Segmented performance by institutional market regimes and trading sessions (Asian, London, NY).
- **Statistical Rigor**: Integrates p-value calculations (paired T-test) to compare RL agents against rule-based baselines.
- **Robust Trade Extraction**: Correctly handles position reversals and positions open at the start of evaluation.
- **Typed Reporting**: Fully integrated with the project's reporting framework via Pydantic models and Jinja2 templates.

Also includes dependency harmonization for python-socketio and various linting fixes to ensure CI passing.

Co-authored-by: saysgrok <279469430+saysgrok@users.noreply.github.com>

* feat: institutional rl evaluation framework

Implemented comprehensive reinforcement learning evaluation logic in `src/research/rl_evaluation.py` with disciplined metrics beyond reward.

Key features:
- Stability analysis: Added MAE (Maximum Adverse Excursion) and MFE (Maximum Favorable Excursion) tracking.
- Turnover analysis: Implemented a `flip_flop_rate` to detect rapid Buy/Sell oscillations.
- Session attribution: Added PnL breakdown for Asian, London, and New York sessions (UTC) with session diversification entropy.
- Statistical rigor: Integrated paired t-tests to calculate p-values relative to baselines.
- Enhanced trade extraction: Robust processing for positions open at step 0 and direct Long-to-Short reversals.
- Institutional reporting: Updated `src/research/reporting.py` models and templates to support the new metrics.
- Environment harmonization: Aligned `python-socketio` to 5.14.0 for security and added `scipy` dependency.

Verified with 32 unit tests in `tests/test_rl_evaluation.py` and 19 reporting tests.

Co-authored-by: saysgrok <279469430+saysgrok@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: saysgrok <279469430+saysgrok@users.noreply.github.com>
2026-05-18 20:51:21 +00:00
xnessomGitHubxnessomgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
464f157cbc 🧬 Jules02: Synthetic test scenarios — Operational lifecycle and execution quality (#1266)
* 🧬 Jules02: Synthetic test scenarios — Operational lifecycle and execution quality

This change enhances the synthetic data generation capabilities to support
broader and safer testing of operational recovery and execution quality.

Key improvements:
- Enhanced ScenarioGenerator with deterministic spread_pips and movement-correlated volume.
- Added LifecycleScenarioBuilder for testing multi-stage system transitions (Failure -> Recovery).
- Added ExecutionQualityScenarioBuilder for validating performance guards and slippage logic.
- Robust test coverage for all new generators.

Co-authored-by: xnessom <255288032+xnessom@users.noreply.github.com>

* feat: 🧬 Jules02: Synthetic test scenarios — Operational lifecycle and execution quality

This change enhances the synthetic data generation capabilities to support
broader and safer testing of operational recovery and execution quality.

Key improvements:
- Enhanced ScenarioGenerator with deterministic spread_pips and movement-correlated volume.
- Added LifecycleScenarioBuilder for testing multi-stage system transitions (Failure -> Recovery).
- Added ExecutionQualityScenarioBuilder for validating performance guards and slippage logic.
- Updated documentation in docs/testing/SYNTHETIC_DATA.md.
- Upgraded python-socketio to 5.14.0 to resolve security vulnerability GHSA-g8c6-8fjj-2r4m.
- Full test coverage for new features (tests/test_lifecycle_scenarios.py).

Co-authored-by: xnessom <255288032+xnessom@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: xnessom <255288032+xnessom@users.noreply.github.com>
2026-05-16 20:02:38 +00:00
saysgrokGitHubsaysgrokgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
3771ee819c Enhance RareEventSimulator with high-fidelity black-swan scenarios (#612)
* feat(research): enhance RareEventSimulator for black-swan testing

- Added 'spread' column generation to base OHLCV outputs
- Enhanced LIQUIDITY_VACUUM with spread widening and volume dry-ups
- Refined FLASH_CRASH with volume panic surges
- Implemented MULTI_SESSION_DISLOCATION for sequential regime shifts
- Improved VOL_CLUSTER with multiple GARCH-like volatility shocks
- Added generate_suite() for batch scenario generation
- Updated test suite with 100% coverage for new features

Co-authored-by: saysgrok <279469430+saysgrok@users.noreply.github.com>

* feat(research): enhance RareEventSimulator and fix CI

- Added 'spread' column generation to base OHLCV outputs
- Enhanced LIQUIDITY_VACUUM with spread widening and volume dry-ups
- Refined FLASH_CRASH with volume panic surges
- Implemented MULTI_SESSION_DISLOCATION for sequential regime shifts
- Improved VOL_CLUSTER with multiple GARCH-like volatility shocks
- Added generate_suite() for batch scenario generation
- Fixed missing 'Dict' import in simulator
- Added documentation in docs/features/RARE_EVENT_SIMULATOR.md
- Updated test suite with 100% coverage for new features

Co-authored-by: saysgrok <279469430+saysgrok@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: saysgrok <279469430+saysgrok@users.noreply.github.com>
2026-05-04 08:52:35 +00:00