Skip to main content

System Architecture

ZeroMTTR is designed following Clean Architecture principles with complete decoupling from the monitored service: any application that emits OpenTelemetry (OTLP) telemetry and lives in a Git repository can be operated by the platform without changing the orchestrator or MCP server core.

Architectural Style​

AspectDecision
Macro styleEvent-driven + Agentic — Grafana webhooks trigger the autonomous workflow, with a deterministic fallback guaranteeing completion if the LLM provider fails.
Internal styleHexagonal Architecture (Ports & Adapters) in apps/orchestrator and apps/mcp-server, isolating business rules from HTTP transport and external SDKs.
Lifecycle controlIncident State Machine governing every transition in a pure, predictable, and auditable way.
Integration protocolMCP over HTTP (Streamable HTTP), consumable by both the internal orchestrator and external MCP clients (.mcp.json).
Decision securityEmail-only HMAC — approval/rejection signatures travel exclusively inside the #fragment of decision email links, never over SSE streams or read endpoints.
DeploymentLocal development via docker-compose.yml and production on a Linux VPS via docker-compose.prod.yml with Traefik + Let's Encrypt, reading secrets outside the repo.

Component Patterns​

ComponentPatternOrganization
apps/orchestrator & apps/mcp-serverHexagonal (Ports & Adapters)domain → application → ports → adapters, wired at the composition root in main.ts.
apps/target-app-demoLayered MVCroutes → controllers → services → repositories (decoupled reference target service).
apps/dashboardSingle-Pane War Room with Signals (Angular)Standalone components (WarRoomComponent + DecisionComponent) styled with PrimeNG Aura Dark.
apps/docsMultilingual Static Manual (Docusaurus + Nginx)pt-BR, en-US, and es-ES documentation served from a dedicated low-memory Nginx container.

Context View (C4 Level 1)​

The diagram below shows ZeroMTTR's system boundary and how it interacts with the monitored service, external MCP clients, LLM provider, GitHub, email provider, and the on-call engineer:

Incident State Machine​

Every incident processed by the orchestrator advances through an explicit sequence of states, streamed live to the Remediation Flow bar at the top of the War Room:

State Summary​

StateWhat is happening
RECEIVEDAlert received via Grafana webhook and accepted after token verification and deduplication/cooldown checks.
INVESTIGATINGCorrelated collection of metrics (Prometheus), error traces (Tempo), and masked logs (Loki) via MCP Server.
ENRICHINGCode diff inspection between the previous healthy release and the current version in the target Git repo.
REMEDIATINGFail-closed privacy audit (PiiPromptGuard), RCA/patch synthesis, creation of the hotfix/zeromttr-* branch, and opening of the Pull Request on GitHub.
AWAITING_PRRemediation Pull Request opened and recorded on GitHub, awaiting dispatch of the on-call notification step.
NOTIFIEDPull Request opened and notification step completed (Post-Mortem email sent, or recorded with DEGRADED status if email delivery failed), awaiting signed human decision.
RESOLVEDFix approved by the on-call engineer and incident closed successfully.
REJECTEDFix rejected by the on-call engineer (activates the Human Takeover post-rejection cooldown window).
FAILEDCritical failure during investigation or external integration, recorded for inspection in the War Room.
Engineering Deep Dive

For container diagrams (C4 Level 2), end-to-end sequence diagrams, hexagonal class diagrams, VPS network topology, and full ADRs, see the Engineering Documentation on GitHub.