From 6100c0c53b54e169c33c6c6c9e13f1e3030554f9 Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Sat, 29 Aug 2026 15:46:37 +0800 Subject: [PATCH] ci: publish weekly M0 research source snapshot Co-Authored-By: Codex --- .github/workflows/weekly_advisory_review.yml | 11 +++++++++++ docs/m0_research_hypothesis_contract.md | 11 +++++++++++ tests/test_workflow_defaults.py | 7 +++++++ 3 files changed, 29 insertions(+) diff --git a/.github/workflows/weekly_advisory_review.yml b/.github/workflows/weekly_advisory_review.yml index 79cf647..62f0041 100644 --- a/.github/workflows/weekly_advisory_review.yml +++ b/.github/workflows/weekly_advisory_review.yml @@ -123,6 +123,17 @@ jobs: ARGS+=(--market-proxy-pool-url "${MARKET_DATA_PROXY_POOL_URL}") fi python scripts/build_advisory_artifacts.py "${ARGS[@]}" + echo "ADVISORY_REPORT_PATH=data/output/weekly_advisory_review/advisory_report_${AS_OF}.json" >> "$GITHUB_ENV" + echo "M0_RESEARCH_SOURCE_SNAPSHOT_PATH=data/output/weekly_advisory_review/m0_research_source_snapshot_${AS_OF}.json" >> "$GITHUB_ENV" + - name: Build offline M0 research source snapshot + working-directory: advisor + run: | + set -euo pipefail + test -f "${ADVISORY_REPORT_PATH}" + python -m quant_advisor_research.m0_research_source_snapshot \ + --report "${ADVISORY_REPORT_PATH}" \ + --output-json "${M0_RESEARCH_SOURCE_SNAPSHOT_PATH}" + test -f "${M0_RESEARCH_SOURCE_SNAPSHOT_PATH}" - name: Save market data cache if: ${{ success() }} uses: actions/cache/save@v5 diff --git a/docs/m0_research_hypothesis_contract.md b/docs/m0_research_hypothesis_contract.md index a237425..058211a 100644 --- a/docs/m0_research_hypothesis_contract.md +++ b/docs/m0_research_hypothesis_contract.md @@ -49,3 +49,14 @@ platform, change a runtime target, or submit an order. The next repository-owned stage may map a valid M0 hypothesis to a bounded research task. Only later P1--P3 data, backtest, and audit evidence can create an immutable strategy candidate for P0 Shadow selection. + +## Weekly artifact snapshot + +The weekly advisory workflow first writes the explicit local report path +`data/output/weekly_advisory_review/advisory_report_.json`. Once that +file exists, the same job invokes the offline +`quant_advisor_research.m0_research_source_snapshot` CLI and writes +`m0_research_source_snapshot_.json` beside it. Both files remain in the +existing `weekly-model-recommendations` artifact. This producer performs no +external synchronization and does not change the weekly report inputs, +schedule, publication site, runtime, platform, or execution state. diff --git a/tests/test_workflow_defaults.py b/tests/test_workflow_defaults.py index 552ab74..6d1359d 100644 --- a/tests/test_workflow_defaults.py +++ b/tests/test_workflow_defaults.py @@ -25,6 +25,13 @@ def test_public_workflows_default_to_live_event_inputs() -> None: assert "--market-cache-dir .cache/market-data" in text assert "--recommendation-review" in text + weekly = (ROOT / ".github" / "workflows" / "weekly_advisory_review.yml").read_text(encoding="utf-8") + assert "ADVISORY_REPORT_PATH=data/output/weekly_advisory_review/advisory_report_${AS_OF}.json" in weekly + assert "M0_RESEARCH_SOURCE_SNAPSHOT_PATH=data/output/weekly_advisory_review/m0_research_source_snapshot_${AS_OF}.json" in weekly + assert "python -m quant_advisor_research.m0_research_source_snapshot" in weekly + assert "--report \"${ADVISORY_REPORT_PATH}\"" in weekly + assert "--output-json \"${M0_RESEARCH_SOURCE_SNAPSHOT_PATH}\"" in weekly + def test_cross_repo_smoke_workflow_uses_live_artifacts_and_no_network_market_fallback() -> None: text = (ROOT / ".github" / "workflows" / "cross_repo_smoke.yml").read_text(encoding="utf-8")