Files
xnessomGitHubxnessomgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
6f122d5a8f 📦 Jules02: Dependency and environment hygiene — hardened config and synced core deps (#603)
* 📦 Jules02: Dependency and environment hygiene — hardened config and synced core deps

- Hardened `TradingConfig` with Pydantic field constraints to match `RISK_LIMITS.md`.
- Synchronized `scikit-learn` (1.7.2) and `structlog` (25.5.0) across all environments.
- Added type stubs for redis, requests, dateutil, and setuptools to CI requirements.
- Updated `test_config_validator.py` to reflect new Pydantic-level enforcement.

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

* 📦 Jules02: Dependency and environment hygiene — hardened config, synced core deps, and CI fixes

- Hardened `TradingConfig` with Pydantic field constraints to match `RISK_LIMITS.md`.
- Synchronized `scikit-learn` (1.7.2) and `structlog` (25.5.0) across all environments.
- Added type stubs for redis, requests, dateutil, and setuptools to CI requirements.
- Updated `test_config_validator.py` to reflect new Pydantic-level enforcement.
- Fixed CI failures:
    - Added missing `Dict` import in `src/trading/execution_filter.py`.
    - Created `docs/environment_hygiene.md` to satisfy auto-merge documentation policy.
    - Added `python-telegram-bot` to migration safety workflow dependencies.

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-04 05:42:43 +00:00

1.3 KiB

Dependency and Environment Hygiene Improvements

Configuration Hardening

  • Alignment with RISK_LIMITS.md: Updated src/core/config.py with strict Pydantic Field constraints (ge, le) to match enterprise risk standards. Unsafe configurations are now rejected at startup.
  • Tighter Bounds:
    • max_positions: reduced maximum from 10 to 5.
    • risk_per_trade: reduced maximum from 5% to 2%.
    • max_daily_loss: reduced maximum from 20% to 6%.
    • confidence_threshold: minimum set to 0.5.
    • model_accuracy_floor: minimum set to 0.5.
    • model_win_rate_floor: minimum set to 0.4.

Dependency Synchronization

  • Consistency: Unified versions of scikit-learn==1.7.2 and structlog==25.5.0 across requirements.txt, requirements-linux.txt, and requirements-docker.txt to eliminate environment drift.
  • Type Safety: Added missing type stubs (types-redis, types-requests, types-python-dateutil, types-setuptools, types-PyYAML) to CI requirements to improve static analysis reliability.

Code Quality & Fixes

  • Fix: Added missing Dict import in src/trading/execution_filter.py to resolve CI linting errors.
  • Validation: Verified Pydantic enforcement logic and ensured compatibility with existing test suites.