from research import *
s=begin(928,'Accept the complete current-source replay prefix','Do the completed96 actions reproduce exactly against frozen and current sources?',{},['VERIFY_THROUGH_C927.json'])
v=json.loads((ROOT/'VERIFY_THROUGH_C927.json').read_text())
prefix=[r for r in json.loads((ROOT/'journal.json').read_text()) if r['step']<=927]
out={k:v[k] for k in ['status','first','last','sequential_steps','journal_sha256_at_read','last_record_sha256','record_metadata_and_results_replayed','journal_hash_chain_verified','source_snapshot_hashes_verified','current_source_copies_checked']}
a=artifact('evidence/PREFIX_REPLAY_ACCEPTANCE_C928.json',json.dumps(out,indent=2)+'\n')
finish(s,{'replay_acceptance':a,'verified_actions':v['sequential_steps'],'frozen_and_current_sources':v['source_snapshot_hashes_verified']},'All96 completed actions replay exactly and all41 current originals match their frozen snapshots. The recorded prefix closes at the expected hash; the next gate tests portability without the original workspace.','Package the97-action prefix and verify an extracted copy in isolation.',{'PASS':v['status']=='PASS','prefix':v['sequential_steps']==96 and v['last']==927,'record_binding':v['last_record_sha256']==prefix[-1]['sha256'],'sources':v['source_snapshot_hashes_verified']==v['current_source_copies_checked']==41,'replayed':v['record_metadata_and_results_replayed']})
