fix(awooop): strengthen outbound truth references
This commit is contained in:
@@ -7251,3 +7251,57 @@ scope=write
|
||||
- T11 已部署:Operator Run Detail 與 Telegram detail formatter 都已能呈現 MCP Gateway 摘要。
|
||||
- 這次沒有發送真實 Telegram 測試訊息,避免洗版;改以 production pod 直接呼叫 detail formatter 驗證。
|
||||
- 目前整體進度更新:約 68%。
|
||||
|
||||
### 2026-05-13 — AwoooP truth-chain T12a:Telegram outbound 可回放關聯強化(local green)
|
||||
|
||||
**production live audit 摘要**:
|
||||
|
||||
```text
|
||||
24h:
|
||||
incidents=150
|
||||
approval_records=102
|
||||
alert_operation_log=682
|
||||
timeline_events=154
|
||||
incident_evidence=130
|
||||
auto_repair_executions=10
|
||||
knowledge_entries=42
|
||||
legacy_mcp_audit_log=1265
|
||||
awooop_mcp_gateway_audit=1365
|
||||
awooop_outbound_message=420
|
||||
|
||||
outbound_quality:
|
||||
total=420 redacted=226 envelope=420 envelope_schema=226 with_run=420 sent_at=0
|
||||
|
||||
incident_join_quality:
|
||||
total=150 with_aol=100 with_evidence=102 with_legacy_mcp=102 with_timeline=102 with_approval=102 with_auto_repair=10
|
||||
|
||||
Sentry / SignOz durable event tables:
|
||||
none found by information_schema table_name ILIKE '%sentry%' OR '%signoz%'
|
||||
```
|
||||
|
||||
**判讀**:
|
||||
|
||||
- MCP / SignOz 能力已有實際使用,且 legacy MCP bridge 已寫入 AwoooP Gateway audit。
|
||||
- 仍不能宣稱完整 AI 自動修復:24h incident 150 筆中只有 10 筆有 `auto_repair_executions`。
|
||||
- Telegram outbound mirror 有資料,但 `sent_at=0` 是真缺口;source envelope 也缺少 structured source refs,truth-chain 只能靠 `content_preview ILIKE` 猜關聯。
|
||||
|
||||
**變更**:
|
||||
|
||||
- `record_outbound_message()` 在 `send_status='sent'` 時寫入 `sent_at=NOW()`。
|
||||
- Telegram outbound `source_envelope` 新增 `source_refs.incident_ids` 與 `source_refs.code_refs`,保留 redaction-friendly 關聯錨點。
|
||||
- truth-chain outbound 查詢支援 structured `source_refs`,不只靠 preview 文字搜尋。
|
||||
|
||||
**local verification**:
|
||||
|
||||
```text
|
||||
DATABASE_URL=postgresql+asyncpg://u:p@localhost:5432/db python -m pytest tests/test_telegram_gateway_error_sanitizer.py tests/test_channel_hub_grouped_alert_events.py tests/test_awooop_truth_chain_service.py tests/test_telegram_adr050.py -q
|
||||
51 passed
|
||||
|
||||
python -m ruff check --select F821 src/services/channel_hub.py src/services/telegram_gateway.py src/services/awooop_truth_chain_service.py tests/test_telegram_gateway_error_sanitizer.py tests/test_channel_hub_grouped_alert_events.py tests/test_telegram_adr050.py
|
||||
All checks passed
|
||||
|
||||
python -m py_compile src/services/channel_hub.py src/services/telegram_gateway.py src/services/awooop_truth_chain_service.py tests/test_telegram_gateway_error_sanitizer.py tests/test_channel_hub_grouped_alert_events.py tests/test_telegram_adr050.py
|
||||
OK
|
||||
```
|
||||
|
||||
**目前整體進度**:約 69%。
|
||||
|
||||
Reference in New Issue
Block a user