Merge remote-tracking branch 'gitea/main' into codex/security-supply-chain-contracts-20260512

This commit is contained in:
Your Name
2026-05-13 12:15:31 +08:00
7 changed files with 109 additions and 4 deletions

View File

@@ -7552,3 +7552,62 @@ scope=write
- T11 已部署Operator Run Detail 與 Telegram detail formatter 都已能呈現 MCP Gateway 摘要。
- 這次沒有發送真實 Telegram 測試訊息,避免洗版;改以 production pod 直接呼叫 detail formatter 驗證。
- 目前整體進度更新:約 68%。
### 2026-05-13 — AwoooP truth-chain T12aTelegram 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 refstruth-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
```
**production smoke 途中補修**
- rollback transaction smoke 抓到 asyncpg bind parameter 型別推論問題:`CASE WHEN :send_status = 'sent'` 會被推成 text/varchar ambiguous。
- 已改成 `CASE WHEN CAST(:send_status AS text) = 'sent' THEN NOW() ELSE NULL END`,避免 outbound mirror 在 production 寫入時失敗。
**目前整體進度**:約 69%。