alter_ego / scripts /e2e_verdict.ps1
geraldaton20's picture
initial upload: source code (no build artifacts)
f4f166e verified
Raw History Blame Contribute Delete
2.04 kB
#requires -Version 5.1
<# A7 Phase-5 LIVE e2e: verdict flowing through OgRune abstention.
Prereqs:
- skull server binary built (alter_ego_dms/serving, og-backend optional)
- ae_engine CLI built + a pulled GGUF model resolvable for profile s1
- config.yaml: verification_tier: "alter-ego", alter_ego_url set
Usage:
.\e2e_verdict.ps1 -EngineExe <path>\ae_engine.exe -ModelPath <model.gguf> [-SkullPort 8080] [-EnginePort 9090]
#>
param(
[Parameter(Mandatory)] [string]$EngineExe,
[Parameter(Mandatory)] [string]$ModelPath,
[int]$SkullPort = 8080,
[int]$EnginePort = 9090
)
$ErrorActionPreference = 'Stop'
# 1) skull up
$skull = Start-Process -FilePath "$PSScriptRoot\..\serving\target\x86_64-pc-windows-gnu\release\alter_ego_serve.exe" `
-ArgumentList "--serve","--port","$SkullPort" -PassThru -WindowStyle Hidden
Start-Sleep 4
try {
# 2) direct brain sanity
$j = Invoke-RestMethod -Uri "http://localhost:$SkullPort/v1/brain/judge" -Method Post `
-ContentType "application/json" `
-Body '{"input":"capital of france?","output":"Paris"}'
Write-Host ("[skull] direct judge -> {0} ({1:N3})" -f $j.verdict, $j.trust.total)
# 3) engine up with alter-ego tier
$eng = Start-Process -FilePath $EngineExe `
-ArgumentList "serve","--port","$EnginePort","--model",$ModelPath -PassThru -WindowStyle Hidden
Start-Sleep 6
# 4) chat THROUGH the engine; verdict middleware must appear
$r = Invoke-RestMethod -Uri "http://localhost:$EnginePort/v1/chat/completions" -Method Post `
-ContentType "application/json" `
-Body '{"messages":[{"role":"user","content":"capital of france?"}],"max_tokens":32}'
Write-Host "[engine] response received"
if ($r.alter_ego) { Write-Host ("[e2e PASS] verdict through abstention: {0}" -f ($r.alter_ego | ConvertTo-Json -Compress)) }
else { Write-Host "[e2e WARN] no alter_ego block — check verification_tier config" }
}
finally {
foreach ($p in @($eng, $skull)) { if ($p -and !$p.HasExited) { Stop-Process -Id $p.Id -Force } }
}