summaryrefslogtreecommitdiff
path: root/scripts/Operational-E2E.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Operational-E2E.ps1')
-rw-r--r--scripts/Operational-E2E.ps134
1 files changed, 15 insertions, 19 deletions
diff --git a/scripts/Operational-E2E.ps1 b/scripts/Operational-E2E.ps1
index b253198..cea1c75 100644
--- a/scripts/Operational-E2E.ps1
+++ b/scripts/Operational-E2E.ps1
@@ -17,8 +17,7 @@ $bundleRoot = Join-Path $root 'bundle'
$fixture = Join-Path $root 'fixture'
$alias = 'python-e2e-' + [Guid]::NewGuid().ToString('N').Substring(0, 12)
$passed = $false
-$approved = $false
-$resolutionStorePath = $null
+$appliedStorePath = $null
$server = $null
New-Item -ItemType Directory -Path $bundleRoot,$fixture | Out-Null
$fixtureAclBefore = (Get-Acl -LiteralPath $fixture).Sddl
@@ -40,6 +39,8 @@ try {
$pythonVersion = (& $python --version 2>&1 | Out-String).Trim()
if ($pythonVersion -notmatch '^Python 3\.14\.') { throw "Operational E2E requires Python 3.14; resolved '$pythonVersion'." }
$runtimeRoot = Split-Path $python
+ $pythonYaml = $pythonLogical.Replace('\','/')
+ $runtimeYaml = $runtimeRoot.Replace('\','/')
Set-Content -LiteralPath (Join-Path $fixture 'README.md') -Encoding utf8NoBOM -Value @'
# Graph metrics fixture
@@ -50,7 +51,7 @@ produce a deterministic topological order, detect cycles, and calculate the weig
$fixtureYaml = $fixture.Replace('\','/')
$config = @"
-schema_version: 1
+schema_version: 2
application:
language: ja
mcp:
@@ -83,9 +84,10 @@ sandbox:
- $fixtureYaml
mounts: []
execution:
- executables:
- - $alias
- shells: []
+ entries:
+ - alias: $alias
+ path: $pythonYaml
+ runtime_root: $runtimeYaml
network:
access: none
local_endpoints: []
@@ -112,15 +114,12 @@ logging:
"@
Set-Content -LiteralPath $configPath -Value $config -Encoding utf8NoBOM
- & $agent executable approve $alias --path $pythonLogical --runtime-root $runtimeRoot --yes --config $configPath --lang en
- if ($LASTEXITCODE -ne 0) { throw 'Executable approval failed.' }
- $approved = $true
- & $agent sandbox confirm --yes --config $configPath --lang en
- if ($LASTEXITCODE -ne 0) { throw 'Sandbox Environment Resolution confirmation failed.' }
+ & $agent apply $configPath --yes
+ if ($LASTEXITCODE -ne 0) { throw 'Applied Configuration failed.' }
$normalizedConfig = [IO.Path]::GetFullPath($configPath).ToUpperInvariant()
$hash = [Convert]::ToHexString([Security.Cryptography.SHA256]::HashData([Text.Encoding]::UTF8.GetBytes($normalizedConfig)))
- $resolutionStorePath = Join-Path $env:LOCALAPPDATA "AgentSandboxMcp\environment-resolutions\$hash.json"
- & $agent sandbox show --format json --config $configPath --lang en | Out-Null
+ $appliedStorePath = Join-Path $env:LOCALAPPDATA "AgentSandboxMcp\applied-configurations\$hash.json"
+ & $agent show $configPath | Out-Null
if ($LASTEXITCODE -ne 0) { throw 'Effective Sandbox Policy show failed.' }
$request = @"
@@ -138,7 +137,7 @@ README.md の読取後、2ファイルの作成、最初のテスト実行、失
if ($LASTEXITCODE -ne 0) { throw 'E2E stdio client failed.' }
}
else {
- $server = Start-Process -FilePath $agent -ArgumentList @('serve','--config',$configPath,'--lang','ja','--transport','http') -WorkingDirectory $bundle -WindowStyle Hidden -PassThru
+ $server = Start-Process -FilePath $agent -ArgumentList @($configPath) -WorkingDirectory $bundle -WindowStyle Hidden -PassThru
$httpAuthority = if ($HttpHost -eq '::1') { '[::1]' } else { $HttpHost }
$endpoint = "http://${httpAuthority}:18080/mcp"
$ready = $false
@@ -183,11 +182,8 @@ catch {
}
finally {
if ($server -and -not $server.HasExited) { $server.Kill($true); $server.WaitForExit() }
- if ($approved -and (Test-Path -LiteralPath $agent)) {
- & $agent executable revoke $alias --yes --config $configPath --lang en | Out-Null
- }
- if ($resolutionStorePath -and (Test-Path -LiteralPath $resolutionStorePath)) {
- Remove-Item -LiteralPath $resolutionStorePath -Force
+ if ($appliedStorePath -and (Test-Path -LiteralPath $appliedStorePath)) {
+ Remove-Item -LiteralPath $appliedStorePath -Force
}
if ($passed -and (Test-Path -LiteralPath $root)) { Remove-Item -LiteralPath $root -Recurse -Force }
}