summaryrefslogtreecommitdiff
path: root/scripts/Operational-E2E.ps1
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-08-13 19:15:01 +0900
committertanaka takashi <isazaka@gmail.com>2026-08-13 19:15:01 +0900
commit36ae1a4cba791ec633a81b38b1d8345af8487276 (patch)
tree91cef96efac7eb8c2754658ce5af5181b1a15898 /scripts/Operational-E2E.ps1
parent76fdcb43585a4c4d288c1026d318a0ddbe3e26ab (diff)
feat!: unify sandbox configuration and permission application
Replace the split executable approval and sandbox resolution workflows with schema_version 2 and a YAML-driven execution.entries model. Resolve workspace, mount, executable, runtime, network, and resource settings into one config-scoped Applied Configuration snapshot protected by a user-only DACL and written with atomic replacement. Reduce the public CLI to implicit server startup, show, and apply. Remove serve/check, executable and sandbox subcommands, and configuration override flags including --config, --lang, --transport, --path, and --runtime-root. Add migration diagnostics for every removed schema and command surface, and keep server preflight mandatory for both stdio and HTTP. Update effective-policy compilation to validate the applied fingerprint, resolved paths, and executable hashes before startup. Preserve fail-closed behavior while allowing execution entries and runtime roots inside a development workspace to inherit that workspace capability without creating an impossible narrower ACL boundary. Rewrite the README around the consolidated permission matrix and document configuration, application, store location, startup, transport-specific elevation, Python 3.14, PowerShell, and cmd usage. Align specifications, design, implementation plan, traceability, audit report, localization, publish scripts, and operational verification with the breaking schema. Verification: Release build completed with zero warnings and errors; Agent.Core.Tests 104/104 and Agent.Planner.Tests 10/10 passed; administrator Windows Security/Recovery 56/56 and README operational 19/19 passed with no skips; published HTTP MCP completed a cmd/curl/venv-Python task with network deny and zero ACL, WFP, journal, backup, or process residue.
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 }
}