# kylehton/git-lint architecture

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

- Interactive diagram: https://gitdiagram.com/kylehton/git-lint
- Repository: https://github.com/kylehton/git-lint

## Overview

GitLint accepts GitHub pull-request webhooks, reviews changed files with codebase context, posts a consolidated review, then refreshes repository embeddings. The graph preserves the separate initial-embedding workflow and the RAG storage layer. Connections reflect README statements and sampled calls; some storage initialization and Pinecone configuration details are only partially shown.

Main entry points: [`app/agent_workflow/run_agent.py`](https://github.com/kylehton/git-lint/blob/main/app/agent_workflow/run_agent.py) (Review orchestrator), [`app/logic_functions/diff_functions.py`](https://github.com/kylehton/git-lint/blob/main/app/logic_functions/diff_functions.py) (RAG context search), [`app/logic_functions/s3_upload.py`](https://github.com/kylehton/git-lint/blob/main/app/logic_functions/s3_upload.py) (Chunk store), [`app/logic_functions/embeddings.py`](https://github.com/kylehton/git-lint/blob/main/app/logic_functions/embeddings.py) (Initial embeddings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Webhook and orchestration"]
  node_webhook["Webhook handler<br/>[main.py]"]
  node_orchestrator["Review orchestrator<br/>[run_agent.py]"]
end

subgraph group_review["Review and RAG"]
  node_diff_ops["Diff operations<br/>[diff_functions.py]"]
  node_file_review["File reviewer<br/>[review_agent.py]"]
  node_review_summary["Review summarizer<br/>[run_agent.py]"]
  node_rag_context["RAG context search<br/>[diff_functions.py]"]
end

subgraph group_embeddings["Repository embeddings"]
  node_embedding_refresh["Embedding refresh<br/>[diff_functions.py]"]
  node_initial_embeddings["Initial embeddings<br/>[embeddings.py]"]
end

subgraph group_storage["Context storage"]
  node_pinecone[("Pinecone index")]
  node_chunk_store["Chunk store<br/>[s3_upload.py]"]
end

node_github(("GitHub"))
node_openai["OpenAI"]
node_s3[("AWS S3")]

node_github -->|"sends webhook"| node_webhook
node_webhook -->|"schedules review"| node_orchestrator
node_orchestrator -->|"fetches and splits"| node_diff_ops
node_orchestrator -->|"requests context"| node_rag_context
node_orchestrator -->|"reviews files"| node_file_review
node_orchestrator -->|"summarizes reviews"| node_review_summary
node_orchestrator -->|"posts comment"| node_diff_ops
node_orchestrator -->|"refreshes embeddings"| node_embedding_refresh
node_diff_ops -->|"fetches diff and files"| node_github
node_diff_ops -->|"posts review comment"| node_github
node_rag_context -->|"embeds diff chunks"| node_openai
node_rag_context -->|"queries vectors"| node_pinecone
node_rag_context -->|"loads matched text"| node_chunk_store
node_file_review -->|"runs review agent"| node_openai
node_review_summary -->|"runs summarizer"| node_openai
node_embedding_refresh -->|"embeds changed code"| node_openai
node_embedding_refresh -->|"upserts vectors"| node_pinecone
node_embedding_refresh -->|"saves updated chunks"| node_chunk_store
node_initial_embeddings -->|"embeds code chunks"| node_openai
node_initial_embeddings -->|"upserts vectors"| node_pinecone
node_initial_embeddings -->|"saves chunk store"| node_chunk_store
node_chunk_store -->|"uploads and downloads"| node_s3

click node_webhook "https://github.com/kylehton/git-lint/blob/main/app/main.py"
click node_orchestrator "https://github.com/kylehton/git-lint/blob/main/app/agent_workflow/run_agent.py"
click node_diff_ops "https://github.com/kylehton/git-lint/blob/main/app/logic_functions/diff_functions.py"
click node_file_review "https://github.com/kylehton/git-lint/blob/main/app/agent_workflow/review_agent.py"
click node_review_summary "https://github.com/kylehton/git-lint/blob/main/app/agent_workflow/run_agent.py"
click node_rag_context "https://github.com/kylehton/git-lint/blob/main/app/logic_functions/diff_functions.py"
click node_embedding_refresh "https://github.com/kylehton/git-lint/blob/main/app/logic_functions/diff_functions.py"
click node_initial_embeddings "https://github.com/kylehton/git-lint/blob/main/app/logic_functions/embeddings.py"
click node_chunk_store "https://github.com/kylehton/git-lint/blob/main/app/logic_functions/s3_upload.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_webhook,node_orchestrator toneBlue
class node_diff_ops,node_file_review,node_review_summary,node_rag_context,node_s3 toneAmber
class node_embedding_refresh,node_initial_embeddings toneMint
class node_pinecone,node_chunk_store toneRose
class node_github,node_openai toneIndigo
```

## Components

### Webhook and orchestration

- [Webhook handler](https://github.com/kylehton/git-lint/blob/main/app/main.py): `app/main.py`
- [Review orchestrator](https://github.com/kylehton/git-lint/blob/main/app/agent_workflow/run_agent.py): `app/agent_workflow/run_agent.py`

### Review and RAG

- [Diff operations](https://github.com/kylehton/git-lint/blob/main/app/logic_functions/diff_functions.py): `app/logic_functions/diff_functions.py`
- [File reviewer](https://github.com/kylehton/git-lint/blob/main/app/agent_workflow/review_agent.py): `app/agent_workflow/review_agent.py`
- [Review summarizer](https://github.com/kylehton/git-lint/blob/main/app/agent_workflow/run_agent.py): `app/agent_workflow/run_agent.py`
- [RAG context search](https://github.com/kylehton/git-lint/blob/main/app/logic_functions/diff_functions.py): `app/logic_functions/diff_functions.py`

### Repository embeddings

- [Embedding refresh](https://github.com/kylehton/git-lint/blob/main/app/logic_functions/diff_functions.py): `app/logic_functions/diff_functions.py`
- [Initial embeddings](https://github.com/kylehton/git-lint/blob/main/app/logic_functions/embeddings.py): `app/logic_functions/embeddings.py`

### Context storage

- **Pinecone index**
- [Chunk store](https://github.com/kylehton/git-lint/blob/main/app/logic_functions/s3_upload.py): `app/logic_functions/s3_upload.py`

### Other components

- **GitHub**
- **OpenAI**
- **AWS S3**

## Connections

- GitHub → Webhook handler: sends webhook (evidence: `README.md`)
- Webhook handler → Review orchestrator: schedules review (evidence: `app/main.py`)
- Review orchestrator → Diff operations: fetches and splits (evidence: `app/agent_workflow/run_agent.py`)
- Review orchestrator → RAG context search: requests context (evidence: `app/agent_workflow/run_agent.py`)
- Review orchestrator → File reviewer: reviews files (evidence: `app/agent_workflow/run_agent.py`)
- Review orchestrator → Review summarizer: summarizes reviews (evidence: `app/agent_workflow/run_agent.py`)
- Review orchestrator → Diff operations: posts comment (evidence: `app/agent_workflow/run_agent.py`)
- Review orchestrator → Embedding refresh: refreshes embeddings (evidence: `app/agent_workflow/run_agent.py`)
- Diff operations → GitHub: fetches diff and files (evidence: `app/logic_functions/diff_functions.py`)
- Diff operations → GitHub: posts review comment (evidence: `app/logic_functions/diff_functions.py`)
- RAG context search → OpenAI: embeds diff chunks (evidence: `app/logic_functions/diff_functions.py`)
- RAG context search → Pinecone index: queries vectors (evidence: `app/logic_functions/diff_functions.py`)
- RAG context search → Chunk store: loads matched text (evidence: `app/logic_functions/diff_functions.py`)
- File reviewer → OpenAI: runs review agent (evidence: `app/agent_workflow/review_agent.py`)
- Review summarizer → OpenAI: runs summarizer (evidence: `app/agent_workflow/run_agent.py`)
- Embedding refresh → OpenAI: embeds changed code (evidence: `app/logic_functions/diff_functions.py`)
- Embedding refresh → Pinecone index: upserts vectors (evidence: `app/logic_functions/diff_functions.py`)
- Embedding refresh → Chunk store: saves updated chunks (evidence: `app/logic_functions/diff_functions.py`)
- Initial embeddings → OpenAI: embeds code chunks (evidence: `app/logic_functions/embeddings.py`)
- Initial embeddings → Pinecone index: upserts vectors (evidence: `app/logic_functions/embeddings.py`)
- Initial embeddings → Chunk store: saves chunk store (evidence: `app/logic_functions/embeddings.py`)
- Chunk store → AWS S3: uploads and downloads (evidence: `app/logic_functions/s3_upload.py`)
