from research import *
s=begin(630,'Run the pre-closure verification gate','Do all98 completed records replay exactly with current source identity and scope checks intact?',{'through':629,'required_steps':98,'required_snapshots':28},['Sequential journal; exact step scripts; current originals; verifier'])
r=json.loads((ROOT/'prep/VERIFY_THROUGH_C629.json').read_text());keys=['status','sequential_steps','step_checks_replayed','source_snapshot_hashes_verified','current_source_copies_checked','journal_hash_chain_verified','second_inverse_guard_violations','replay_writes_blocked'];out={k:r[k] for k in keys}
finish(s,{'verification':out,'report_sha256':hashlib.sha256((ROOT/'prep/VERIFY_THROUGH_C629.json').read_bytes()).hexdigest()},'All98 completed records replay exactly with241 named checks,28 source snapshots and29 current copies verified. The hash chain and predecessor match; replay is read-only and no second-inversion guard violation occurred.','Close the100-step cycle and bind the deliverables, then execute the final100-record verification.',{'passed':r['status']=='PASS' and r['sequential_steps']==98,'sources':r['source_snapshot_hashes_verified']==28 and r['current_source_copies_checked']==29,'scope':r['second_inverse_guard_violations']==0 and r['replay_writes_blocked'] is True})
