Reconcile the record: STATE.md header + Model Train arc 1 spec (docs only)

Arc 1 (7a925f4) shipped without a spec and without a STATE.md entry — the
plan lived only in a session context that was lost. Both written from the
code on disk, not from memory.

- STATE.md: header was stale at a8e383e; now 7a925f4 (pushed, NOT yet
  deploy-fingerprinted). New top section records de-vig + EV + takeable/
  value gates + hero v2 + the value triplet, the real config values, and
  the 274/3289 -> 276/3306 test baseline.
- specs/model-train.md (NEW, per CLAUDE.md rule #1): every knob and its
  ACTUAL default (TAKEABLE_ODDS_CEILING -160, TAKEABLE_ODDS_MAX +200,
  VALUE_EV_THRESHOLD 2, JUICE_ODDS_FLOOR -400, RARE_EVENT_LINE_MAX 0.5);
  the gate AS BUILT (flat price-only refusal at -400 pre-feature, NOT
  edge-aware, no -250 wall; the -160..+200 band never refuses a grade and
  is enforced on the hero alone); the triplet + hero v2; and a checklist
  of what is NOT built.

Recorded honestly rather than assumed: EDGE_FLEX_WALL, HARD_JUICE_WALL,
LADDER_ODDS_MAX and MIN_RUNG_PROBABILITY do not exist in the codebase; no
frontend reads ev_pct/fair_odds/model_odds/book_odds/suppressed_reason yet;
the value fields are ungated to free tier; a second EV implementation
(processing/EVCalculator.js) still coexists with devig.evPct.

No engine code touched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SmNjJAwEnqHPtXbvSZR8kA
This commit is contained in:
Kev
2026-07-19 17:56:09 -04:00
parent 7a925f43eb
commit 18bf3ecb51
2 changed files with 243 additions and 1 deletions
+29 -1
View File
@@ -1,5 +1,33 @@
# VYNDR — STATE OF THE WORLD
### As of `a8e383e` (main, deployed + fingerprint-verified live), 2026-07-18. This file opens every future session. Update it when a train ships.
### As of `7a925f4` (main, pushed to gitea; NOT yet fingerprinted live), 2026-07-19. This file opens every future session. Update it when a train ships.
## MODEL TRAIN — ARC 1 (ENGINE) SHIPPED (2026-07-19, on main `7a925f4`, pushed, NOT yet deploy-fingerprinted)
Spec written retroactively: `specs/model-train.md` (arc list + what's open). Goal of the
train: make "real opportunities at takeable prices" the ENGINE, not a display filter.
Arc 1 = steps 16, backend only. **No frontend consumes the new fields yet** — the
triplet/VALUE marker/refusal copy are Design's Session-2 surfaces.
- **De-vig** (`src/utils/devig.js`, NEW): two-way multiplicative de-vig → fair prob +
fair American price per side + `overround`. One side unpriced → fair is NULL, never
faked. Also `americanToImpliedProb` / `americanToDecimal` / `impliedProbToAmerican`.
- **EV** (`devig.evPct`): `ev_pct = modelProb × decimal 1`, at the graded side's
ACTUAL price. This is the ranking signal now, replacing raw |model consensus|.
- **Takeable / value gates** (`src/config/valueEngine.js`, NEW): `TAKEABLE_ODDS_CEILING`
**160**, `TAKEABLE_ODDS_MAX` **+200**, `VALUE_EV_THRESHOLD` **2** (%) — all env-tunable.
`takeable` = price in band; `value` = takeable AND ev ≥ threshold. Strict null guards
(`Number(null)===0` would have made a missing price "takeable").
- **Hero v2** (`heroPropService`): the hero is the highest `ev_pct` among **takeable**
A/B reads — a huge model-vs-line gap on a 900 line is trivia, not an opportunity.
Falls back to most-recent-real graded read on an empty slate (unchanged).
- **Value triplet** on every graded read: `book_odds` · `fair_odds` · `model_odds`
(+ `fair_prob`, `overround`, `devig_method`). Wired inside `analyzeViaEngine1`'s
existing p_win/Kelly block; rides the `...result` spread through snapshot / hero /
scan. Documented in `BACKEND_HANDOFF.md`.
- **Test baseline: 276 suites / 3306 tests green** (was 274/3289), `next build` exit 0.
New suites: `devig.test.js`, `valueEngine.test.js` (+ `heroPropService.test.js` rewritten).
- **Knobs NOT in this arc** (asked about, confirmed absent from the codebase):
`EDGE_FLEX_WALL`, `HARD_JUICE_WALL`, `LADDER_ODDS_MAX`, `MIN_RUNG_PROBABILITY`.
The only price wall on disk is the flat `JUICE_ODDS_FLOOR` (400) from the
rare-event work below — it is **not** edge-aware, and there is no 250 wall.
## RARE-EVENT UNDER SUPPRESSION (2026-07-19, on main)
Betting-logic audit: the CONSENSUS-vs-MODEL board flooded with "doubles u0.5 · MODEL 0.2 · +edge" fake reads (juiced rare-event unders). Report: the doubles projection is REAL per-player (MLB_LOG_FIELD doubles→doubles; values varied 0.03/0.16/0.2/0.22) — NOT a flat fallback; the issue is purely structural.