feat(sre): require Agent99 RAG and MCP closure receipts

This commit is contained in:
Your Name
2026-07-19 00:24:44 +08:00
parent f1811bf8ab
commit 17e60dd36f
5 changed files with 294 additions and 11 deletions

View File

@@ -498,6 +498,8 @@ def build_agent99_dispatch_receipt_envelope(
"incident_closure_receipt_id",
"telegram_lifecycle_receipt_id",
"km_writeback_ack_id",
"rag_writeback_ack_id",
"mcp_evidence_writeback_ack_id",
"playbook_trust_writeback_ack_id",
],
},
@@ -1406,6 +1408,8 @@ class PostgresAgent99DispatchLedger:
"incident_closure_receipt_id",
"telegram_lifecycle_receipt_id",
"km_writeback_ack_id",
"rag_writeback_ack_id",
"mcp_evidence_writeback_ack_id",
"playbook_trust_writeback_ack_id",
],
},
@@ -2068,15 +2072,17 @@ class PostgresAgent99DispatchLedger:
) -> dict[str, Any]:
"""Atomically close the incident, operation log, and same-run ledger.
KM, PlayBook, DR, and Telegram each provide a durable idempotent
acknowledgement first. The incident terminal state, immutable closure
event, run state, and step-3 receipt then commit in one PostgreSQL
transaction. Redis is only a post-commit projection.
KM, RAG, MCP evidence, PlayBook, DR, and Telegram each provide a
durable idempotent acknowledgement first. The incident terminal state,
immutable closure event, run state, and step-3 receipt then commit in
one PostgreSQL transaction. Redis is only a post-commit projection.
"""
required_refs = {
"telegram_lifecycle_receipt_id",
"km_writeback_ack_id",
"rag_writeback_ack_id",
"mcp_evidence_writeback_ack_id",
"playbook_trust_writeback_ack_id",
}
if "backup_health" in identity.route_id:
@@ -2354,11 +2360,12 @@ class PostgresAgent99DispatchLedger:
) -> dict[str, Any]:
"""Checkpoint per-run learning side effects before terminal closure.
Reconciliation may crash after KM, PlayBook, Telegram, or DR succeeds.
Persisting each public acknowledgement on the same run lets the next
tick resume at the first missing asset instead of replaying completed
side effects. The asset writers retain their own deterministic keys as
the final crash fence between side effect and this checkpoint.
Reconciliation may crash after KM, RAG, MCP evidence, PlayBook,
Telegram, or DR succeeds. Persisting each public acknowledgement on
the same run lets the next tick resume at the first missing asset
instead of replaying completed side effects. The asset writers retain
their own deterministic keys as the final crash fence between side
effect and this checkpoint.
"""
supplied = sanitize_agent99_public_receipt_refs(

View File

@@ -29,6 +29,8 @@ AGENT99_LEARNING_RECEIPT_REFS = frozenset({
"incident_closure_receipt_id",
"telegram_lifecycle_receipt_id",
"km_writeback_ack_id",
"rag_writeback_ack_id",
"mcp_evidence_writeback_ack_id",
"playbook_trust_writeback_ack_id",
"dr_scorecard_writeback_ack_id",
})