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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EizBKhTqrAYago9KJG3dA3
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-13 00:29:06 +02:00
1 parent d0d225cb99
commit 2a32c28cca
1 file changed
+3 -1
+3 -1
View File
@@ -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: