@djibrilm/lazy-review 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +63 -49
  2. package/package.json +3 -2
package/README.md CHANGED
@@ -1,43 +1,50 @@
1
1
  <p align="center">
2
- <img src="./logo.png" width="200" alt="Lazy Review Logo">
2
+ <img src="https://github.com/DjibrilM/lazy-review/raw/develop/frontend/public/resources/images/logo.png" width="200" alt="Lazy Review Logo">
3
3
  </p>
4
4
 
5
- # Lazy Review
5
+ # Lazy Review — PR Review Assistant
6
6
 
7
- A fully offline AI code reviewer. Run it once and it spins up a local Express server with a React UI — no cloud, no subscriptions, no code leaving your machine.
7
+ A CLI tool that reviews GitHub pull requests using local AI models. Point it at a repository, select a PR, and it posts a structured review comment back to GitHub — no cloud inference, no API keys beyond GitHub OAuth.
8
8
 
9
- It connects to GitHub to fetch your PRs, runs a multi-agent review pipeline against your local models, and posts the review back as a GitHub comment.
9
+ ## Overview
10
10
 
11
- ## Features
11
+ Lazy Review fetches PR diffs from GitHub and runs them through a multi-agent pipeline on your machine. The output is a structured GitHub PR review comment with categorized findings (`approve` / `request_changes` / `comment`), severity scores, and file-level annotations.
12
12
 
13
- **Offline-first by design** — The entire stack runs locally. AI inference is handled by the [QVAC SDK](https://www.npmjs.com/package/@qvac/sdk), which downloads and manages open-weight models directly on your machine. A coding LLM (~5 GB RAM) handles review generation; a separate embedding model (~2 GB RAM) handles semantic search.
13
+ It uses two models:
14
14
 
15
- **Multi-agent review pipeline** — A single LLM call isn't enough for a thorough review. Lazy Review orchestrates five specialized agents:
15
+ - A coding LLM (~5 GB RAM) for review generation
16
+ - An embedding model (~2 GB RAM) for semantic codebase search
16
17
 
17
- - **Change Analyzer** — reads the diff and decides which review lenses are needed (security, performance, concurrency, correctness, architecture, maintainability)
18
- - **Specialist Reviewer** — investigates the PR through a specific lens, forming hypotheses without reading raw files directly
19
- - **Repository Explorer** — a sub-agent with deterministic file tools (`read_file`, `search_symbol`, `semantic_search`) that the Reviewer delegates evidence-gathering to
20
- - **Finding Verifier** — acts as a red team. Before anything is reported, it actively tries to _disprove_ each finding by searching for cleanup handlers, timeouts, or lifecycle methods that would make the issue impossible
21
- - **Secret Scanner** — scans diff file names for sensitive candidates (`.env`, private keys, credential bundles), then reads the actual diff content to confirm before flagging anything
18
+ Both are downloaded and managed via the [QVAC SDK](https://www.npmjs.com/package/@qvac/sdk).
22
19
 
23
- **Semantic codebase indexing** — When you add a repository, Lazy Review walks the source tree, extracts symbols via Tree-sitter (TypeScript, JavaScript, Python, Rust, Go), and stores embeddings in a local SQLite vector database using `sqlite-vec`. Content is chunked at safe token boundaries to fit within the embedding model's 512-token context window without truncation.
20
+ ## Review pipeline
24
21
 
25
- **Resilient tool-call parsing** Local models don't always produce perfectly structured output. The agent loop includes a JSON fallback parser and a regex parser for non-standard tool-call formats (e.g., `<|tool_call|>` dialect) so the pipeline keeps running even when the model's output is messy. Tool results from fallback-parsed calls are injected as `user` messages to bypass strict API structural validation.
22
+ A review goes through five sequential stages:
26
23
 
27
- **Real-time streaming** — Project creation logs and agent progress are streamed to the frontend over WebSockets via `socket.io`. Model download progress is also streamed byte-by-byte so you can see exactly what's happening.
24
+ 1. **Change Analyzer** — classifies the PR diff and selects which specialist reviewers are needed (e.g. `security`, `performance`, `concurrency`, `correctness`, `architecture`, `maintainability`)
25
+ 2. **Specialist Reviewers** — each runs a ReAct loop, forming hypotheses and querying the Repository Explorer for evidence rather than reading files directly
26
+ 3. **Repository Explorer** — a sub-agent with deterministic tools (`read_file`, `search_symbol`, `semantic_search`) that answers evidence queries from the Specialist Reviewers
27
+ 4. **Finding Verifier** — receives each candidate finding and attempts to disprove it by searching for cleanup handlers, timeouts, or lifecycle methods that would make the issue a false positive
28
+ 5. **Secret Scanner** — independently scans diff file names for sensitive candidates (`.env`, private keys, credential bundles), reads the actual diff content to confirm before reporting
28
29
 
29
- **Model preloading** — At startup, both models are loaded into memory in the background before any request comes in. The HTTP server starts accepting connections immediately, so if preloading finishes before the first review request, the cold-start latency disappears entirely.
30
+ Confirmed findings are deduplicated by a hash of their text and location, ranked by `Impact × Likelihood`, and included in the final review verdict (`approve` / `request_changes` / `comment`).
30
31
 
31
- ## How a review works
32
+ ## Codebase indexing
32
33
 
33
- 1. You select a GitHub repository and a PR from the UI.
34
- 2. Lazy Review fetches the PR diff and description via the GitHub API.
35
- 3. The **Change Analyzer** classifies the change and decides which specialist agents to spawn.
36
- 4. Each **Specialist Reviewer** forms hypotheses, then delegates evidence queries to the **Repository Explorer**, which has access to the local filesystem and the semantic index.
37
- 5. Every candidate finding is passed to the **Finding Verifier**, which attempts to disprove it. Only confirmed findings make it through.
38
- 6. The **Secret Scanner** runs independently, checking for leaked credentials.
39
- 7. Surviving findings are deduplicated by a hash of their text and location, then ranked by `Impact × Likelihood`.
40
- 8. The final structured review (`approve` / `request_changes` / `comment`) is posted as a GitHub PR comment.
34
+ When you add a repository, Lazy Review scans the source tree and builds a local vector index. It:
35
+
36
+ - Parses symbols from TypeScript, JavaScript, Python, Rust, and Go files using Tree-sitter
37
+ - Chunks content at safe token boundaries (the embedding model has a 512-token context window)
38
+ - Stores embeddings in SQLite using the `sqlite-vec` extension
39
+
40
+ The index is used during reviews to provide semantic context to the agents.
41
+
42
+ ## Tool-call parsing
43
+
44
+ Local models don't always return well-structured tool calls. The agent loop handles two fallback cases:
45
+
46
+ - A regex parser for non-standard formats (e.g. the `<|tool_call|>` dialect used by some quantized models)
47
+ - Tool results from fallback-parsed calls are injected as `user` messages to avoid strict API validation errors
41
48
 
42
49
  ## Tech stack
43
50
 
@@ -53,36 +60,31 @@ It connects to GitHub to fetch your PRs, runs a multi-agent review pipeline agai
53
60
 
54
61
  ## Hardware requirements
55
62
 
56
- Developed and tested on a Mac Mini (Apple Silicon). You need enough free RAM to hold both models simultaneously:
63
+ Tested on a Mac Mini (Apple Silicon). You need ~7 GB of free RAM to hold both models simultaneously:
57
64
 
58
- | Model | RAM |
59
- | --------------- | -------------- |
60
- | Coding LLM | ~5 GB |
61
- | Embedding Model | ~2 GB |
62
- | **Total** | **~7 GB free** |
65
+ | Model | RAM |
66
+ | --------------- | ----- |
67
+ | Coding LLM | ~5 GB |
68
+ | Embedding Model | ~2 GB |
63
69
 
64
- GPU inference is available and can be toggled in Settings. If you hit crashes during model initialization on an older GPU, switch to CPU inference it's slower but stable.
70
+ Since the models alone take up around 7 GB and other computer operations also need space, a good environment should have around 12 GB to 16 GB of total RAM.
65
71
 
66
- ## Getting started
72
+ GPU inference can be toggled in Settings. If the app crashes during model initialization (common on older GPUs), switch to CPU inference.
67
73
 
68
- ### Install from npm (recommended)
74
+ ## Installation
75
+
76
+ ### From npm
69
77
 
70
78
  ```bash
71
79
  npm install -g @djibrilm/lazy-review
72
80
  lrv run
73
81
  ```
74
82
 
75
- Open `http://localhost:16500` in your browser.
76
-
77
- You can also specify a custom port:
78
-
79
- ```bash
80
- lazy-review run --port 8080
81
- ```
83
+ Starts the server on `http://localhost:16500`.
82
84
 
83
- ### Run from source
85
+ ### From source
84
86
 
85
- **Prerequisites:** Node.js 18+, pnpm
87
+ Requires Node.js 18+ and pnpm.
86
88
 
87
89
  ```bash
88
90
  git clone https://github.com/djibrilm/lazy-review
@@ -91,14 +93,26 @@ pnpm install
91
93
  pnpm run dev
92
94
  ```
93
95
 
94
- This starts the Express backend on port `16500` and the Vite dev server concurrently.
96
+ This starts both the Express server (port `16500`) and the Vite dev server concurrently.
97
+
98
+ ## CLI Commands
99
+
100
+ The CLI is available as either `lazy-review` or the `lrv` shorthand.
101
+
102
+ ### `run`
103
+
104
+ Starts the Lazy Review server.
105
+
106
+ ```bash
107
+ lrv run
108
+ ```
95
109
 
96
- ## First-time setup
110
+ ## Setup
97
111
 
98
- 1. Go to **Settings → Local AI Models** and download both models. The download progress is shown live.
99
- 2. Go to **Settings → GitHub Authentication** and connect your GitHub account.
100
- 3. Add a repository from the dashboard. Lazy Review will clone it and index the codebase using Tree-sitter and local embeddings.
101
- 4. Open any PR from the repository view and click **Run Review**.
112
+ 1. Open Settings → Local AI Models and download both models.
113
+ 2. Open Settings → GitHub Authentication and connect your GitHub account.
114
+ 3. Add a repository from the dashboard. Lazy Review will clone it and index the codebase.
115
+ 4. Select a PR from the repository view and run a review.
102
116
 
103
117
  ## License
104
118
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@djibrilm/lazy-review",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "description": "",
6
6
  "bin": {
7
7
  "lazy-review": "./dist/bin.js",
@@ -91,6 +91,7 @@
91
91
  "link": "pnpm run postbuild && pnpm run prod:build && pnpm link --global",
92
92
  "link-watch": "nodemon --watch dist --ext js --exec \"pnpm link --global\"",
93
93
  "lint": "eslint \"src/**/*.ts\"",
94
- "format": "prettier --write \"**/*.{ts,js,json,md}\""
94
+ "format": "prettier --write \"**/*.{ts,js,json,md}\"",
95
+ "release": "pnpm run prod:build && pnpm publish --access public"
95
96
  }
96
97
  }