fix(awooop): surface alert inbound by provider event
All checks were successful
Code Review / ai-code-review (push) Successful in 10s
CD Pipeline / tests (push) Successful in 1m5s
CD Pipeline / build-and-deploy (push) Successful in 3m29s
CD Pipeline / post-deploy-checks (push) Successful in 1m19s

This commit is contained in:
Your Name
2026-05-13 20:36:53 +08:00
parent 453e22f80d
commit 8d7b938f78
2 changed files with 9 additions and 0 deletions

View File

@@ -1200,6 +1200,7 @@ async def fetch_truth_chain(source_id: str, project_id: str = "awoooi") -> dict[
WHERE project_id = :project_id
AND (
run_id::text = :source_id
OR provider_event_id = :source_id
OR content_preview ILIKE :source_needle
OR (
:fingerprint_needle != ''

View File

@@ -1,5 +1,6 @@
from __future__ import annotations
import inspect
from datetime import datetime, timedelta, timezone
from types import SimpleNamespace
@@ -15,6 +16,7 @@ from src.services.awooop_truth_chain_service import (
_incident_fingerprints,
_summarize_gateway_mcp,
_truth_status,
fetch_truth_chain,
summarize_automation_quality_records,
)
from src.services.drift_repeat_state import (
@@ -51,6 +53,12 @@ def test_incident_fingerprints_reads_signal_labels() -> None:
assert fingerprints == ["fp-direct", "fp-label"]
def test_fetch_truth_chain_can_match_inbound_provider_event_id() -> None:
source = inspect.getsource(fetch_truth_chain)
assert "provider_event_id = :source_id" in source
def test_truth_status_marks_no_action_approval_as_manual_required() -> None:
status = _truth_status(
incident={"incident_id": "INC-1", "status": "INVESTIGATING"},