Answer the third round: split rank, check decision citations both ways, one fence rule, prose fixes

This commit is contained in:
2026-10-02 20:28:13 +02:00
parent 798dfd781e
commit b712076144
8 changed files with 181 additions and 121 deletions
+4 -1
View File
@@ -1,7 +1,10 @@
import pathlib
import re
from loop_claude.stop import Stop
FENCE = re.compile(r"^ {0,3}(```|~~~)", re.M)
def read_premises(root: str) -> str | Stop:
try:
@@ -26,7 +29,7 @@ def sections(text: str) -> dict[str, list[str]]:
blocks: list[tuple[str | None, list[str]]] = []
fenced = False
for line in text.splitlines():
fenced ^= line.startswith("```")
fenced ^= bool(FENCE.match(line))
if not fenced and line.startswith("## "):
blocks.append((line.strip()[3:], []))
elif not fenced and line.startswith("# "):