# sicklefire/m-vis architecture

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

- Interactive diagram: https://gitdiagram.com/sicklefire/m-vis
- Repository: https://github.com/sicklefire/m-vis

## Overview

m-vis is a cross-platform process-memory diagnostic CLI and terminal UI. Users select a process, inspect its mappings, heaps, loaded modules, or memory bytes, and can compare heap snapshots or explore pointer relationships; CI mode can run checks and export reports. The central runtime path runs through command handling and the scan engine to the selected OS memory provider. The README documents the product capabilities; some subsystem links below rely on that documentation or the source index because their implementation excerpts were not provided.

Main entry points: [`src/core/scan.rs`](https://github.com/sicklefire/m-vis/blob/master/src/core/scan.rs) (Memory scanner), [`src/ui/tui.rs`](https://github.com/sicklefire/m-vis/blob/master/src/ui/tui.rs) (Terminal UI), [`src/os/mod.rs`](https://github.com/sicklefire/m-vis/blob/master/src/os/mod.rs) (Memory provider), [`src/ui/commands.rs`](https://github.com/sicklefire/m-vis/blob/master/src/ui/commands.rs) (UI commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Interfaces &amp; automation"]
  node_cli["CLI<br/>[main.rs]"]
  node_tui["Terminal UI<br/>[tui.rs]"]
  node_commands["UI commands<br/>[commands.rs]"]
  node_ci["CI checks<br/>[ci.rs]"]
end

subgraph group_inspection["Memory inspection"]
  node_scan["Memory scanner<br/>[scan.rs]"]
  node_delta["Snapshot delta<br/>[delta.rs]"]
  node_stack["Stack capture<br/>[stack_trace.rs]"]
  node_hex["Hex inspection<br/>[hex_dump.rs]"]
  node_types["Memory records<br/>[types.rs]"]
end

subgraph group_platform["Platform providers"]
  node_provider["Memory provider<br/>[mod.rs]"]
  node_linux["Linux APIs<br/>[linux.rs]"]
  node_macos["macOS APIs<br/>[macos.rs]"]
  node_windows["Windows APIs<br/>[windows.rs]"]
end

subgraph group_support["Output &amp; shared support"]
  node_export["Report export<br/>[export.rs]"]
  node_process["Process lookup<br/>[process.rs]"]
  node_format["Formatting<br/>[formatting.rs]"]
  node_render["UI rendering<br/>[render.rs]"]
  node_theme["UI theme<br/>[theme.rs]"]
  node_loader["Loading UI<br/>[loader.rs]"]
end

node_user(("User"))

node_user -->|"runs commands"| node_cli
node_user -->|"opens dashboard"| node_tui
node_cli -.->|"requests inspection"| node_scan
node_tui -->|"dispatches commands"| node_commands
node_commands -->|"resolves process"| node_process
node_commands -->|"runs scan"| node_scan
node_commands -->|"queries modules"| node_provider
node_scan -->|"reads process memory"| node_provider
node_scan -->|"compares snapshots"| node_delta
node_scan -->|"captures observed stack"| node_stack
node_tui -->|"inspects bytes"| node_hex
node_tui -->|"renders views"| node_render
node_tui -->|"uses theme"| node_theme
node_tui -->|"uses loading indicator"| node_loader
node_provider -->|"dispatches on Linux"| node_linux
node_provider -->|"dispatches on macOS"| node_macos
node_provider -->|"dispatches on Windows"| node_windows
node_ci -->|"runs checks"| node_scan
node_ci -->|"uses process data"| node_process
node_ci -->|"exports reports"| node_export
node_export -->|"serializes records"| node_types
node_delta -->|"formats byte counts"| node_format
node_render -->|"formats values"| node_format
node_scan -->|"produces scan records"| node_types

click node_cli "https://github.com/sicklefire/m-vis/blob/master/src/main.rs"
click node_tui "https://github.com/sicklefire/m-vis/blob/master/src/ui/tui.rs"
click node_commands "https://github.com/sicklefire/m-vis/blob/master/src/ui/commands.rs"
click node_ci "https://github.com/sicklefire/m-vis/blob/master/src/ci.rs"
click node_scan "https://github.com/sicklefire/m-vis/blob/master/src/core/scan.rs"
click node_delta "https://github.com/sicklefire/m-vis/blob/master/src/core/delta.rs"
click node_stack "https://github.com/sicklefire/m-vis/blob/master/src/core/stack_trace.rs"
click node_hex "https://github.com/sicklefire/m-vis/blob/master/src/core/hex_dump.rs"
click node_types "https://github.com/sicklefire/m-vis/blob/master/src/types.rs"
click node_provider "https://github.com/sicklefire/m-vis/blob/master/src/os/mod.rs"
click node_linux "https://github.com/sicklefire/m-vis/blob/master/src/os/linux.rs"
click node_macos "https://github.com/sicklefire/m-vis/blob/master/src/os/macos.rs"
click node_windows "https://github.com/sicklefire/m-vis/blob/master/src/os/windows.rs"
click node_export "https://github.com/sicklefire/m-vis/blob/master/src/export.rs"
click node_process "https://github.com/sicklefire/m-vis/blob/master/src/utils/process.rs"
click node_format "https://github.com/sicklefire/m-vis/blob/master/src/utils/formatting.rs"
click node_render "https://github.com/sicklefire/m-vis/blob/master/src/ui/render.rs"
click node_theme "https://github.com/sicklefire/m-vis/blob/master/src/ui/theme.rs"
click node_loader "https://github.com/sicklefire/m-vis/blob/master/src/utils/loader.rs"

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_tui,node_commands,node_ci,node_user toneBlue
class node_scan,node_delta,node_stack,node_hex,node_types toneAmber
class node_provider,node_linux,node_macos,node_windows toneMint
class node_export,node_process,node_format,node_render,node_theme,node_loader toneRose
```

## Components

### Interfaces & automation

- [CLI](https://github.com/sicklefire/m-vis/blob/master/src/main.rs): `src/main.rs`
- [Terminal UI](https://github.com/sicklefire/m-vis/blob/master/src/ui/tui.rs): `src/ui/tui.rs`
- [UI commands](https://github.com/sicklefire/m-vis/blob/master/src/ui/commands.rs): `src/ui/commands.rs`
- [CI checks](https://github.com/sicklefire/m-vis/blob/master/src/ci.rs): `src/ci.rs`

### Memory inspection

- [Memory scanner](https://github.com/sicklefire/m-vis/blob/master/src/core/scan.rs): `src/core/scan.rs`
- [Snapshot delta](https://github.com/sicklefire/m-vis/blob/master/src/core/delta.rs): `src/core/delta.rs`
- [Stack capture](https://github.com/sicklefire/m-vis/blob/master/src/core/stack_trace.rs): `src/core/stack_trace.rs`
- [Hex inspection](https://github.com/sicklefire/m-vis/blob/master/src/core/hex_dump.rs): `src/core/hex_dump.rs`
- [Memory records](https://github.com/sicklefire/m-vis/blob/master/src/types.rs): `src/types.rs`

### Platform providers

- [Memory provider](https://github.com/sicklefire/m-vis/blob/master/src/os/mod.rs): `src/os/mod.rs`
- [Linux APIs](https://github.com/sicklefire/m-vis/blob/master/src/os/linux.rs): `src/os/linux.rs`
- [macOS APIs](https://github.com/sicklefire/m-vis/blob/master/src/os/macos.rs): `src/os/macos.rs`
- [Windows APIs](https://github.com/sicklefire/m-vis/blob/master/src/os/windows.rs): `src/os/windows.rs`

### Output & shared support

- [Report export](https://github.com/sicklefire/m-vis/blob/master/src/export.rs): `src/export.rs`
- [Process lookup](https://github.com/sicklefire/m-vis/blob/master/src/utils/process.rs): `src/utils/process.rs`
- [Formatting](https://github.com/sicklefire/m-vis/blob/master/src/utils/formatting.rs): `src/utils/formatting.rs`
- [UI rendering](https://github.com/sicklefire/m-vis/blob/master/src/ui/render.rs): `src/ui/render.rs`
- [UI theme](https://github.com/sicklefire/m-vis/blob/master/src/ui/theme.rs): `src/ui/theme.rs`
- [Loading UI](https://github.com/sicklefire/m-vis/blob/master/src/utils/loader.rs): `src/utils/loader.rs`

### Other components

- **User**

## Connections

- User → CLI: runs commands (evidence: `README.md`)
- User → Terminal UI: opens dashboard (evidence: `README.md`)
- CLI → Memory scanner: requests inspection
- Terminal UI → UI commands: dispatches commands (evidence: `src/ui/tui.rs`)
- UI commands → Process lookup: resolves process (evidence: `src/ui/commands.rs`)
- UI commands → Memory scanner: runs scan (evidence: `src/ui/commands.rs`)
- UI commands → Memory provider: queries modules (evidence: `src/ui/commands.rs`)
- Memory scanner → Memory provider: reads process memory (evidence: `src/core/scan.rs`)
- Memory scanner → Snapshot delta: compares snapshots (evidence: `src/core/scan.rs`)
- Memory scanner → Stack capture: captures observed stack (evidence: `src/core/scan.rs`)
- Terminal UI → Hex inspection: inspects bytes (evidence: `src/ui/tui.rs`)
- Terminal UI → UI rendering: renders views (evidence: `src/ui/tui.rs`)
- Terminal UI → UI theme: uses theme (evidence: `src/ui/tui.rs`)
- Terminal UI → Loading UI: uses loading indicator (evidence: `src/ui/tui.rs`)
- Memory provider → Linux APIs: dispatches on Linux (evidence: `src/os/mod.rs`)
- Memory provider → macOS APIs: dispatches on macOS (evidence: `src/os/mod.rs`)
- Memory provider → Windows APIs: dispatches on Windows (evidence: `src/os/mod.rs`)
- CI checks → Memory scanner: runs checks (evidence: `src/ci.rs`)
- CI checks → Process lookup: uses process data (evidence: `src/ci.rs`)
- CI checks → Report export: exports reports (evidence: `src/ci.rs`)
- Report export → Memory records: serializes records (evidence: `src/export.rs`)
- Snapshot delta → Formatting: formats byte counts (evidence: `src/core/delta.rs`)
- UI rendering → Formatting: formats values (evidence: `src/ui/render.rs`)
- Memory scanner → Memory records: produces scan records (evidence: `src/core/scan.rs`)
