Skip to content

Weekly Intelligent Advisory Review #15

Weekly Intelligent Advisory Review

Weekly Intelligent Advisory Review #15

name: Weekly Intelligent Advisory Review
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
market_data_proxy_urls:
description: "Optional comma/newline-separated public proxy URLs for free market data fetches."
required: false
default: ""
type: string
market_data_proxy_pool_url:
description: "Optional public text URL returning one proxy per line for free market data fetches."
required: false
default: ""
type: string
schedule:
- cron: "30 12 * * 6"
permissions:
contents: read
concurrency:
group: weekly-advisory-review-${{ github.ref_name }}
cancel-in-progress: false
jobs:
build-review:
runs-on: ubuntu-latest
timeout-minutes: 45
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: Restore market data cache
uses: actions/cache/restore@v5
continue-on-error: true
with:
path: advisor/.cache/market-data
key: ${{ runner.os }}-qar-market-data-v1-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
${{ runner.os }}-qar-market-data-v1-
- name: Build intelligent advisory 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 || '' }}
MARKET_DATA_PROXY_URLS: ${{ github.event.inputs.market_data_proxy_urls || vars.MARKET_DATA_PROXY_URLS || '' }}
MARKET_DATA_PROXY_POOL_URL: ${{ github.event.inputs.market_data_proxy_pool_url || vars.MARKET_DATA_PROXY_POOL_URL || '' }}
run: |
set -euo pipefail
AS_OF="${INPUT_AS_OF:-$(date -u +%F)}"
mkdir -p .cache/market-data
ARGS=(
--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}"
--output-dir data/output/weekly_advisory_review
--market-cache-dir .cache/market-data
--recommendation-review
)
if [ -n "${THEME_MOMENTUM_PATH}" ]; then
ARGS+=(--theme-momentum "../research-signal-context/${THEME_MOMENTUM_PATH}")
fi
if [ -n "${MARKET_CONFIRMATION_PATH}" ]; then
ARGS+=(--market-confirmation "${MARKET_CONFIRMATION_PATH}")
fi
if [ -n "${MARKET_DATA_PROXY_URLS}" ]; then
ARGS+=(--market-proxy-urls "${MARKET_DATA_PROXY_URLS}")
fi
if [ -n "${MARKET_DATA_PROXY_POOL_URL}" ]; then
ARGS+=(--market-proxy-pool-url "${MARKET_DATA_PROXY_POOL_URL}")
fi
python scripts/build_advisory_artifacts.py "${ARGS[@]}"
- name: Save market data cache
if: ${{ success() }}
uses: actions/cache/save@v5
continue-on-error: true
with:
path: advisor/.cache/market-data
key: ${{ runner.os }}-qar-market-data-v1-${{ github.run_id }}-${{ github.run_attempt }}
- name: Upload intelligent advisory artifact
uses: actions/upload-artifact@v7
with:
name: weekly-model-recommendations
path: advisor/data/output/weekly_advisory_review/
if-no-files-found: error