RheoBench / explore /PhaseLatch /scripts /continue_remote_delivery_transfer.ps1
Travor278's picture
RheoBench working tree snapshot 2026-10-27 (sanitized mirror of Travor278/PhaseLatch) (part 12)
d513eb2 verified
Raw History Blame Contribute Delete
2.47 kB
$ErrorActionPreference='Stop'
$plRoot=(Resolve-Path (Join-Path $PSScriptRoot '..')).Path
Set-Location -LiteralPath $plRoot
$plDeadline=[DateTime]::UtcNow.AddHours(2)
while(-not (Get-Content ops/v91_chunk_progress.json -Raw | ConvertFrom-Json).complete){
if([DateTime]::UtcNow -gt $plDeadline){throw 'V91 upload wait timed out'}
Start-Sleep -Seconds 10
}
Write-Output 'All V91 chunks uploaded; waiting for final remote SHA and ZIP CRC'
$plJoined=$false
for($plAttempt=0;$plAttempt -lt 90;$plAttempt++){
try{& scripts/qizhi_read.ps1 ops/v91_remote_archive_verified.json -SavePath ops/v91_remote_archive_verified.json | Out-Null;$plJoined=$true;break}catch{Start-Sleep -Seconds 5}
}
if(-not $plJoined){throw 'Remote ZIP verification did not finish'}
& scripts/clean_verified_v91_archive.ps1
$plQueue=@('ops/pl03_review_assets_manifest.json','ops/pl03_review_assets_20261011.tgz','C:/Windows/Fonts/msyh.ttc','C:/Windows/Fonts/consola.ttf','ops/poster_cache_pack_plan.json','ops/receive_remote_cache.py')
foreach($plFile in $plQueue){
$plSource=(Resolve-Path -LiteralPath $plFile).Path;$plBytes=(Get-Item -LiteralPath $plSource).Length;$plHash=(Get-FileHash -LiteralPath $plSource -Algorithm SHA256).Hash.ToLower();$plName=[IO.Path]::GetFileName($plSource)
& scripts/qizhi_upload_scoped.ps1 $plSource | Out-Null
$plVerified=$false
for($plAttempt=0;$plAttempt -lt 40;$plAttempt++){
Start-Sleep -Seconds 3
try{$plInfo=& scripts/qizhi_file_info.ps1 $plName}catch{continue}
if($plInfo.size -eq $plBytes -and $plInfo.hash_algorithm -eq 'sha256' -and $plInfo.hash -eq $plHash){$plVerified=$true;break}
}
if(-not $plVerified){throw ('Upload not verified: '+$plName)}
Write-Output ('Verified remote delivery resource: '+$plName)
}
& scripts/qizhi_send_scoped.ps1 ops/prepare_remote_review_assets.sh | Out-Null
$plReady=$false
for($plAttempt=0;$plAttempt -lt 40;$plAttempt++){
Start-Sleep -Seconds 3
try{& scripts/qizhi_read.ps1 ops/review_assets_ready.json -SavePath ops/review_assets_ready.json | Out-Null;$plReady=(Get-Content ops/review_assets_ready.json -Raw | ConvertFrom-Json).passed;if($plReady){break}}catch{continue}
}
if(-not $plReady){throw 'Remote review resources not ready; inspect setup log'}
$plBundle=(Resolve-Path -LiteralPath ops/pl03_review_assets_20261011.tgz).Path
if($plBundle -ne (Join-Path $plRoot 'ops\pl03_review_assets_20261011.tgz')){throw 'Unexpected staging bundle'}
Remove-Item -LiteralPath $plBundle
& scripts/qizhi_offload_cache.ps1