phase-10.5: screener enhancements

This commit is contained in:
saikiranvella
2026-06-11 19:18:19 -04:00
parent bac00ab5d5
commit e953822bab
51 changed files with 3745 additions and 36 deletions
+49 -2
View File
@@ -8,6 +8,40 @@ Guidance for working in this repository.
`market-screener` is a Node.js project consisting of a Fastify API server that powers the SvelteKit dashboard in the `ui/` subdirectory. **Evolved to support day trading**: real-time news webhooks, LLM-driven stock analysis with prompt caching, multi-user authentication, and Discord alerts for price movements.
---
## ✅ Status Update — Shipped June 2026 (post-Phase-10 sprint)
See **PRODUCT.md** (priorities P0P3) and **FREE-DATA-STACK.md** (zero-cost data architecture) for design rationale. Shipped since the Phase 9/10 reports below:
**Correctness / foundations (PRODUCT.md P0):**
- Structured verdict tiers — scorers return `{ tier: PASS|HOLD|REJECT, score }`; `signal()` no longer string-matches emoji (P0.3)
- Signal snapshot ledger — `signal_snapshots` table, written on every screen; `GET /api/screen/history/:ticker`; `npm run screen:daily` (P0.1)
- Rate-regime hysteresis (±0.25% band, survives restarts) (P0.5)
- Data-sanity sentinel — `dataHealth` on `/api/screen` + UI banner when >30% of stocks return null fundamentals (P0.4)
- Bug-fix pass: ETF null-handling (missing data no longer auto-REJECTs), dividend-ETF↔bond classification via `fundProfile.categoryName`, zero-as-null sanitization, no-data verdicts labeled honestly, coverage field in every audit
**Free-tier news pipeline (`server/domains/news/` — Phase-12-lite, $0):**
- EDGAR poller (8-K, SC 13D, S-4, DEFM14A; CIK→ticker map) + PR-wire RSS poller (GlobeNewswire, PR Newswire; exchange-tag ticker extraction)
- Shared pipeline: universe filter → noise blocklist → dedupe → keyword catalyst classifier → `news_articles` / `ticker_catalysts` tables; retention jobs
- In-server scheduler (EDGAR 10 min, PR 15 min; `NEWS_POLL=off` to disable) + `npm run news:poll` for cron
- `GET /api/news/:ticker` (stored + live Yahoo merge), `GET /api/news/recent`
**Daily change digest (`server/domains/digest/` — PRODUCT P1.1, partial Phase 14):**
- Diffs today's snapshots vs previous, attaches news catalysts, M&A always surfaced
- `GET /api/digest`, `npm run digest:daily`, Discord webhook (forum-channel aware), `npm run discord:test`
**UI (screener page):**
- Market Pulse header band — full-bleed sector bubbles (SPDR ETFs, 15-min cache), leader headline, loading/unavailable states; `GET /api/screen/sectors`
- Sector drill-down panel — top-10 ETF holdings screened on demand, Today/1Y gain sort, 3-day sector news; `GET /api/screen/sector/:sector`
- Ticker modal — company profile, range-switchable chart (1D…5Y, hover crosshair), Yahoo analyst target bar + Zacks link, latest news; `GET /api/screen/profile/:ticker`, `GET /api/screen/chart/:ticker?range=`
- Plain-language advice layer (`adviceFor`) — "Buy — stable growth" / "Buy, but expect dips" on Strong Buys + no-data honesty; full text in modal
- ↗ Turnaround watch + 💎 Quality dips filters (with live counts + self-explaining empty states) in the STOCK table header
- Score cell: negative-score fix, coverage chip, "No data" state
**New env vars:** `EDGAR_USER_AGENT` (recommended), `DISCORD_WEBHOOK_URL`, `NEWS_PRWIRE_FEEDS`, `NEWS_POLL`.
**Pages NOT yet touched in this sprint:** Portfolio, Market Calls, Safe Buys (still at their Phase 7 state — see realigned roadmap in PHASES.md).
### Two Scoring Lenses (Original)
Every asset is scored under two lenses:
@@ -1278,9 +1312,22 @@ lib/types/
| **Regime badge colors** | `HIGH` = amber, `NORMAL` = muted gray, `LOW` = blue (driven by `data-regime` CSS attribute) |
| **Signal Summary hidden** | Removed from `+page.svelte` — table section no longer renders |
#### 🔲 Next Up (Phase 10.5 Remaining)
#### 🔲 Next Up (Phase 10.5 Remaining — status corrected June 2026)
These five items are the immediate next build targets, in priority order:
Item 1 (tearsheet) is **partially superseded**: the Ticker Modal now delivers
the chart, company profile, analyst targets, and news. Still genuinely
pending from the original list:
1. **P/E + ROE + 52W columns in main table** (10.5c) — not started
2. **Valuation context / peer comparison** (10.5d §2) — modal has analyst
targets but no sector/S&P comparison table
3. **Numeric range filters for P/E and ROE** (10.5b) — price min/max and
score min exist; P/E-max / ROE-min do not
4. **Threshold sensitivity what-ifs** (10.5d §5) — not started
5. **Decision logging + backtest** (10.5e) — not started, but the snapshot
ledger (P0.1) now provides its data foundation
Original spec below for reference:
**1. Slide-in tearsheet panel** (`10.5d`)
- Replace the current inline expand row with a 420px right-side slide-in panel (CSS `transform: translateX` animation, 0.2s)