# kenn-io/roborev architecture

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

- Interactive diagram: https://gitdiagram.com/kenn-io/roborev
- Repository: https://github.com/kenn-io/roborev

## Overview

roborev is a local, continuous code-review system for AI coding workflows. Its main loop begins when a commit triggers a background review; findings are stored and surfaced in the terminal or browser, then can be sent to an agent for fixes whose new commits are reviewed again. The daemon also serves analysis, verification, search, agent-session hooks, and optional cross-machine sync. The README documents these product flows; sampled source confirms key daemon routes, storage, and browser-session/API boundaries, but not every internal call.

Main entry points: [`internal/daemon/server.go`](https://github.com/kenn-io/roborev/blob/main/internal/daemon/server.go) (Daemon API), [`internal/daemon/worker.go`](https://github.com/kenn-io/roborev/blob/main/internal/daemon/worker.go) (Review Worker), [`internal/review/runner.go`](https://github.com/kenn-io/roborev/blob/main/internal/review/runner.go) (Review Pipeline), [`internal/storage/db.go`](https://github.com/kenn-io/roborev/blob/main/internal/storage/db.go) (Local Review Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_review["Review Engine"]
  node_commit_hook["Post-commit Hook<br/>[githook.go]"]
  node_review_worker["Review Worker<br/>[worker.go]"]
  node_agent_runtime["Agent Runners<br/>[agent.go]"]
  node_review_pipeline["Review Pipeline<br/>[runner.go]"]
  node_prompting["Review Prompts<br/>[prompt.go]"]
  node_analysis["Code Analysis<br/>[analyze.go]"]
  node_verification["Finding Verification<br/>[synthesis.go]"]
  node_fix_refine["Fix / Refine<br/>[fix.go]"]
end

subgraph group_daemon["Local Daemon"]
  node_daemon_server["Daemon API<br/>[server.go]"]
end

subgraph group_interfaces["User Interfaces"]
  node_tui["Terminal UI<br/>[handlers_msg.go]"]
  node_web_ui["Browser UI<br/>[App.svelte]"]
  node_web_api["Browser API Client<br/>[client.ts]"]
end

subgraph group_automation["Agent Automation"]
  node_agent_hooks["Agent Session Hooks<br/>[install.go]"]
  node_event_hooks["Review Event Hooks<br/>[hooks.go]"]
end

subgraph group_data["Review Data"]
  node_db[("Local Review Store<br/>[db.go]")]
  node_sync_worker["Remote Sync<br/>[syncworker.go]"]
  node_history_search["Review Search<br/>[service.go]"]
end

node_developer(("Developer / Git"))
node_external_agents(("Configured Coding Agents"))
node_postgres[("Optional PostgreSQL")]

node_developer -->|"commits code"| node_commit_hook
node_commit_hook -->|"enqueues review"| node_daemon_server
node_daemon_server -.->|"dispatches jobs"| node_review_worker
node_review_worker -.->|"runs review"| node_review_pipeline
node_review_pipeline -.->|"builds prompts"| node_prompting
node_review_pipeline -.->|"invokes agent"| node_agent_runtime
node_review_worker -.->|"persists findings"| node_db
node_developer -->|"requests analysis"| node_analysis
node_analysis -.->|"submits analysis job"| node_daemon_server
node_developer -->|"runs compact"| node_verification
node_developer -->|"requests fixes"| node_fix_refine
node_fix_refine -->|"asks for changes"| node_external_agents
node_developer -->|"views reviews"| node_tui
node_tui -.->|"requests review data"| node_daemon_server
node_developer -->|"browses reviews"| node_web_ui
node_web_ui -->|"uses API client"| node_web_api
node_web_api -.->|"calls API"| node_daemon_server
node_daemon_server -->|"reads and writes"| node_db
node_developer -->|"searches history"| node_history_search
node_agent_hooks -->|"posts session events"| node_daemon_server
node_daemon_server -.->|"runs configured hooks"| node_event_hooks
node_external_agents -->|"emits session events"| node_agent_hooks
node_sync_worker -->|"syncs local records"| node_db
node_sync_worker -->|"pushes and pulls"| node_postgres

click node_commit_hook "https://github.com/kenn-io/roborev/blob/main/internal/githook/githook.go"
click node_daemon_server "https://github.com/kenn-io/roborev/blob/main/internal/daemon/server.go"
click node_review_worker "https://github.com/kenn-io/roborev/blob/main/internal/daemon/worker.go"
click node_agent_runtime "https://github.com/kenn-io/roborev/blob/main/internal/agent/agent.go"
click node_review_pipeline "https://github.com/kenn-io/roborev/blob/main/internal/review/runner.go"
click node_prompting "https://github.com/kenn-io/roborev/blob/main/internal/prompt/prompt.go"
click node_analysis "https://github.com/kenn-io/roborev/blob/main/internal/prompt/analyze/analyze.go"
click node_verification "https://github.com/kenn-io/roborev/blob/main/internal/review/synthesis.go"
click node_fix_refine "https://github.com/kenn-io/roborev/blob/main/cmd/roborev/fix.go"
click node_db "https://github.com/kenn-io/roborev/blob/main/internal/storage/db.go"
click node_sync_worker "https://github.com/kenn-io/roborev/blob/main/internal/storage/syncworker.go"
click node_history_search "https://github.com/kenn-io/roborev/blob/main/internal/searchindex/service.go"
click node_tui "https://github.com/kenn-io/roborev/blob/main/cmd/roborev/tui/handlers_msg.go"
click node_web_ui "https://github.com/kenn-io/roborev/blob/main/web/src/App.svelte"
click node_web_api "https://github.com/kenn-io/roborev/blob/main/web/src/lib/api/client.ts"
click node_agent_hooks "https://github.com/kenn-io/roborev/blob/main/internal/agenthook/install.go"
click node_event_hooks "https://github.com/kenn-io/roborev/blob/main/internal/daemon/hooks.go"

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_commit_hook,node_review_worker,node_agent_runtime,node_review_pipeline,node_prompting,node_analysis,node_verification,node_fix_refine toneBlue
class node_daemon_server,node_postgres toneAmber
class node_tui,node_web_ui,node_web_api toneMint
class node_agent_hooks,node_event_hooks toneRose
class node_db,node_sync_worker,node_history_search,node_developer,node_external_agents toneIndigo
```

## Components

### Review Engine

- [Post-commit Hook](https://github.com/kenn-io/roborev/blob/main/internal/githook/githook.go): `internal/githook/githook.go`
- [Review Worker](https://github.com/kenn-io/roborev/blob/main/internal/daemon/worker.go): `internal/daemon/worker.go`
- [Agent Runners](https://github.com/kenn-io/roborev/blob/main/internal/agent/agent.go): `internal/agent/agent.go`
- [Review Pipeline](https://github.com/kenn-io/roborev/blob/main/internal/review/runner.go): `internal/review/runner.go`
- [Review Prompts](https://github.com/kenn-io/roborev/blob/main/internal/prompt/prompt.go): `internal/prompt/prompt.go`
- [Code Analysis](https://github.com/kenn-io/roborev/blob/main/internal/prompt/analyze/analyze.go): `internal/prompt/analyze/analyze.go`
- [Finding Verification](https://github.com/kenn-io/roborev/blob/main/internal/review/synthesis.go): `internal/review/synthesis.go`
- [Fix / Refine](https://github.com/kenn-io/roborev/blob/main/cmd/roborev/fix.go): `cmd/roborev/fix.go`

### Local Daemon

- [Daemon API](https://github.com/kenn-io/roborev/blob/main/internal/daemon/server.go): `internal/daemon/server.go`

### User Interfaces

- [Terminal UI](https://github.com/kenn-io/roborev/blob/main/cmd/roborev/tui/handlers_msg.go): `cmd/roborev/tui/handlers_msg.go`
- [Browser UI](https://github.com/kenn-io/roborev/blob/main/web/src/App.svelte): `web/src/App.svelte`
- [Browser API Client](https://github.com/kenn-io/roborev/blob/main/web/src/lib/api/client.ts): `web/src/lib/api/client.ts`

### Agent Automation

- [Agent Session Hooks](https://github.com/kenn-io/roborev/blob/main/internal/agenthook/install.go): `internal/agenthook/install.go`
- [Review Event Hooks](https://github.com/kenn-io/roborev/blob/main/internal/daemon/hooks.go): `internal/daemon/hooks.go`

### Review Data

- [Local Review Store](https://github.com/kenn-io/roborev/blob/main/internal/storage/db.go): `internal/storage/db.go`
- [Remote Sync](https://github.com/kenn-io/roborev/blob/main/internal/storage/syncworker.go): `internal/storage/syncworker.go`
- [Review Search](https://github.com/kenn-io/roborev/blob/main/internal/searchindex/service.go): `internal/searchindex/service.go`

### Other components

- **Developer / Git**
- **Configured Coding Agents**
- **Optional PostgreSQL**

## Connections

- Developer / Git → Post-commit Hook: commits code (evidence: `README.md`)
- Post-commit Hook → Daemon API: enqueues review (evidence: `README.md`)
- Daemon API → Review Worker: dispatches jobs
- Review Worker → Review Pipeline: runs review
- Review Pipeline → Review Prompts: builds prompts
- Review Pipeline → Agent Runners: invokes agent
- Review Worker → Local Review Store: persists findings
- Developer / Git → Code Analysis: requests analysis (evidence: `README.md`)
- Code Analysis → Daemon API: submits analysis job
- Developer / Git → Finding Verification: runs compact (evidence: `README.md`)
- Developer / Git → Fix / Refine: requests fixes (evidence: `README.md`)
- Fix / Refine → Configured Coding Agents: asks for changes (evidence: `README.md`)
- Developer / Git → Terminal UI: views reviews (evidence: `README.md`)
- Terminal UI → Daemon API: requests review data
- Developer / Git → Browser UI: browses reviews (evidence: `README.md`)
- Browser UI → Browser API Client: uses API client (evidence: `web/src/App.svelte`)
- Browser API Client → Daemon API: calls API
- Daemon API → Local Review Store: reads and writes (evidence: `internal/daemon/server.go`)
- Developer / Git → Review Search: searches history (evidence: `README.md`)
- Agent Session Hooks → Daemon API: posts session events (evidence: `README.md`)
- Daemon API → Review Event Hooks: runs configured hooks
- Configured Coding Agents → Agent Session Hooks: emits session events (evidence: `README.md`)
- Remote Sync → Local Review Store: syncs local records (evidence: `internal/storage/syncworker.go`)
- Remote Sync → Optional PostgreSQL: pushes and pulls (evidence: `internal/storage/syncworker.go`)
