Map each CIK to its common stock ticker #39

Merged
chris-kreidl merged 1 commit from 37-primary-ticker into main 2026-11-06 04:01:03 +00:00
chris-kreidl commented 2026-11-06 03:57:32 +00:00 (Migrated from github.com)

🤖 Claude: Closes #37

SEC's company_tickers.json lists a company's primary security first, then its other share classes, notes and preferreds. fetchTickerMapping kept the last entry for each CIK. It now keeps the first, using a new pure function primaryTickers in src/tickers.ts, which enrich-prices.ts calls.

Definition of Done

  • Acceptance criteria met and demonstrated: I ran primaryTickers on today's live company_tickers.json, and every example from the issue now maps to its common stock:
    1326801 META    (was METAM)
    1652044 GOOGL   (was GOOGM)
    1283699 TMUS    (was TMUSL)
    106640  WHR     (was WHR-PA)
    1004434 AMG     (was MGRB)
    
  • bun test passes; new logic has tests: 142 pass, 0 fail. test/tickers.test.ts uses real entries and ranks from the SEC file.
  • bun check is clean (no type errors) and bun fmt --check passes on the changed files.
  • Runs end to end on real data: still needed. I haven't rerun bun run enrich + bun run export (it takes hours at 1 req/s). After that rerun, AMG should drop out as Financial Services, and Meta's market cap should reflect META.

🤖 Generated with Claude Code

🤖 **Claude:** Closes #37 SEC's `company_tickers.json` lists a company's primary security first, then its other share classes, notes and preferreds. `fetchTickerMapping` kept the **last** entry for each CIK. It now keeps the **first**, using a new pure function `primaryTickers` in `src/tickers.ts`, which `enrich-prices.ts` calls. ### Definition of Done - [x] Acceptance criteria met and demonstrated: I ran `primaryTickers` on today's live `company_tickers.json`, and every example from the issue now maps to its common stock: ``` 1326801 META (was METAM) 1652044 GOOGL (was GOOGM) 1283699 TMUS (was TMUSL) 106640 WHR (was WHR-PA) 1004434 AMG (was MGRB) ``` - [x] `bun test` passes; new logic has tests: 142 pass, 0 fail. `test/tickers.test.ts` uses real entries and ranks from the SEC file. - [x] `bun check` is clean (no type errors) and `bun fmt --check` passes on the changed files. - [ ] Runs end to end on real data: **still needed.** I haven't rerun `bun run enrich` + `bun run export` (it takes hours at 1 req/s). After that rerun, AMG should drop out as Financial Services, and Meta's market cap should reflect META. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude[bot] commented 2026-11-06 03:58:14 +00:00 (Migrated from github.com)

🤖 Claude: ## Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 **Claude:** ## Code review No issues found. Checked for bugs and CLAUDE.md compliance.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ckreidl/screener!39
No description provided.