repopilot 0.20.0 → 0.22.0

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 +127 -107
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -3,172 +3,192 @@
3
3
  [![Crates.io](https://img.shields.io/crates/v/repopilot.svg)](https://crates.io/crates/repopilot)
4
4
  [![npm](https://img.shields.io/npm/v/repopilot.svg)](https://www.npmjs.com/package/repopilot)
5
5
  [![CI](https://github.com/MykytaStel/repopilot/actions/workflows/ci.yaml/badge.svg)](https://github.com/MykytaStel/repopilot/actions)
6
- [![GitHub Release](https://img.shields.io/github/v/release/MykytaStel/repopilot)](https://github.com/MykytaStel/repopilot/releases)
7
6
  [![License](https://img.shields.io/crates/l/repopilot.svg)](LICENSE)
8
7
 
9
- **Review what you or an AI agent changed before you merge.**
8
+ **Deterministic review for code you didn't write.**
10
9
 
11
- RepoPilot is a fast, local-first Rust CLI for Git change review. It flags
12
- security-boundary changes, behavioral and algorithmic shifts, taint-lite flows,
13
- and blast radius so maintainers can focus on the parts of a diff that deserve
14
- extra attention. It is deterministic, runs entirely on your machine, and can be
15
- called by coding agents over MCP. Nothing is uploaded.
10
+ Coding agents and busy teams produce more diffs than anyone can carefully
11
+ read. RepoPilot is a local Rust CLI that inspects a Git change and reports,
12
+ with structural evidence, where it crosses security boundaries, changes
13
+ behavior, and how far it reaches through the import graph. There is no LLM
14
+ inside and nothing leaves your machine: the same diff always produces the
15
+ same answer, so you can gate CI on it.
16
16
 
17
- ```text
18
- git diff -> boundary + behavior + taint + blast radius -> review or CI gate
19
- ```
17
+ ## Sixty seconds: an agent "optimizes" image uploads
18
+
19
+ An agent is asked to shell out to `mogrify` after image edits in a Django
20
+ app (Wagtail). The diff is one file, +12 −6, and it works. It also quietly
21
+ drops a permission check and pipes request input into a shell.
20
22
 
21
23
  <p align="center">
22
- <img src="https://raw.githubusercontent.com/MykytaStel/repopilot/main/docs/demos/02-review.gif" alt="RepoPilot reviewing a branch change" width="800">
24
+ <img src="https://raw.githubusercontent.com/MykytaStel/repopilot/main/docs/demos/03-agent-review.gif" alt="repopilot review flagging a removed auth check and a request-to-shell taint flow in a one-file diff" width="800">
23
25
  </p>
24
26
 
25
- > RepoPilot reports structural evidence, not a security verdict. Use it beside
26
- > tests, linters, type checkers, and dedicated security tools.
27
+ One command, `repopilot review .`, and the diff answers for itself:
27
28
 
28
- ## Install
29
+ ```text
30
+ ⚑ access control changed — wagtail/images/views/images.py
31
+ ⚑ auth check removed — wagtail/images/views/images.py:264
32
+ Authentication/authorization check removed (auth calls: 1 -> 0)
33
+ ⚑ subprocess/exec added — wagtail/images/views/images.py:270
34
+ ⚑ untrusted input reaches subprocess/exec — wagtail/images/views/images.py:270
35
+ HTTP request input reaches subprocess/exec: subprocess.run("mogrify -quality " + quality + ...
36
+ ⚠ A code boundary changed but no test did — confirm it's still covered.
37
+ ```
38
+
39
+ The edit is scripted so you can replay it on the pinned Wagtail checkout
40
+ RepoPilot uses for regression testing — but it is the kind of diff agents
41
+ ship every day:
29
42
 
30
43
  ```bash
31
- cargo install repopilot
32
- # or
33
- npm install -g repopilot
44
+ python3 scripts/zoo.py clone --only wagtail
45
+ scripts/demo-agent-edit.sh .zoo/wagtail
46
+ repopilot review .zoo/wagtail
34
47
  ```
35
48
 
36
- Homebrew, curl, GitHub Releases, and source builds are documented in
37
- [Installation](https://github.com/MykytaStel/repopilot/blob/main/docs/install.md).
38
-
39
- ## Choose Your Workflow
49
+ The same review works across languages — the identical flow in a Spring
50
+ controller (`scripts/demo-java-agent-edit.sh` on the pinned PetClinic
51
+ checkout) is caught the same way.
40
52
 
41
- | Goal | Command |
42
- |---|---|
43
- | Review what changed before merge | `repopilot review .` |
44
- | Review a branch against main | `repopilot review . --base origin/main` |
45
- | Audit the whole repository | `repopilot scan .` |
46
- | Adopt existing debt gradually | `repopilot baseline create .` |
47
- | Review a complete agent run | `repopilot snapshot` then `repopilot review --since-snapshot` |
48
- | Prepare context for an assistant | `repopilot ai context .` |
49
- | Connect a local MCP client | `repopilot mcp --root .` |
53
+ > RepoPilot reports structural evidence, not a security verdict. A flagged
54
+ > flow is a path to verify, not a confirmed vulnerability. Use it beside
55
+ > tests, linters, and dedicated security tools.
50
56
 
51
- `review` is the daily change-review workflow. Use `scan` when repository-wide
52
- architecture, framework, testing, and coupling results must be authoritative.
57
+ ## Catch broken code, not just risky code
53
58
 
54
- ## Review A Change
59
+ A tidy-looking rename and file move — nothing a diff review would flag on its
60
+ own — quietly breaks two callers that still expect the old names. No compiler
61
+ runs; both are AST-plus-resolver proofs.
55
62
 
56
- Review the working tree against `HEAD`:
63
+ <p align="center">
64
+ <img src="https://raw.githubusercontent.com/MykytaStel/repopilot/main/docs/demos/05-broken-code.gif" alt="repopilot review catching a removed export still imported and an unresolved local import in a tidy-looking rename" width="800">
65
+ </p>
57
66
 
58
67
  ```bash
59
- repopilot review .
68
+ scripts/demo-broken-code-review.sh
60
69
  ```
61
70
 
62
- Review a branch before merge:
71
+ ## Why not an LLM reviewer?
63
72
 
64
- ```bash
65
- repopilot review . --base origin/main
66
- ```
67
-
68
- RepoPilot groups review evidence into confidence tiers:
73
+ - **Deterministic.** Same diff in, same signals out. You can gate a pipeline
74
+ on it and reproduce any result; there is no prompt to drift and no model
75
+ to update under you.
76
+ - **Local.** No source upload, no API key, no per-review cost, no telemetry.
77
+ It runs offline, including the MCP server.
78
+ - **Evidence, not opinions.** Every signal points at a line and states the
79
+ structural fact behind it — an auth call count that went down, a request
80
+ value reaching `subprocess.run`. Nothing "looks fine."
69
81
 
70
- - security boundaries: access control, request trust, deploy surface, supply
71
- chain, and secret configuration;
72
- - behavioral changes: network, subprocess, filesystem, SQL, dependencies,
73
- migrations, removed error handling, or removed auth checks;
74
- - algorithmic changes: deeper nesting, nested loops, growth, or recursion;
75
- - taint-lite flows: changed request or process input reaching SQL, exec,
76
- filesystem-write, or outbound-network sinks;
77
- - blast radius: files that import a changed file.
82
+ LLM reviewers are useful; a deterministic layer under them is what makes
83
+ their output checkable.
78
84
 
79
- All review signals ship at `preview`. They are advisory by default; enable the
80
- explicit high-confidence gate with:
85
+ ## Install
81
86
 
82
87
  ```bash
83
- repopilot review . --base origin/main --fail-on-review definitely
88
+ cargo install repopilot
89
+ # or
90
+ npm install -g repopilot
84
91
  ```
85
92
 
86
- For a complete agent run:
93
+ Homebrew, GitHub Releases, and source builds:
94
+ [Installation](https://github.com/MykytaStel/repopilot/blob/main/docs/install.md).
95
+
96
+ ## Review a change
87
97
 
88
98
  ```bash
89
- repopilot snapshot
90
- # let the agent or developer work
91
- repopilot review --since-snapshot
99
+ repopilot review . # working tree vs HEAD
100
+ repopilot review . --base origin/main # branch vs main
92
101
  ```
93
102
 
94
- ## Full Repository Audit
103
+ Review groups evidence into tiers: security boundaries (access control,
104
+ request trust, deploy surface, supply chain, secrets), behavioral changes
105
+ (network, subprocess, filesystem, SQL, removed error handling or auth),
106
+ algorithmic shifts, taint-lite flows (changed request/process input reaching
107
+ SQL, exec, filesystem-write, or network sinks), broken local imports and
108
+ exports (a deleted or renamed file still imported, a removed export still
109
+ called under its old name — no compiler required), and blast radius (files
110
+ that import what changed).
95
111
 
96
- The broader scan remains available for repository adoption and CI:
112
+ Signals are advisory by default. Gate CI on the high-confidence tier:
97
113
 
98
114
  ```bash
99
- repopilot scan .
100
- repopilot baseline create .
101
- repopilot scan . \
102
- --baseline .repopilot/baseline.json \
103
- --fail-on new-high
115
+ repopilot review . --base origin/main --fail-on-review definitely
104
116
  ```
105
117
 
106
- Default scans hide low-confidence, experimental, and broad maintainability
107
- suggestions. Use `--profile strict` for the full audit surface.
118
+ Every review also resolves to one merge-readiness verdict — `ready`,
119
+ `review`, or `blocked` — built from findings, review signals, CODEOWNERS,
120
+ and blast radius, with deterministic reason codes and suggested owners.
121
+ Console, Markdown, JSON, MCP, and the GitHub Action summary all read the
122
+ same record.
108
123
 
109
- ## AI Handoff
124
+ ## Compare risk across runs
110
125
 
111
- When you want an external assistant to drive a fix, `repopilot ai context` turns a
112
- scan into one compact, copy-paste-ready Markdown handoff — locally, with no network
113
- or LLM calls:
126
+ History is local, bounded, and off by default. Record two compatible
127
+ analyses to see what's new, persisting, resolved, or changed severity —
128
+ nothing leaves your machine:
114
129
 
115
130
  ```bash
116
- repopilot ai context .
117
- repopilot ai context . --focus security --budget 8k
118
- repopilot ai context . --no-task --output ai-context.md # fact-only, for embedding
131
+ repopilot review . --record-history
132
+ repopilot scan . --record-history
119
133
  ```
120
134
 
121
- The handoff bundles everything an assistant needs in one document: repository facts
122
- and risk, the findings with evidence, a prioritized **P0–P3 remediation plan** with
123
- the Context Risk Graph edit order, working rules, and a verification checklist. Three
124
- controls shape it:
135
+ Receipts live under `.repopilot/history/`.
125
136
 
126
- - `--focus` — `security`, `arch`, `quality`, `framework`, or `all` (default);
127
- - `--budget` — `2k`/`4k`/`8k`/`16k` or an integer token target (default `4k`,
128
- roughly four characters per token), so the output fits your model's context;
129
- - `--output FILE` — write Markdown to a file instead of stdout (or pipe to your
130
- clipboard, e.g. `| pbcopy`). Pass `--no-task` to drop the agent guidance and emit
131
- fact-only context.
137
+ To calibrate a known rule to your repository instead of silencing it
138
+ project-wide, add a scoped, diffable entry to `.repopilot/overlay.toml`:
132
139
 
133
- ## MCP Server
140
+ ```toml
141
+ [[overlay]]
142
+ rule = "behavioral.panic-risk"
143
+ path = "src/cli/**"
144
+ severity = "low"
145
+ reason = "CLI handlers can terminate on unrecoverable input"
146
+ ```
134
147
 
135
- `repopilot mcp` exposes that context — fact-only, the way `--no-task` emits it —
136
- plus review, scan, file explanation, and finding replay tools over stdio so
137
- coding agents can call it directly:
148
+ Overlay decisions stay visible in `--profile strict` and the decision
149
+ trace — never a silent post-scan filter. Details:
150
+ [Configuration](https://github.com/MykytaStel/repopilot/blob/main/docs/configuration.md).
138
151
 
139
- Generate a client-neutral MCP configuration example with
140
- `repopilot init --mcp-client generic`. Client-specific Claude Code and Cursor
141
- adapters are available through the same `--mcp-client` option.
152
+ ## Guard an agent run
142
153
 
143
- The MCP server is synchronous, root-confined, and makes no network or LLM calls.
144
- See [MCP server](https://github.com/MykytaStel/repopilot/blob/main/docs/mcp.md).
154
+ Take a snapshot before the agent starts, review everything it did — commits
155
+ and uncommitted edits — when it stops:
145
156
 
146
- ## Distribution
157
+ ```bash
158
+ repopilot snapshot
159
+ # ... agent session ...
160
+ repopilot review --since-snapshot
161
+ ```
162
+
163
+ To wire this in permanently — a Claude Code hook that reviews every agent
164
+ session, an MCP server the agent can query mid-task (`repopilot init
165
+ --mcp-client claude|cursor|generic`), or a PR gate via the GitHub Action —
166
+ see [Guard your agent runs](https://github.com/MykytaStel/repopilot/blob/main/docs/agent-guardrail.md).
167
+
168
+ ## Beyond the diff
147
169
 
148
- Official CLI channels are crates.io, npm, Homebrew, and GitHub Releases.
149
- Editor extensions and PyPI packages are not supported distribution channels.
170
+ - `repopilot scan .` — full-repository audit (architecture, coupling,
171
+ framework, testing). `repopilot baseline create .` adopts existing debt so
172
+ only new findings gate.
173
+ - `repopilot ai context .` — one compact Markdown handoff of repository
174
+ facts, findings, and a prioritized fix plan for an external assistant.
175
+ Local, no LLM calls.
176
+ - `repopilot mcp --root .` — the same analysis over stdio for coding agents:
177
+ synchronous, root-confined, offline.
178
+
179
+ Details: [Common workflows](https://github.com/MykytaStel/repopilot/blob/main/docs/commands.md).
150
180
 
151
181
  ## Documentation
152
182
 
153
183
  - [Documentation index](https://github.com/MykytaStel/repopilot/blob/main/docs/README.md)
154
- - [Common workflows](https://github.com/MykytaStel/repopilot/blob/main/docs/commands.md)
184
+ - [Guard your agent runs](https://github.com/MykytaStel/repopilot/blob/main/docs/agent-guardrail.md)
155
185
  - [CLI reference](https://github.com/MykytaStel/repopilot/blob/main/docs/cli.md)
156
186
  - [Configuration](https://github.com/MykytaStel/repopilot/blob/main/docs/configuration.md)
157
187
  - [Reports and schemas](https://github.com/MykytaStel/repopilot/blob/main/docs/reports.md)
158
188
  - [GitHub pull request integration](https://github.com/MykytaStel/repopilot/blob/main/docs/integrations/github-code-scanning.md)
159
- - [Signal contract](https://github.com/MykytaStel/repopilot/blob/main/docs/engineering/signal-contract.md)
160
- - [Release process](https://github.com/MykytaStel/repopilot/blob/main/docs/release.md)
161
-
162
- ## Development
163
189
 
164
- ```bash
165
- cargo fmt --all -- --check
166
- cargo clippy --all-targets --all-features -- -D warnings
167
- cargo test --all
168
- npm run release:contract
169
- ./scripts/smoke-product.sh
170
- ```
190
+ Contributing and development commands: [CONTRIBUTING.md](CONTRIBUTING.md).
171
191
 
172
192
  ## License
173
193
 
174
- RepoPilot is licensed under **MIT OR Apache-2.0**.
194
+ MIT OR Apache-2.0.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repopilot",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Local-first CLI for reviewing Git changes, security boundaries, and blast radius before merge.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": {
@@ -30,11 +30,11 @@
30
30
  "LICENSE"
31
31
  ],
32
32
  "optionalDependencies": {
33
- "@repopilot/darwin-arm64": "0.20.0",
34
- "@repopilot/darwin-x64": "0.20.0",
35
- "@repopilot/linux-arm64-gnu": "0.20.0",
36
- "@repopilot/linux-x64-gnu": "0.20.0",
37
- "@repopilot/win32-x64-msvc": "0.20.0"
33
+ "@repopilot/darwin-arm64": "0.22.0",
34
+ "@repopilot/darwin-x64": "0.22.0",
35
+ "@repopilot/linux-arm64-gnu": "0.22.0",
36
+ "@repopilot/linux-x64-gnu": "0.22.0",
37
+ "@repopilot/win32-x64-msvc": "0.22.0"
38
38
  },
39
39
  "keywords": [
40
40
  "cli",