Save reboot checkpoint with source layout WIP and native evidence
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
param([Parameter(Mandatory=$true)][string]$Mode,[string]$Observed='work',[string[]]$Carriers=@(),[switch]$Same,[string]$LogName='')
|
||||
$ErrorActionPreference='Stop'
|
||||
$trialRepo='C:\Users\User\Documents\Git\ARCADIA-Studio'
|
||||
$trialRoot=Join-Path $trialRepo '.local/native-qa/contextual-source-20260911-v1'
|
||||
$oracle=Join-Path $trialRepo '.local/staged-source-oracle-20260911/staged-source-authoring-contract.exe'
|
||||
if((Get-FileHash -LiteralPath $oracle -Algorithm SHA256).Hash -ne '967D9BA3C6FB3A7EFB410833903EC94556CA2D48A67D5072C8BB160F40A00F9C') { throw 'Oracle changed' }
|
||||
$base=Join-Path $trialRepo 'harness/fixtures/staged-source-authoring/base/project.arcadia'
|
||||
$observedEntry=Join-Path $trialRoot "$Observed/project.arcadia"
|
||||
$argsList=@('check',$Mode,$base,$observedEntry)
|
||||
foreach($carrier in $Carriers) { $argsList += Join-Path $trialRoot "$carrier/project.arcadia" }
|
||||
if($Same) { $argsList=@('same') + @($Carriers | ForEach-Object { Join-Path $trialRoot "$_/project.arcadia" }) }
|
||||
$oldRuntimePath=$env:PATH
|
||||
if(-not $LogName) { $LogName=$Mode }
|
||||
if(Test-Path -LiteralPath "$trialRoot/$LogName-result.json") { throw 'Refuse to overwrite an earlier oracle result' }
|
||||
try {
|
||||
$env:PATH="$trialRoot/bin;$env:SystemRoot\System32;$env:SystemRoot"
|
||||
& $oracle @argsList 2>&1 | Tee-Object -FilePath "$trialRoot/$LogName.log"
|
||||
$oracleExit=$LASTEXITCODE
|
||||
[pscustomobject]@{finishedUtc=[DateTimeOffset]::UtcNow.ToString('o');exitCode=$oracleExit;arguments=$argsList;runtimePath=$env:PATH} | ConvertTo-Json -Depth 4 | Set-Content -LiteralPath "$trialRoot/$LogName-result.json"
|
||||
if($oracleExit -ne 0) { throw "Oracle failed with exit $oracleExit" }
|
||||
} finally { $env:PATH=$oldRuntimePath }
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$stageRepo = 'C:\Users\User\Documents\Git\ARCADIA-Studio'
|
||||
$stageRoot = Join-Path $stageRepo '.local/native-qa/contextual-source-20260911-v1'
|
||||
$stageInputs = Join-Path $stageRepo '.local/contextual-source-20260911'
|
||||
if (Test-Path -LiteralPath $stageRoot) { throw 'Native stage already exists.' }
|
||||
if (Get-Process -Name arcadia-studio -ErrorAction SilentlyContinue) { throw 'Another Studio process exists.' }
|
||||
$sourceManifest = Get-Content -Raw -LiteralPath (Join-Path $stageInputs 'focused5-inputs.json') | ConvertFrom-Json
|
||||
foreach ($entry in $sourceManifest.inputs) {
|
||||
if ((Get-FileHash -Algorithm SHA256 -LiteralPath (Join-Path $stageRepo $entry.path)).Hash -ne $entry.sha256) { throw "Frozen input differs: $($entry.path)" }
|
||||
}
|
||||
$guiManifest = Get-Content -Raw -LiteralPath (Join-Path $stageInputs 'gui-verified/manifest.json') | ConvertFrom-Json
|
||||
foreach ($entry in $guiManifest.artifacts) {
|
||||
if ((Get-FileHash -Algorithm SHA256 -LiteralPath (Join-Path $stageInputs "gui-verified/$($entry.file)")).Hash -ne $entry.sha256) { throw "GUI artifact differs: $($entry.file)" }
|
||||
}
|
||||
New-Item -ItemType Directory -Path "$stageRoot/bin", "$stageRoot/profile/local", "$stageRoot/profile/roaming" | Out-Null
|
||||
foreach ($entry in $guiManifest.artifacts) { Copy-Item -LiteralPath (Join-Path $stageInputs "gui-verified/$($entry.file)") -Destination "$stageRoot/bin" }
|
||||
Copy-Item -LiteralPath (Join-Path $stageRepo 'harness/fixtures/staged-source-authoring/base') -Destination "$stageRoot/work" -Recurse
|
||||
$originalPath = $env:PATH
|
||||
$originalAppData = $env:APPDATA
|
||||
$originalLocalAppData = $env:LOCALAPPDATA
|
||||
try {
|
||||
$env:PATH = "$stageRoot/bin;$env:SystemRoot\System32;$env:SystemRoot"
|
||||
$env:APPDATA = "$stageRoot/profile/roaming"
|
||||
$env:LOCALAPPDATA = "$stageRoot/profile/local"
|
||||
$guiProcess = Start-Process -FilePath "$stageRoot/bin/arcadia-studio.exe" -WorkingDirectory "$stageRoot/bin" -WindowStyle Hidden -PassThru -RedirectStandardOutput "$stageRoot/stdout.log" -RedirectStandardError "$stageRoot/stderr.log"
|
||||
[pscustomobject]@{ pid=$guiProcess.Id; startedUtc=[DateTimeOffset]::UtcNow.ToString('o'); sourceManifest="$stageInputs/focused5-inputs.json"; artifacts=$guiManifest.artifacts; executable="$stageRoot/bin/arcadia-studio.exe"; appData=$env:APPDATA; localAppData=$env:LOCALAPPDATA; runtimePath=$env:PATH; baseline=(Get-ChildItem -LiteralPath "$stageRoot/work" -File | Get-FileHash -Algorithm SHA256 | Select-Object Path,Hash) } | ConvertTo-Json -Depth 6 | Set-Content -LiteralPath "$stageRoot/launch.json"
|
||||
$guiProcess | Select-Object Id, ProcessName
|
||||
} finally {
|
||||
$env:PATH=$originalPath
|
||||
$env:APPDATA=$originalAppData
|
||||
$env:LOCALAPPDATA=$originalLocalAppData
|
||||
}
|
||||
Reference in New Issue
Block a user