Files
rune/scripts/gen_grading_gap_truth.py
T
Nick a367ebd605 feat(grading): literal-100% residue — dichotomy wave
Audit-missing fn _gr_core ported name-preserving (gap.rs): the
delegation-probe verdict as data (salience_gate _sg_core / spine
_rust_core pattern — the loader module is unrepresentable over FFI).
Shared-harness frozen truth (frozen_gr_gap_truth.json, byte-verified
via freeze_truth.py --verify) + gap battery + live gap parity (pinned
2/2, live matrix 2/2 — 100%) + pytest both pins green. Audit: grading
3/4 -> 4/4 FULL.

Lane factory-literal-l0 (issue #2479).
2026-10-15 05:47:47 +01:00

54 lines
1.7 KiB
Python

#!/usr/bin/env python3
"""gen_grading_gap_truth.py — literal-100% residue truth for grading
(dichotomy wave #2479, lane factory-literal-l0): the audit-missing
`_gr_core` delegation probe.
Shared-harness rows (scripts/freeze_truth.py list format): the probe
observed under RUNE_GR_CORE=python — the pin is honored inside
gr_loader.core(), so the oracle returns None (the fallback verdict);
gr_loader absent (direct-script execution) yields the same observable.
The all-present branch is delegation itself — machine-dependent .so
presence, covered LIVE by scripts/check_grading_gap_parity.py, never
frozen.
Pin BEFORE the oracle import: freeze_truth's stem-derived pin
(RUNE_GRADING_CORE) does not reach this oracle (cognitive_budgeter law).
Verify (byte-identical law):
PYTHONPATH=src:scripts RUNE_GR_CORE=python \\
python3 scripts/freeze_truth.py --verify \\
src/rust/grading/frozen_gr_gap_truth.json --module rune.grading
"""
import os
import sys
from pathlib import Path
REPO = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(REPO / "src"))
sys.path.insert(0, str(Path(__file__).resolve().parent))
os.environ["RUNE_GR_CORE"] = "python"
from freeze_truth import freeze, write # noqa: E402
TRUTH_PATH = REPO / "src" / "rust" / "grading" / "frozen_gr_gap_truth.json"
def main() -> int:
cases = freeze(
"grading",
[
("_gr_core", (), {}), # pin honored → None (fallback verdict)
("_gr_core", (), {}),
],
oracle_module="rune.grading",
)
write(cases, TRUTH_PATH)
print(f"wrote {TRUTH_PATH} ({len(cases)} cases)")
return 0
if __name__ == "__main__":
raise SystemExit(main())