repopilot 0.20.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 +112 -108
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -3,172 +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
+ 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).
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.
38
52
 
39
- ## Choose Your Workflow
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.
40
56
 
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 .` |
57
+ ## Why not an LLM reviewer?
50
58
 
51
- `review` is the daily change-review workflow. Use `scan` when repository-wide
52
- architecture, framework, testing, and coupling results must be authoritative.
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."
53
67
 
54
- ## Review A Change
68
+ LLM reviewers are useful; a deterministic layer under them is what makes
69
+ their output checkable.
55
70
 
56
- Review the working tree against `HEAD`:
71
+ ## Install
57
72
 
58
73
  ```bash
59
- repopilot review .
74
+ cargo install repopilot
75
+ # or
76
+ npm install -g repopilot
60
77
  ```
61
78
 
62
- Review a branch before merge:
79
+ Homebrew, GitHub Releases, and source builds:
80
+ [Installation](https://github.com/MykytaStel/repopilot/blob/main/docs/install.md).
81
+
82
+ ## Review a change
63
83
 
64
84
  ```bash
65
- repopilot review . --base origin/main
85
+ repopilot review . # working tree vs HEAD
86
+ repopilot review . --base origin/main # branch vs main
66
87
  ```
67
88
 
68
- RepoPilot groups review evidence into confidence tiers:
69
-
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.
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).
78
95
 
79
- All review signals ship at `preview`. They are advisory by default; enable the
80
- explicit high-confidence gate with:
96
+ Signals are advisory by default. Gate CI on the high-confidence tier:
81
97
 
82
98
  ```bash
83
99
  repopilot review . --base origin/main --fail-on-review definitely
84
100
  ```
85
101
 
86
- For a complete agent run:
87
-
88
- ```bash
89
- repopilot snapshot
90
- # let the agent or developer work
91
- repopilot review --since-snapshot
92
- ```
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
- ## Full Repository Audit
108
+ ## Compare risk across runs
95
109
 
96
- The broader scan remains available for repository adoption and CI:
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:
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 . --record-history
116
+ repopilot scan . --record-history
104
117
  ```
105
118
 
106
- Default scans hide low-confidence, experimental, and broad maintainability
107
- suggestions. Use `--profile strict` for the full audit surface.
108
-
109
- ## AI Handoff
119
+ Receipts live under `.repopilot/history/`.
110
120
 
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:
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`:
114
123
 
115
- ```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
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"
119
130
  ```
120
131
 
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:
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).
125
135
 
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.
136
+ ## Guard an agent run
132
137
 
133
- ## MCP Server
138
+ Take a snapshot before the agent starts, review everything it did — commits
139
+ and uncommitted edits — when it stops:
134
140
 
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:
141
+ ```bash
142
+ repopilot snapshot
143
+ # ... agent session ...
144
+ repopilot review --since-snapshot
145
+ ```
138
146
 
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.
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).
142
151
 
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).
152
+ ## Beyond the diff
145
153
 
146
- ## Distribution
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.
147
162
 
148
- Official CLI channels are crates.io, npm, Homebrew, and GitHub Releases.
149
- Editor extensions and PyPI packages are not supported distribution channels.
163
+ Details: [Common workflows](https://github.com/MykytaStel/repopilot/blob/main/docs/commands.md).
150
164
 
151
165
  ## Documentation
152
166
 
153
167
  - [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)
168
+ - [Guard your agent runs](https://github.com/MykytaStel/repopilot/blob/main/docs/agent-guardrail.md)
155
169
  - [CLI reference](https://github.com/MykytaStel/repopilot/blob/main/docs/cli.md)
156
170
  - [Configuration](https://github.com/MykytaStel/repopilot/blob/main/docs/configuration.md)
157
171
  - [Reports and schemas](https://github.com/MykytaStel/repopilot/blob/main/docs/reports.md)
158
172
  - [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
173
 
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
- ```
174
+ Contributing and development commands: [CONTRIBUTING.md](CONTRIBUTING.md).
171
175
 
172
176
  ## License
173
177
 
174
- 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.20.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.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.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",