fix(deduction-serve): resolve assert_corpus_sound name collision
Two unrelated functions shared the name assert_corpus_sound: the practice-corpus soundness check in evals/deduction_serve/practice/gold.py (no args) and the curriculum lane's case-contract check in evals/curriculum_serve/runner.py (domain, cases). Renamed to assert_practice_gold_sound and assert_lane_cases_sound respectively so each name states what it validates, and updated all call sites, the gold.py __all__ export, and two prose mentions that named the function. [Verification]: uv run --python 3.12.13 core test --suite smoke -q → 569 passed; --suite deductive -q → 285 passed.
This commit is contained in:
parent
bc8276d693
commit
fa0f85573c
4 changed files with 10 additions and 10 deletions
|
|
@ -68,7 +68,7 @@ def assert_provenance(domain: str, cases: list[dict]) -> None:
|
||||||
resolve_pinned(curriculum, pinned) # raises UnratifiedChain
|
resolve_pinned(curriculum, pinned) # raises UnratifiedChain
|
||||||
|
|
||||||
|
|
||||||
def assert_corpus_sound(domain: str, cases: list[dict]) -> None:
|
def assert_lane_cases_sound(domain: str, cases: list[dict]) -> None:
|
||||||
"""The independent oracle must re-derive every committed gold (§4.4)."""
|
"""The independent oracle must re-derive every committed gold (§4.4)."""
|
||||||
for case in cases:
|
for case in cases:
|
||||||
query = read_curriculum_question(case["text"])
|
query = read_curriculum_question(case["text"])
|
||||||
|
|
@ -105,7 +105,7 @@ def assert_anti_recall_coverage(cases: list[dict]) -> None:
|
||||||
|
|
||||||
def build_report(domain: str, cases: list[dict]) -> dict:
|
def build_report(domain: str, cases: list[dict]) -> dict:
|
||||||
assert_provenance(domain, cases)
|
assert_provenance(domain, cases)
|
||||||
assert_corpus_sound(domain, cases)
|
assert_lane_cases_sound(domain, cases)
|
||||||
assert_anti_recall_coverage(cases)
|
assert_anti_recall_coverage(cases)
|
||||||
|
|
||||||
counts = Counter({"correct": 0, "wrong": 0, "declined": 0})
|
counts = Counter({"correct": 0, "wrong": 0, "declined": 0})
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ _TEMPLATES: dict[str, tuple[tuple[str, Any], ...]] = {
|
||||||
# the reader singularizes to ``x3``); ``a, b, c`` are the three distinct
|
# the reader singularizes to ``x3``); ``a, b, c`` are the three distinct
|
||||||
# middle/subject/predicate classes. Gold is the unconditional validity (modern
|
# middle/subject/predicate classes. Gold is the unconditional validity (modern
|
||||||
# reading) of the standard form — cross-checked against the INDEPENDENT
|
# reading) of the standard form — cross-checked against the INDEPENDENT
|
||||||
# syllogism oracle in ``assert_corpus_sound``.
|
# syllogism oracle in ``assert_practice_gold_sound``.
|
||||||
CATEGORICAL: (
|
CATEGORICAL: (
|
||||||
# Barbara (AAA) — valid.
|
# Barbara (AAA) — valid.
|
||||||
("valid", lambda a, b, c: f"All {a}s are {b}s. All {c}s are {a}s. Therefore all {c}s are {b}s."),
|
("valid", lambda a, b, c: f"All {a}s are {b}s. All {c}s are {a}s. Therefore all {c}s are {b}s."),
|
||||||
|
|
@ -180,7 +180,7 @@ def _en_neg(clause: str) -> str:
|
||||||
|
|
||||||
#: English-band templates: (gold, text_builder, intended_premises, intended_query).
|
#: English-band templates: (gold, text_builder, intended_premises, intended_query).
|
||||||
#: The INTENDED formulas are the template's logical form over fixed placeholder
|
#: The INTENDED formulas are the template's logical form over fixed placeholder
|
||||||
#: atoms — the reader-independent gold ``assert_corpus_sound`` cross-checks
|
#: atoms — the reader-independent gold ``assert_practice_gold_sound`` cross-checks
|
||||||
#: against the truth-table oracle (INV-25: no reader, no ROBDD involvement).
|
#: against the truth-table oracle (INV-25: no reader, no ROBDD involvement).
|
||||||
_EN_TEMPLATES: dict[str, tuple[tuple[str, Any, tuple[str, ...], str], ...]] = {
|
_EN_TEMPLATES: dict[str, tuple[tuple[str, Any, tuple[str, ...], str], ...]] = {
|
||||||
EN_CONDITIONAL_SINGLE: (
|
EN_CONDITIONAL_SINGLE: (
|
||||||
|
|
@ -1160,7 +1160,7 @@ class ConstructionGoldTether:
|
||||||
return str(problem.payload["gold"])
|
return str(problem.payload["gold"])
|
||||||
|
|
||||||
|
|
||||||
def assert_corpus_sound() -> None:
|
def assert_practice_gold_sound() -> None:
|
||||||
"""Belt-and-suspenders: every generated case's by-construction gold must
|
"""Belt-and-suspenders: every generated case's by-construction gold must
|
||||||
agree with an INDEPENDENT oracle over its projected form.
|
agree with an INDEPENDENT oracle over its projected form.
|
||||||
|
|
||||||
|
|
@ -1214,6 +1214,6 @@ __all__ = [
|
||||||
"ConstructionGoldTether",
|
"ConstructionGoldTether",
|
||||||
"DeductionSolver",
|
"DeductionSolver",
|
||||||
"all_gold_problems",
|
"all_gold_problems",
|
||||||
"assert_corpus_sound",
|
"assert_practice_gold_sound",
|
||||||
"generate_problems",
|
"generate_problems",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ from evals.deduction_serve.practice.gold import (
|
||||||
ConstructionGoldTether,
|
ConstructionGoldTether,
|
||||||
DeductionSolver,
|
DeductionSolver,
|
||||||
all_gold_problems,
|
all_gold_problems,
|
||||||
assert_corpus_sound,
|
assert_practice_gold_sound,
|
||||||
)
|
)
|
||||||
|
|
||||||
#: The committed sealed ledger lives next to its serving READER (chat/), mirroring
|
#: The committed sealed ledger lives next to its serving READER (chat/), mirroring
|
||||||
|
|
@ -96,7 +96,7 @@ def build_sealed_artifact() -> dict[str, Any]:
|
||||||
def seal_ledger(path: Path = _SEALED_LEDGER_PATH) -> dict[str, Any]:
|
def seal_ledger(path: Path = _SEALED_LEDGER_PATH) -> dict[str, Any]:
|
||||||
"""Regenerate + write the committed sealed ledger. Verifies corpus soundness
|
"""Regenerate + write the committed sealed ledger. Verifies corpus soundness
|
||||||
against the independent oracle first (a mis-stated gold can never seal)."""
|
against the independent oracle first (a mis-stated gold can never seal)."""
|
||||||
assert_corpus_sound()
|
assert_practice_gold_sound()
|
||||||
return write_sealed_ledger(path, build_sealed_artifact())
|
return write_sealed_ledger(path, build_sealed_artifact())
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,9 @@ def test_shape_bands_are_exhaustive_for_the_projector() -> None:
|
||||||
|
|
||||||
|
|
||||||
def test_corpus_is_sound_against_independent_oracle() -> None:
|
def test_corpus_is_sound_against_independent_oracle() -> None:
|
||||||
from evals.deduction_serve.practice.gold import assert_corpus_sound
|
from evals.deduction_serve.practice.gold import assert_practice_gold_sound
|
||||||
|
|
||||||
assert_corpus_sound() # raises AssertionError on any mis-stated gold
|
assert_practice_gold_sound() # raises AssertionError on any mis-stated gold
|
||||||
|
|
||||||
|
|
||||||
def test_every_band_earns_serve_wrong_zero() -> None:
|
def test_every_band_earns_serve_wrong_zero() -> None:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue