fix(automation): enforce durable alert closure
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m32s
CD Pipeline / build-and-deploy (push) Successful in 8m2s
CD Pipeline / post-deploy-checks (push) Successful in 2m22s

Restore D037 durable incident readback without weakening database failure semantics.

Fence Agent99 dispatch and terminal learning to canonical identities, durable leases, verifier receipts, and reconciler-owned checkpoints.

Drain backup and restore legacy receipts in bounded cohorts with strict transport, claim, projection, and no-false-green controls.

Keep SSH service refusal visible while separating it from broker network-policy reachability.
This commit is contained in:
ogt
2026-07-14 09:40:53 +08:00
parent 72a167a322
commit 6cf8429d17
56 changed files with 15100 additions and 227 deletions

View File

@@ -27,6 +27,7 @@ from src.models.incident import (
IncidentStatus,
Severity,
Signal,
parse_signal_source,
)
logger = structlog.get_logger(__name__)
@@ -83,12 +84,10 @@ def brain_to_local(brain_incident: Any) -> Incident:
except ValueError:
sig_severity = Severity.P2
# BrainSignal.source 是 strLocalSignal.source 是 Literal
# 使用 getattr 確保不因 BrainSignal 欄位增減而崩潰
source = getattr(brain_signal, "source", "alertmanager")
valid_sources = {"prometheus", "signoz", "alertmanager", "manual", "telegram"}
if source not in valid_sources:
source = "alertmanager"
# Preserve repo-owned producer provenance across the package
# boundary. Unknown values fail closed instead of being mislabeled
# as Alertmanager and later poisoning the durable read model.
source = parse_signal_source(getattr(brain_signal, "source", ""))
local_signals.append(
Signal(