Files
aevolution/tools/client/package-selftest.ps1
T
dingoandClaude Opus 5.5 1819ebc0ab
Foundation / checks (checks) (push) Successful in 32m47s
Foundation / checks (client) (push) Failing after 10m1s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m53s
Foundation / checks (network) (push) Successful in 11m18s
Foundation / checks (postgres) (push) Successful in 40m20s
Foundation / checks (tsan) (push) Successful in 7m46s
Foundation / postgres-tools (push) Skipped
Foundation / image (push) Skipped
Foundation / server-image (push) Skipped
Switch the engineering client to M10 sessions (M10.5c)
evo-client's remote mode now runs over RegionSessionClient (QUIC, session
v2): snapshot-fed environment and organism views, the camera following the
server's view until the user moves it and then driving the interest, intention
records with a simulated state, and reconnects with the next grant of a bundle.
The launcher reads 160-byte M10 grants and defaults to the dev route.

- quic::resolve_ipv4 shared by the client and evo-session-probe
- evo-session-probe grants: owner-only bundles of 1-64 grants
- evo-server --m10-max-grant-lifetime (dev only, 60..3600 s)
- presets client-network/client-package build QUIC; msquic links the CRT
  fully static; msquic.dll and msquic/OpenSSL licences in the Windows package
- client-remote-session test against a loopback region
- ADR-0093/0091/0086 amendments, M10_CLIENT_SESSIONS guide, validation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 11:57:07 -04:00

52 lines
3.1 KiB
PowerShell

# M9.8e negative checks for the package guards (ADR-0086). Copies a staged package
# folder, applies one defect at a time and requires each guard to refuse it.
# Usage: package-selftest.ps1 -Staged build\packages\<name> [-DynamicRuntimeImage FILE]
param(
[Parameter(Mandatory = $true)][string]$Staged,
# An image linked against the dynamic MSVC runtime (e.g. build\client-network\evo-client.exe).
[string]$DynamicRuntimeImage = ''
)
$ErrorActionPreference = 'Stop'
. (Join-Path $PSScriptRoot 'package-common.ps1')
$utf8 = New-Object Text.UTF8Encoding $false
$failures = 0
function Expect-Refused([string]$Label, [scriptblock]$Mutate, [scriptblock]$Check) {
$copy = Join-Path ([IO.Path]::GetTempPath()) ("evo-package-selftest-" + [Guid]::NewGuid().ToString('N'))
Copy-Item -LiteralPath $Staged -Destination $copy -Recurse
try {
& $Mutate $copy
$refused = $false
try { & $Check $copy } catch { $refused = $true; Write-Output "refused ($Label): $($_.Exception.Message)" }
if (!$refused) { Write-Output "NOT REFUSED: $Label"; $script:failures++ }
} finally { Remove-Item -LiteralPath $copy -Recurse -Force }
}
$content = { param($p) Assert-PackageContent $p }
$secrets = { param($p) Assert-NoSecrets $p }
# Baseline: the untouched copy passes every guard.
Assert-PackageContent $Staged
Assert-NoSecrets $Staged
foreach ($binary in $script:PackageImages) { Assert-AllowedImports (Join-Path $Staged $binary) }
Expect-Refused 'extra file' { param($p) [IO.File]::WriteAllText((Join-Path $p 'notes.txt'), 'x', $utf8) } $content
Expect-Refused 'missing file' { param($p) Remove-Item -LiteralPath (Join-Path $p 'LICENSES\SDL3.txt') } $content
Expect-Refused 'missing msquic.dll' { param($p) Remove-Item -LiteralPath (Join-Path $p 'msquic.dll') } $content
Expect-Refused 'checksum mismatch' { param($p) [IO.File]::AppendAllText((Join-Path $p 'README.txt'), ' ', $utf8) } $content
Expect-Refused 'credential file type' { param($p) [IO.File]::WriteAllText((Join-Path $p 'dev-ca.pem'), 'x', $utf8) } $secrets
Expect-Refused 'grant bundle file type' { param($p) [IO.File]::WriteAllBytes((Join-Path $p 'client-grants.bin'), [byte[]]::new(160)) } $secrets
Expect-Refused 'private key text' {
param($p) [IO.File]::AppendAllText((Join-Path $p 'README.txt'),
"-----BEGIN EC PRIVATE KEY-----`nMHcCAQEEIBbF0p3l9QpKl2+abcdefghijklmnopqrstuvwxyzABCDEFG`n", $utf8) } $secrets
Expect-Refused 'certificate text' {
param($p) [IO.File]::AppendAllText((Join-Path $p 'BUILD-INFO.txt'),
"-----BEGIN CERTIFICATE-----`nMIIBkTCB+wIJAKHBfpE7d1cRMA0GCSqGSIb3DQEBCwUAMBExDzANBgNVBAMM`n", $utf8) } $secrets
Expect-Refused 'user profile path' {
param($p) [IO.File]::AppendAllText((Join-Path $p 'BUILD-INFO.txt'), "C:\Users\someone\build`n", $utf8) } $secrets
if ($DynamicRuntimeImage) {
$refused = $false
try { Assert-AllowedImports $DynamicRuntimeImage } catch { $refused = $true; Write-Output "refused (dynamic runtime): $($_.Exception.Message)" }
if (!$refused) { Write-Output 'NOT REFUSED: dynamic runtime image'; $failures++ }
}
if ($failures -ne 0) { throw "$failures package guard(s) did not refuse a defect" }
Write-Output 'package guard self-test passed'