Files
awoooi/scripts/reboot-recovery/tests/test_agent99_stale_queue_quarantine_contract.py
Your Name 50c7a7f7f5
Some checks failed
CD Pipeline / select-latest-carrier (push) Successful in 1m9s
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 10m26s
CD Pipeline / revalidate-deploy-carrier (push) Has been skipped
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / revalidate-post-deploy-carrier (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
MCP External Protocol Replay / replay-and-verify (push) Successful in 44s
MCP External Artifact Mirror / mirror-and-verify (push) Successful in 33s
E2E Health Check / e2e-health (push) Failing after 48s
AI 技術雷達監控 / ai-technology-watch (push) Successful in 34s
Agent Version Lifecycle Watch / version-lifecycle-watch (push) Successful in 7s
Agent Market Watch / market-watch (push) Failing after 26s
AWOOOI Harbor 110 Local Repair / workflow-shape (push) Successful in 1s
AWOOOI Harbor 110 Local Repair / harbor-110-local-repair (push) Successful in 23s
fix(agent99): unblock bounded maintenance deployment
2026-07-19 16:04:18 +08:00

45 lines
1.9 KiB
Python

from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
SCRIPT = ROOT / "scripts/reboot-recovery/agent99-stale-queue-quarantine.ps1"
def test_stale_queue_quarantine_is_exact_recoverable_and_receipted() -> None:
source = SCRIPT.read_text(encoding="utf-8")
assert '[ValidateSet("Check", "Apply")]' in source
assert "ExpectedQueueSha256" in source
assert "ExpectedMaintenanceSha256" in source
assert '"Global\\WoooAgent99StaleQueueMaintenanceV1"' in source
assert '"Global\\WoooAgent99RecoveryTransportV1"' in source
assert 'Get-ScheduledTask `' in source
assert '"Wooo-Agent99-Control-Loop"' in source
assert 'throw "control_loop_not_frozen"' in source
assert 'throw "active_control_or_recover_process"' in source
assert 'throw "recovery_lease_present"' in source
assert 'throw "recovery_mutex_active"' in source
assert '[string]$command.mode -ne "Recover"' in source
assert '[string]$command.source -ne "agent99-recovery-observer"' in source
assert "$command.controlledApply -isnot [bool]" in source
assert '"atomic_move_exact_queue_item_to_failed"' in source
assert "[IO.File]::Move($sourcePath, $destinationPath)" in source
assert "[IO.File]::Move($destinationPath, $sourcePath)" in source
assert '"verified_quarantined"' in source
assert '"failed_rolled_back"' in source
assert '"rollback_unverified"' in source
def test_stale_queue_quarantine_does_not_execute_or_delete_command() -> None:
source = SCRIPT.read_text(encoding="utf-8")
assert "commandExecuted = $false" in source
assert "deletePerformed = $false" in source
assert "otherQueueMutationPerformed = $false" in source
assert "rawInstructionStored = $false" in source
assert "secretValueRead = $false" in source
assert "Remove-Item -LiteralPath $sourcePath" not in source
assert "Start-ScheduledTask" not in source
assert "Invoke-Expression" not in source
assert "& $command" not in source