fix(agent99): bound stale transport processes

This commit is contained in:
ogt
2026-07-10 22:57:10 +08:00
parent ff2e082c12
commit 2d798cc7c7
8 changed files with 172 additions and 4 deletions

View File

@@ -1,9 +1,9 @@
# AWOOOI 重開機恢復 SOP
> **版本**: v5.23
> **版本**: v5.24
> **最後更新**: 2026-07-10 (台北時間)
> **更新者**: Codex
> **觸發事件**: 2026-07-10 全主機重啟後備份/Gitea 可還原性與排程補跑收斂
> **觸發事件**: 2026-07-10 全主機重啟後 Agent99 transport、效能修復與證據鏈收斂
---
@@ -21,6 +21,18 @@
## 架構概覽與依賴圖
### 2026-07-10 P0 Agent99 Transport / Verified Remediation 覆蓋
99 的 Agent99 是全主機恢復控制節點。Windows 開機後由既有 Agent99 scheduled tasks 啟動;`Status` 讀到 boot identity 變更時,只能用 single-flight queue 觸發一次 `Recover`,並以 10 分鐘 cooldown 避免併發恢復。每次執行必須寫入 `bootState``recoveryTrigger``recoverySlo` evidence。只有實際全主機重啟事件、五主機 reachability、必要服務、public routes 與 freshness 全部在同一個 10 分鐘 window 通過,才可宣稱 reboot recovery SLO 達標。
Agent99 SSH transport 使用 99 本機專用 Ed25519 identity `C:\Wooo\Agent99\keys\agent99_ed25519`private key 不得輸出、複製到 evidence、Telegram 或 repo。只允許將 public key 以 `from="192.168.0.99",restrict` 授權到 110 `wooo` 與 112 `kali`。固定 route map 為 110 / 112 direct120 / 121 / 188 優先經 110 jump禁止以共用密碼或任意 interactive shell 取代。Runtime 必須由 `agent99-deploy.ps1` 經 parse、contract、synthetic、staging、backup、atomic promote 與 rollback gate 部署,`runtime-manifest.json.sourceRevision` 必須等於 Gitea commit SHA。
所有 SSH command 都必須 bounded timeout。Timeout 時先用 `taskkill /T` 終止 process tree再確認 process 是否仍存活;`Perf` / `LoadShed` controlled apply 執行前會清理只符合以下全部條件的 stale clientAgent99 allowlisted target、`BatchMode=yes`、沒有 `-N/-L/-R/-D` tunnel、超過 15 分鐘且 parent 已消失,或超過 60 分鐘 hard limit。guard 不記錄 command line不碰互動式 SSH 或 tunnel結果寫入 `sshProcessGuard` evidence。
效能修復不得以 command exit code 取代 post-verifier。只要 action 配置 verifier成功判定完全由 verifier 決定verifier 失敗必須記為 failed僅建立 10 分鐘 failure backoff不得建立 success cooldown。policy 變更必須提升 `policyVersion`,由 deployer migration 更新 99 live config避免舊 command 或 marker 繼續造成 false green。
本輪 live receipt`agent99-load-shed-marker-correction.json` 已封存 188 舊 false-success marker`agent99-stale-ssh-cleanup-v2.json` 已受控終止 7 個逾時 orphan SSH client`agent99-Perf-20260710-224454.json` 顯示 110、112、120、121、188 全部 readback OKroute 分別為 direct、direct、via110、via110、via110。110 load/core `0.60`、disk `84%`188 load/core `0.18`、disk 由 `90%` 降至 `88%`。這證明 transport、效能讀回與 verifier 修復 lane 已恢復,不等於已完成下一次實際全主機 cold-start 的 10 分鐘 SLA 驗收。
### 2026-07-10 P0 備份/Gitea 自動驗證覆蓋
每次 host reboot 後,備份 lane 必須依序執行 `/backup/scripts/backup-status.sh --no-notify``/backup/scripts/verify-gitea-backup.sh --no-notify`,再由 110 的每日排程執行 `/backup/scripts/gitea-bundle-backup-sync-188.sh`。最後讀回 110/188 `backup_health.prom`、Gitea restore status、bundle sync status、188 sample restore metric 與 Prometheus Backup/Gitea alerts不得只看檔案 mtime、HTTP 200 或命令 exit code。