Auger/mvp_watchlist.md

97 lines
3.6 KiB
Markdown

# Augor — Watchlist MVP
## Goal
Replace the current bulk-feed home screen with a stock-watchlist-centric UX. Users add stocks they care about; the app fetches relevant news, runs LLM analysis, and surfaces per-stock growth signals with a confidence score.
## Scope (in)
- Watchlist: add/remove stock tickers (e.g. AAPL, TSLA)
- Home screen: grid of stock cards showing ticker, last signal (growth/decline/neutral), probability, and a sparkline placeholder
- Stock dashboard: full signal list for that stock, rationale text, source articles
- Per-stock pipeline: filter aggregated feed by ticker relevance, run clustering + signal generation scoped to that ticker
- Settings: API key, feed list (unchanged), watchlist persisted via SharedPreferences
## Scope (out — do later)
- Real-time or live price data
- Actual candlestick/OHLC charts (use placeholder or flat line for now)
- Backtesting
- Push notifications
- Backend / cloud processing
## Data Model
```dart
class WatchedStock {
final String ticker; // e.g. "AAPL"
final String companyName; // e.g. "Apple Inc."
EventSignal? latestSignal;
List<EventSignal> signalHistory;
}
```
`WatchedStock` is persisted as JSON in SharedPreferences under key `watched_stocks`.
## State
Add a `WatchlistProvider` (ChangeNotifier):
- `List<WatchedStock> stocks`
- `addStock(ticker, companyName)`
- `removeStock(ticker)`
- `updateSignals(ticker, List<EventSignal>)`
- `save()` / `load()`
## Routing (go_router)
| Path | Page |
|---|---|
| `/` | Home — stock card grid |
| `/stock/:ticker` | Stock dashboard |
| `/settings` | Settings (existing) |
| `/watchlist/add` | Add stock dialog or page |
## Home Screen
- `GridView` of `StockCard` widgets, one per watched stock
- Each card: ticker symbol (large), company name, signal badge (colored chip), probability percentage, placeholder mini-chart area
- Floating action button or top-right icon to add a stock
- Empty state: prompt to add a stock
## Stock Dashboard
- Header: ticker + company name
- "Run Analysis" button — triggers the per-stock pipeline
- Status/progress text
- Placeholder chart (Container with grey background for now)
- Scrollable list of `EventSignalCard` widgets (reuse existing widget)
- Each card shows summary, signal, probability, confidence, rationale, source count
## Per-Stock Pipeline
Scoped version of the existing pipeline:
1. Fetch all enabled feeds (same as now)
2. Filter `FeedItem` list to items relevant to the ticker — use company name + ticker as keywords alongside existing keyword list
3. Generate embeddings on filtered items only
4. Group by event (existing clustering)
5. Generate signals (existing `SignalGenerator`)
6. Store results in `WatchlistProvider.updateSignals(ticker, signals)`
The simplest first pass: add ticker + company name into the relevance keyword check. No separate embedding per ticker yet — just string matching on title/description.
## Build Order
1. `WatchedStock` model + `WatchlistProvider`
2. Persist watchlist in SharedPreferences
3. New home screen with `StockCard` grid and add-stock flow
4. `go_router` routes updated
5. Stock dashboard page (static layout first)
6. Wire per-stock pipeline to dashboard "Run Analysis" button
7. Verbose progress logging (status string passed down to UI)
8. Placeholder chart widget
## Definition of Done
- User can add AAPL and TSLA to watchlist
- Home screen shows both cards
- Tapping a card opens its dashboard
- Tapping "Run Analysis" runs the pipeline and populates signal cards
- At least one signal card renders with summary + probability
- No crashes on empty watchlist or missing API key