Submissions / #4 / scripts/overlap.py

scripts/overlap.py

Submission
#4 · Claim audit: the "Anthropic cryptanalysis breakthrough" post of 2026-11-29
Contributor
@jz
Published
2026-11-30 02:01 UTC
Type
text/x-python
Size
3.0 kB
SHA-256
01c21a7bb2296c0c51855f641bea4877302a7a371d36025fc6146597adcc1e1c
DownloadBack to submission

Preview

"""Compare people named on the Lattice Frontier program (every git revision of
index.html) with the CIRG member list. Usage:
  python3 -I scripts/overlap.py <latticefrontier repo dir> <cirg index.html>
"""
import html, re, subprocess, sys, json

repo, cirg_path = sys.argv[1], sys.argv[2]

def text(s):
    s = re.sub(r'<(style|script).*?</\1>', '', s, flags=re.S)
    return re.sub(r'\s+', ' ', html.unescape(re.sub(r'<[^>]+>', ' ', s)))

def norm(n):  # surname key, tolerant of middle initials/names
    n = re.sub(r'\(.*?\)', '', n).replace('Q.', '').strip()
    return n.split()[-1].lower()

# Program: speakers are in <span class="who">Name, <em>Affil</em> ...</span>;
# organizers/hosts are in the footer sentence.
def program_people(s):
    people = {}
    for kind, who in re.findall(r'<div class="what">.*?<span class="who">(.*?)</span>\s*</div>\s*<span class="kind">([^<]*)<', s, flags=re.S) and \
            [(k, w) for w, k in re.findall(r'<span class="who">(.*?)</span>\s*</div>\s*<span class="kind">([^<]*)<', s, flags=re.S)]:
        if 'dinner' in kind.lower(): continue  # venue description, not a person
        w = text(who).replace('Moderator:', '')
        for part in re.split(r';', w):
            m = re.match(r'\s*([^,]+),\s*(.+)', part.strip())
            if m: people[norm(m.group(1))] = (m.group(1).strip(), m.group(2).strip(), 'speaker/panelist')
    t = text(s)
    m = re.search(r'Organizers:(.*?)\.\s*Hosted at MIT thanks to (.*?)\.', t)
    for name in re.findall(r'([A-Z][a-z]+ [A-Z][a-z]+)', m.group(1)):
        people.setdefault(norm(name), (name, '', 'organizer'))
    for name in re.split(r' and ', m.group(2)):
        people.setdefault(norm(name), (name.strip(), 'MIT', 'host'))
    return people

cirg_html = open(cirg_path).read()
cirg_names = [text(n).strip() for n in re.findall(r'<span class="name">(.*?)</span>', cirg_html, flags=re.S)]
cirg_keys = {norm(n): n for n in cirg_names}

revs = subprocess.run(['git', '-C', repo, 'log', '--format=%H %aI', '--', 'index.html'],
                      capture_output=True, text=True, check=True).stdout.split('\n')
out = {}
for line in filter(None, revs):
    sha, date = line.split()
    s = subprocess.run(['git', '-C', repo, 'show', f'{sha}:index.html'],
                       capture_output=True, text=True, check=True).stdout
    p = program_people(s)
    inside = sorted(v[0] for k, v in p.items() if k in cirg_keys)
    outside = sorted(f'{v[0]} ({v[1]})' for k, v in p.items() if k not in cirg_keys)
    out[sha[:7]] = {'author_date': date, 'program_people': len(p),
                    'in_cirg': inside, 'not_in_cirg': outside}
prog_keys = set(program_people(subprocess.run(['git','-C',repo,'show','HEAD:index.html'],
                capture_output=True,text=True,check=True).stdout))
out['cirg_member_count'] = len(cirg_keys)
out['cirg_members_not_on_program'] = sorted(v for k, v in cirg_keys.items() if k not in prog_keys)
print(json.dumps(out, indent=2, ensure_ascii=False))