repopilot 0.19.0 → 0.21.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 +114 -95
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -3,157 +3,176 @@
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
-
28
- ## Install
27
+ One command, `repopilot review .`, and the diff answers for itself:
29
28
 
30
- ```bash
31
- cargo install repopilot
32
- # or
33
- npm install -g repopilot
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.
34
37
  ```
35
38
 
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
- ## Review A Change
40
-
41
- Review the working tree against `HEAD`:
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:
42
42
 
43
43
  ```bash
44
- repopilot review .
44
+ python3 scripts/zoo.py clone --only wagtail
45
+ scripts/demo-agent-edit.sh .zoo/wagtail
46
+ repopilot review .zoo/wagtail
45
47
  ```
46
48
 
47
- Review a branch before merge:
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.
48
52
 
49
- ```bash
50
- repopilot review . --base origin/main
51
- ```
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.
56
+
57
+ ## Why not an LLM reviewer?
52
58
 
53
- RepoPilot groups review evidence into confidence tiers:
59
+ - **Deterministic.** Same diff in, same signals out. You can gate a pipeline
60
+ on it and reproduce any result; there is no prompt to drift and no model
61
+ to update under you.
62
+ - **Local.** No source upload, no API key, no per-review cost, no telemetry.
63
+ It runs offline, including the MCP server.
64
+ - **Evidence, not opinions.** Every signal points at a line and states the
65
+ structural fact behind it — an auth call count that went down, a request
66
+ value reaching `subprocess.run`. Nothing "looks fine."
54
67
 
55
- - security boundaries: access control, request trust, deploy surface, supply
56
- chain, and secret configuration;
57
- - behavioral changes: network, subprocess, filesystem, SQL, dependencies,
58
- migrations, removed error handling, or removed auth checks;
59
- - algorithmic changes: deeper nesting, nested loops, growth, or recursion;
60
- - taint-lite flows: changed request or process input reaching SQL, exec,
61
- filesystem-write, or outbound-network sinks;
62
- - blast radius: files that import a changed file.
68
+ LLM reviewers are useful; a deterministic layer under them is what makes
69
+ their output checkable.
63
70
 
64
- All review signals ship at `preview`. They are advisory by default; enable the
65
- explicit high-confidence gate with:
71
+ ## Install
66
72
 
67
73
  ```bash
68
- repopilot review . --base origin/main --fail-on-review definitely
74
+ cargo install repopilot
75
+ # or
76
+ npm install -g repopilot
69
77
  ```
70
78
 
71
- For a complete agent run:
79
+ Homebrew, GitHub Releases, and source builds:
80
+ [Installation](https://github.com/MykytaStel/repopilot/blob/main/docs/install.md).
81
+
82
+ ## Review a change
72
83
 
73
84
  ```bash
74
- repopilot snapshot
75
- # let the agent or developer work
76
- repopilot review --since-snapshot
85
+ repopilot review . # working tree vs HEAD
86
+ repopilot review . --base origin/main # branch vs main
77
87
  ```
78
88
 
79
- ## Full Repository Audit
89
+ Review groups evidence into tiers: security boundaries (access control,
90
+ request trust, deploy surface, supply chain, secrets), behavioral changes
91
+ (network, subprocess, filesystem, SQL, removed error handling or auth),
92
+ algorithmic shifts, taint-lite flows (changed request/process input reaching
93
+ SQL, exec, filesystem-write, or network sinks), and blast radius (files that
94
+ import what changed).
80
95
 
81
- The broader scan remains available for repository adoption and CI:
96
+ Signals are advisory by default. Gate CI on the high-confidence tier:
82
97
 
83
98
  ```bash
84
- repopilot scan .
85
- repopilot baseline create .
86
- repopilot scan . \
87
- --baseline .repopilot/baseline.json \
88
- --fail-on new-high
99
+ repopilot review . --base origin/main --fail-on-review definitely
89
100
  ```
90
101
 
91
- Default scans hide low-confidence, experimental, and broad maintainability
92
- suggestions. Use `--profile strict` for the full audit surface.
102
+ Every review also resolves to one merge-readiness verdict — `ready`,
103
+ `review`, or `blocked` — built from findings, review signals, CODEOWNERS,
104
+ and blast radius, with deterministic reason codes and suggested owners.
105
+ Console, Markdown, JSON, MCP, and the GitHub Action summary all read the
106
+ same record.
93
107
 
94
- ## AI Handoff
108
+ ## Compare risk across runs
95
109
 
96
- When you want an external assistant to drive a fix, `repopilot ai context` turns a
97
- scan into one compact, copy-paste-ready Markdown handoff — locally, with no network
98
- or LLM calls:
110
+ History is local, bounded, and off by default. Record two compatible
111
+ analyses to see what's new, persisting, resolved, or changed severity —
112
+ nothing leaves your machine:
99
113
 
100
114
  ```bash
101
- repopilot ai context .
102
- repopilot ai context . --focus security --budget 8k
103
- repopilot ai context . --no-task --output ai-context.md # fact-only, for embedding
115
+ repopilot review . --record-history
116
+ repopilot scan . --record-history
104
117
  ```
105
118
 
106
- The handoff bundles everything an assistant needs in one document: repository facts
107
- and risk, the findings with evidence, a prioritized **P0–P3 remediation plan** with
108
- the Context Risk Graph edit order, working rules, and a verification checklist. Three
109
- controls shape it:
119
+ Receipts live under `.repopilot/history/`.
110
120
 
111
- - `--focus` — `security`, `arch`, `quality`, `framework`, or `all` (default);
112
- - `--budget` — `2k`/`4k`/`8k`/`16k` or an integer token target (default `4k`,
113
- roughly four characters per token), so the output fits your model's context;
114
- - `--output FILE` — write Markdown to a file instead of stdout (or pipe to your
115
- clipboard, e.g. `| pbcopy`). Pass `--no-task` to drop the agent guidance and emit
116
- fact-only context.
121
+ To calibrate a known rule to your repository instead of silencing it
122
+ project-wide, add a scoped, diffable entry to `.repopilot/overlay.toml`:
117
123
 
118
- ## MCP Server
124
+ ```toml
125
+ [[overlay]]
126
+ rule = "behavioral.panic-risk"
127
+ path = "src/cli/**"
128
+ severity = "low"
129
+ reason = "CLI handlers can terminate on unrecoverable input"
130
+ ```
119
131
 
120
- `repopilot mcp` exposes that context — fact-only, the way `--no-task` emits it —
121
- plus review, scan, file explanation, and finding replay tools over stdio so
122
- coding agents can call it directly:
132
+ Overlay decisions stay visible in `--profile strict` and the decision
133
+ trace — never a silent post-scan filter. Details:
134
+ [Configuration](https://github.com/MykytaStel/repopilot/blob/main/docs/configuration.md).
135
+
136
+ ## Guard an agent run
137
+
138
+ Take a snapshot before the agent starts, review everything it did — commits
139
+ and uncommitted edits — when it stops:
123
140
 
124
141
  ```bash
125
- claude mcp add repopilot -- repopilot mcp --root .
142
+ repopilot snapshot
143
+ # ... agent session ...
144
+ repopilot review --since-snapshot
126
145
  ```
127
146
 
128
- The MCP server is synchronous, root-confined, and makes no network or LLM calls.
129
- See [MCP server](https://github.com/MykytaStel/repopilot/blob/main/docs/mcp.md).
147
+ To wire this in permanently — a Claude Code hook that reviews every agent
148
+ session, an MCP server the agent can query mid-task (`repopilot init
149
+ --mcp-client claude|cursor|generic`), or a PR gate via the GitHub Action —
150
+ see [Guard your agent runs](https://github.com/MykytaStel/repopilot/blob/main/docs/agent-guardrail.md).
130
151
 
131
- ## Distribution
152
+ ## Beyond the diff
132
153
 
133
- Official CLI channels are crates.io, npm, Homebrew, and GitHub Releases.
134
- Editor extensions and PyPI packages are not supported distribution channels.
154
+ - `repopilot scan .` — full-repository audit (architecture, coupling,
155
+ framework, testing). `repopilot baseline create .` adopts existing debt so
156
+ only new findings gate.
157
+ - `repopilot ai context .` — one compact Markdown handoff of repository
158
+ facts, findings, and a prioritized fix plan for an external assistant.
159
+ Local, no LLM calls.
160
+ - `repopilot mcp --root .` — the same analysis over stdio for coding agents:
161
+ synchronous, root-confined, offline.
162
+
163
+ Details: [Common workflows](https://github.com/MykytaStel/repopilot/blob/main/docs/commands.md).
135
164
 
136
165
  ## Documentation
137
166
 
138
167
  - [Documentation index](https://github.com/MykytaStel/repopilot/blob/main/docs/README.md)
139
- - [Common workflows](https://github.com/MykytaStel/repopilot/blob/main/docs/commands.md)
168
+ - [Guard your agent runs](https://github.com/MykytaStel/repopilot/blob/main/docs/agent-guardrail.md)
140
169
  - [CLI reference](https://github.com/MykytaStel/repopilot/blob/main/docs/cli.md)
141
170
  - [Configuration](https://github.com/MykytaStel/repopilot/blob/main/docs/configuration.md)
142
171
  - [Reports and schemas](https://github.com/MykytaStel/repopilot/blob/main/docs/reports.md)
143
172
  - [GitHub pull request integration](https://github.com/MykytaStel/repopilot/blob/main/docs/integrations/github-code-scanning.md)
144
- - [Signal contract](https://github.com/MykytaStel/repopilot/blob/main/docs/engineering/signal-contract.md)
145
- - [Release process](https://github.com/MykytaStel/repopilot/blob/main/docs/release.md)
146
-
147
- ## Development
148
173
 
149
- ```bash
150
- cargo fmt --all -- --check
151
- cargo clippy --all-targets --all-features -- -D warnings
152
- cargo test --all
153
- npm run release:contract
154
- ./scripts/smoke-product.sh
155
- ```
174
+ Contributing and development commands: [CONTRIBUTING.md](CONTRIBUTING.md).
156
175
 
157
176
  ## License
158
177
 
159
- RepoPilot is licensed under **MIT OR Apache-2.0**.
178
+ MIT OR Apache-2.0.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repopilot",
3
- "version": "0.19.0",
3
+ "version": "0.21.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.19.0",
34
- "@repopilot/darwin-x64": "0.19.0",
35
- "@repopilot/linux-arm64-gnu": "0.19.0",
36
- "@repopilot/linux-x64-gnu": "0.19.0",
37
- "@repopilot/win32-x64-msvc": "0.19.0"
33
+ "@repopilot/darwin-arm64": "0.21.0",
34
+ "@repopilot/darwin-x64": "0.21.0",
35
+ "@repopilot/linux-arm64-gnu": "0.21.0",
36
+ "@repopilot/linux-x64-gnu": "0.21.0",
37
+ "@repopilot/win32-x64-msvc": "0.21.0"
38
38
  },
39
39
  "keywords": [
40
40
  "cli",