fix(web): show Runs incident status-chain focus
Some checks failed
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / tests (push) Successful in 1m34s
CD Pipeline / build-and-deploy (push) Successful in 3m43s
CD Pipeline / post-deploy-checks (push) Successful in 1m29s
Ansible / Reboot Recovery Contract / validate (push) Has been cancelled

This commit is contained in:
Your Name
2026-06-25 21:57:13 +08:00
parent e5a0aa1345
commit 426ad3d5dd
3 changed files with 40 additions and 4 deletions

View File

@@ -4539,10 +4539,13 @@ export default function RunsPage() {
};
}, [runs]);
const runIncidentIds = useMemo(() => {
return Array.from(new Set(
runs.flatMap((run) => linkedIncidentIds(run.remediation_summary))
));
}, [runs]);
const normalizedIncidentFilter = incidentFilter.trim().toUpperCase();
const ids = runs.flatMap((run) => linkedIncidentIds(run.remediation_summary));
if (INCIDENT_ID_FILTER_RE.test(normalizedIncidentFilter)) {
ids.unshift(normalizedIncidentFilter);
}
return Array.from(new Set(ids));
}, [runs, incidentFilter]);
const {
statusChains: runStatusChains,
isLoading: runStatusChainsLoading,

View File

@@ -17,6 +17,24 @@
**邊界**:本段只修查詢預篩選;不寫 DB、不改 run 狀態、不執行修復、不發 Telegram、不開 runtime gate。
## 2026-06-25Runs incident filter 直接接入 status-chain 焦點
**背景**`e5a0aa13` 部署後,正式 `/api/v1/platform/runs/list?incident_id=INC-20260625-977E5F` 已從 `502` 修成 `200`,但 run list 摘要本身不一定帶 `remediation_summary.incident_ids`。Runs 頁原本只從 run summary 推導要查哪些 status-chain導致 URL 已經帶 `incident_id` 時仍可能看不到該事故的 `automation_handoff`
**完成**
- Runs 頁在 `incidentFilter` 符合 `INC-*` 格式時,直接把 URL 上的 incident id 納入 `useIncidentStatusChains` 查詢。
- 保留原本從 run summary 收斂多事故關聯的邏輯URL 焦點只是補上單一事故 drilldown 的主資料源。
**驗證待辦**
- `pnpm --filter @awoooi/web typecheck`
- 下一個 deploy marker 後重跑 `/zh-TW/awooop/runs?project_id=awoooi&incident_id=INC-20260625-977E5F` desktop / mobile smoke。
**完成度同步**
- Runs incident drilldown 穩定性:`72% -> 82%`
- AwoooP Runs apply-gate 正式頁驗證:等待前端修正 deploy 後重跑。
**邊界**:本段只補 UI 查詢來源;不寫 DB、不改 run 狀態、不執行修復、不發 Telegram、不開 runtime gate。
## 2026-06-25Status-chain 新增乾跑後套用閘門 handoff
**背景**`INC-20260625-977E5F` 類告警目前已能辨識 Ansible `check_mode` 乾跑成功、`apply_total=0``verifier=missing`,但 operator 在 Runs / Telegram 看見的下一步仍容易停在「需人工」或長文字。這會讓 AI 自動化看起來像只是把問題丟回人工,而不是清楚交付下一個可審核 gate。

View File

@@ -264,6 +264,21 @@ Tenants 目前已讀到:
完成度同步Runs incident drilldown 穩定性 `60% -> 72%`Runs apply-gate 正式頁驗證需下一個 deploy marker 後重跑。
### 2.5.10 Runs incident filter 接入 status-chain 焦點
2026-06-25 `e5a0aa13` 部署後,正式 API 已證明 incident drilldown 不再 502
| 項目 | 結果 |
|---|---|
| Health | `/api/v1/health``healthy / prod / mock_mode=false` |
| Status-chain | `INC-20260625-977E5F``ansible_check_mode_only``automation_handoff.kind=ansible_check_mode_apply_gate``runtime_execution_authorized=false` |
| Runs list | `/api/v1/platform/runs/list?incident_id=INC-20260625-977E5F``200``total=3` |
| 新缺口 | run list 摘要不一定帶 `remediation_summary.incident_ids`,前端只靠 run summary 推導 status-chain 時URL 已帶 incident id 仍可能看不到焦點 handoff |
修正Runs 頁若 URL `incident_id` 符合 `INC-*` 格式,直接把該 id 納入 `useIncidentStatusChains`,保留原本從 run summary 收斂多事故關聯的邏輯。
完成度同步Runs incident drilldown 穩定性 `72% -> 82%`AwoooP Runs apply-gate 正式頁驗證需前端修正 deploy 後重跑。
## 3. 頁面 UI/UX 現況盤點
2026-06-25 對正式站桌機 / mobile 抽查: