Skip to content

feat: congress trades phase 2 — committee relevance, expanded politicians, trade links - #15

Merged
chapati23 merged 4 commits into
mainfrom
feat/congress-trades-phase2
Feb 25, 2026
Merged

feat: congress trades phase 2 — committee relevance, expanded politicians, trade links#15
chapati23 merged 4 commits into
mainfrom
feat/congress-trades-phase2

Conversation

@gisk0

@gisk0 gisk0 commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator

Phase 2: Congress Trades Enrichment

Changes

  • Expanded politician map from 20 → 30 members with full committee assignments, chamber, state, and party data
  • Committee↔sector relevance mapping — new committee-sectors.json maps committees to stock sectors
  • Ticker↔sector mapping — new ticker-sectors.json with 75+ commonly traded tickers
  • 2x insider relevance multiplier when a politician trades a stock in a sector their committee oversees
  • Direction weighting for sale_full (1.75x), sale_partial (1.25x), and exchange (0.75x) types
  • Trade detail URLs parsed from Capitol Trades HTML and included in BriefingItem output
  • Committee context shown in formatted output for relevant trades (e.g. Armed Services · $250K – $500K · ...)

Limitations

  • Capitol Trades HTML does not distinguish full vs partial sales. The sale_full/sale_partial weights are implemented but dormant until Capitol Trades adds this distinction.

Tests

  • 22 new tests covering committee relevance scoring, expanded politician map validation, ticker-sector lookups, direction weighting for new trade types, and committee context in formatted output
  • All 478 tests pass
  • Typecheck clean
  • Trunk check clean

…ians, trade links

- Expand politician map from 20 to 30 members with committee assignments,
  chamber, state, and party data for each entry
- Add committee↔sector relevance mapping (committee-sectors.json)
- Add ticker↔sector mapping with 75+ commonly traded tickers
- Apply 2x 'insider relevance' multiplier when a politician trades a stock
  in a sector their committee oversees
- Add direction weighting for sale_full (1.75x), sale_partial (1.25x),
  and exchange (0.75x) trade types
- Parse and include trade detail URLs from Capitol Trades HTML
- Show committee context in formatted output for relevant trades
- Include url in BriefingItem output for trade detail links
- Add 22 new tests covering committee relevance scoring, politician map
  validation, ticker-sector lookups, direction weighting, and formatting

Note: Capitol Trades HTML does not distinguish full vs partial sales.
The sale_full/sale_partial weights are implemented but will only activate
if Capitol Trades adds this distinction in the future.
- Remove retired/resigned members: Cathy McMorris Rodgers, Mark Green,
  Marjorie Taylor Greene
- Mitch McConnell: multiplier 3→1, no longer leadership tier
- Nancy Pelosi: remove Financial Services (no committee assignments in 119th)
- Fix Cleo Fields: House not Senate, committees → Financial Services
- Fix John Curtis: committees updated to actual 119th assignments
- Add _lastReviewed timestamp to politician JSON

- Narrow Energy & Commerce sectors: drop 'tech' and 'pharma' (too broad)
- Implement tiered committee relevance: direct (2x) vs tangential (1.5x)
- committee-sectors.json now uses {direct, tangential} arrays
- Document intentionally empty committees (Small Business, Ethics)

- Log missing ticker sector at debug level
- Log sector relevance boost with politician/committee/ticker detail
- Add first-match semantics comment on getCommitteeRelevance
- Add URL selector fragility comment
- Add TODO for multi-sector ticker support
- Pass pre-computed committee relevance to calculateScore (avoid redundant calc)
- Tests import JSON modules directly instead of fs.readFileSync
@chapati23
chapati23 marked this pull request as ready for review February 25, 2026 15:58
@chapati23
chapati23 merged commit 7860c90 into main Feb 25, 2026
2 checks passed
@chapati23
chapati23 deleted the feat/congress-trades-phase2 branch February 25, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants