from pathlib import Path import csv, re h = Path('output/handoff.md').read_text() rows = list(csv.DictReader(Path('output/requirements.csv').open(newline=''))) assert len(h.split()) < 900 assert list(rows[0]) == ['id','current_requirement','owner','status','source'] assert len({r['id'] for r in rows}) == len(rows) a = Path('inputs/archive.md').read_text() c = Path('inputs/approved-changes.md').read_text() for r in rows: assert all(r.values()) and None not in r for ident in re.findall(r'(?:CR-\d+|TEST-\d+|MAIL-\d+|EMAIL-\d+|DEC-\d+|NOTE-\d+|TICKET-\d+)',r['source']): assert ident in a or ident in c, ident print('Handoff whitespace-delimited word count:',len(h.split())) print('CSV rows:',len(rows)) print('PASS: under 900 words; exact CSV header; unique IDs; populated five-column rows; cited record IDs exist.') print('Checks validate structure and reference existence, not underlying project tests.')