#!/usr/bin/env python3 """The round's registered integers, in ONE place, and the refusal every scorer makes. PREREG §0: *"Every integer in §4–§7 is a denominator a scorer refuses to disagree with."* This module is that sentence as code. A scorer that recomputes a denominator from whatever rows it happens to find on disk cannot tell a partial run from a complete one, and it publishes the smaller number without a word — which is the whole failure class the collection-state vocabulary exists to prevent. So every scorer calls :func:`refuse_unless` on its own shape before it scores, names the prereg section it is checking, and dies loudly on a mismatch. Nothing here is derived from a results file. These are the numbers an operator co-signed at G-PREREG; a run that produces different ones is a re-registration, not a rounding difference. """ from __future__ import annotations import sys sys.dont_write_bytecode = True ROUND_ID = "two-frontiers-r1" # ── Leg A · PREREG §4 ───────────────────────────────────────────────────────── LEG_A_CASES = 60 LEG_A_CLASSES = {"answered": 36, "abstained-correct": 12, "injection": 6, "corrupt-corpus": 6} LEG_A_REPS = 3 LEG_A_WARMUPS_PER_ARM = 1 LEG_A_ARMS = 3 LEG_A_SCORED_CALLS = LEG_A_CASES * LEG_A_REPS * LEG_A_ARMS # 540 #: PREREG §4 (the users' words, D-20260905-09 (b)): 26 canonical one-tap asks run verbatim, #: 34 free-typed queries are substituted. The four canonical strings and their counts are the #: bank's own `enum_canonical_question` texts. LEG_A_CANONICAL_QUERIES = { "How do I play?": 18, "How do I setup the game?": 4, "How do I take my turn?": 2, "When does the game end?": 2, } LEG_A_CANONICAL_CASES = 26 LEG_A_SUBSTITUTED_CASES = 34 # ── Leg C · PREREG §6 ───────────────────────────────────────────────────────── LEG_C_ITEMS = 36 LEG_C_TIERS = ("8k", "16k", "32k") LEG_C_DEPTHS = ("d10", "d50", "d90") LEG_C_KINDS = ("recall", "absent") LEG_C_ITEMS_PER_CELL = 2 LEG_C_NEEDLES = 12 LEG_C_ABSENTS = 6 LEG_C_RECALL_ITEMS = 18 LEG_C_ABSENT_ITEMS = 18 LEG_C_REPS = 1 LEG_C_ARMS = 3 LEG_C_SCORED_CALLS = LEG_C_ITEMS * LEG_C_REPS * LEG_C_ARMS # 108 #: PREREG A3 FOLDED (2): the local seat runs Leg C a second time at think:true. LEG_C_THINK_TRUE_CALLS = LEG_C_ITEMS * LEG_C_REPS # 36 #: PREREG §6 / measurement §4.7: reported prompt tokens / our estimate, per item, EVERY arm (A3.3). LEG_C_CONTEXT_RATIO_FLOOR = 0.80 #: PREREG §6: the local arm refuses above this fraction of its own num_ctx rather than truncating. LEG_C_LOCAL_NUM_CTX_REFUSAL = 0.95 #: PLAN §2 / C7's own prereg: differences under 2 items read TIED. LEG_C_TIE_BAND = 2 # ── Leg H + the panel · PREREG §5, §7 ───────────────────────────────────────── LEG_H_COMPARISONS = 36 LEG_H_ORDERS = 2 PANEL_SEATS = 7 PANEL_FLOOR_FAMILIES = 4 JUDGE_REPS = 1 LEG_H_JUDGE_CALLS = LEG_H_COMPARISONS * LEG_H_ORDERS * PANEL_SEATS # 504 G4_JUDGE_CALLS_MAX = LEG_A_CLASSES["answered"] * LEG_A_ARMS * PANEL_SEATS # 756 #: PREREG §4 / §5: a call whose sources + answer exceed this fraction of a judge's context is #: REFUSED with the count published, never truncated into a verdict. JUDGE_CTX_REFUSAL_RATIO = 0.7 #: PREREG §7: one full-size audition per seat per call shape (the G4 shape and the Leg H shape). AUDITIONS = PANEL_SEATS * 2 # 14 #: PREREG §5: 2,000 percentile resamples over the 36 cases; t(35) noted beside it. BOOTSTRAP_RESAMPLES = 2000 BOOTSTRAP_CLUSTERS = LEG_H_COMPARISONS #: PLAN §2: intervals only where the independent-unit N is at least this. INTERVAL_MIN_N = 30 # ── G-CALIBRATE · PREREG §4 (v) ─────────────────────────────────────────────── CALIBRATION_FLOOR = 0.85 class PreregMismatch(AssertionError): """A shape that disagrees with a registered integer. Always fatal, never a warning.""" def refuse_unless(condition: bool, *, got: object, want: object, section: str, what: str) -> None: """The one refusal. ``section`` names the prereg clause the caller is honouring. The message carries got, want AND the section, because the reader of a refusal is a person at 03:00 deciding whether the run is broken or the roster is: "36 != 60" alone does not say. """ if not condition: raise PreregMismatch( f"{what}: got {got!r}, the prereg registers {want!r} ({section}). A denominator this " "harness recomputed differently from the co-signed document is a re-registration, " "not a rounding difference — fix the shape or amend the prereg in §12, dated." ) def refuse_equal(got: object, want: object, *, section: str, what: str) -> None: refuse_unless(got == want, got=got, want=want, section=section, what=what) def assert_bank_composition(composition: dict[str, int], n_cases: int) -> None: """Leg A's four class counts and its N, together — PREREG §4.""" refuse_equal(n_cases, LEG_A_CASES, section="PREREG §4", what="Leg A bank case count") refuse_equal(dict(composition), LEG_A_CLASSES, section="PREREG §4", what="Leg A bank class composition") def assert_legC_grid(items: list[dict]) -> None: """Leg C's grid: 36 items, 18 recall, 18 absent, and the tier x depth x kind shape.""" refuse_equal(len(items), LEG_C_ITEMS, section="PREREG §6", what="Leg C item count") kinds = {k: sum(1 for it in items if it.get("kind") == k) for k in LEG_C_KINDS} refuse_equal(kinds["recall"], LEG_C_RECALL_ITEMS, section="PREREG §6", what="Leg C recall items") refuse_equal(kinds["absent"], LEG_C_ABSENT_ITEMS, section="PREREG §6", what="Leg C absent items") for tier in LEG_C_TIERS: for depth in LEG_C_DEPTHS: for kind in LEG_C_KINDS: cell = [it for it in items if (it.get("tier"), it.get("depth"), it.get("kind")) == (tier, depth, kind)] refuse_equal(len(cell), LEG_C_ITEMS_PER_CELL, section="PREREG §6", what=f"Leg C cell {tier}/{depth}/{kind}") def assert_panel(seats: list[dict]) -> None: """Seven seats, seven families, zero house — PREREG §7 (+ amendment A1).""" refuse_equal(len(seats), PANEL_SEATS, section="PREREG §7", what="panel seat count") families = [s.get("family") for s in seats] refuse_equal(len(set(families)), PANEL_SEATS, section="PREREG §7", what="panel family count (never two seated models from one vendor)") for seat in seats: model = str(seat.get("model", "")).lower() if "gpt-oss" in model or "claude" in model: raise PreregMismatch( f"seat {seat.get('seat')!r} names model {seat.get('model')!r}: PREREG §7 seats no " "gpt-oss tag (the openai family, strict reading) and no Claude, because both arms' " "vendors are the two the panel exists to be independent of." )