feat: Feature 1.3 — Prop Analysis Engine with 6-step grading pipeline
Core intelligence for BetonBLK prop analysis: - POST /api/analyze/prop — single prop analysis - POST /api/analyze/batch — multi-prop analysis for parlay scanner - 6-step pipeline: season avg → recent form → situational splits → cross-book lines → kill conditions → grade (A/B/C/D) - 6 kill conditions: low_minutes, small_sample, b2b_high_usage, blowout_risk, split_conflict, no_opponent_data - Composite scoring with confidence (30-95), bonuses, penalties - Added spreads market to Odds API fetch (zero extra credits) - Full reasoning output with step-by-step breakdown 36 new tests (unit + integration), 128 total across all features Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+40
-34
@@ -4,7 +4,7 @@
|
||||
2026-03-21
|
||||
|
||||
## Current Phase
|
||||
Phase 1 — Foundation
|
||||
Phase 1 — Foundation (COMPLETE)
|
||||
|
||||
## What Has Shipped
|
||||
|
||||
@@ -12,60 +12,66 @@ Phase 1 — Foundation
|
||||
- GET /api/odds/nba — live NBA player props from DraftKings, FanDuel, BetMGM
|
||||
- GET /api/odds/ncaab — NCAAB props (with off-season detection)
|
||||
- Normalizer: pairs Over/Under outcomes, maps 8 market types, filters to 3 books
|
||||
- Spreads market added for blowout risk detection (Feature 1.3)
|
||||
- Redis cache: 15-min TTL, stale fallback on API failure
|
||||
- Quota tracking via response headers, 429 when exhausted
|
||||
- Query filters: stat_type, player (partial match), book
|
||||
- 28 tests passing (18 unit, 10 integration)
|
||||
- Known limitation: player-to-team assignment deferred to Feature 1.2
|
||||
|
||||
### Feature 1.2 — NBA_API Stats Wrapper (COMPLETE)
|
||||
- FastAPI microservice in nba-service/ on port 8000
|
||||
- GET /stats/season-avg — season averages (24hr cache)
|
||||
- GET /stats/last-n — last N game averages (1hr cache)
|
||||
- GET /stats/splits — home/away, B2B/rest days, vs-team (6hr cache)
|
||||
- GET /players/search — partial name to player ID (7-day cache)
|
||||
- PRA computed as derived stat
|
||||
- 0.6s rate limiting between nba_api calls with retry
|
||||
- 27 tests passing (16 unit, 11 integration)
|
||||
- Startup script: scripts/start.sh runs both Node + Python services
|
||||
- GET /stats/season-avg (24hr cache), /stats/last-n (1hr), /stats/splits (6hr), /players/search (7-day)
|
||||
- PRA computed as derived stat, 0.6s rate limiting with retry
|
||||
- 27 Python tests passing
|
||||
|
||||
### Feature 1.4 — Database Schema (CODE COMPLETE — pending Supabase apply)
|
||||
- Migration SQL: supabase/migrations/001_initial_schema.sql
|
||||
- 6 tables: users, picks, scan_sessions, bets, outcomes, performance
|
||||
### Feature 1.3 — Prop Analysis Engine (COMPLETE)
|
||||
- POST /api/analyze/prop — single prop analysis with full 6-step pipeline
|
||||
- POST /api/analyze/batch — multi-prop analysis for parlay scanner
|
||||
- 6-step pipeline: season avg → recent form → situational splits → cross-book lines → kill conditions → grade
|
||||
- Grading: composite score → A/B/C/D with confidence 30-95
|
||||
- 6 kill conditions: low_minutes, small_sample, b2b_high_usage, blowout_risk, split_conflict, no_opponent_data
|
||||
- Full reasoning output: step-by-step breakdown with signals
|
||||
- Cross-book line comparison identifies best/worst lines
|
||||
|
||||
### Feature 1.4 — Database Schema (COMPLETE)
|
||||
- 6 tables applied to Supabase: users, picks, scan_sessions, bets, outcomes, performance
|
||||
- RLS enabled on all tables with auth.uid() policies
|
||||
- 3 triggers: auto-create user, updated_at, scan count reset
|
||||
- All constraints, indexes, and FKs defined
|
||||
- 37 schema validation tests passing
|
||||
- BLOCKED: WSL2 cannot resolve *.supabase.co — needs manual apply via SQL Editor
|
||||
|
||||
## Test Summary
|
||||
- Node.js: 101 tests passing (unit + integration)
|
||||
- Python: 27 tests passing
|
||||
- Total: 128 tests, all green
|
||||
|
||||
## What's Next
|
||||
- Apply Feature 1.4 migration to Supabase (manual via SQL Editor)
|
||||
- Run verify-schema.js to confirm tables exist
|
||||
- Feature 1.3 — Prop Analysis Engine (depends: 1.1 + 1.2)
|
||||
- Feature 2.1 — Parlay Scan (depends: 1.3 + 1.4)
|
||||
- Feature 2.2 — Real-Time Line Movement + Cascade Detection (depends: 1.1)
|
||||
- Feature 1.5 — Bet Submission (depends: 1.4)
|
||||
|
||||
## Active Blockers
|
||||
- BLOCKER-003: WSL2 DNS cannot resolve *.supabase.co (see BLOCKERS.md)
|
||||
- BLOCKER-003: WSL2 DNS cannot resolve *.supabase.co (verify-schema.js cannot run from CLI)
|
||||
|
||||
## Session Log
|
||||
|
||||
### Session 1 — 2026-03-21
|
||||
- Made live Odds API test call, documented raw response format in DECISIONS.md
|
||||
- Built: oddsNormalizer.js, oddsService.js, routes/odds.js, teamMap.js, redis.js, app.js
|
||||
- Wrote 28 tests (unit + integration), all passing
|
||||
- Built Feature 1.1: oddsNormalizer.js, oddsService.js, routes/odds.js, teamMap.js, redis.js, app.js
|
||||
- 28 tests (unit + integration), all passing
|
||||
- Logged DECISION-001 (API response format) and DECISION-002 (credit conservation)
|
||||
- Spec updated: home_team/away_team replaces team/opponent (API limitation)
|
||||
- Credits used: 2 of 500 (498 remaining)
|
||||
|
||||
### Session 2 — 2026-03-21
|
||||
- Built Feature 1.2: FastAPI microservice wrapping nba_api
|
||||
- stats.py, player_map.py, cache.py, main.py, config.py
|
||||
- 27 Python tests, all passing
|
||||
- Built Feature 1.4: Full database schema SQL
|
||||
- 6 tables, RLS, triggers, indexes, constraints
|
||||
- 37 schema validation tests, all passing
|
||||
- Could not apply to Supabase (DNS blocker)
|
||||
- Built Feature 1.2: FastAPI microservice wrapping nba_api (27 Python tests)
|
||||
- Built Feature 1.4: Full database schema SQL (37 tests), applied manually via Supabase SQL Editor
|
||||
- Logged DECISION-003 (Python microservice) and DECISION-004 (Supabase Auth)
|
||||
- Created startup script (scripts/start.sh) for both services
|
||||
- Created Supabase client module (src/utils/supabase.js)
|
||||
- Created schema verification script (scripts/verify-schema.js)
|
||||
- Total tests: 92 (65 Node.js + 27 Python), all passing
|
||||
- Created startup script, Supabase client module, schema verification script
|
||||
|
||||
### Session 3 — 2026-03-21
|
||||
- Built Feature 1.3: Prop Analysis Engine
|
||||
- propAnalyzer.js (orchestrator), grader.js, killConditions.js, nbaStatsClient.js, signals.js
|
||||
- routes/analyze.js (POST /api/analyze/prop + /batch)
|
||||
- Added spreads market to Odds API fetch (zero extra credits)
|
||||
- 36 new tests (unit + integration)
|
||||
- Logged DECISION-005 (spreads for blowout risk)
|
||||
- Phase 1 Foundation is now COMPLETE
|
||||
- Total: 128 tests (101 Node.js + 27 Python), all green
|
||||
|
||||
Reference in New Issue
Block a user