$ErrorActionPreference = 'Stop' . ./.local/toolchain/env.ps1 $env:CARGO_BUILD_JOBS = '1' $evidenceRoot = Join-Path (Get-Location) '.local/contextual-source-20260911' $gates = @( @{name='focused5'; args=@('test','--locked','-p','oa-desktop','--bin','arcadia-studio','contextual_source','--','--test-threads=1')}, @{name='guide-final'; args=@('test','--locked','-p','oa-desktop','--bin','arcadia-studio','guide','--','--test-threads=1')}, @{name='clippy2'; args=@('clippy','--locked','-p','oa-desktop','--all-targets','--','-D','warnings')}, @{name='gui-final'; args=@('build','--locked','-p','oa-desktop','--bin','arcadia-studio')}, @{name='fmt-final'; args=@('fmt','--all','--','--check')} ) foreach ($gate in $gates) { $logPath = Join-Path $evidenceRoot ($gate.name + '.log') $statusPath = Join-Path $evidenceRoot ($gate.name + '-status.json') if ((Test-Path -LiteralPath $logPath) -or (Test-Path -LiteralPath $statusPath)) { throw "Refusing to overwrite $($gate.name)" } $started = [DateTime]::UtcNow.ToString('o') $gateArgs = $gate.args & cargo @gateArgs 2>&1 | Tee-Object -FilePath $logPath $gateExit = $LASTEXITCODE [ordered]@{started=$started;finished=[DateTime]::UtcNow.ToString('o');exitCode=$gateExit;args=$gateArgs} | ConvertTo-Json -Depth 4 | Set-Content -LiteralPath $statusPath if ($gateExit -ne 0) { exit $gateExit } }