Merge pull request #459 from easygap/fix/snapshot-coverage-recovery #877
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 -r requirements.txt | |
| python -m pip install -e . --no-deps | |
| - 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 -q | |
| - 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 are runtime evidence and are not committed; sync checks require an artifact-enabled operational run" | |
| fi |