# 2akouwu/reverify architecture

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

- Interactive diagram: https://gitdiagram.com/2akouwu/reverify
- Repository: https://github.com/2akouwu/reverify

## Overview

Reverify pairs agent proposals with deterministic checks against an artifact; claims return verdicts and evidence, while an optional ledger preserves established facts. Users can invoke tools through the CLI or MCP. Its binary-analysis capabilities include parsing, disassembly, emulation, protocol inspection, and semantic analysis; it also checks behavioral equivalence and supports context rollover. The graph follows documented capabilities and source-index references; unsampled implementations are represented only at their supported paths, and optional engine integrations are shown separately.

Main entry points: [`reverify/cli.py`](https://github.com/2akouwu/reverify/blob/main/reverify/cli.py) (CLI), [`reverify/verifier.py`](https://github.com/2akouwu/reverify/blob/main/reverify/verifier.py) (Claim verifier), [`reverify/agent.py`](https://github.com/2akouwu/reverify/blob/main/reverify/agent.py) (Reconstruction agent), [`reverify/binary.py`](https://github.com/2akouwu/reverify/blob/main/reverify/binary.py) (Binary parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI<br/>[cli.py]"]
  node_mcp["MCP server<br/>[mcp_server.py]"]
end

subgraph group_analysis["Artifact analysis"]
  node_parser["Binary parser<br/>[binary.py]"]
  node_pe["PE parser<br/>[pe_parser.py]"]
  node_disasm["Disassembler<br/>[disasm.py]"]
  node_emulator["CPU emulator<br/>[emulator.py]"]
  node_protocol["Protocol dissector<br/>[protocol_parser.py]"]
  node_semantic["Semantic analysis<br/>[semantic.py]"]
  node_frida["Frida bridge<br/>[frida_bridge.py]"]
  node_backends["Engine detection<br/>[backends.py]"]
end

subgraph group_verification["Verification and evidence"]
  node_verifier["Claim verifier<br/>[verifier.py]"]
  node_behavior["Behavior checks<br/>[behavior.py]"]
  node_boundary["Boundary auditing"]
  node_equiv["Executable equivalence<br/>[exebench.py]"]
  node_sandbox["Execution sandbox<br/>[sandbox.py]"]
end

subgraph group_context["Agent context and equivalence"]
  node_agent["Reconstruction agent<br/>[agent.py]"]
  node_ledger[("Fact ledger<br/>[ledger.py]")]
  node_rollover["Rollover controller<br/>[rollover.py]"]
  node_harness["Rollover harness"]
end

node_user(("Engineer"))
node_artifact["Target artifact"]
node_model(("Language model"))

node_user -->|"invokes"| node_cli
node_user -->|"connects agent"| node_mcp
node_cli -->|"checks claims"| node_verifier
node_mcp -->|"offers verification"| node_verifier
node_cli -->|"parses artifacts"| node_parser
node_cli -->|"disassembles"| node_disasm
node_cli -->|"emulates code"| node_emulator
node_cli -->|"dissects payloads"| node_protocol
node_cli -->|"queries semantics"| node_semantic
node_cli -->|"generates hooks"| node_frida
node_cli -->|"audits boundaries"| node_boundary
node_cli -->|"checks equivalence"| node_equiv
node_cli -->|"reconstructs claims"| node_agent
node_cli -->|"starts rollover"| node_rollover
node_cli -->|"runs handoff"| node_harness
node_artifact -->|"is checked"| node_verifier
node_model -->|"proposes claims"| node_agent
node_agent -->|"checks proposals"| node_verifier
node_agent -->|"returns evidence"| node_model
node_agent -->|"records facts"| node_ledger
node_verifier -->|"reads binary facts"| node_parser
node_verifier -->|"checks instructions"| node_disasm
node_verifier -->|"checks execution"| node_emulator
node_verifier -->|"checks fields"| node_protocol
node_verifier -->|"checks relationships"| node_semantic
node_verifier -->|"checks behavior"| node_behavior
node_verifier -->|"checks candidate"| node_equiv
node_parser -.->|"falls back to"| node_pe
node_parser -->|"detects engines"| node_backends
node_disasm -.->|"selects engine"| node_backends
node_emulator -.->|"selects engine"| node_backends
node_semantic -->|"uses binary info"| node_parser
node_semantic -->|"checks availability"| node_backends
node_behavior -->|"checks engine"| node_backends
node_equiv -->|"runs candidate"| node_sandbox
node_equiv -->|"complements checks"| node_behavior
node_rollover -->|"loads established facts"| node_ledger
node_rollover -->|"continues reconstruction"| node_agent
node_rollover -->|"verifies handoff"| node_verifier

click node_cli "https://github.com/2akouwu/reverify/blob/main/reverify/cli.py"
click node_mcp "https://github.com/2akouwu/reverify/blob/main/reverify/mcp_server.py"
click node_parser "https://github.com/2akouwu/reverify/blob/main/reverify/binary.py"
click node_pe "https://github.com/2akouwu/reverify/blob/main/reverify/pe_parser.py"
click node_disasm "https://github.com/2akouwu/reverify/blob/main/reverify/disasm.py"
click node_emulator "https://github.com/2akouwu/reverify/blob/main/reverify/emulator.py"
click node_protocol "https://github.com/2akouwu/reverify/blob/main/reverify/protocol_parser.py"
click node_semantic "https://github.com/2akouwu/reverify/blob/main/reverify/semantic.py"
click node_frida "https://github.com/2akouwu/reverify/blob/main/reverify/frida_bridge.py"
click node_backends "https://github.com/2akouwu/reverify/blob/main/reverify/backends.py"
click node_verifier "https://github.com/2akouwu/reverify/blob/main/reverify/verifier.py"
click node_behavior "https://github.com/2akouwu/reverify/blob/main/reverify/behavior.py"
click node_boundary "https://github.com/2akouwu/reverify/blob/main/reverify/boundary_auditor.py"
click node_agent "https://github.com/2akouwu/reverify/blob/main/reverify/agent.py"
click node_ledger "https://github.com/2akouwu/reverify/blob/main/reverify/ledger.py"
click node_rollover "https://github.com/2akouwu/reverify/blob/main/reverify/rollover.py"
click node_harness "https://github.com/2akouwu/reverify/blob/main/reverify/rollover_harness.py"
click node_equiv "https://github.com/2akouwu/reverify/blob/main/reverify/exebench.py"
click node_sandbox "https://github.com/2akouwu/reverify/blob/main/reverify/sandbox.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_cli,node_mcp toneBlue
class node_parser,node_pe,node_disasm,node_emulator,node_protocol,node_semantic,node_frida,node_backends toneAmber
class node_verifier,node_behavior,node_boundary,node_equiv,node_sandbox toneMint
class node_agent,node_ledger,node_rollover,node_harness toneRose
class node_user,node_artifact,node_model toneIndigo
```

## Components

### User interfaces

- [CLI](https://github.com/2akouwu/reverify/blob/main/reverify/cli.py): `reverify/cli.py`
- [MCP server](https://github.com/2akouwu/reverify/blob/main/reverify/mcp_server.py): `reverify/mcp_server.py`

### Artifact analysis

- [Binary parser](https://github.com/2akouwu/reverify/blob/main/reverify/binary.py): `reverify/binary.py`
- [PE parser](https://github.com/2akouwu/reverify/blob/main/reverify/pe_parser.py): `reverify/pe_parser.py`
- [Disassembler](https://github.com/2akouwu/reverify/blob/main/reverify/disasm.py): `reverify/disasm.py`
- [CPU emulator](https://github.com/2akouwu/reverify/blob/main/reverify/emulator.py): `reverify/emulator.py`
- [Protocol dissector](https://github.com/2akouwu/reverify/blob/main/reverify/protocol_parser.py): `reverify/protocol_parser.py`
- [Semantic analysis](https://github.com/2akouwu/reverify/blob/main/reverify/semantic.py): `reverify/semantic.py`
- [Frida bridge](https://github.com/2akouwu/reverify/blob/main/reverify/frida_bridge.py): `reverify/frida_bridge.py`
- [Engine detection](https://github.com/2akouwu/reverify/blob/main/reverify/backends.py): `reverify/backends.py`

### Verification and evidence

- [Claim verifier](https://github.com/2akouwu/reverify/blob/main/reverify/verifier.py): `reverify/verifier.py`
- [Behavior checks](https://github.com/2akouwu/reverify/blob/main/reverify/behavior.py): `reverify/behavior.py`
- [Boundary auditing](https://github.com/2akouwu/reverify/blob/main/reverify/boundary_auditor.py): `reverify/boundary_auditor.py`
- [Executable equivalence](https://github.com/2akouwu/reverify/blob/main/reverify/exebench.py): `reverify/exebench.py`
- [Execution sandbox](https://github.com/2akouwu/reverify/blob/main/reverify/sandbox.py): `reverify/sandbox.py`

### Agent context and equivalence

- [Reconstruction agent](https://github.com/2akouwu/reverify/blob/main/reverify/agent.py): `reverify/agent.py`
- [Fact ledger](https://github.com/2akouwu/reverify/blob/main/reverify/ledger.py): `reverify/ledger.py`
- [Rollover controller](https://github.com/2akouwu/reverify/blob/main/reverify/rollover.py): `reverify/rollover.py`
- [Rollover harness](https://github.com/2akouwu/reverify/blob/main/reverify/rollover_harness.py): `reverify/rollover_harness.py`

### Other components

- **Engineer**
- **Target artifact**
- **Language model**

## Connections

- Engineer → CLI: invokes (evidence: `README.md`)
- Engineer → MCP server: connects agent (evidence: `README.md`)
- CLI → Claim verifier: checks claims (evidence: `reverify/cli.py`)
- MCP server → Claim verifier: offers verification (evidence: `reverify/mcp_server.py`)
- CLI → Binary parser: parses artifacts (evidence: `reverify/cli.py`)
- CLI → Disassembler: disassembles (evidence: `reverify/cli.py`)
- CLI → CPU emulator: emulates code (evidence: `reverify/cli.py`)
- CLI → Protocol dissector: dissects payloads (evidence: `reverify/cli.py`)
- CLI → Semantic analysis: queries semantics (evidence: `reverify/cli.py`)
- CLI → Frida bridge: generates hooks (evidence: `reverify/cli.py`)
- CLI → Boundary auditing: audits boundaries (evidence: `reverify/cli.py`)
- CLI → Executable equivalence: checks equivalence (evidence: `reverify/cli.py`)
- CLI → Reconstruction agent: reconstructs claims (evidence: `reverify/cli.py`)
- CLI → Rollover controller: starts rollover (evidence: `reverify/cli.py`)
- CLI → Rollover harness: runs handoff (evidence: `reverify/cli.py`)
- Target artifact → Claim verifier: is checked (evidence: `README.md`)
- Language model → Reconstruction agent: proposes claims (evidence: `README.md`)
- Reconstruction agent → Claim verifier: checks proposals (evidence: `reverify/agent.py`)
- Reconstruction agent → Language model: returns evidence (evidence: `reverify/agent.py`)
- Reconstruction agent → Fact ledger: records facts (evidence: `reverify/agent.py`)
- Claim verifier → Binary parser: reads binary facts (evidence: `reverify/verifier.py`)
- Claim verifier → Disassembler: checks instructions (evidence: `reverify/verifier.py`)
- Claim verifier → CPU emulator: checks execution (evidence: `reverify/verifier.py`)
- Claim verifier → Protocol dissector: checks fields (evidence: `reverify/verifier.py`)
- Claim verifier → Semantic analysis: checks relationships (evidence: `reverify/verifier.py`)
- Claim verifier → Behavior checks: checks behavior (evidence: `reverify/verifier.py`)
- Claim verifier → Executable equivalence: checks candidate (evidence: `reverify/verifier.py`)
- Binary parser → PE parser: falls back to (evidence: `reverify/binary.py`)
- Binary parser → Engine detection: detects engines (evidence: `reverify/binary.py`)
- Disassembler → Engine detection: selects engine (evidence: `reverify/backends.py`)
- CPU emulator → Engine detection: selects engine (evidence: `reverify/backends.py`)
- Semantic analysis → Binary parser: uses binary info (evidence: `reverify/semantic.py`)
- Semantic analysis → Engine detection: checks availability (evidence: `reverify/semantic.py`)
- Behavior checks → Engine detection: checks engine (evidence: `reverify/behavior.py`)
- Executable equivalence → Execution sandbox: runs candidate (evidence: `reverify/exebench.py`)
- Executable equivalence → Behavior checks: complements checks (evidence: `reverify/exebench.py`)
- Rollover controller → Fact ledger: loads established facts (evidence: `reverify/rollover.py`)
- Rollover controller → Reconstruction agent: continues reconstruction (evidence: `reverify/rollover.py`)
- Rollover controller → Claim verifier: verifies handoff (evidence: `reverify/rollover.py`)
