From 138ab2df8ddfcd16b4c40ea9be594d975dc6d4d4 Mon Sep 17 00:00:00 2001 From: ogt Date: Wed, 15 Jul 2026 19:55:24 +0800 Subject: [PATCH] fix(agent99): align visual lifecycle verifier v6 --- agent99-control-plane.ps1 | 8 ++++---- .../test_agent99_transport_recovery_deploy_contract.py | 4 ++-- .../reboot-recovery/agent99-recover-receipt-readback.ps1 | 2 +- .../tests/test_agent99_recovery_coordinator_contract.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/agent99-control-plane.ps1 b/agent99-control-plane.ps1 index 03787a7a5..46fc4b7b0 100644 --- a/agent99-control-plane.ps1 +++ b/agent99-control-plane.ps1 @@ -1624,7 +1624,7 @@ function Invoke-AgentTelegramCardSelfTest { lifecycleSuppressionReason = $stateSuppressionReason lifecycleRootMessageId = $stateRootMessageId sentTelegram = $false - messageFormat = "incident_card_zh_tw_v5" + messageFormat = "incident_card_zh_tw_v6" } $selfTestPath = Join-Path $EvidenceDir "agent99-TelegramCardSelfTest-$stamp.json" $result | ConvertTo-Json -Depth 6 | Set-Content -Path $selfTestPath -Encoding UTF8 @@ -1649,7 +1649,7 @@ function Invoke-AgentTelegramDeliverySelfTest { testId = $testId sentTelegram = $sent deliveryAttempt = $deliveryAttempt - messageFormat = "incident_card_zh_tw_v5" + messageFormat = "incident_card_zh_tw_v6" attempts = $script:TelegramAttempts } $selfTestPath = Join-Path $EvidenceDir "agent99-TelegramDeliverySelfTest-$stamp.json" @@ -2097,7 +2097,7 @@ function Record-AgentEvent { timestamp = (Get-Date -Format o) eventType = $EventType severity = $Severity - messageFormat = "incident_card_zh_tw_v5" + messageFormat = "incident_card_zh_tw_v6" incidentId = $incidentCard.incidentId fingerprint = $incidentCard.fingerprint lifecycle = $incidentCard.lifecycle @@ -2150,7 +2150,7 @@ function Record-AgentEvent { timestamp = (Get-Date -Format o) eventType = $EventType severity = $Severity - messageFormat = "incident_card_zh_tw_v5" + messageFormat = "incident_card_zh_tw_v6" incidentId = $incidentCard.incidentId fingerprint = $incidentCard.fingerprint lifecycle = $incidentCard.lifecycle diff --git a/apps/api/tests/test_agent99_transport_recovery_deploy_contract.py b/apps/api/tests/test_agent99_transport_recovery_deploy_contract.py index b0062591f..d1ffc62ab 100644 --- a/apps/api/tests/test_agent99_transport_recovery_deploy_contract.py +++ b/apps/api/tests/test_agent99_transport_recovery_deploy_contract.py @@ -61,7 +61,7 @@ def test_agent99_recovery_completion_has_human_lifecycle_receipt() -> None: assert '獨立驗證' in source -def test_agent99_telegram_v5_hides_raw_evidence_and_has_operator_fields() -> None: +def test_agent99_telegram_v6_hides_raw_evidence_and_has_operator_fields() -> None: source = CONTROL.read_text(encoding="utf-8") formatter = source[source.index("function Format-AgentTelegramText {") :] formatter = formatter[: formatter.index("function Format-AgentTelegramCaption")] @@ -75,7 +75,7 @@ def test_agent99_telegram_v5_hides_raw_evidence_and_has_operator_fields() -> Non assert "candidatePath" not in formatter assert "kmPath" not in formatter assert "verifierName=" not in formatter - assert 'messageFormat = "incident_card_zh_tw_v5"' in source + assert 'messageFormat = "incident_card_zh_tw_v6"' in source for phase_label in ("VMware", "Host111 WOL", "主機連線", "Kali 112", "公開網站", "Full SOP"): assert f'{{ "{phase_label}" }}' in source diff --git a/scripts/reboot-recovery/agent99-recover-receipt-readback.ps1 b/scripts/reboot-recovery/agent99-recover-receipt-readback.ps1 index e87cf7e1d..a36db40f6 100644 --- a/scripts/reboot-recovery/agent99-recover-receipt-readback.ps1 +++ b/scripts/reboot-recovery/agent99-recover-receipt-readback.ps1 @@ -58,7 +58,7 @@ $notificationReceipted = [bool]($lifecycleReceipts.Count -gt 0) $humanReadableCardReady = [bool]( $lifecycleReceipts.Count -gt 0 -and @($lifecycleReceipts | Where-Object { - $_.messageFormat -ne "incident_card_zh_tw_v5" -or + $_.messageFormat -ne "incident_card_zh_tw_v6" -or $_.incidentId -notmatch "^INC-[A-F0-9]{8}$" -or $_.lifecycle -notin @("remediating", "recovered", "blocked") }).Count -eq 0 diff --git a/scripts/reboot-recovery/tests/test_agent99_recovery_coordinator_contract.py b/scripts/reboot-recovery/tests/test_agent99_recovery_coordinator_contract.py index dc6f54d6f..f78b88507 100644 --- a/scripts/reboot-recovery/tests/test_agent99_recovery_coordinator_contract.py +++ b/scripts/reboot-recovery/tests/test_agent99_recovery_coordinator_contract.py @@ -239,7 +239,7 @@ def test_recover_receipt_readback_requires_verifier_and_notification() -> None: assert '$humanReadableCardReady' in readback assert '$visualLifecycleReady' in readback assert '$incidentStateReady' in readback - assert 'incident_card_zh_tw_v5' in readback + assert 'incident_card_zh_tw_v6' in readback assert '$recoveryVerified -and $notificationReceipted -and $humanReadableCardReady' in readback assert '$recentReceipts' in readback assert 'visualSentCount' in readback