#!/usr/bin/env python3 """Audit of the closed-routes register of research/OUTCOMES.md (job #1348). Reproduces every count in the report: (1) how many closures there are, and their verdict words; (2) how many clauses engage the signed/unsigned distinction, and how many of those name the signed question as surviving -- reported as a LIMITED pattern, not a law; (3) which closures carry a NAMED, UNVERIFIED EXTERNAL DEPENDENCY, i.e. a closure whose validity is contingent on a source the corpus marks unread. INPUT: the served research/OUTCOMES.md beside this file, named OUTCOMES.md. Rows are split on UNESCAPED pipes only. A naive split("|") counts a `\\|` escape as a separator and miscounts; that error produced two wrong figures on job #1343 before it was caught, and the table-integrity check below exists so it cannot happen silently here. """ import re, sys, pathlib from collections import Counter SPLIT = re.compile(r'(? repairing by re-joining overflow fields so the counts below are right;") print(" the file itself still needs the escapes (patch attached to this return).") def fixed(line): """Re-join the fields a bare-bar group split, so a row has `ncol` cells again.""" c = cells(line) if len(c) - 2 == ncol: return c head, tail = c[:2], c[-2:] middle = c[2:-2] # collapse the middle back to (ncol - 3) cells, joining the overflow with a bar while len(middle) > ncol - 3 + 1: middle[1:3] = ['|'.join(middle[1:3])] return head + middle + tail print("\n# (1) closures and verdict words") vc = Counter(verdict_word(fixed(r)[2]) for r in rows) print(f" total closures: {len(rows)}") for k, n in vc.most_common(): print(f" {k:<13} {n}") print("\n# (2) the signed/unsigned pattern -- a tenth of the register, not a law") eng = [r for r in rows if SIGNED.search(' '.join(fixed(r)[1:4]))] surv = [r for r in eng if SURVIVES.search(' '.join(fixed(r)[1:4]))] print(f" clauses engaging signed/cancellation at all : {len(eng)} of {len(rows)}") print(f" ... naming the signed question as surviving : {len(surv)}") print(" NOT evidence that the other rows leave it open: they close other kinds of thing.") print("\n# (3) closures contingent on a named unverified external source") hits = [r for r in rows if CONTINGENT.search(' '.join(fixed(r)[1:4]))] print(f" count: {len(hits)}") for r in hits: c = fixed(r) print(f" route : {c[1]}") print(f" verdict : {c[2][:160]}") print(f" closed : {c[4] if len(c) > 4 else '?'}") print("\n Scope: this reads the one-clause summaries only. A contingency recorded") print(" solely in a linked note would not appear here; see the report's falsifier 1.")