19 lines
1.9 KiB
PowerShell
19 lines
1.9 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
$originRoot = 'C:\Users\User\Documents\Git\ARCADIA-Studio\.local\packaged-server-repair-union-20260912'
|
|
$sources = @(Get-ChildItem -LiteralPath $originRoot -File) + @(Get-ChildItem -LiteralPath (Join-Path $originRoot 'rest-strict') -File | Where-Object Name -ne 'synthetic-token.txt')
|
|
$records = @()
|
|
foreach ($source in ($sources | Sort-Object FullName)) {
|
|
$relative = $source.FullName.Substring($originRoot.Length+1).Replace('\','/')
|
|
if ($relative -eq 'README.md') { $relative = 'preparation-README.md' }
|
|
$destination = Join-Path $PSScriptRoot $relative
|
|
if (Test-Path -LiteralPath $destination) { throw "Refusing overwrite $destination" }
|
|
$hash = (Get-FileHash -LiteralPath $source.FullName).Hash
|
|
New-Item -ItemType Directory -Path (Split-Path $destination) -Force | Out-Null
|
|
Copy-Item -LiteralPath $source.FullName -Destination $destination
|
|
$copyHash = (Get-FileHash -LiteralPath $destination).Hash
|
|
if ($copyHash -ne $hash) { throw "Copy mismatch $relative" }
|
|
$records += [pscustomobject][ordered]@{path=$relative;original=$source.FullName;bytes=$source.Length;original_sha256=$hash;copy_sha256=$copyHash}
|
|
}
|
|
$manifest = [ordered]@{created_utc=[DateTime]::UtcNow.ToString('o');scope='Exact closed server evidence; no new execution';payload_count=$records.Count;payload_bytes=($records|Measure-Object bytes -Sum).Sum;files=$records;excluded=@('rest-strict/store: private server envelope/lock duplicates served model/source evidence, not claimed as an archived disk snapshot','rest-strict/synthetic-token.txt: fixed public test credential already literal in runner, no additional evidence','unrelated-cwd: empty working directory','package executables/DLL/ZIP: only existing before/postflight inventories copied')}
|
|
[IO.File]::WriteAllText((Join-Path $PSScriptRoot 'manifest.json'),($manifest|ConvertTo-Json -Depth 6)+"`n",[Text.UTF8Encoding]::new($false))
|