[$native,'gl_journals'],'native_stock'=>[$native,'stock_movements'],'clients'=>[$host,'a_clients'],'invoices'=>[$host,'si_invoices']] as $key=>[$db,$table]){$rows=json_decode($before[$key],true);$ids=array_column($rows,'id');$same=$db->table($table)->whereIn('id',$ids)->orderBy('id')->get()->toJson()===$before[$key];if(!$same)throw new LogicException('Original rows changed: '.$key);$checks[$key]=['original_rows'=>count($rows),'identical'=>true];} if(hash_file('sha256',$s['root'].'/binding.json')!==$before['original_binding_sha256'])throw new LogicException('Original binding changed'); $checks['original_binding_unchanged']=true;$checks['six_protected_records']='No connection or command targets their databases; not reread or reassigned.';$checks['blocked_cache']='No clear/delete commands; original cache paths not changed.'; file_put_contents($work.'/next-block-preservation.json',json_encode(['passed'=>true,'checks'=>$checks,'journals_now'=>$native->table('gl_journals')->count(),'public_grants'=>0,'new_demo'=>false],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'proof'=>$work.'/next-block-preservation.json']).PHP_EOL;