fix(agent99): harden runtime deploy rollback

This commit is contained in:
ogt
2026-07-11 20:58:00 +08:00
parent 98ccf02231
commit aceedcc202
2 changed files with 54 additions and 9 deletions

View File

@@ -164,6 +164,25 @@ def test_agent99_deployer_verifies_promoted_runtime_and_writes_revision() -> Non
assert f'"{name}"' in bootstrap
def test_agent99_deployer_backs_up_manifest_before_runtime_promotion() -> None:
deploy = DEPLOY.read_text(encoding="utf-8")
promotion = deploy[deploy.index("$configBackedUp = $false") :]
promotion = promotion[: promotion.index("$config = Get-Content $ConfigPath")]
assert promotion.index('Copy-Item -Force $ConfigPath') < promotion.index(
"foreach ($name in $runtimeFiles)"
)
assert promotion.index('Copy-Item -Force $ManifestPath') < promotion.index(
"foreach ($name in $runtimeFiles)"
)
assert 'Restore-Agent99Deployment $promotionRows $configBackedUp $manifestBackedUp' in deploy
assert "function Copy-AgentRuntimeFileWithRetry" in deploy
assert "MaxAttempts = 20" in deploy
assert 'reason = "file_in_use"' in deploy
assert "runtimeCopyRetryCount" in deploy
assert "Copy-AgentRuntimeFileWithRetry (Join-Path $StageDir $name) $livePath" in deploy
def test_agent99_completion_callback_waits_for_durable_same_trace_readback() -> None:
source = CONTROL.read_text(encoding="utf-8")
deploy = DEPLOY.read_text(encoding="utf-8")