"""Local document checks only; does not test the webinar platform or consent.""" import csv, io, pathlib, re, json, hashlib from datetime import datetime, timedelta root=pathlib.Path('output') read=lambda p:p.read_text(encoding='utf-8') text=read(root/'action-plan.csv') reader=csv.DictReader(io.StringIO(text)) expected=['action_id','action','owner','due','status','dependencies','source'] assert reader.fieldnames==expected rows=list(reader) assert len(rows)==17 assert all(None not in r and all(r.values()) for r in rows) ids=[r['action_id'] for r in rows] assert len(ids)==len(set(ids)) for r in rows: refs=re.findall(r'\bA\d{2}\b',r['dependencies']) assert all(x in ids for x in refs), (r['action_id'],refs) assert r['action_id'] not in refs paths=re.findall(r'inputs/[\w.-]+',r['source']) assert paths and all(pathlib.Path(p).exists() for p in paths) buf=io.StringIO(newline='') w=csv.DictWriter(buf,fieldnames=expected,lineterminator='\n') w.writeheader();w.writerows(rows) assert list(csv.DictReader(io.StringIO(buf.getvalue())))==rows by={r['action_id']:r for r in rows} # Assertions transcribed from CR-07; they validate the plan, not actual completion. for key,owner,due in [ ('A01','Priya','2026-10-21 12:00 Pacific'), ('A03','Alex','2026-10-21 Pacific (time unspecified)'), ('A04','Jonah','2026-10-21 17:00 Pacific'), ('A07','Mei','2026-10-22 12:00 Pacific'), ('A10','Priya','2026-10-22 17:00 Pacific'), ('A14','Alex','2026-10-27 17:00 Pacific'), ('A16','Alex','2026-10-30 11:00 Pacific')]: assert by[key]['owner']==owner and by[key]['due']==due, key assert by['A09']['owner']=='TBD platform test owner' assert by['A09']['due'].startswith('2026-10-22 Pacific') assert by['A12']['due']=='2026-10-23 09:00 Pacific (conditional)' assert all(s in by['A12']['dependencies'] for s in ['A09 pass on Oct 22','A10 approval']) assert 'On hold' in by['A17']['status'] email=read(root/'update-email.txt') words=len(email.split()) assert words<=220, words assert email.startswith('To: Field Notes project team') assert 'Draft only; not sent.' in email assert 'All dates are 2026; times Pacific.' in email log=read(root/'decision-log.md') assert 'not already completed' in log assert '11:45' in log end=datetime(2026,10,30,11,0)+timedelta(minutes=45) assert end==datetime(2026,10,30,11,45) manifest=json.loads(read(root/'review-integrity.json')) for name,digest in manifest.items(): assert hashlib.sha256(pathlib.Path(name).read_bytes()).hexdigest()==digest, name messages=[ 'PASS: CSV exact seven-column schema; 17 complete rows; unique IDs; valid dependency references; CSV round-trip; cited CSV input paths exist.', 'PASS: Source-derived owner/deadline assertions, unassigned tester, conditional opening and advertising hold.', f'PASS: Email {words} whitespace-delimited words including headers and sources (limit 220); team addressee, draft-only marker and year/timezone present.', 'PASS: Event end calculation: October 30, 2026 11:00 Pacific + 45 minutes = 11:45 Pacific.', 'PASS: Original-submission archive and all seven supplied files unchanged against review-start SHA-256 manifest.', 'LIMIT: Document checks only. Dependency references include conditional/nonblocking checks, not just strict predecessors. No platform tests, consent verification, approvals, publishing or sending performed.' ] report='\n'.join(messages)+'\n' (root/'review-checks.txt').write_text(report,encoding='utf-8') print(report)