# abhaykatiyar804/review_agent architecture

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

- Interactive diagram: https://gitdiagram.com/abhaykatiyar804/review_agent
- Repository: https://github.com/abhaykatiyar804/review_agent

## Overview

This repository is a Git-review-agent project whose implemented daemon workflow accepts Unix-socket requests and dispatches Git worktree actions; review dispatch and the standalone review CLI are placeholders. The README provides no capability details, and unsampled DTO/config behavior is represented only where supported by the tree and visible callers. The sampled client uses newline framing while the async server expects a length-prefixed frame, so successful interoperability is not established.

Main entry points: [`src/daemon/cmd_dispatcher.py`](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/cmd_dispatcher.py) (Command dispatcher), [`src/review_agent/cli.py`](https://github.com/abhaykatiyar804/review_agent/blob/main/src/review_agent/cli.py) (Review CLI), [`src/daemon/daemon.py`](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/daemon.py) (Daemon server), [`src/daemon/adapter/connection/connection.py`](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/adapter/connection/connection.py) (Connection handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_socket_client["Socket client<br/>[client.py]"]
  node_review_cli["Review CLI<br/>[cli.py]"]
end

subgraph group_daemon["Daemon runtime"]
  node_server["Daemon server<br/>[daemon.py]"]
  node_connection["Connection handler<br/>[connection.py]"]
  node_job_manager["Job manager<br/>[job_manager.py]"]
  node_config["Daemon config<br/>[config.py]"]
  node_request["Request/response DTOs<br/>[dto.py]"]
end

subgraph group_actions["Git actions"]
  node_dispatcher["Command dispatcher<br/>[cmd_dispatcher.py]"]
  node_worktree["Worktree action<br/>[cmd_dispatcher.py]"]
  node_review_action["Review action<br/>[cmd_dispatcher.py]"]
end

node_user(("User"))
node_git_repo[("Git repository")]
node_agent["LangChain agent"]
node_gh_cli["GitHub CLI"]

node_user -->|"sends request"| node_socket_client
node_socket_client -->|"connects socket"| node_server
node_server -->|"loads settings"| node_config
node_server -->|"handles connection"| node_connection
node_connection -->|"parses request"| node_request
node_connection -->|"starts job"| node_job_manager
node_job_manager -->|"runs command"| node_dispatcher
node_dispatcher -->|"dispatches action"| node_request
node_dispatcher -->|"selects action"| node_worktree
node_dispatcher -->|"selects action"| node_review_action
node_worktree -->|"creates worktree"| node_git_repo
node_user -->|"invokes CLI"| node_review_cli
node_review_cli -.->|"creates agent"| node_agent
node_review_cli -.->|"retrieves token"| node_gh_cli

click node_socket_client "https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/client.py"
click node_review_cli "https://github.com/abhaykatiyar804/review_agent/blob/main/src/review_agent/cli.py"
click node_server "https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/daemon.py"
click node_connection "https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/adapter/connection/connection.py"
click node_job_manager "https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/job_manager.py"
click node_config "https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/config.py"
click node_request "https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/dto.py"
click node_dispatcher "https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/cmd_dispatcher.py"
click node_worktree "https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/cmd_dispatcher.py"
click node_review_action "https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/cmd_dispatcher.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_socket_client,node_review_cli,node_user toneBlue
class node_server,node_connection,node_job_manager,node_config,node_request,node_git_repo toneAmber
class node_dispatcher,node_worktree,node_review_action toneMint
class node_agent,node_gh_cli toneIndigo
```

## Components

### Entry points

- [Socket client](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/client.py): `src/daemon/client.py`
- [Review CLI](https://github.com/abhaykatiyar804/review_agent/blob/main/src/review_agent/cli.py): `src/review_agent/cli.py`

### Daemon runtime

- [Daemon server](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/daemon.py): `src/daemon/daemon.py`
- [Connection handler](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/adapter/connection/connection.py): `src/daemon/adapter/connection/connection.py`
- [Job manager](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/job_manager.py): `src/daemon/job_manager.py`
- [Daemon config](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/config.py): `src/daemon/config.py`
- [Request/response DTOs](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/dto.py): `src/daemon/dto.py`

### Git actions

- [Command dispatcher](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/cmd_dispatcher.py): `src/daemon/cmd_dispatcher.py`
- [Worktree action](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/cmd_dispatcher.py): `src/daemon/cmd_dispatcher.py`
- [Review action](https://github.com/abhaykatiyar804/review_agent/blob/main/src/daemon/cmd_dispatcher.py): `src/daemon/cmd_dispatcher.py`

### Other components

- **User**
- **Git repository**
- **LangChain agent**
- **GitHub CLI**

## Connections

- User → Socket client: sends request
- Socket client → Daemon server: connects socket
- Daemon server → Daemon config: loads settings
- Daemon server → Connection handler: handles connection
- Connection handler → Request/response DTOs: parses request
- Connection handler → Job manager: starts job
- Job manager → Command dispatcher: runs command
- Command dispatcher → Request/response DTOs: dispatches action
- Command dispatcher → Worktree action: selects action
- Command dispatcher → Review action: selects action
- Worktree action → Git repository: creates worktree
- User → Review CLI: invokes CLI
- Review CLI → LangChain agent: creates agent
- Review CLI → GitHub CLI: retrieves token
