From 2a32c28cca5cb86ef556430ee858c9a3cdd1d372 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Tue, 13 Oct 2026 00:29:06 +0200 Subject: [PATCH] battery nullmodel: a section title is '# N. TITLE', not any comment line starting with a digit The CC(model, data) table's rows ('# 4.13 ...') were read as section titles, so every key after the table in 5. MODEL VALIDATION counted as a decision outside it. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01EizBKhTqrAYago9KJG3dA3 --- tools/battery/nullmodel.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/battery/nullmodel.py b/tools/battery/nullmodel.py index efb5c33e5..b1ef4fba3 100644 --- a/tools/battery/nullmodel.py +++ b/tools/battery/nullmodel.py @@ -39,6 +39,7 @@ RANDOM_R_FREE_MIN = 0.50 # lines of p_report.txt that say how and when the run was made, not what it decided PROVENANCE = {"DATE", "COMMAND_LINE", "WALL_TIME"} MODEL_SECTION = "5. MODEL VALIDATION" +SECTION_TITLE = re.compile(r"^# \d+\. [A-Z]") def f(x, fmt): @@ -61,7 +62,8 @@ def decision_keys(path): """KEY= lines of a report outside the model section, provenance left out.""" out, in_model = {}, False for line in open(path, errors="replace"): - if line.startswith("# ") and line[3:].strip()[:1].isdigit(): + # a numbered section's title ("# 5. MODEL VALIDATION"), not a table row that starts with a number + if SECTION_TITLE.match(line): in_model = line[3:].strip() == MODEL_SECTION m = score.REPORT_LINE.match(line.rstrip("\n")) if m and not in_model and m.group(1) not in PROVENANCE: