Files
ARCADIA-Studio/harness/experiments/canvas-camera-a57c334-20260912/archive.ps1
T

30 lines
2.5 KiB
PowerShell

$ErrorActionPreference = 'Stop'
$originRoot = 'C:\Users\User\Documents\Git\ARCADIA-Studio\.local\native-a57c334-camera'
$destinationRoot = $PSScriptRoot
$paths = @('launch-script-syntax.json','launch.json','normal-close.json','preparation-manifest.json','prepare-inputs.py','second-readback.json','wide-passive-status.json')
foreach ($directory in @('baseline-wide','checkpoints/wide-passive','logs','provenance','screenshots')) {
$paths += Get-ChildItem -LiteralPath (Join-Path $originRoot $directory) -Recurse -File | ForEach-Object { $_.FullName.Substring($originRoot.Length + 1).Replace('\','/') }
}
$entries = @()
foreach ($relative in ($paths | Sort-Object)) {
$original = Join-Path $originRoot $relative
$copy = Join-Path $destinationRoot $relative
if (Test-Path -LiteralPath $copy) { throw "Refusing to overwrite $copy" }
$before = (Get-FileHash -LiteralPath $original -Algorithm SHA256).Hash
New-Item -ItemType Directory -Path (Split-Path $copy) -Force | Out-Null
Copy-Item -LiteralPath $original -Destination $copy
$after = (Get-FileHash -LiteralPath $copy -Algorithm SHA256).Hash
if ($before -ne $after) { throw "Copy mismatch $relative" }
$entries += [ordered]@{path=$relative;original=$original;bytes=(Get-Item -LiteralPath $copy).Length;original_sha256=$before;copy_sha256=$after}
}
$original = 'C:\Users\User\Documents\Git\ARCADIA-Studio\.local\launch-native-a57c334-camera.ps1'
$copy = Join-Path $destinationRoot 'launch-native-a57c334-camera.ps1'
if (Test-Path -LiteralPath $copy) { throw "Refusing to overwrite $copy" }
$before = (Get-FileHash -LiteralPath $original).Hash
Copy-Item -LiteralPath $original -Destination $copy
$after = (Get-FileHash -LiteralPath $copy).Hash
if ($before -ne $after) { throw 'Launch script mismatch' }
$entries += [ordered]@{path='launch-native-a57c334-camera.ps1';original=$original;bytes=(Get-Item -LiteralPath $copy).Length;original_sha256=$before;copy_sha256=$after}
$manifest = [ordered]@{created_utc=[DateTime]::UtcNow.ToString('o');scope='Closed a57 camera evidence only; copying does not execute gates or UI';payload_count=$entries.Count;payload_bytes=($entries|ForEach-Object { $_.bytes }|Measure-Object -Sum).Sum;files=$entries;excluded=@('bin','oracles executables/DLL','baseline-clusters','working-wide','working-clusters','profile','unrelated-cwd','ZIP archives')}
[IO.File]::WriteAllText((Join-Path $destinationRoot 'manifest.json'),($manifest|ConvertTo-Json -Depth 6)+"`n",[Text.UTF8Encoding]::new($false))