# hrithik373/auto--remediation-agent- architecture

> Architecture diagram of the GitHub repository hrithik373/auto--remediation-agent-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hrithik373/auto--remediation-agent-
- Repository: https://github.com/hrithik373/auto--remediation-agent-

## Overview

Sentinel is a safety-gated AIOps remediation agent. Its intended workflow gathers and compacts incident context, proposes an action, verifies it before execution, and records the run for evaluation. The README says only P0 schemas, offline support, and the deterministic envelope verifier are implemented; most other modules are typed stubs. The graph preserves the documented product branches, but omits unsupported environment adapters absent from the supplied tree. Dashed links indicate documented or intended relationships whose implementation is incomplete.

Main entry points: [`src/sentinel/schemas/run.py`](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/schemas/run.py) (Run records), [`src/sentinel/orchestrator/loop.py`](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/orchestrator/loop.py) (Orchestrator), [`src/sentinel/schemas/action.py`](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/schemas/action.py) (Action contract), [`src/sentinel/verifier/policy.py`](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/policy.py) (Combined policy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_incident["Incident context"]
  node_incident_context["Incident context<br/>[incident.py]"]
  node_context_builder["Context builder<br/>[builder.py]"]
  node_retrievers["Telemetry selectors<br/>[retrievers.py]"]
end

subgraph group_safety["Diagnosis and safety"]
  node_agent["Diagnosis agent<br/>[react.py]"]
  node_agent_tools["Agent tools<br/>[tools.py]"]
  node_action_proposal["Action proposal<br/>[propose.py]"]
  node_action["Action contract<br/>[action.py]"]
  node_verifier["Verifier interface<br/>[base.py]"]
  node_envelope["Envelope gate<br/>[envelope.py]"]
  node_policy["Combined policy<br/>[policy.py]"]
  node_llm_judge["LLM judge<br/>[llm_judge.py]"]
  node_learned["Learned verifier<br/>[learned.py]"]
  node_features["Verifier features<br/>[features.py]"]
  node_verdict["Verdict contract<br/>[verdict.py]"]
end

subgraph group_runtime["Execution and orchestration"]
  node_orchestrator["Orchestrator<br/>[loop.py]"]
  node_executor["Executor<br/>[executor.py]"]
  node_rollback["Rollback<br/>[rollback.py]"]
end

subgraph group_ops["Operations and data"]
  node_gateway["Gateway app<br/>[app.py]"]
  node_gateway_clients["Gateway clients<br/>[clients.py]"]
  node_observability["Observability metrics<br/>[metrics.py]"]
  node_run_record["Run records<br/>[run.py]"]
  node_store[("DuckDB store<br/>[duckdb_store.py]")]
end

subgraph group_evaluation["Labeling and evaluation"]
  node_labeler["Oracle labeler<br/>[oracle_labeler.py]"]
  node_label_schema["Label schema<br/>[schema.py]"]
  node_review["Review CLI<br/>[review_cli.py]"]
  node_eval_runner["Evaluation runner<br/>[runner.py]"]
  node_metrics["Evaluation metrics<br/>[metrics.py]"]
  node_pareto["Pareto analysis<br/>[pareto.py]"]
  node_ablations["Ablations<br/>[ablations.py]"]
end

node_operator(("Operator"))

node_operator -.->|"submits requests"| node_gateway
node_context_builder -.->|"builds context"| node_incident_context
node_context_builder -.->|"selects telemetry"| node_retrievers
node_agent -.->|"uses tools"| node_agent_tools
node_agent -.->|"emits proposal"| node_action_proposal
node_action_proposal -.->|"creates action"| node_action
node_orchestrator -.->|"requests proposal"| node_agent
node_orchestrator -.->|"requests verdict"| node_verifier
node_orchestrator -.->|"executes if allowed"| node_executor
node_envelope -->|"implements"| node_verifier
node_policy -.->|"combines gate"| node_envelope
node_policy -.->|"combines judge"| node_llm_judge
node_policy -.->|"combines score"| node_learned
node_learned -.->|"uses features"| node_features
node_verifier -->|"returns verdict"| node_verdict
node_envelope -->|"checks action"| node_action
node_executor -->|"accepts action"| node_action
node_executor -.->|"may delegate"| node_rollback
node_orchestrator -.->|"records run"| node_run_record
node_store -.->|"persists records"| node_run_record
node_eval_runner -.->|"evaluates runs"| node_run_record
node_metrics -->|"reads records"| node_run_record
node_pareto -->|"analyzes runs"| node_run_record
node_labeler -->|"creates labels"| node_label_schema
node_labeler -->|"labels actions"| node_action
node_review -.->|"reviews labels"| node_label_schema
node_gateway -.->|"uses clients"| node_gateway_clients

click node_incident_context "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/schemas/incident.py"
click node_context_builder "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/context/builder.py"
click node_retrievers "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/context/retrievers.py"
click node_agent "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/agent/react.py"
click node_agent_tools "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/agent/tools.py"
click node_action_proposal "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/agent/propose.py"
click node_action "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/schemas/action.py"
click node_verifier "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/base.py"
click node_envelope "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/envelope.py"
click node_policy "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/policy.py"
click node_llm_judge "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/llm_judge.py"
click node_learned "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/learned.py"
click node_features "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/features.py"
click node_verdict "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/schemas/verdict.py"
click node_orchestrator "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/orchestrator/loop.py"
click node_executor "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/executor/executor.py"
click node_rollback "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/executor/rollback.py"
click node_gateway "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/gateway/app.py"
click node_gateway_clients "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/gateway/clients.py"
click node_observability "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/observability/metrics.py"
click node_run_record "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/schemas/run.py"
click node_store "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/store/duckdb_store.py"
click node_labeler "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/labeling/oracle_labeler.py"
click node_label_schema "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/labeling/schema.py"
click node_review "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/labeling/review_cli.py"
click node_eval_runner "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/eval/runner.py"
click node_metrics "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/eval/metrics.py"
click node_pareto "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/eval/pareto.py"
click node_ablations "https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/eval/ablations.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_incident_context,node_context_builder,node_retrievers toneBlue
class node_agent,node_agent_tools,node_action_proposal,node_action,node_verifier,node_envelope,node_policy,node_llm_judge,node_learned,node_features,node_verdict toneAmber
class node_orchestrator,node_executor,node_rollback toneMint
class node_gateway,node_gateway_clients,node_observability,node_run_record,node_store toneRose
class node_labeler,node_label_schema,node_review,node_eval_runner,node_metrics,node_pareto,node_ablations,node_operator toneIndigo
```

## Components

### Incident context

- [Incident context](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/schemas/incident.py): `src/sentinel/schemas/incident.py`
- [Context builder](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/context/builder.py): `src/sentinel/context/builder.py`
- [Telemetry selectors](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/context/retrievers.py): `src/sentinel/context/retrievers.py`

### Diagnosis and safety

- [Diagnosis agent](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/agent/react.py): `src/sentinel/agent/react.py`
- [Agent tools](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/agent/tools.py): `src/sentinel/agent/tools.py`
- [Action proposal](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/agent/propose.py): `src/sentinel/agent/propose.py`
- [Action contract](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/schemas/action.py): `src/sentinel/schemas/action.py`
- [Verifier interface](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/base.py): `src/sentinel/verifier/base.py`
- [Envelope gate](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/envelope.py): `src/sentinel/verifier/envelope.py`
- [Combined policy](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/policy.py): `src/sentinel/verifier/policy.py`
- [LLM judge](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/llm_judge.py): `src/sentinel/verifier/llm_judge.py`
- [Learned verifier](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/learned.py): `src/sentinel/verifier/learned.py`
- [Verifier features](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/verifier/features.py): `src/sentinel/verifier/features.py`
- [Verdict contract](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/schemas/verdict.py): `src/sentinel/schemas/verdict.py`

### Execution and orchestration

- [Orchestrator](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/orchestrator/loop.py): `src/sentinel/orchestrator/loop.py`
- [Executor](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/executor/executor.py): `src/sentinel/executor/executor.py`
- [Rollback](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/executor/rollback.py): `src/sentinel/executor/rollback.py`

### Operations and data

- [Gateway app](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/gateway/app.py): `src/sentinel/gateway/app.py`
- [Gateway clients](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/gateway/clients.py): `src/sentinel/gateway/clients.py`
- [Observability metrics](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/observability/metrics.py): `src/sentinel/observability/metrics.py`
- [Run records](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/schemas/run.py): `src/sentinel/schemas/run.py`
- [DuckDB store](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/store/duckdb_store.py): `src/sentinel/store/duckdb_store.py`

### Labeling and evaluation

- [Oracle labeler](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/labeling/oracle_labeler.py): `src/sentinel/labeling/oracle_labeler.py`
- [Label schema](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/labeling/schema.py): `src/sentinel/labeling/schema.py`
- [Review CLI](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/labeling/review_cli.py): `src/sentinel/labeling/review_cli.py`
- [Evaluation runner](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/eval/runner.py): `src/sentinel/eval/runner.py`
- [Evaluation metrics](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/eval/metrics.py): `src/sentinel/eval/metrics.py`
- [Pareto analysis](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/eval/pareto.py): `src/sentinel/eval/pareto.py`
- [Ablations](https://github.com/hrithik373/auto--remediation-agent-/blob/main/src/sentinel/eval/ablations.py): `src/sentinel/eval/ablations.py`

### Other components

- **Operator**

## Connections

- Operator → Gateway app: submits requests
- Context builder → Incident context: builds context (evidence: `src/sentinel/context/builder.py`)
- Context builder → Telemetry selectors: selects telemetry (evidence: `src/sentinel/context/retrievers.py`)
- Diagnosis agent → Agent tools: uses tools (evidence: `src/sentinel/agent/react.py`)
- Diagnosis agent → Action proposal: emits proposal (evidence: `src/sentinel/agent/react.py`)
- Action proposal → Action contract: creates action (evidence: `src/sentinel/agent/propose.py`)
- Orchestrator → Diagnosis agent: requests proposal (evidence: `src/sentinel/orchestrator/loop.py`)
- Orchestrator → Verifier interface: requests verdict (evidence: `src/sentinel/orchestrator/loop.py`)
- Orchestrator → Executor: executes if allowed (evidence: `src/sentinel/orchestrator/loop.py`)
- Envelope gate → Verifier interface: implements (evidence: `src/sentinel/verifier/envelope.py`)
- Combined policy → Envelope gate: combines gate (evidence: `src/sentinel/verifier/envelope.py`)
- Combined policy → LLM judge: combines judge
- Combined policy → Learned verifier: combines score
- Learned verifier → Verifier features: uses features
- Verifier interface → Verdict contract: returns verdict (evidence: `src/sentinel/verifier/base.py`)
- Envelope gate → Action contract: checks action (evidence: `src/sentinel/verifier/envelope.py`)
- Executor → Action contract: accepts action (evidence: `src/sentinel/executor/executor.py`)
- Executor → Rollback: may delegate
- Orchestrator → Run records: records run (evidence: `src/sentinel/orchestrator/loop.py`)
- DuckDB store → Run records: persists records (evidence: `src/sentinel/schemas/run.py`)
- Evaluation runner → Run records: evaluates runs (evidence: `src/sentinel/eval/runner.py`)
- Evaluation metrics → Run records: reads records (evidence: `src/sentinel/eval/metrics.py`)
- Pareto analysis → Run records: analyzes runs (evidence: `src/sentinel/eval/pareto.py`)
- Oracle labeler → Label schema: creates labels (evidence: `src/sentinel/labeling/oracle_labeler.py`)
- Oracle labeler → Action contract: labels actions (evidence: `src/sentinel/labeling/oracle_labeler.py`)
- Review CLI → Label schema: reviews labels
- Gateway app → Gateway clients: uses clients
