Merge pull request #426 from easygap/fix/evaluator-per-basket-capital #807
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Safety Regression | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| safety-regression: | |
| name: Paper and promotion safety checks | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| env: | |
| PYTHONUNBUFFERED: "1" | |
| QUANT_AUTO_ENTRY: "false" | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e . | |
| python -m pip install pytest pytest-asyncio pandas numpy scipy sqlalchemy pyyaml loguru requests click matplotlib websockets | |
| - name: Compile safety modules | |
| run: | | |
| python -m py_compile main.py api/websocket_handler.py core/data_collector.py core/order_executor.py core/paper_preflight.py core/scheduler.py core/live_gate.py core/target_weight_rotation.py monitoring/liquidate_trigger.py tools/target_weight_rotation_pilot.py tools/paper_pilot_control.py | |
| - name: Run safety regression tests | |
| env: | |
| TMPDIR: ${{ runner.temp }} | |
| TMP: ${{ runner.temp }} | |
| TEMP: ${{ runner.temp }} | |
| run: | | |
| python -m pytest \ | |
| tests/test_order_executor_paper.py \ | |
| tests/test_executor_state_machine.py \ | |
| tests/test_paper_runtime.py \ | |
| tests/test_paper_preflight.py \ | |
| tests/test_paper_pilot.py \ | |
| tests/test_audit_safety.py \ | |
| tests/test_critical_fixes.py \ | |
| tests/test_live_status_sync.py \ | |
| tests/test_scheduler.py \ | |
| tests/test_target_weight_rotation.py \ | |
| tests/test_target_weight_paper_adapter.py \ | |
| tests/test_live_gate.py \ | |
| tests/test_paper_evidence.py \ | |
| tests/test_promotion_engine.py \ | |
| tests/test_evaluate_and_promote.py | |
| - name: Run operator artifact checks | |
| run: | | |
| if [ -f reports/promotion/metrics_summary.json ] && \ | |
| [ -f reports/promotion/promotion_result.json ] && \ | |
| [ -f reports/promotion/promotion_blocker_summary.json ] && \ | |
| [ -f reports/current_blockers.json ]; then | |
| python tools/evaluate_and_promote.py --check-only | |
| python tools/evaluate_and_promote.py --current-blockers-check | |
| else | |
| echo "operator artifacts not present in this checkout; skipping artifact sync checks" | |
| fi |