From 783e7c404842cbaeabf92f40c665f01ab288e0ef Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Fri, 18 Sep 2026 01:23:59 +0800 Subject: [PATCH] feat(ai): wire Cursor to canary diagnosis and briefing consumers Point research-task diagnosis, portfolio proposal diagnosis, and daily briefing at Cursor subscription; leave codegen/CN/promotion on Codex. Co-authored-by: Cursor --- .github/workflows/codex_audit.yml | 3 ++- .github/workflows/portfolio_research_proposal_diagnosis.yml | 2 ++ .github/workflows/strategy_optimization_watcher.yml | 5 ++++- tests/test_daily_briefing_summary.py | 1 + tests/test_portfolio_research_proposal_workflow.py | 1 + tests/test_strategy_optimization_watcher_workflow.py | 4 +++- 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codex_audit.yml b/.github/workflows/codex_audit.yml index 37c91932..3cebe763 100644 --- a/.github/workflows/codex_audit.yml +++ b/.github/workflows/codex_audit.yml @@ -265,7 +265,8 @@ jobs: CODEX_AUDIT_SERVICE_URL: ${{ secrets.CODEX_AUDIT_SERVICE_URL }} CODEX_AUDIT_SERVICE_AUDIENCE: ${{ vars.CODEX_AUDIT_SERVICE_AUDIENCE || 'quant-codex-audit' }} AI_GATEWAY_SOURCE_REPO: QuantStrategyLab/AIAuditBridge - AI_GATEWAY_RESEARCH_PROVIDERS: codex + # Canary-eligible daily briefing (research_summary): Cursor subscription. + AI_GATEWAY_RESEARCH_PROVIDERS: cursor PYTHONDONTWRITEBYTECODE: "1" run: | set -euo pipefail diff --git a/.github/workflows/portfolio_research_proposal_diagnosis.yml b/.github/workflows/portfolio_research_proposal_diagnosis.yml index d38732fa..0afdfbc9 100644 --- a/.github/workflows/portfolio_research_proposal_diagnosis.yml +++ b/.github/workflows/portfolio_research_proposal_diagnosis.yml @@ -95,6 +95,8 @@ jobs: CODEX_AUDIT_SERVICE_URL: ${{ secrets.CODEX_AUDIT_SERVICE_URL }} CODEX_AUDIT_SERVICE_AUDIENCE: ${{ vars.CODEX_AUDIT_SERVICE_AUDIENCE || 'quant-codex-audit' }} READINESS_INPUT: ${{ steps.readiness.outputs.input }} + # Canary-eligible portfolio diagnosis: Cursor subscription; fallback stays off. + AI_GATEWAY_RESEARCH_PROVIDERS: cursor run: | set -euo pipefail output_dir="${RUNNER_TEMP}/portfolio-research-proposal" diff --git a/.github/workflows/strategy_optimization_watcher.yml b/.github/workflows/strategy_optimization_watcher.yml index 5ebf2be0..d250bc6a 100644 --- a/.github/workflows/strategy_optimization_watcher.yml +++ b/.github/workflows/strategy_optimization_watcher.yml @@ -346,7 +346,7 @@ jobs: fi done - - name: Run one bounded Codex-only research diagnosis + - name: Run one bounded Cursor research diagnosis id: research-diagnosis if: steps.fetch-metrics.outputs.downloaded == 'true' && github.event_name == 'schedule' env: @@ -355,6 +355,9 @@ jobs: CODEX_AUDIT_SERVICE_URL: ${{ secrets.CODEX_AUDIT_SERVICE_URL }} CODEX_AUDIT_SERVICE_AUDIENCE: ${{ vars.CODEX_AUDIT_SERVICE_AUDIENCE || 'quant-codex-audit' }} RESEARCH_DIAGNOSIS_MAX_PER_RUN: "1" + # Canary-eligible diagnosis lane: Cursor subscription (sandbox enabled). + # Codegen / CN / promotion jobs below stay AI_GATEWAY_RESEARCH_PROVIDERS=codex. + AI_GATEWAY_RESEARCH_PROVIDERS: cursor working-directory: bridge run: | set -euo pipefail diff --git a/tests/test_daily_briefing_summary.py b/tests/test_daily_briefing_summary.py index 1eec360d..6481bbb7 100644 --- a/tests/test_daily_briefing_summary.py +++ b/tests/test_daily_briefing_summary.py @@ -203,6 +203,7 @@ def test_daily_job_uses_existing_oidc_workflow_and_only_exports_summary(): assert "ACTIONS_ID_TOKEN_REQUEST_TOKEN" not in job assert "uses: actions/upload-artifact@v7" in job and "if: always()" in job assert "path: daily-ai-summary.json" in job + assert "AI_GATEWAY_RESEARCH_PROVIDERS: cursor" in job.split("\n operational-diagnosis:", 1)[0] def test_historical_diagnosis_rehearsal_is_manual_oidc_codex_only(): diff --git a/tests/test_portfolio_research_proposal_workflow.py b/tests/test_portfolio_research_proposal_workflow.py index 82fb7f95..b77b1e0a 100644 --- a/tests/test_portfolio_research_proposal_workflow.py +++ b/tests/test_portfolio_research_proposal_workflow.py @@ -18,6 +18,7 @@ def test_workflow_only_consumes_sanitized_readiness_and_comments_existing_issue( self.assertIn("portfolio-candidate-readiness.yml", text) self.assertIn("portfolio-candidate-readiness-*", text) self.assertIn("run_portfolio_research_proposal_diagnosis.py", text) + self.assertIn("AI_GATEWAY_RESEARCH_PROVIDERS: cursor", text) self.assertIn("actions/create-github-app-token", text) self.assertIn("permission-actions: read", text) self.assertIn("permission-issues: write", text) diff --git a/tests/test_strategy_optimization_watcher_workflow.py b/tests/test_strategy_optimization_watcher_workflow.py index 483ba525..400dc9ed 100644 --- a/tests/test_strategy_optimization_watcher_workflow.py +++ b/tests/test_strategy_optimization_watcher_workflow.py @@ -42,9 +42,11 @@ def test_workflow_uses_source_metrics_checkout(self) -> None: self.assertIn("p1-status.json", text) self.assertIn("soxl_soxx_trend_income", text) self.assertIn("python -m scripts.run_research_task_diagnosis", text) + self.assertIn("AI_GATEWAY_RESEARCH_PROVIDERS: cursor", text) + self.assertIn("Run one bounded Cursor research diagnosis", text) self.assertIn("Recover pending verified watcher tasks", text) recovery = text.split(" - name: Recover pending verified watcher tasks", 1)[1].split( - " - name: Run one bounded Codex-only research diagnosis", 1 + " - name: Run one bounded Cursor research diagnosis", 1 )[0] self.assertIn("github.event.schedule == '23 6 * * *'", recovery) self.assertIn("--event schedule --status success --limit 20", text)