blob: 9039c77d1395269ded05e67ac2e567ba7cde2c04 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
param(
[string]$EvidenceRoot = 'artifacts\evidence\final-elevated'
)
$ErrorActionPreference = 'Continue'
$OutputEncoding = [Text.UTF8Encoding]::new($false)
[Console]::OutputEncoding = $OutputEncoding
$repository = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
$evidence = [IO.Path]::GetFullPath((Join-Path $repository $EvidenceRoot))
if (-not $evidence.StartsWith($repository + [IO.Path]::DirectorySeparatorChar, [StringComparison]::OrdinalIgnoreCase)) {
throw 'Evidence output must remain inside the repository.'
}
New-Item -ItemType Directory -Force -Path $evidence | Out-Null
$failed = $false
function Invoke-VerificationStep {
param([string]$Name, [scriptblock]$Action)
$path = Join-Path $evidence "$Name.log"
"START $Name $(Get-Date -Format o)" | Tee-Object -FilePath $path
$exitCode = 0
try {
& $Action *>&1 | Tee-Object -FilePath $path -Append
if ($LASTEXITCODE) { $exitCode = $LASTEXITCODE }
}
catch {
$_ | Out-String | Tee-Object -FilePath $path -Append
$exitCode = 1
}
"END $Name exit=$exitCode $(Get-Date -Format o)" | Tee-Object -FilePath $path -Append
if ($exitCode -ne 0) { $script:failed = $true }
}
$bundle = Join-Path $repository 'build\Release\publish\agent-sandbox-mcp-1.0.0-win-x64'
$windowsTests = Join-Path $repository 'build\Release\Agent.Windows.Tests\net10.0-windows10.0.26100.0\Agent.Windows.Tests.exe'
$coreTests = Join-Path $repository 'build\Release\Agent.Core.Tests\net10.0-windows10.0.26100.0\Agent.Core.Tests.exe'
$plannerTests = Join-Path $repository 'build\Release\Agent.Planner.Tests\net10.0\Agent.Planner.Tests.exe'
Invoke-VerificationStep 'bundle-check' {
& (Join-Path $bundle 'agent-mcp.exe') check --config (Join-Path $bundle 'agent.yaml') --lang en
}
Invoke-VerificationStep 'windows-security-tests' { & $windowsTests }
Invoke-VerificationStep 'core-unit-integration-tests' { & $coreTests }
Invoke-VerificationStep 'planner-unit-tests' { & $plannerTests }
Invoke-VerificationStep 'e2e-01-stdio' {
& (Join-Path $PSScriptRoot 'Operational-E2E.ps1') -Transport stdio
}
Invoke-VerificationStep 'e2e-02-http-ipv4' {
& (Join-Path $PSScriptRoot 'Operational-E2E.ps1') -Transport http -HttpHost 127.0.0.1
}
Invoke-VerificationStep 'e2e-02-http-ipv6' {
& (Join-Path $PSScriptRoot 'Operational-E2E.ps1') -Transport http -HttpHost ::1
}
if ($failed) {
Write-Error "Final elevated verification FAILED. Evidence: $evidence"
exit 1
}
Write-Output "Final elevated verification PASS. Evidence: $evidence"
exit 0
|