From b33ef23f59f67130360cda7b87e385dc515b1b45 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 29 Jun 2026 15:44:51 +0800 Subject: [PATCH] fix(awooop): count timeline and playbook log sources --- .../ai_agent_autonomous_runtime_control.py | 19 +++---------------- docs/LOGBOOK.md | 1 + 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/apps/api/src/services/ai_agent_autonomous_runtime_control.py b/apps/api/src/services/ai_agent_autonomous_runtime_control.py index 548c5913e..241aae4b6 100644 --- a/apps/api/src/services/ai_agent_autonomous_runtime_control.py +++ b/apps/api/src/services/ai_agent_autonomous_runtime_control.py @@ -2437,21 +2437,9 @@ _RUNTIME_TIMELINE_COUNTS_SQL = """ WHERE created_at >= NOW() - (:lookback_hours * INTERVAL '1 hour') ) AS recent FROM timeline_events - WHERE event_type IN ( - 'mcp_call', - 'verifier', - 'ai_agent_deploy_control_plane_decision', - 'controlled_apply', - 'auto_repair', - 'km_writeback' - ) - OR actor IN ( - 'ansible_check_mode_worker', - 'ansible_controlled_apply_worker', - 'post_apply_verifier', - 'truth_chain_reconciliation' - ) - OR actor_role IN ('mcp', 'replay', 'verifier', 'executor') + WHERE event_type IS NOT NULL + OR actor IS NOT NULL + OR actor_role IS NOT NULL """ @@ -2469,7 +2457,6 @@ _RUNTIME_PLAYBOOK_TRUST_COUNTS_SQL = """ WHERE updated_at >= NOW() - (:lookback_hours * INTERVAL '1 hour') ) AS recent FROM playbooks - WHERE project_id = :project_id GROUP BY CASE WHEN review_required IS TRUE THEN 'review_required' diff --git a/docs/LOGBOOK.md b/docs/LOGBOOK.md index 3e5caaff6..7478e2c9b 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -4,6 +4,7 @@ - `agent-autonomous-runtime-control` readback 新增 `trace_ledger`,把 MCP、service/package log evidence、executor log projection、candidate、check-mode、controlled apply、auto-repair receipt、post-apply verifier、KM/RAG、PlayBook trust、timeline projection、Telegram receipt 收斂為 12 個 public-safe 節點。 - 新增 `log_integration_taxonomy`,把專案 / 產品 / 網站 / 服務 / 套件 / 工具 / incident / operation / playbook 等 label dimensions 與 10 類 source families 明確列入 API,供 AI Agent 分類、分群、RAG retrieve、PlayBook 選擇與學習回寫。 - 新增 `work_item_progress`,把 P0-A 到 P2-B 的 ordered work items 與每個 source family 接入狀態列成可計數 readback:completed / in_progress / pending / blocked / not_started。 +- P1-A readback 補強:`operator_timeline_projection` 改以全部 `timeline_events` projection 統計;`playbook_trust_signals` 改以全 PlayBook trust/status 統計,避免既有資料因過窄 filter 被誤判未接入。 - AwoooP 主頁、Approvals、Runs、Work Items 新增 `AutonomousRuntimeReceiptPanel`,顯示 Loop / Trace / MCP / Logs / Apply / Verifier / KM-RAG / PlayBook / Telegram 與 Log 來源、貼標維度、分類事件、學習來源、工作項目完成度。 - 補 `sidebar.iwooos` / `sidebar.iwooosSecurityCompliance` i18n,避免 IwoooS 導航入口在 runtime console 出現 missing message。