Skip to content

Commit 8c62fb7

Browse files
committed
Use live sources for public advisory publishing
1 parent 990d9d9 commit 8c62fb7

15 files changed

Lines changed: 369 additions & 93 deletions

.github/workflows/publish_advisory_site.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ on:
1515
political_events_path:
1616
description: "Path inside PoliticalEventTrackingResearch."
1717
required: false
18-
default: "examples/political_events.example.csv"
18+
default: "data/live/political_events.csv"
1919
type: string
2020
political_watchlist_path:
2121
description: "Path inside PoliticalEventTrackingResearch."
2222
required: false
23-
default: "examples/political_watchlist.example.csv"
23+
default: "data/live/political_watchlist.csv"
2424
type: string
2525
ai_signal_path:
2626
description: "Path inside ResearchSignalContextPipelines."
@@ -73,8 +73,8 @@ jobs:
7373
env:
7474
INPUT_AS_OF: ${{ github.event.inputs.as_of || '' }}
7575
SITE_URL: ${{ github.event.inputs.site_url || 'https://quantstrategylab.github.io/QuantAdvisorResearch' }}
76-
POLITICAL_EVENTS_PATH: ${{ github.event.inputs.political_events_path || 'examples/political_events.example.csv' }}
77-
POLITICAL_WATCHLIST_PATH: ${{ github.event.inputs.political_watchlist_path || 'examples/political_watchlist.example.csv' }}
76+
POLITICAL_EVENTS_PATH: ${{ github.event.inputs.political_events_path || 'data/live/political_events.csv' }}
77+
POLITICAL_WATCHLIST_PATH: ${{ github.event.inputs.political_watchlist_path || 'data/live/political_watchlist.csv' }}
7878
AI_SIGNAL_PATH: ${{ github.event.inputs.ai_signal_path || 'data/output/latest_signal.json' }}
7979
THEME_MOMENTUM_PATH: ${{ github.event.inputs.theme_momentum_path || 'data/output/theme_momentum_snapshot.json' }}
8080
run: |

.github/workflows/weekly_advisory_review.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ on:
1010
political_events_path:
1111
description: "Path inside PoliticalEventTrackingResearch."
1212
required: false
13-
default: "examples/political_events.example.csv"
13+
default: "data/live/political_events.csv"
1414
type: string
1515
political_watchlist_path:
1616
description: "Path inside PoliticalEventTrackingResearch."
1717
required: false
18-
default: "examples/political_watchlist.example.csv"
18+
default: "data/live/political_watchlist.csv"
1919
type: string
2020
ai_signal_path:
2121
description: "Path inside ResearchSignalContextPipelines."
@@ -58,8 +58,8 @@ jobs:
5858
working-directory: advisor
5959
env:
6060
INPUT_AS_OF: ${{ github.event.inputs.as_of || '' }}
61-
POLITICAL_EVENTS_PATH: ${{ github.event.inputs.political_events_path || 'examples/political_events.example.csv' }}
62-
POLITICAL_WATCHLIST_PATH: ${{ github.event.inputs.political_watchlist_path || 'examples/political_watchlist.example.csv' }}
61+
POLITICAL_EVENTS_PATH: ${{ github.event.inputs.political_events_path || 'data/live/political_events.csv' }}
62+
POLITICAL_WATCHLIST_PATH: ${{ github.event.inputs.political_watchlist_path || 'data/live/political_watchlist.csv' }}
6363
AI_SIGNAL_PATH: ${{ github.event.inputs.ai_signal_path || 'data/output/latest_signal.json' }}
6464
THEME_MOMENTUM_PATH: ${{ github.event.inputs.theme_momentum_path || 'data/output/theme_momentum_snapshot.json' }}
6565
run: |

README.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ Live site:
2929

3030
<https://quantstrategylab.github.io/QuantAdvisorResearch/>
3131

32+
Key documents:
33+
34+
- [System design](docs/system_design.md) / [系统设计](docs/system_design.zh-CN.md)
35+
- [Data and factor roadmap](docs/data_factor_roadmap.md) / [数据源与因子路线](docs/data_factor_roadmap.zh-CN.md)
36+
- [Notification format](docs/notification_format.md) / [通知格式](docs/notification_format.zh-CN.md)
37+
- [Artifact contract](docs/advisory_contract.md)
38+
3239

3340
## Horizon Source Split
3441

@@ -150,16 +157,14 @@ The published HTML, RSS feed title, and Telegram summary default to Simplified
150157
Chinese (`zh-CN`) because the current audience is Chinese-language retail
151158
research readers. JSON field names remain stable English contract keys.
152159

153-
For real-source publishing, dispatch the workflow with paths inside sibling
154-
repositories:
160+
The scheduled publish workflow defaults to live source artifacts inside sibling
161+
repositories. Manual dispatch can normally pass only `as_of`; override paths only
162+
when intentionally testing a different artifact:
155163

156164
```bash
157165
gh workflow run "Publish Model Recommendations Site" \
158166
--repo QuantStrategyLab/QuantAdvisorResearch \
159-
-f as_of=2026-05-30 \
160-
-f political_events_path=data/live/political_events.csv \
161-
-f political_watchlist_path=data/live/political_watchlist.csv \
162-
-f ai_signal_path=data/output/latest_signal.json
167+
-f as_of=2026-05-30
163168
```
164169

165170
Notification channel rules are documented in
@@ -211,11 +216,11 @@ evidence_refs[]
211216
review_checklist[]
212217
```
213218

214-
`theme_first_candidates[]` is an optional display section derived from the
215-
theme momentum snapshot. Public renderers present it as a 5-10 name "重点股票池":
216-
industry/theme background, why the name entered the pool, event-confirmation
217-
state, and key risks. It is still research-only and must not encode orders,
218-
target weights, or account-level advice.
219+
`theme_first_candidates[]` is an optional internal explanation artifact derived
220+
from the theme momentum snapshot. The current public HTML, RSS, and Telegram
221+
outputs show only final recommendations; theme candidates remain available in
222+
JSON/Markdown for audit and future review. They are still research-only and must
223+
not encode orders, target weights, or account-level advice.
219224

220225
Default horizon windows:
221226

@@ -226,7 +231,7 @@ Default horizon windows:
226231

227232
## Versioning
228233

229-
The Python package version is `0.1.1`. Report artifacts are versioned separately:
234+
The Python package version is `0.1.2`. Report artifacts are versioned separately:
230235

231236
- report schema: `schema_version = 5`
232237
- report contract: `model_recommendations.v5`
@@ -240,8 +245,13 @@ into executable strategy targets.
240245
## Source Mode
241246

242247
Reports built from `examples/` inputs are marked `source_mode=fixture` and the
243-
HTML/RSS output displays that warning. Live operator-provided inputs are marked
244-
`source_mode=operator_supplied`.
248+
individual HTML report displays a fixture warning. Scheduled weekly/monthly and
249+
Pages workflows now default to `data/live/*` inputs from
250+
`PoliticalEventTrackingResearch`, so published reports should be
251+
`source_mode=operator_supplied` and should not show the fixture warning.
252+
253+
`source_mode` remains in the JSON contract for auditability, but the public
254+
index, RSS, and Telegram summaries do not expose that internal field.
245255

246256
## Regulatory Boundary
247257

@@ -274,12 +284,12 @@ python scripts/build_advisory_report.py \
274284
--output-md data/output/advisory_report.example.md
275285
```
276286

277-
Theme momentum is display-first context: it highlights strong themes and creates
278-
a `theme_first_candidates[]` stock-pool section so AI/high-tech candidates are
279-
visible with industry/theme background and reasons even when stable event
280-
evidence is still pending. It does not change recommendation ratings, scores,
281-
allocations, or execution policy. Workflows skip the section when the snapshot
282-
file is absent.
287+
Theme momentum is explanation-first context: it highlights strong themes and
288+
creates `theme_first_candidates[]` for JSON/Markdown audit material. The public
289+
HTML, RSS, and Telegram outputs stay focused on final recommendations only, so
290+
theme candidates are not mistaken for a buy list. Theme momentum does not change
291+
recommendation ratings, scores, allocations, or execution policy. Workflows skip
292+
this context when the snapshot file is absent.
283293

284294
Yahoo chart downloads are only a temporary fallback. Do not rely on random free
285295
proxy pools for the stable pipeline; prefer audited price snapshots, cache files,

README.zh-CN.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ QuantStrategyLab 的“智慧顾投”研究协调仓库。它生成非个性化
66

77
线上站点:<https://quantstrategylab.github.io/QuantAdvisorResearch/>
88

9+
主要文档:
10+
11+
- [系统设计](docs/system_design.zh-CN.md) / [System design](docs/system_design.md)
12+
- [数据源与因子路线](docs/data_factor_roadmap.zh-CN.md) / [Data and factor roadmap](docs/data_factor_roadmap.md)
13+
- [通知格式](docs/notification_format.zh-CN.md) / [Notification format](docs/notification_format.md)
14+
- [Artifact contract](docs/advisory_contract.md)
15+
916
当前运行节奏是:**周度公开推荐 + 周度事件/主题刷新 + 月度 AI shadow 背景 + 单独月度复盘 artifact**。月度复盘只做变化回顾和月末检查;只要报告里仍保留短线 `1-10个交易日` 和中线 `2-12周` 窗口,公开推荐就不应改成月更。
1017

1118
## 仓库定位
@@ -70,7 +77,9 @@ manifest 会记录 JSON/Markdown 的 SHA256、`as_of`、cadence、来源 artifac
7077

7178
## 来源模式
7279

73-
如果报告输入来自 `examples/`,输出会标记 `source_mode=fixture`,HTML/RSS 也会显示 fixture 警告,避免把合成样例误认为真实推荐。真实运营输入会标记为 `source_mode=operator_supplied`
80+
如果报告输入来自 `examples/`,输出会标记 `source_mode=fixture`,单篇 HTML 报告会显示 fixture 警告,避免把合成样例误认为真实推荐。周度/月度和 Pages 发布 workflow 现在默认读取 `PoliticalEventTrackingResearch``data/live/*`,因此正式发布应为 `source_mode=operator_supplied`,页面不应出现 fixture 警告。
81+
82+
`source_mode` 继续保留在 JSON 契约里用于审计,但公开首页、RSS 和 Telegram 摘要不再展示这个内部字段。
7483

7584
## 边界
7685

@@ -158,15 +167,12 @@ python scripts/publish_advisory_site.py \
158167
当前公开页面、RSS 标题和 Telegram 摘要默认使用简体中文(`zh-CN`)。
159168
JSON 字段名继续保持英文契约键,避免破坏下游程序读取。
160169

161-
发布真实来源时,workflow inputs 要切到 `PoliticalEventTrackingResearch` 内的真实 CSV:
170+
发布 workflow 默认已经读取 `PoliticalEventTrackingResearch` 内的真实 CSV。手工触发通常只需要传日期;只有刻意测试其他 artifact 时才覆盖路径
162171

163172
```bash
164173
gh workflow run "Publish Model Recommendations Site" \
165174
--repo QuantStrategyLab/QuantAdvisorResearch \
166-
-f as_of=2026-05-30 \
167-
-f political_events_path=data/live/political_events.csv \
168-
-f political_watchlist_path=data/live/political_watchlist.csv \
169-
-f ai_signal_path=data/output/latest_signal.json
175+
-f as_of=2026-05-30
170176
```
171177

172178
通知格式设计见 [docs/notification_format.zh-CN.md](docs/notification_format.zh-CN.md)
@@ -188,9 +194,9 @@ python scripts/build_advisory_report.py \
188194
--output-md data/output/advisory_report.example.md
189195
```
190196

191-
主题动量会生成 `theme_first_candidates[]`公开页面会把它展示为“本期重点股票池”
192-
股票池每期保留 5-10 个股票/公司标的,说明行业/主题背景、为什么入选、事件确认状态和主要风险。
193-
这些候选按主题和个股动量排序,并标明是否已有事件确认;但它们仍然不直接改变推荐评级、分数、仓位或执行状态。
197+
主题动量会生成 `theme_first_candidates[]`但它现在只作为 JSON/Markdown 中的解释和审计材料。公开页面、RSS 和 Telegram 摘要默认只显示最终推荐,避免把候选池误读为买入清单
198+
199+
候选池仍会保留行业/主题背景、入选原因、事件确认状态和主要风险;但它不直接改变推荐评级、分数、仓位或执行状态。
194200
线上 workflow 如果找不到 `data/output/theme_momentum_snapshot.json`,会自动跳过这个展示区块。
195201

196202
Yahoo chart 下载只作为临时 fallback。不要把随机免费代理 IP 池作为稳定生产方案;它有稳定性、数据污染、封禁、隐私和合规风险。更稳的做法是使用本组织已有价格快照、缓存文件,或可审计的自有代理/数据源。

docs/advisory_contract.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@ The contract intentionally rejects account-action fields such as `target_weight`
119119
## Theme-first Candidate
120120

121121
`theme_first_candidates` is optional and is derived from the theme momentum
122-
snapshot. Public renderers present it as a 5-10 name stock pool with
123-
industry/theme background, reasons, event confirmation, and risks. It exists to
124-
make strong-theme candidates visible before the event-confirmed recommendation
125-
list. It is still research-only and must not contain account-action fields.
122+
snapshot. It is kept as JSON/Markdown explanation and audit material with
123+
industry/theme background, reasons, event confirmation, and risks. The current
124+
public HTML, RSS, and Telegram renderers show final recommendations only, so
125+
theme candidates are not mistaken for a buy list. It is still research-only and
126+
must not contain account-action fields.
126127

127128
Important fields:
128129

@@ -175,7 +176,7 @@ generated_at
175176

176177
`summary.source_mode` is:
177178

178-
- `fixture`: one or more inputs came from `examples/`; public output must show a fixture warning.
179-
- `operator_supplied`: inputs did not come from fixture paths.
179+
- `fixture`: one or more inputs came from `examples/`; the individual HTML report should show a fixture warning and scheduled publication should avoid this mode.
180+
- `operator_supplied`: inputs did not come from fixture paths. This is the expected mode for scheduled public publication.
180181

181-
`summary.data_quality_warnings` carries any source-mode warnings for renderers.
182+
`summary.data_quality_warnings` carries source-mode warnings for renderers. Public index, RSS, and Telegram summaries intentionally do not display `source_mode`; it remains an audit field in JSON.

docs/data_factor_roadmap.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Data Source and Factor Roadmap
2+
3+
[English](data_factor_roadmap.md) | [简体中文](data_factor_roadmap.zh-CN.md)
4+
5+
## Current Direction
6+
7+
`QuantAdvisorResearch` should remain the final recommendation repository instead
8+
of becoming a full multi-factor trading platform.
9+
10+
Two different research paths should stay separated:
11+
12+
- Backtestable/executable path: price, technical, momentum, volatility, snapshot,
13+
and strategy repositories that may eventually connect to broker platforms.
14+
- Event/policy/news/AI-shadow path: less stable evidence that should only produce
15+
non-personalized recommendation reports and review artifacts.
16+
17+
For now, this repository consumes only:
18+
19+
- `PoliticalEventTrackingResearch` for source events and watchlists;
20+
- `ResearchSignalContextPipelines` for medium-horizon theme context and
21+
long-horizon AI shadow context.
22+
23+
`UsEquitySnapshotPipelines`, `UsEquityStrategies`, `CryptoSnapshotPipelines`, and
24+
`CryptoStrategies` remain independent reference material until there is enough
25+
live evidence to justify a separate integration.
26+
27+
## Current Inputs
28+
29+
### PoliticalEventTrackingResearch
30+
31+
Owns the event evidence layer:
32+
33+
- official or semi-structured records;
34+
- RSS/Atom feeds from durable public sources;
35+
- alias-based ticker extraction;
36+
- event study tooling for later review.
37+
38+
Stable default sources should be official records, issuer releases, regulatory
39+
feeds, and other replayable primary sources. X, Truth Social, Longbridge login
40+
sessions, and community content are excluded from the stable default pipeline
41+
until they have reliable interfaces, clear permission boundaries, and saved
42+
point-in-time artifacts.
43+
44+
### ResearchSignalContextPipelines
45+
46+
Owns reusable signal context:
47+
48+
- medium-horizon theme momentum (`2-12 weeks`);
49+
- long-horizon AI shadow artifacts (`1-3 years`);
50+
- static theme taxonomy and symbol exposures;
51+
- saved `latest_signal.json` and `signal_history/*.json`;
52+
- replay based on saved artifacts only.
53+
54+
This repository can provide background regime, theme, and risk context, but it
55+
must not directly generate orders, target weights, or account actions.
56+
57+
### QuantAdvisorResearch
58+
59+
Owns final non-personalized model recommendations:
60+
61+
- inputs: event CSV, watchlist CSV, saved AI shadow JSON, optional theme momentum;
62+
- outputs: JSON, Markdown, HTML, RSS, and optional Telegram summary;
63+
- contract blocks orders, target weights, target share quantities, broker routing,
64+
account information, and suitability claims.
65+
66+
## Factors to Add Later
67+
68+
Priority order:
69+
70+
1. Primary policy and disclosure sources: SEC, issuer IR, White House, Federal
71+
Register, Congress, DoD/DOE/CHIPS, Treasury, USAspending, or SAM.gov.
72+
2. Verified official social media: government, issuer, and executive accounts
73+
only when replayable and clearly attributable.
74+
3. Financial media leads: low-confidence discovery only, never high-confidence
75+
recommendation evidence without primary-source confirmation.
76+
4. Market confirmation: relative returns, abnormal volume, trend state,
77+
drawdown, volatility, and sector-relative moves.
78+
5. Fundamentals and valuation: market cap, revenue growth, margins, leverage,
79+
earnings dates, and valuation bands.
80+
6. Macro/risk regime: VIX, rates, dollar, credit spreads, oil, yield curve, and
81+
sector beta.
82+
83+
## Low-Risk Implementation Order
84+
85+
1. Keep public output focused on final recommendations. Preserve
86+
`theme_first_candidates[]` as JSON/Markdown explanation and audit material,
87+
not as a public buy list.
88+
2. Improve stable real sources in `PoliticalEventTrackingResearch`: RSS, official
89+
releases, SEC/EDGAR, company IR, policy/procurement sources, alias maps, and
90+
source registry coverage.
91+
3. Add optional market confirmation CSVs while keeping report generation working
92+
when the data is absent.
93+
4. Add event review inputs for 1/5/20/60 trading-day follow-up.
94+
5. Add fundamentals/valuation snapshots for risk explanation, not execution.
95+
6. Only then consider read-only references from existing snapshot repositories.
96+
97+
## Anti-Overfitting Rules
98+
99+
Long-lived advisory research should not chase only the current AI trade.
100+
101+
Use static, versioned taxonomy files in `ResearchSignalContextPipelines`:
102+
103+
```text
104+
config/theme_taxonomy.csv
105+
config/symbol_theme_exposure.csv
106+
```
107+
108+
Rules:
109+
110+
1. Fix theme membership first, then observe future behavior.
111+
2. AI may output theme bias and shadow context, but not position sizes.
112+
3. Advisor may use theme bias and theme momentum as explanation inputs for final
113+
recommendations; theme candidates remain audit material by default.
114+
4. Every taxonomy, universe, and scoring-rule change must be versioned.
115+
5. Do not change weights just because MU, INTC, DELL, or any other name is
116+
currently popular.

0 commit comments

Comments
 (0)