Files
vyndr/migrations/025_ledger_ruler_version.sql
builtbykev 1372e6bcf7 Order Zero Phases 1-3: keyed verification, ruler_version boundary, report
PHASE 1 (measured on the live prod feed with the real key):

- WNBA is NOT thin at the feed -- 4.21 books/prop vs MLB's 3.61. It was
  allow-list-starved exactly as MLB was. This removes one candidate
  explanation for its anti-predictive result; it does not explain it, and
  WNBA stays abstaining.
- We cannot see 64.8% of the MLB slate at all (zero admitted books).
- Exchanges are real (smarkets 27%, novig 22%, kalshi 15% on MLB) but
  pinnacle, matchbook and polymarket measured 0% on BOTH sports. There is
  no sharp anchor for player props. The consensus is a MARKET consensus,
  not a SHARP one -- recorded as a permanent limitation, not a milestone.
- DFS is the trap, quantified: prizepicks covers 82% of MLB props, the
  highest in the feed. Admitting it "for breadth" would have looked like
  the biggest available win. Permanently excluded.
- Endpoints: /context WORKS and is FREE (umpire, roof, pitcher handedness,
  lineup confirmation -- richer than what we hand-built). /odds/closing and
  /movement are REDACTED (full structure, zero prices). /results and
  /exports/resolved-props are 403.
- The $19/mo question is answered: soccer IS graded, ~15 competitions in 30
  days (MLS 41k, Liga MX 15k, Brasileirao 12k, UCL/Europa/Conference). Our
  "soccer grades into a void" is a Pro-tier problem, not a data problem.
  NBA is absent because it is July -- seasonal, not inferable either way.

PHASE 2 delta, corrected: MLB mean +1.50 pts, median 0, p90 +10.0, 17.0%
of comparable props move >=5 pts, one-directional (the incumbent prices
the over below the exchange-inclusive consensus). WNBA symmetric and
tight. The median prop does not move -- the change is a right-skewed
minority. That the rulers DIFFER is established; that the new one is
BETTER is not, and that is the re-run.

PHASE 2 item 6: ledger_entries.ruler_version applied to prod, 1,384
existing rows backfilled to v1_first_book (a statement of fact -- every
row to date was produced by the first-book rule). ledgerService stamps
CURRENT_RULER_VERSION on new rows. Never pool edge or CLV across it.

Repo migration numbering lags prod; 025_ledger_ruler_version.sql records
the DDL for review.

PHASE 3: MLB isotonic p_win remains PROVISIONAL -- calibrated against
v1_first_book, does not promote until re-run on the consensus ruler.

NOT LIVE, deliberately: ALLOWED_BOOKS unchanged, served slate
byte-identical, CURRENT_RULER_VERSION still v1_first_book, no live path
calls consensusRuler.

Gates: 4,022 tests passed / 322 suites; next build exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QJs13VsyiSKYQP6rj3NNmc
2026-07-31 23:52:28 -04:00

38 lines
1.9 KiB
SQL

-- 025_ledger_ruler_version.sql — Order Zero Phase 2 item 6 (APPLIED 2026-08-01)
--
-- Stamp the RULER that produced fair_prob_lock so pre- and post-change rows are
-- never pooled. fair_prob_lock is the denominator of every edge and CLV number;
-- changing how it is derived means a value computed before the change is NOT the
-- same measurement as one computed after it. Arithmetically forced, not policy —
-- the same reasoning as model_version.
--
-- v1_first_book — the incumbent: normalizeProps applies ALLOWED_BOOKS, then
-- gradeSlateService.dedupeProps keeps the FIRST surviving row
-- per player+stat+line. Whichever admitted book PropLine
-- happened to list first became the entire "market".
-- v2_consensus — median de-vigged fair_prob across >=2 REFERENCE books
-- posting BOTH sides at the SAME line. NOT LIVE.
--
-- Backfill to v1_first_book is a statement of fact: every row written to date
-- was produced by the first-book rule.
--
-- NOTE: repo migration numbering lags prod (the repo stops at 024 while prod
-- carries later ones applied via the Supabase MCP). This file records the DDL
-- for review; prod already has it.
ALTER TABLE public.ledger_entries
ADD COLUMN IF NOT EXISTS ruler_version text;
UPDATE public.ledger_entries
SET ruler_version = 'v1_first_book'
WHERE ruler_version IS NULL;
ALTER TABLE public.ledger_entries
ALTER COLUMN ruler_version SET DEFAULT 'v1_first_book';
COMMENT ON COLUMN public.ledger_entries.ruler_version IS
'Which fair-probability ruler produced fair_prob_lock. NEVER pool edge or CLV across differing values — the denominator changed. v1_first_book = first admitted book (incumbent); v2_consensus = median across >=2 reference books at the same line.';
CREATE INDEX IF NOT EXISTS idx_ledger_entries_ruler_version
ON public.ledger_entries (ruler_version);