# dharinish007/revathi architecture

> Architecture diagram of the GitHub repository dharinish007/revathi, 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/dharinish007/revathi
- Repository: https://github.com/dharinish007/revathi

## Overview

REVATHI is a local trust layer for AI coding agents. A tool hook translates incoming events into a shared event format; the pipeline applies safety checks and snapshots before actions, records outcomes, and gates completion on proof. Approved memory is recalled into new sessions, while CLI commands let users install integrations, review memory, inspect logs, and undo changes. The README documents additional skills and subagents. Some subsystem links are based on documented capabilities or SOURCE INDEX references; unsampled implementation details are not assumed.

Main entry points: [`engine/pipeline.py`](https://github.com/dharinish007/revathi/blob/main/engine/pipeline.py) (Hook pipeline), [`cli/revathi.py`](https://github.com/dharinish007/revathi/blob/main/cli/revathi.py) (REVATHI CLI), [`engine/memory.py`](https://github.com/dharinish007/revathi/blob/main/engine/memory.py) (Approved memory), [`cli/install.py`](https://github.com/dharinish007/revathi/blob/main/cli/install.py) (Tool installer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Tool integrations"]
  node_claude["Claude Code"]
  node_antigravity["Antigravity"]
  node_claude_hook["Claude hook<br/>[hook.py]"]
  node_antigravity_hook["Antigravity hook<br/>[hook.py]"]
  node_skills["Skills and agents"]
end

subgraph group_runtime["Event runtime"]
  node_event["Common events<br/>[event.py]"]
  node_pipeline["Hook pipeline<br/>[pipeline.py]"]
end

subgraph group_safety["Safety and evidence"]
  node_guard["Action guard<br/>[guard.py]"]
  node_proof["Completion proof<br/>[proof.py]"]
  node_policy["Policy rules<br/>[policy.py]"]
  node_undo["Snapshots and undo<br/>[undo.py]"]
  node_canary["Canary credentials<br/>[canary.py]"]
end

subgraph group_memory["Memory"]
  node_memory_store[("Approved memory<br/>[memory.py]")]
  node_learner["Memory learning<br/>[learn.py]"]
  node_memory_graph["Memory graph<br/>[graph.py]"]
  node_claude_import["Claude memory import<br/>[memory_import.py]"]
end

subgraph group_userops["User operations"]
  node_config["Mode config<br/>[config.py]"]
  node_log[("Tamper-evident log<br/>[log.py]")]
  node_cli["REVATHI CLI<br/>[revathi.py]"]
  node_install["Tool installer<br/>[install.py]"]
end

node_developer(("Developer"))

node_claude -->|"sends hook events"| node_claude_hook
node_antigravity -->|"sends hook events"| node_antigravity_hook
node_claude_hook -->|"translates events"| node_event
node_antigravity_hook -->|"translates events"| node_event
node_claude_hook -->|"dispatches events"| node_pipeline
node_antigravity_hook -->|"dispatches events"| node_pipeline
node_pipeline -->|"checks actions"| node_guard
node_pipeline -->|"checks completion"| node_proof
node_pipeline -->|"takes snapshots"| node_undo
node_pipeline -->|"checks canaries"| node_canary
node_pipeline -->|"records events"| node_log
node_pipeline -->|"loads rules"| node_policy
node_pipeline -->|"loads mode"| node_config
node_guard -->|"uses rules"| node_policy
node_proof -->|"returns decisions"| node_event
node_canary -->|"records findings"| node_log
node_cli -->|"runs install"| node_install
node_cli -->|"restores snapshots"| node_undo
node_cli -->|"shows records"| node_log
node_cli -->|"sets mode"| node_config
node_cli -->|"reviews notes"| node_memory_store
node_cli -->|"learns notes"| node_learner
node_cli -->|"shows graph"| node_memory_graph
node_cli -->|"imports notes"| node_claude_import
node_pipeline -->|"recalls notes"| node_memory_store
node_learner -->|"proposes notes"| node_memory_store
node_memory_graph -->|"reads notes"| node_memory_store
node_claude_import -->|"proposes notes"| node_memory_store
node_developer -->|"runs commands"| node_cli
node_install -->|"connects tool"| node_claude
node_install -->|"connects tool"| node_antigravity
node_install -->|"installs skills"| node_skills

click node_claude_hook "https://github.com/dharinish007/revathi/blob/main/adapters/claude-code/hook.py"
click node_antigravity_hook "https://github.com/dharinish007/revathi/blob/main/adapters/antigravity/hook.py"
click node_skills "https://github.com/dharinish007/revathi/tree/main/core"
click node_event "https://github.com/dharinish007/revathi/blob/main/engine/event.py"
click node_pipeline "https://github.com/dharinish007/revathi/blob/main/engine/pipeline.py"
click node_guard "https://github.com/dharinish007/revathi/blob/main/engine/guard.py"
click node_proof "https://github.com/dharinish007/revathi/blob/main/engine/proof.py"
click node_policy "https://github.com/dharinish007/revathi/blob/main/engine/policy.py"
click node_undo "https://github.com/dharinish007/revathi/blob/main/engine/undo.py"
click node_canary "https://github.com/dharinish007/revathi/blob/main/engine/canary.py"
click node_config "https://github.com/dharinish007/revathi/blob/main/engine/config.py"
click node_log "https://github.com/dharinish007/revathi/blob/main/engine/log.py"
click node_cli "https://github.com/dharinish007/revathi/blob/main/cli/revathi.py"
click node_install "https://github.com/dharinish007/revathi/blob/main/cli/install.py"
click node_memory_store "https://github.com/dharinish007/revathi/blob/main/engine/memory.py"
click node_learner "https://github.com/dharinish007/revathi/blob/main/engine/learn.py"
click node_memory_graph "https://github.com/dharinish007/revathi/blob/main/cli/graph.py"
click node_claude_import "https://github.com/dharinish007/revathi/blob/main/adapters/claude-code/memory_import.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_claude,node_antigravity,node_claude_hook,node_antigravity_hook,node_skills toneBlue
class node_event,node_pipeline toneAmber
class node_guard,node_proof,node_policy,node_undo,node_canary toneMint
class node_memory_store,node_learner,node_memory_graph,node_claude_import toneRose
class node_config,node_log,node_cli,node_install,node_developer toneIndigo
```

## Components

### Tool integrations

- **Claude Code**
- **Antigravity**
- [Claude hook](https://github.com/dharinish007/revathi/blob/main/adapters/claude-code/hook.py): `adapters/claude-code/hook.py`
- [Antigravity hook](https://github.com/dharinish007/revathi/blob/main/adapters/antigravity/hook.py): `adapters/antigravity/hook.py`
- [Skills and agents](https://github.com/dharinish007/revathi/tree/main/core): `core`

### Event runtime

- [Common events](https://github.com/dharinish007/revathi/blob/main/engine/event.py): `engine/event.py`
- [Hook pipeline](https://github.com/dharinish007/revathi/blob/main/engine/pipeline.py): `engine/pipeline.py`

### Safety and evidence

- [Action guard](https://github.com/dharinish007/revathi/blob/main/engine/guard.py): `engine/guard.py`
- [Completion proof](https://github.com/dharinish007/revathi/blob/main/engine/proof.py): `engine/proof.py`
- [Policy rules](https://github.com/dharinish007/revathi/blob/main/engine/policy.py): `engine/policy.py`
- [Snapshots and undo](https://github.com/dharinish007/revathi/blob/main/engine/undo.py): `engine/undo.py`
- [Canary credentials](https://github.com/dharinish007/revathi/blob/main/engine/canary.py): `engine/canary.py`

### Memory

- [Approved memory](https://github.com/dharinish007/revathi/blob/main/engine/memory.py): `engine/memory.py`
- [Memory learning](https://github.com/dharinish007/revathi/blob/main/engine/learn.py): `engine/learn.py`
- [Memory graph](https://github.com/dharinish007/revathi/blob/main/cli/graph.py): `cli/graph.py`
- [Claude memory import](https://github.com/dharinish007/revathi/blob/main/adapters/claude-code/memory_import.py): `adapters/claude-code/memory_import.py`

### User operations

- [Mode config](https://github.com/dharinish007/revathi/blob/main/engine/config.py): `engine/config.py`
- [Tamper-evident log](https://github.com/dharinish007/revathi/blob/main/engine/log.py): `engine/log.py`
- [REVATHI CLI](https://github.com/dharinish007/revathi/blob/main/cli/revathi.py): `cli/revathi.py`
- [Tool installer](https://github.com/dharinish007/revathi/blob/main/cli/install.py): `cli/install.py`

### Other components

- **Developer**

## Connections

- Claude Code → Claude hook: sends hook events (evidence: `adapters/claude-code/hook.py`)
- Antigravity → Antigravity hook: sends hook events (evidence: `adapters/antigravity/hook.py`)
- Claude hook → Common events: translates events (evidence: `adapters/claude-code/hook.py`)
- Antigravity hook → Common events: translates events (evidence: `adapters/antigravity/hook.py`)
- Claude hook → Hook pipeline: dispatches events (evidence: `adapters/claude-code/hook.py`)
- Antigravity hook → Hook pipeline: dispatches events (evidence: `adapters/antigravity/hook.py`)
- Hook pipeline → Action guard: checks actions (evidence: `engine/pipeline.py`)
- Hook pipeline → Completion proof: checks completion (evidence: `engine/pipeline.py`)
- Hook pipeline → Snapshots and undo: takes snapshots (evidence: `engine/pipeline.py`)
- Hook pipeline → Canary credentials: checks canaries (evidence: `engine/pipeline.py`)
- Hook pipeline → Tamper-evident log: records events (evidence: `engine/pipeline.py`)
- Hook pipeline → Policy rules: loads rules (evidence: `engine/pipeline.py`)
- Hook pipeline → Mode config: loads mode (evidence: `engine/pipeline.py`)
- Action guard → Policy rules: uses rules (evidence: `engine/guard.py`)
- Completion proof → Common events: returns decisions (evidence: `engine/proof.py`)
- Canary credentials → Tamper-evident log: records findings (evidence: `engine/canary.py`)
- REVATHI CLI → Tool installer: runs install (evidence: `cli/revathi.py`)
- REVATHI CLI → Snapshots and undo: restores snapshots (evidence: `cli/revathi.py`)
- REVATHI CLI → Tamper-evident log: shows records (evidence: `cli/revathi.py`)
- REVATHI CLI → Mode config: sets mode (evidence: `cli/revathi.py`)
- REVATHI CLI → Approved memory: reviews notes (evidence: `cli/revathi.py`)
- REVATHI CLI → Memory learning: learns notes (evidence: `cli/revathi.py`)
- REVATHI CLI → Memory graph: shows graph (evidence: `cli/revathi.py`)
- REVATHI CLI → Claude memory import: imports notes (evidence: `cli/revathi.py`)
- Hook pipeline → Approved memory: recalls notes (evidence: `engine/pipeline.py`)
- Memory learning → Approved memory: proposes notes (evidence: `engine/learn.py`)
- Memory graph → Approved memory: reads notes (evidence: `cli/graph.py`)
- Claude memory import → Approved memory: proposes notes
- Developer → REVATHI CLI: runs commands (evidence: `README.md`)
- Tool installer → Claude Code: connects tool (evidence: `README.md`)
- Tool installer → Antigravity: connects tool (evidence: `README.md`)
- Tool installer → Skills and agents: installs skills (evidence: `cli/install.py`)
