Files
troupe-standup/wizard-work/ledger/2026-10-29-queue-ledger/debug5.py
T

20 lines
768 B
Python

import re, csv
SRC = "/root/troupe-standup/WORK-QUEUE.md"
text = open(SRC, encoding="utf-8").read().splitlines()
Q = re.compile(r"^## Q(\d+)\s?(.*)$")
heads = []
for i, raw in enumerate(text):
m = Q.match(raw)
if m:
heads.append((i + 1, int(m.group(1)), m.group(2).strip().lstrip("—").strip()))
print("total Q headings:", len(heads))
print("first 5:", heads[:5])
with open("/root/troupe-standup/wizard-work/ledger/2026-10-29-queue-ledger/queue-ledger.tsv", encoding="utf-8", newline="") as fh:
rows = list(csv.reader(fh, delimiter="\t"))
present = set(int(r[0]) for r in rows[1:])
missing = [h for h in heads if h[1] not in present]
print("missing headings:", len(missing))
for m in missing:
print(" line", m[0], "q", m[1], "|", m[2][:60])