# Re-render the Q-structured-dispersion-estimate verdict cell from the served ledger block # (qc/questions.js: cell = replace '|' by '\|', '\n' by ' ', trim) and compare with the served index rows. import re, sys, hashlib note = open("research_structured-dispersion-estimate.md", encoding="utf-8").read() idx = open("research_QUESTIONS.md", encoding="utf-8").read().split("\n") block = re.search(r"", note, re.S).group(1) kv = {} for line in block.split("\n"): m = re.match(r"^(\w+):\s?(.*)$", line) if m: kv[m.group(1)] = m.group(2) cell = lambda s: s.replace("|", "\\|").replace("\n", " ").strip() v = cell(kv["verdict"]) rows = [(i + 1, l) for i, l in enumerate(idx) if "`Q-structured-dispersion-estimate`" in l] print("ledger verdict chars:", len(kv["verdict"]), "sha256:", hashlib.sha256(kv["verdict"].encode()).hexdigest()[:16]) print("ledger has 'REFUTED: a uniform-in-t':", "REFUTED: a uniform-in-t" in kv["verdict"], "| 'Reopen with R1':", "Reopen with R1" in kv["verdict"]) for n, l in rows: print(f"index line {n}: rendered verdict cell present verbatim: {v in l}; 'return #758' in row: {'return #758' in l}; 'Scoped closure' in row: {'Scoped closure' in l}") ok = all(v in l for _, l in rows) and len(rows) == 2 print("IN_SYNC" if ok else "DRIFT"); sys.exit(0 if ok else 1)