"""Index active report figures from authored TeX and final LaTeX build records. Standard library only. Never extracts PDF text. The manifest supplies reviewed status/type; figure labels, source paths, hashes and page locations are derived. """ import argparse import hashlib import json import re from pathlib import Path HERE = Path(__file__).resolve().parent ROOT = HERE.parent MANIFEST = HERE / 'diagram-manifest.json' def strip_comments(text): return re.sub(r'(?{row["section"]} | '+ ' | '.join(page_cells)+' |') lines += ['', 'Historical diagrams and archived reports/slides are excluded from active figure numbering. The former frozen deployment source is retained in `assets/diagram-audit-2026-11-24/`; the old UI wireframe is retained in `assets/design-diagrams/current-ui-wireframe.tex`.', ''] (HERE/'DIAGRAM_INDEX.md').write_text('\n'.join(lines), encoding='utf-8') print(f'PASS diagram index: {len(rows)} classified active figures; '+', '.join(name for name, _ in editions)) if __name__ == '__main__': main()