Session 50: Complete Parlay Lab (2215 tests)

Correlation-aware combined parlay grading — the Desk-tier differentiator.

- Correlation model (parlayService.js, added to S28 funcs): correlationScore
  (game-aware 0.7/0.4/0.2/0.0), combinedGrade (avg penalized by avgCorr*0.5),
  estimatedPayout (fair-odds product * (1-avgCorr) discount), correlationWarning,
  gradeParlay.
- POST /api/parlay/grade (public, 2-6 legs) -> {combined,correlation,payout,legs}.
  Fixed the Next proxy (was forwarding to /api/scan/parlay).
- ParlayContext: legs gained team/game/archetype; tier-aware maxLegs; auto-grades
  the slip (debounced) when legs>=2 -> live combined/correlation/payout; hasLeg/
  legKey/atCap.
- "+" button on every graded prop: StatStrip onAddLeg/isLegActive, wired by
  vyndr/GameCard via useParlay (builds leg w/ team + game). GradeResultCard feeds
  the same context from the scan page.
- ParlayPanel (replaces legacy ParlayTray): bottom slide-up w/ legs, combined
  grade, correlation warning, est payout, CLEAR ALL + floating leg-count badge.
  Tier-gated: free 2 legs (payout blurred -> Desk upsell), Analyst 4, Desk 6.

Backend 2185 -> 2215 tests (+30), 187 suites. Web build clean (exit 0).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kev
2026-06-19 11:25:14 -04:00
parent 3b47b783dc
commit f1956dc953
14 changed files with 706 additions and 48 deletions
+35 -2
View File
@@ -4,8 +4,41 @@
2026-06-18
## Current Phase
SHIP BUILD v49.0 — Complete onboarding flow (prefs API, 3-step page, redirect,
dashboard personalization, settings editor) + name micro-fixes.
SHIP BUILD v50.0 — Parlay Lab: correlation-aware combined grading, live slip,
"+" on every graded prop, tier-gated panel. The Desk-tier differentiator.
## Session 50 (2026-06-19) — SHIPPED ✅ PARLAY LAB
Backend 2185 → **2215 tests** (+30), 187 suites. Web build clean (exit 0).
### Phase 1 — correlation-score model (parlayService.js, ADDED to S28 funcs)
Numeric, GAME-AWARE model: `correlationScore(l1,l2)` → 0.7 same-player/game /
0.4 same-team/game / 0.2 same-game-diff-team / 0.0 diff-game. `combinedGrade` =
leg-grade avg penalized by `avgCorrelation * 0.5`. `estimatedPayout` = product of
per-grade fair odds × (1 avgCorrelation) discount. `correlationWarning`
"⚠ N legs from {TEAM}…". `gradeParlay` bundles it all.
### Phase 2 — POST /api/parlay/grade
Returns `{ combined, correlation, payout, legs }` (26 legs, public/stateless).
The Next `/api/parlay/grade` proxy was forwarding to the wrong upstream
(`/api/scan/parlay`) — fixed to the new route.
### Phase 3 — ParlayContext extended
`ParlayLeg` gained team/game/archetype; MAX_LEGS now 6 with a tier-aware
`maxLegs` (set by the panel). Auto-grades the slip (debounced) via the endpoint
when legs ≥ 2 → live `combined`/`correlation`/`payout`. + `hasLeg`/`legKey`/`atCap`.
### Phase 4 — "+" buttons
`StatStrip` renders a "+"/"✓" per graded prop (toggles add/remove); `vyndr/GameCard`
wires it via `useParlay` (builds a leg with team + game id). `GradeResultCard`'s
existing "Add to Parlay" feeds the same context from the scan page.
### Phase 5 — ParlayPanel (replaces legacy ParlayTray in the layout)
Bottom slide-up: legs (archetype + grade + remove), correlation warning, combined
grade, est. payout, CLEAR ALL + a floating leg-count badge (bottom-right) when
closed. Tier-gated: free 2 legs (payout blurred → Desk upgrade), Analyst 4, Desk 6.
## Session 49 (2026-06-19) — SHIPPED ✅ ONBOARDING FLOW
## Session 49 (2026-06-19) — SHIPPED ✅ ONBOARDING FLOW