fix(agent99): expose verified recovery lifecycle
This commit is contained in:
@@ -31,7 +31,7 @@ def test_agent99_enterprise_work_items_loader_returns_complete_scope() -> None:
|
||||
"agent99_enterprise_ai_automation_work_items_v1"
|
||||
)
|
||||
assert payload["scope_complete"] is False
|
||||
assert payload["current_p0"]["id"] == "AG99-P0-007"
|
||||
assert payload["current_p0"]["id"] == "AG99-P0-001"
|
||||
assert payload["summary"] == {
|
||||
"host_count": 7,
|
||||
"product_count": 12,
|
||||
@@ -40,21 +40,27 @@ def test_agent99_enterprise_work_items_loader_returns_complete_scope() -> None:
|
||||
"p0_count": 14,
|
||||
"p1_count": 8,
|
||||
"p2_count": 3,
|
||||
"in_progress_count": 7,
|
||||
"in_progress_count": 9,
|
||||
"in_progress_blocked_count": 0,
|
||||
"planned_count": 16,
|
||||
"complete_count": 2,
|
||||
"planned_count": 15,
|
||||
"complete_count": 1,
|
||||
"current_p0_count": 1,
|
||||
}
|
||||
assert payload["next_execution_order"][0] == "AG99-P0-007"
|
||||
assert payload["next_execution_order"][-1] == "AG99-P0-014"
|
||||
assert payload["next_execution_order"][:5] == [
|
||||
"AG99-P0-001",
|
||||
"AG99-P0-006",
|
||||
"AG99-P0-003",
|
||||
"AG99-P0-004",
|
||||
"AG99-P0-005",
|
||||
]
|
||||
assert payload["next_execution_order"][-1] == "AG99-P0-011"
|
||||
|
||||
|
||||
def test_agent99_enterprise_projection_is_bounded() -> None:
|
||||
payload = load_latest_agent99_enterprise_ai_automation_work_items()
|
||||
projection = build_agent99_enterprise_priority_projection(payload)
|
||||
|
||||
assert projection["current_p0"]["id"] == "AG99-P0-007"
|
||||
assert projection["current_p0"]["id"] == "AG99-P0-001"
|
||||
assert projection["coverage"] == {
|
||||
"host_count": 7,
|
||||
"product_count": 12,
|
||||
@@ -73,7 +79,7 @@ def test_priority_readback_projects_agent99_enterprise_order() -> None:
|
||||
payload = load_latest_awoooi_priority_work_order_readback()
|
||||
projection = payload["agent99_enterprise_ai_automation"]
|
||||
|
||||
assert projection["current_p0"]["id"] == "AG99-P0-007"
|
||||
assert projection["current_p0"]["id"] == "AG99-P0-001"
|
||||
assert projection["work_item_counts"]["p0"] == 14
|
||||
assert (
|
||||
payload["source_refs"]["agent99_enterprise_ai_automation_work_items_api"]
|
||||
@@ -118,7 +124,7 @@ def test_agent99_enterprise_work_items_endpoint_returns_snapshot() -> None:
|
||||
|
||||
assert response.status_code == 200
|
||||
payload = response.json()
|
||||
assert payload["current_p0"]["id"] == "AG99-P0-007"
|
||||
assert payload["current_p0"]["id"] == "AG99-P0-001"
|
||||
assert payload["summary"]["host_count"] == 7
|
||||
assert payload["summary"]["product_count"] == 12
|
||||
assert payload["summary"]["public_surface_count"] == 23
|
||||
|
||||
@@ -43,6 +43,30 @@ def test_agent99_auto_recovery_is_single_flight_and_slo_measured() -> None:
|
||||
assert '$host112Recovery -and $host112Recovery.verified' in source
|
||||
|
||||
|
||||
def test_agent99_recovery_completion_has_human_lifecycle_receipt() -> None:
|
||||
source = CONTROL.read_text(encoding="utf-8")
|
||||
|
||||
assert '$EventType -eq "recovery_slo_result"' in source
|
||||
assert '主機與服務恢復 / recovery lifecycle' in source
|
||||
assert '已恢復且符合目標 / recovered within target' in source
|
||||
assert '$lifecycleInfoAlert' in source
|
||||
assert '$EventType -in @("recovery_slo_result")' in source
|
||||
assert 'Agent99 恢復狀態 / Recovery Status' in source
|
||||
assert '恢復階段 / RECOVERY PHASES' in source
|
||||
assert 'Detect -> Apply -> Verify -> Notify receipt' in source
|
||||
|
||||
|
||||
def test_agent99_records_deduped_telegram_as_an_explicit_attempt() -> None:
|
||||
source = CONTROL.read_text(encoding="utf-8")
|
||||
dedupe = source[source.index('if ($dedupeMinutes -gt 0 -and (Test-Path $dedupePath))') :]
|
||||
dedupe = dedupe[: dedupe.index('Set-Content -Path $dedupePath')]
|
||||
|
||||
assert '$script:TelegramAttempts +=' in dedupe
|
||||
assert 'suppressed = $true' in dedupe
|
||||
assert 'reason = "dedupe_window"' in dedupe
|
||||
assert 'dedupeAgeMinutes' in dedupe
|
||||
|
||||
|
||||
def test_agent99_host112_recovery_is_allowlisted_and_independently_verified() -> None:
|
||||
source = CONTROL.read_text(encoding="utf-8")
|
||||
function = source[source.index("function Convert-AgentHost112GuestReadback") :]
|
||||
|
||||
Reference in New Issue
Block a user