Drift Check #1
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: Drift Check | |
| # Daily drift detection for crypto strategies. | |
| on: | |
| schedule: | |
| - cron: "0 6 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: write | |
| id-token: write | |
| jobs: | |
| drift: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| STRATEGY_DOMAIN: crypto | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Checkout QuantPlatformKit | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: QuantStrategyLab/QuantPlatformKit | |
| ref: main | |
| path: external/QuantPlatformKit | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| set -euo pipefail | |
| python -m pip install --upgrade pip | |
| python -m pip install -e . pandas | |
| python -m pip install --no-deps -e external/QuantPlatformKit | |
| - name: Run drift detection | |
| run: quant-lifecycle drift --domain crypto --no-alerts | |
| - name: Sync drift alerts to GitHub Issues | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| run: python scripts/run_drift_github_issues.py | |
| - name: Checkout AIAuditBridge | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: QuantStrategyLab/AIAuditBridge | |
| ref: main | |
| path: external/AIAuditBridge | |
| - name: Dual-review critical drift | |
| env: | |
| AIAUDIT_BRIDGE_ROOT: external/AIAuditBridge | |
| CODEX_AUDIT_SERVICE_URL: ${{ secrets.CODEX_AUDIT_SERVICE_URL }} | |
| AI_GATEWAY_SERVICE_URL: ${{ vars.AI_GATEWAY_SERVICE_URL }} | |
| run: | | |
| script="external/AIAuditBridge/scripts/run_drift_dual_review.py" | |
| if [ ! -f "$script" ]; then | |
| echo "::notice::dual-review scripts unavailable; skipping until AIAuditBridge is merged" | |
| exit 0 | |
| fi | |
| if [ -z "${CODEX_AUDIT_SERVICE_URL:-}" ]; then | |
| echo "::notice::CODEX_AUDIT_SERVICE_URL not configured; skipping dual-review dispatch" | |
| exit 0 | |
| fi | |
| PYTHONPATH=external/AIAuditBridge python "$script" \ | |
| --domain "${STRATEGY_DOMAIN}" --dispatch |