docs(awooop): record t7 mcp gateway deployment

This commit is contained in:
Your Name
2026-05-13 10:25:47 +08:00
parent 8ac4ba24f7
commit 15873b9e0c
2 changed files with 78 additions and 1 deletions

View File

@@ -1,3 +1,67 @@
## 2026-05-13 | T7 first-class MCP Gateway read-only sense path 已推版
**背景**T2 已把 legacy MCP 呼叫 bridge/backfill 到 `awooop_mcp_gateway_audit`,但 production 真相是 `awooop_mcp_tool_registry` / grants / active agent contracts 對 `awoooi` 幾乎未啟用,`first_class=0`。這代表 Operator 雖看得到 MCP 相關紀錄,仍不能證明告警調查真的穿過 AwoooP MCP Gateway 五閘門。
**修正**
- `pre_decision_investigator.py`production `AuditedMCPToolProvider` 改由 `McpGateway` 執行 read-only sense toolraw provider 測試路徑維持直呼。
- `mcp/gateway.py`
- provider registry 從「provider 名稱」補強為可依 tool manifest 找 provider。
- `_mcp_audit` metadata 傳遞到 provider audit context。
- `awooop_mcp_gateway_audit.gate_result` 寫入 `schema_version=awooop_mcp_gateway_audit_v1``gateway_path=awooop_mcp_gateway``policy_enforced=true``required_scope``is_shadow`
- Migration
- seed `awoooi` 42 個 read-only MCP tools、84 筆 grants、2 個 agent active contracts。
-`awoooi` project 從 `legacy_awoooi_default` 升到 `shadow`,讓 Gateway Gate 1 按設計放行。
- 邊界:只授權 read scope未授權 restart / delete / scale / apply / rollback 等 write/admin 工具。
- CI migration workflow 修補:
- migration path detection 改用 `git diff --no-renames --diff-filter=A`
- owner retry 納入 `permission denied for table`
**驗證與推版**
- Local
- `pytest tests/test_mcp_gateway_audit.py tests/test_mcp_gateway_gate5.py tests/test_pre_decision_investigator.py tests/test_mcp_audit_service.py tests/test_mcp_tool_registry.py tests/test_post_execution_verifier.py -q`92 passed。
- migration shadow dry-runtransaction 內 `awoooi` 可從 legacy 更新到 shadowrollback 後仍為 legacy。
- `DATABASE_URL=... python3.11 -m pytest tests/test_mcp_gateway_audit.py -q`2 passed。
- `git diff --check`pass。
- Gitea
- `57ed07d1 feat(awooop): route sense mcp through gateway` 已推 `gitea main`
- `0b707495 fix(migrations): retrigger mcp gateway seed` 已推 `gitea main`
- `42789dbe fix(awooop): enable awoooi mcp gateway shadow` 已推 `gitea main`
- Code Review run `1974`success。
- run-migration run `1975`success。
- CD run `1973`success。
- Deploy marker`8ac4ba24 chore(cd): deploy 42789db [skip ci]`
- Production
- API/Web/Worker image 均為 `42789dbe9ebf5d1f3405048173ee1406997bec0b`
- K3s rollout statusAPI/Web/Worker success。
- Healthhost-local NodePort `127.0.0.1:32334` healthy / mock_mode=falsePostgreSQL / Redis / OpenClaw / SignOz 皆 up。
- Seed counts
- `tools=42`
- `grants=84`
- `agents=2`
- Project state`awoooi.migration_mode=shadow`
- Gateway smoke
- `trace_id=codex-t7-smoke-a69e998b`
- `tool_name=prometheus_query`
- `gateway_result_success=True`
- audit row`result_status=success``block_gate=NULL``gateway_path=awooop_mcp_gateway``policy_enforced=true``required_scope=read``is_shadow=true`
- first-class Gateway count從 0 提升到 16。
- Recent first-class tools
- `prometheus_query` success。
- `query_logs` / `error_logs_summary` success。
- 部分 SSH read tools failed但有經 Gateway audit 留痕,不再是黑盒。
**整體進度**
- Wave 0MOMO PostgreSQL backup → AwoooP 失敗通知接線完成並已推版。
- T0Truth-chain read-only API 完成、部署、production smoke 完成。
- T1Channel Event hardening 完成、部署、production smoke 完成。
- T2legacy MCP audit bridge / backfill / truth-chain visibility 完成、部署、production smoke 完成。
- T3Ansible audit contract + decision candidate dry-run audit 完成、部署、production smoke 完成。
- T4Config Drift stable fingerprint / repeat-state / Telegram stage visibility 完成、部署、production smoke 完成。
- T5Incident / Approval / Execution reconciliation 完成、部署、production smoke 完成。
- T6Incident timeline / Telegram detail reconciliation visibility 完成、部署、production smoke 完成。
- T7first-class MCP Gateway read-only sense path 完成、部署、production smoke 完成。
- 仍未完成write/admin MCP Gateway enforcement、PostExecutionVerifier production path 全面改走 Gateway、approval execution SSH 路徑改走 Gateway、Ansible 真正 check-mode executor / diff / apply / rollback、Operator Console 前端完整呈現、root cause 修復 execution / incident closure 矛盾。
## 2026-05-13 | T6 Incident timeline / Telegram detail reconciliation visibility 已推版
**背景**T5 已把 incident / approval / execution / evidence 的矛盾整理成 `incident_reconciliation_v1`,但 operator 仍需要在既有 incident timeline 與 Telegram「詳情」入口看到同一個真相鏈狀態不能只靠另外查 truth-chain API。

View File

@@ -369,7 +369,7 @@ source_event_received
**T0 first implementation2026-05-12 22:50 台北)**:新增 read-only `GET /api/v1/platform/truth-chain/{source_id}`,由 Operator Console auth 保護,聚合 incident / drift / approval / evidence / legacy MCP / AwoooP MCP Gateway / automation_operation_log / KM / timeline / outbound mirror。此 endpoint 只揭露現況與缺口,不改任何 incident、approval、execution 或 Telegram state。
**當前紅線**T0-T6 已補上第一批查詢/詳情可觀測性, T2 仍不是 first-class MCP Gateway enforcementT3 仍不是 Ansible check-mode / apply executorT6 也只把 reconciliation 推進詳情層。任何「中低風險告警已有完整 AI 自動修復」仍必須逐案查證,不能全域宣稱。
**當前紅線**T0-T7 已補上第一批查詢/詳情可觀測性, T7 已讓 pre-decision read-only sense path 進入 first-class AwoooP MCP Gateway;但這仍不是「所有 MCP / 自建 MCP / write-admin tool 全面 enforcement」。T3 仍不是 Ansible check-mode / apply executorT6 也只把 reconciliation 推進詳情層。任何「中低風險告警已有完整 AI 自動修復」仍必須逐案查證,不能全域宣稱。
**T1 first implementation2026-05-12 23:20 台北)**:開始補 `awooop_outbound_message` 的真相鏈欄位:`content_redacted``redaction_version``source_envelope`。設計邊界是只保存 redacted rendered card 與 source metadata 摘要raw Telegram payload、完整 callback data、未遮蔽 token 不入庫。production DB migration 已預套用API app role 在 `app.project_id=awoooi` 下可讀 outbound rows`total=312`),代表 T1 的 RLS visibility 紅燈已先驗證可見;新欄位需等 T1 API image 上線後才會產生非空資料。
@@ -1989,6 +1989,19 @@ Phase 6 完成後
- Production API/Web/Worker image 均為 `af9798a62e85e3876b471d7c9c4339dd78fb6aa4`K3s rollout successhost-local health healthy / `mock_mode=false`
- 邊界T6 是 read-only 顯示層收斂不修改主告警卡、Telegram button callback、approval execution也尚未修復 execution / incident closure root cause。
**T7 first-class MCP Gateway read-only sense path production verified2026-05-13 台北)**
- `57ed07d1 feat(awooop): route sense mcp through gateway``0b707495 fix(migrations): retrigger mcp gateway seed``42789dbe fix(awooop): enable awoooi mcp gateway shadow` 已推 Gitea main。
- Deploy marker`8ac4ba24 chore(cd): deploy 42789db [skip ci]`Code Review run `1974` successrun-migration run `1975` successCD run `1973` success。
- Production API/Web/Worker image 均為 `42789dbe9ebf5d1f3405048173ee1406997bec0b`K3s rollout successhost-local health healthy / `mock_mode=false`
- `awoooi` project 已由 `legacy_awoooi_default` 升到 `shadow`,讓 MCP Gateway Gate 1 按設計放行read-only seed 為 42 tools / 84 grants / 2 agent contracts。
- Production Gateway smoke
- `trace_id=codex-t7-smoke-a69e998b`
- `tool_name=prometheus_query`
- `gateway_result_success=True`
- audit row`result_status=success``block_gate=NULL``gateway_path=awooop_mcp_gateway``policy_enforced=true``required_scope=read``is_shadow=true`
- first-class Gateway count0 → 16
- 邊界T7 只完成 pre-decision read-only sense path。write/admin MCP、PostExecutionVerifier production path、approval execution SSH、Ansible check-mode/apply/rollback 仍未完成,不能宣稱所有 MCP 或自動修復流程都已全面治理。
---
### 2026-04-20 晚 (台北) — C1-C4 全流程串接 — Playbook 鏈路保護commit de2d34d