diff --git a/.github/workflows/drift-check.yml b/.github/workflows/drift-check.yml index 05decc9..9e572c4 100644 --- a/.github/workflows/drift-check.yml +++ b/.github/workflows/drift-check.yml @@ -6,6 +6,11 @@ on: schedule: - cron: "0 6 * * *" workflow_dispatch: + inputs: + strategy_profile: + description: "Optional supported profile for an isolated research/drift run." + required: false + type: string permissions: contents: read @@ -26,7 +31,7 @@ jobs: uses: actions/checkout@v6 with: repository: QuantStrategyLab/QuantPlatformKit - ref: aae333fe8b3fe5aeb32e1ff135ab14ea7db32420 + ref: b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c path: external/QuantPlatformKit - name: Set up Python @@ -137,6 +142,7 @@ jobs: env: LIFECYCLE_PREFLIGHT_BUNDLE_ROOT: ${{ runner.temp }}/lifecycle-preflight-bundle MARKET_HISTORY_PATH: ${{ runner.temp }}/snapshot-input/downloaded_price_history.csv + REQUESTED_STRATEGY_PROFILE: ${{ inputs.strategy_profile || '' }} run: | set -euo pipefail python - <<'PY' @@ -145,12 +151,27 @@ jobs: import subprocess from pathlib import Path - profiles = json.loads( - subprocess.check_output( - ["python", "scripts/run_walk_forward_backtest.py", "--list-lifecycle-profiles"], - text=True, - ) - )["profiles"] + requested_profile = os.environ.get("REQUESTED_STRATEGY_PROFILE", "").strip() + if requested_profile: + supported_profiles = json.loads( + subprocess.check_output( + ["python", "scripts/run_walk_forward_backtest.py", "--list-profiles"], + text=True, + ) + )["profiles"] + if requested_profile not in supported_profiles: + raise SystemExit( + f"unsupported targeted lifecycle profile={requested_profile!r}; " + f"supported={sorted(supported_profiles)}" + ) + profiles = [requested_profile] + else: + profiles = json.loads( + subprocess.check_output( + ["python", "scripts/run_walk_forward_backtest.py", "--list-lifecycle-profiles"], + text=True, + ) + )["profiles"] bundle_root = Path(os.environ["LIFECYCLE_PREFLIGHT_BUNDLE_ROOT"]) market_history = os.environ["MARKET_HISTORY_PATH"] store_root = bundle_root / "data" / "lifecycle_store" @@ -194,7 +215,7 @@ jobs: contents: read issues: write id-token: write - uses: QuantStrategyLab/QuantPlatformKit/.github/workflows/reusable-drift-check.yml@8b8ce3543c04bf12920e38b0f45d2b32a8896580 + uses: QuantStrategyLab/QuantPlatformKit/.github/workflows/reusable-drift-check.yml@b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c with: strategy_domain: us_equity caller_event_name: ${{ github.event_name }} @@ -203,8 +224,9 @@ jobs: snapshot_checkout_path: external/UsEquitySnapshotPipelines snapshot_repository_ref: ${{ needs.preflight_backtests.outputs.snapshot_repository_ref }} ai_gateway_service_url: ${{ vars.AI_GATEWAY_SERVICE_URL }} - quant_platform_kit_ref: 8b8ce3543c04bf12920e38b0f45d2b32a8896580 + quant_platform_kit_ref: b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c lifecycle_preflight_artifact: lifecycle-preflight-${{ github.run_id }}-${{ github.run_attempt }} + strategy_profile: ${{ inputs.strategy_profile || '' }} secrets: codex_audit_service_url: ${{ secrets.CODEX_AUDIT_SERVICE_URL }} snapshot_repository_token: ${{ secrets.SNAPSHOT_REPOSITORY_TOKEN || secrets.QSL_REPO_SYNC_TOKEN || github.token }} diff --git a/pyproject.toml b/pyproject.toml index bf8101c..07e1d69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ requires-python = ">=3.11" dependencies = [ "pandas>=2.0", "pytz>=2024.1", - "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@8b8ce3543c04bf12920e38b0f45d2b32a8896580", + "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c", ] [tool.setuptools] diff --git a/qsl.toml b/qsl.toml index 54c7036..7d1b670 100644 --- a/qsl.toml +++ b/qsl.toml @@ -6,5 +6,5 @@ bundle = "2026.08.0" requires = [ "pandas>=2.0", "pytz>=2024.1", - "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@8b8ce3543c04bf12920e38b0f45d2b32a8896580", + "quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c", ] diff --git a/tests/test_drift_workflow_config.py b/tests/test_drift_workflow_config.py index 101e7ac..cb26c77 100644 --- a/tests/test_drift_workflow_config.py +++ b/tests/test_drift_workflow_config.py @@ -21,7 +21,7 @@ def test_drift_workflow_wires_real_snapshot_history_and_preflight_bundle() -> No assert '"conclusion": "success"' in workflow assert '"QuantStrategyLab/UsEquitySnapshotPipelines"' in workflow assert "repository: QuantStrategyLab/QuantPlatformKit" in workflow - assert "ref: 8b8ce3543c04bf12920e38b0f45d2b32a8896580" in workflow + assert "ref: b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c" in workflow assert "python -m pip install --no-deps -e external/QuantPlatformKit" in workflow assert "scripts/run_walk_forward_backtest.py" in workflow assert '"--list-lifecycle-profiles"' in workflow @@ -30,7 +30,7 @@ def test_drift_workflow_wires_real_snapshot_history_and_preflight_bundle() -> No assert "LIFECYCLE_PREFLIGHT_BUNDLE_ROOT" in workflow assert "Upload lifecycle preflight artifact" in workflow assert "actions/upload-artifact@v7" in workflow - assert "uses: QuantStrategyLab/QuantPlatformKit/.github/workflows/reusable-drift-check.yml@8b8ce3543c04bf12920e38b0f45d2b32a8896580" in workflow + assert "uses: QuantStrategyLab/QuantPlatformKit/.github/workflows/reusable-drift-check.yml@b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c" in workflow assert "strategy_domain: us_equity" in workflow assert "caller_event_name: ${{ github.event_name }}" in workflow assert "caller_pr_head_repository: ${{ github.event.pull_request.head.repo.full_name || '' }}" in workflow @@ -38,6 +38,10 @@ def test_drift_workflow_wires_real_snapshot_history_and_preflight_bundle() -> No assert "snapshot_checkout_path: external/UsEquitySnapshotPipelines" in workflow assert "ai_gateway_service_url: ${{ vars.AI_GATEWAY_SERVICE_URL }}" in workflow assert "lifecycle_preflight_artifact: lifecycle-preflight-${{ github.run_id }}-${{ github.run_attempt }}" in workflow - assert "quant_platform_kit_ref: 8b8ce3543c04bf12920e38b0f45d2b32a8896580" in workflow + assert "quant_platform_kit_ref: b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c" in workflow + assert "strategy_profile:" in workflow + assert "REQUESTED_STRATEGY_PROFILE: ${{ inputs.strategy_profile || '' }}" in workflow + assert '"--list-profiles"' in workflow + assert "unsupported targeted lifecycle profile=" in workflow assert "codex_audit_service_url: ${{ secrets.CODEX_AUDIT_SERVICE_URL }}" in workflow assert "secrets.SNAPSHOT_REPOSITORY_TOKEN || secrets.QSL_REPO_SYNC_TOKEN || github.token" in workflow diff --git a/tests/test_qsl_compat_metadata.py b/tests/test_qsl_compat_metadata.py index df3c526..7497ea4 100644 --- a/tests/test_qsl_compat_metadata.py +++ b/tests/test_qsl_compat_metadata.py @@ -3,7 +3,7 @@ ROOT = Path(__file__).resolve().parents[1] -QPK_REVISION = "8b8ce3543c04bf12920e38b0f45d2b32a8896580" +QPK_REVISION = "b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c" QPK_URL = ( "quant-platform-kit @ git+https://github.com/QuantStrategyLab/" f"QuantPlatformKit.git@{QPK_REVISION}" diff --git a/uv.lock b/uv.lock index 84d46b3..07c4475 100644 --- a/uv.lock +++ b/uv.lock @@ -241,7 +241,7 @@ wheels = [ [[package]] name = "quant-platform-kit" version = "0.10.0" -source = { git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=8b8ce3543c04bf12920e38b0f45d2b32a8896580#8b8ce3543c04bf12920e38b0f45d2b32a8896580" } +source = { git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c#b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c" } [[package]] name = "six" @@ -275,5 +275,5 @@ dependencies = [ requires-dist = [ { name = "pandas", specifier = ">=2.0" }, { name = "pytz", specifier = ">=2024.1" }, - { name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=8b8ce3543c04bf12920e38b0f45d2b32a8896580" }, + { name = "quant-platform-kit", git = "https://github.com/QuantStrategyLab/QuantPlatformKit.git?rev=b65ddd6dbacf47d1b4e4eaecf404cd98eddd7a2c" }, ]