Weekly Intelligent Advisory Review #5
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: Weekly Model Recommendations | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| as_of: | |
| description: "Report date. Defaults to current UTC date when empty." | |
| required: false | |
| type: string | |
| political_events_path: | |
| description: "Path inside PoliticalEventTrackingResearch." | |
| required: false | |
| default: "data/live/political_events.csv" | |
| type: string | |
| political_watchlist_path: | |
| description: "Path inside PoliticalEventTrackingResearch." | |
| required: false | |
| default: "data/live/political_watchlist.csv" | |
| type: string | |
| ai_signal_path: | |
| description: "Path inside ResearchSignalContextPipelines." | |
| required: false | |
| default: "data/output/latest_signal.json" | |
| type: string | |
| theme_momentum_path: | |
| description: "Optional path inside ResearchSignalContextPipelines. Empty disables theme momentum context." | |
| required: false | |
| default: "data/output/theme_momentum_snapshot.json" | |
| type: string | |
| market_confirmation_path: | |
| description: "Optional market confirmation CSV path inside advisor repository. Empty disables this input." | |
| required: false | |
| default: "" | |
| type: string | |
| schedule: | |
| - cron: "30 12 * * 6" | |
| jobs: | |
| build-review: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout advisor repository | |
| uses: actions/checkout@v6 | |
| with: | |
| path: advisor | |
| - name: Checkout political event repository | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: QuantStrategyLab/PoliticalEventTrackingResearch | |
| path: political-events | |
| - name: Checkout signal context repository | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: QuantStrategyLab/ResearchSignalContextPipelines | |
| path: research-signal-context | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install advisor package | |
| working-directory: advisor | |
| run: python -m pip install -e . | |
| - name: Build model recommendation report | |
| working-directory: advisor | |
| env: | |
| INPUT_AS_OF: ${{ github.event.inputs.as_of || '' }} | |
| POLITICAL_EVENTS_PATH: ${{ github.event.inputs.political_events_path || 'data/live/political_events.csv' }} | |
| POLITICAL_WATCHLIST_PATH: ${{ github.event.inputs.political_watchlist_path || 'data/live/political_watchlist.csv' }} | |
| AI_SIGNAL_PATH: ${{ github.event.inputs.ai_signal_path || 'data/output/latest_signal.json' }} | |
| THEME_MOMENTUM_PATH: ${{ github.event.inputs.theme_momentum_path || 'data/output/theme_momentum_snapshot.json' }} | |
| MARKET_CONFIRMATION_PATH: ${{ github.event.inputs.market_confirmation_path || '' }} | |
| run: | | |
| set -euo pipefail | |
| AS_OF="${INPUT_AS_OF:-$(date -u +%F)}" | |
| mkdir -p data/output/weekly_advisory_review | |
| THEME_ARGS=() | |
| RESOLVED_THEME_MOMENTUM="" | |
| if [ -n "${THEME_MOMENTUM_PATH}" ] && [ -f "../research-signal-context/${THEME_MOMENTUM_PATH}" ]; then | |
| RESOLVED_THEME_MOMENTUM="../research-signal-context/${THEME_MOMENTUM_PATH}" | |
| THEME_ARGS=(--theme-momentum "${RESOLVED_THEME_MOMENTUM}") | |
| fi | |
| MARKET_ARGS=() | |
| if [ -n "${MARKET_CONFIRMATION_PATH}" ] && [ -f "${MARKET_CONFIRMATION_PATH}" ]; then | |
| MARKET_ARGS=(--market-confirmation "${MARKET_CONFIRMATION_PATH}") | |
| else | |
| GENERATED_MARKET_CONFIRMATION="data/output/weekly_advisory_review/market_confirmation_${AS_OF}.csv" | |
| MARKET_BUILD_ARGS=( | |
| --as-of "${AS_OF}" | |
| --political-watchlist "../political-events/${POLITICAL_WATCHLIST_PATH}" | |
| --ai-signal "../research-signal-context/${AI_SIGNAL_PATH}" | |
| --output "${GENERATED_MARKET_CONFIRMATION}" | |
| ) | |
| if [ -n "${RESOLVED_THEME_MOMENTUM}" ]; then | |
| MARKET_BUILD_ARGS+=(--theme-momentum "${RESOLVED_THEME_MOMENTUM}") | |
| fi | |
| python scripts/build_market_confirmation.py "${MARKET_BUILD_ARGS[@]}" | |
| MARKET_ARGS=(--market-confirmation "${GENERATED_MARKET_CONFIRMATION}") | |
| fi | |
| python scripts/build_advisory_report.py \ | |
| --as-of "${AS_OF}" \ | |
| --cadence weekly \ | |
| --political-events "../political-events/${POLITICAL_EVENTS_PATH}" \ | |
| --political-watchlist "../political-events/${POLITICAL_WATCHLIST_PATH}" \ | |
| --ai-signal "../research-signal-context/${AI_SIGNAL_PATH}" \ | |
| "${THEME_ARGS[@]}" \ | |
| "${MARKET_ARGS[@]}" \ | |
| --output-json "data/output/weekly_advisory_review/advisory_report_${AS_OF}.json" \ | |
| --output-md "data/output/weekly_advisory_review/advisory_report_${AS_OF}.md" | |
| - name: Upload model recommendation artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: weekly-model-recommendations | |
| path: advisor/data/output/weekly_advisory_review/ | |
| if-no-files-found: error |