-- 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);