Part of epic: #31
Depends on: #39 (--sector CLI flag must exist first)
What
When --sector is used, generate a ranked summary table across all tickers in the sweep in addition to individual stock notes. Output in both HTML and Markdown formats. This is the key demo artifact: a single file that shows the engine operating at institutional scale.
Output format
Technology Sector Sweep — 2026-04-16
┌────────┬─────────┬─────────┬─────────┬──────────┬──────────────┐
│ Rank │ Ticker │ Rating │ TP ($) │ Score │ Key Driver │
├────────┼─────────┼─────────┼─────────┼──────────┼──────────────┤
│ 1 │ NVDA │ BUY │ 950 │ 92/100 │ AI capex │
│ 2 │ MSFT │ BUY │ 520 │ 88/100 │ Cloud growth │
│ 3 │ AAPL │ HOLD │ 210 │ 74/100 │ Services mix │
│ ... │ ... │ ... │ ... │ ... │ ... │
└────────┴─────────┴─────────┴─────────┴──────────┴──────────────┘
Implementation
def generate_sector_sweep_table(results: list[dict], sector: str) -> dict:
"""
results: list of per-ticker pipeline output dicts, sorted by score desc
Returns: {'html': str, 'markdown': str}
"""
sorted_results = sorted(results, key=lambda x: x['score'], reverse=True)
# build HTML table with color-coded rating cells
# build Markdown table
...
Output files
outputs/sector_{sector}_sweep_{date}.html
outputs/sector_{sector}_sweep_{date}.md
outputs/demo/sector_technology_sweep.html (committed demo)
Acceptance Criteria
Part of epic: #31
Depends on: #39 (--sector CLI flag must exist first)
What
When
--sectoris used, generate a ranked summary table across all tickers in the sweep in addition to individual stock notes. Output in both HTML and Markdown formats. This is the key demo artifact: a single file that shows the engine operating at institutional scale.Output format
Implementation
Output files
outputs/sector_{sector}_sweep_{date}.htmloutputs/sector_{sector}_sweep_{date}.mdoutputs/demo/sector_technology_sweep.html(committed demo)Acceptance Criteria
--sectorflag usedoutputs//outputs/demo/sector_technology_sweep.html