repopilot 0.15.0 → 0.17.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 +90 -68
  2. package/package.json +11 -8
package/README.md CHANGED
@@ -4,124 +4,145 @@
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
6
  [![GitHub Release](https://img.shields.io/github/v/release/MykytaStel/repopilot)](https://github.com/MykytaStel/repopilot/releases)
7
- [![Downloads](https://img.shields.io/crates/d/repopilot)](https://crates.io/crates/repopilot)
8
7
  [![License](https://img.shields.io/crates/l/repopilot.svg)](LICENSE)
9
- [![GitHub Stars](https://img.shields.io/github/stars/MykytaStel/repopilot?style=social)](https://github.com/MykytaStel/repopilot)
10
8
 
11
- **See what your AI agent — or you — just changed, before you merge.**
12
- RepoPilot is a fast, local-first Rust CLI that reviews a Git change and flags when it crossed a **security boundary** — the parts of your repo that decide *who can do what* (auth, sessions, permissions, CORS) and *how it ships* (CI, Dockerfiles, dependencies, committed `.env`) — then shows how far each changed file reaches. It's deterministic, runs entirely on your machine, and plugs into your AI coding agent over [MCP](#use-with-ai-agents-mcp). Nothing is uploaded.
9
+ **Review what you or an AI agent changed before you merge.**
10
+
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.
13
16
 
14
17
  ```text
15
- review a change -> boundary + blast radius -> baseline / CI gate -> local AI context
18
+ git diff -> boundary + behavior + taint + blast radius -> review or CI gate
16
19
  ```
17
20
 
18
21
  <p align="center">
19
- <img src="docs/demos/02-review.gif" alt="RepoPilot reviewing a branch change" width="800">
22
+ <img src="https://raw.githubusercontent.com/MykytaStel/repopilot/main/docs/demos/02-review.gif" alt="RepoPilot reviewing a branch change" width="800">
20
23
  </p>
21
24
 
22
- > RepoPilot flags *that* a boundary moved and how far it reaches — it does **not** prove the change is safe. Think "open the report before merging," not "security audit." It complements linters, type checkers, and dedicated security scanners; it doesn't replace them.
25
+ > RepoPilot reports structural evidence, not a security verdict. Use it beside
26
+ > tests, linters, type checkers, and dedicated security tools.
23
27
 
24
28
  ## Install
25
29
 
26
30
  ```bash
27
- cargo install repopilot # or: npm install -g repopilot
31
+ cargo install repopilot
32
+ # or
33
+ npm install -g repopilot
28
34
  ```
29
35
 
30
- Homebrew, install script, and from-source: [docs/install.md](docs/install.md).
36
+ Homebrew, curl, GitHub Releases, and source builds are documented in
37
+ [Installation](https://github.com/MykytaStel/repopilot/blob/main/docs/install.md).
31
38
 
32
- ## Quick start
39
+ ## Review A Change
33
40
 
34
- Review a change — what you'd check before merging, and what an agent can check on its own edits:
41
+ Review the working tree against `HEAD`:
35
42
 
36
43
  ```bash
37
- repopilot review . --base main
44
+ repopilot review .
38
45
  ```
39
46
 
40
- ```text
41
- $ repopilot review . --base main
47
+ Review a branch before merge:
42
48
 
43
- Changed files: 2
44
- In-diff findings: 2
49
+ ```bash
50
+ repopilot review . --base origin/main
51
+ ```
45
52
 
46
- Blast radius:
47
- The following files import changed files and may need extra review:
48
- - src/admin.ts
49
- - src/routes.ts
53
+ RepoPilot groups review evidence into confidence tiers:
50
54
 
51
- Security boundary changed [preview]:
52
- ⚑ access control src/middleware/auth.ts (imported by 2 files)
53
- ⚑ request trust src/server/cors.ts
54
- ⚠ A code boundary changed but no test did — confirm it's still covered.
55
- ```
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.
56
63
 
57
- Boundary categories: **access control**, **request trust**, **deploy surface**, **supply chain**, **secret config**. Tune or disable them in `repopilot.toml` under `[security_boundary]` (ships at `preview`).
64
+ All review signals ship at `preview`. They are advisory by default; enable the
65
+ explicit high-confidence gate with:
58
66
 
59
- Beyond boundaries, `repopilot review` also flags **behavioral** changes (added network/subprocess/filesystem/SQL, removed error handling or auth checks) and **algorithmic** changes (deeper nesting, a new nested loop, a function that grew or became recursive), grouped into three confidence tiers and reported as structural facts — never verdicts (ships at `preview`). To review a whole agent run, take a marker first: `repopilot snapshot`, let the agent edit, then `repopilot review --since-snapshot` covers every commit and uncommitted change since.
67
+ ```bash
68
+ repopilot review . --base origin/main --fail-on-review definitely
69
+ ```
60
70
 
61
- Full audit, a CI gate that fails only on *new* risk, and a local brief for an assistant:
71
+ For a complete agent run:
62
72
 
63
73
  ```bash
64
- repopilot scan . # full local audit (quiet by default)
65
- repopilot scan . --baseline .repopilot/baseline.json --fail-on new-high # fail CI only on newly introduced risk
66
- repopilot ai context . --budget 4k # budgeted, evidence-backed Markdown
74
+ repopilot snapshot
75
+ # let the agent or developer work
76
+ repopilot review --since-snapshot
67
77
  ```
68
78
 
69
- First five minutes for AI-assisted work:
79
+ ## Full Repository Audit
80
+
81
+ The broader scan remains available for repository adoption and CI:
70
82
 
71
83
  ```bash
72
- repopilot doctor . # confirm RepoPilot is ready for this repo
73
- repopilot scan . # see current visible risk
74
- repopilot ai context . # prepare local, evidence-backed context
75
- repopilot ai plan . # get a prioritized remediation plan
76
- repopilot ai prompt . # generate a paste-ready prompt for an assistant
77
- repopilot review . # check the assistant's change before merging
84
+ repopilot scan .
85
+ repopilot baseline create .
86
+ repopilot scan . \
87
+ --baseline .repopilot/baseline.json \
88
+ --fail-on new-high
78
89
  ```
79
90
 
80
- ## Use with AI agents (MCP)
91
+ Default scans hide broad maintainability noise. Use `--profile strict` for the
92
+ full audit surface.
93
+
94
+ ## AI Handoff
81
95
 
82
- RepoPilot ships a local [Model Context Protocol](https://modelcontextprotocol.io) server so AI coding agents (Claude Code, Cursor, …) can call it as a tool — the deterministic, private check an agent can run on its **own** edits before handing you the PR.
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:
83
99
 
84
100
  ```bash
85
- claude mcp add repopilot -- repopilot mcp
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
86
104
  ```
87
105
 
88
- It runs over stdio (JSON-RPC, no network, no AI calls) and exposes four tools:
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:
89
110
 
90
- - `repopilot_review_change` — audit the current Git changes: in-diff vs out-of-diff findings, tiered review signals (security-boundary, behavioral, and algorithmic changes grouped by confidence), and blast radius (structured JSON).
91
- - `repopilot_scan` — full repository audit as JSON.
92
- - `repopilot_context` — a budgeted, AI-ready Markdown brief of the repo.
93
- - `repopilot_explain_file` — how a single file is classified and which rules apply.
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.
94
117
 
95
- More: [docs/mcp.md](docs/mcp.md).
118
+ ## MCP Server
96
119
 
97
- ## What RepoPilot does
120
+ `repopilot mcp` exposes that context — fact-only, the way `--no-task` emits it —
121
+ plus review, scan, and explain, as tools over stdio so coding agents can call it
122
+ directly:
98
123
 
99
- | Capability | What it does |
100
- |---|---|
101
- | **Review a change** | changed-line findings, blast radius, and tiered boundary/behavioral/algorithmic signals — including before/after an agent edit via `snapshot` + `review --since-snapshot` (`review`, MCP) |
102
- | Full scan | repo-wide, evidence-ranked findings — secrets, runtime footguns, architecture — quiet by default ([trust mode](docs/trust-mode.md)) |
103
- | Baseline + CI gate | accept current debt as a baseline; fail CI only on newly introduced risk |
104
- | Reports | Console, Markdown, JSON, [SARIF](docs/integrations/github-code-scanning.md), HTML, receipts |
105
- | AI context | local, budgeted, evidence-backed Markdown brief for coding assistants |
124
+ ```bash
125
+ claude mcp add repopilot -- repopilot mcp --root .
126
+ ```
106
127
 
107
- Rules carry an `experimental -> preview -> stable` lifecycle and a quality gate (fixtures, stable IDs, evidence). See [docs/rule-quality-gate.md](docs/rule-quality-gate.md).
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).
108
130
 
109
- ## Local-first
131
+ ## Distribution
110
132
 
111
- RepoPilot does not upload source code, run a hosted scanner, call LLM APIs implicitly, send telemetry, or require an account. AI commands only format local scan evidence as Markdown for tools such as Claude Code, Cursor, or Zed.
133
+ Official CLI channels are crates.io, npm, Homebrew, and GitHub Releases.
134
+ Editor extensions and PyPI packages are not supported distribution channels.
112
135
 
113
136
  ## Documentation
114
137
 
115
- | Document | Purpose |
116
- |---|---|
117
- | [Install](docs/install.md) | Cargo, npm, Homebrew, curl, and source builds |
118
- | [Commands](docs/commands.md) / [CLI](docs/cli.md) | Task-oriented workflows and the full flag reference |
119
- | [Configuration](docs/configuration.md) | `repopilot.toml`, presets, ignores, baselines |
120
- | [Rulesets](docs/rulesets.md) / [Rule quality gate](docs/rule-quality-gate.md) | Built-in rules, lifecycle, and the gate |
121
- | [Trust Mode](docs/trust-mode.md) | Default vs strict visibility |
122
- | [Reports](docs/reports.md) / [Code Scanning](docs/integrations/github-code-scanning.md) | Formats, schema, and SARIF in CI |
123
- | [MCP](docs/mcp.md) | Using RepoPilot from AI agents |
124
- | [Release Process](docs/release.md) | Local and CI release gates |
138
+ - [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)
140
+ - [CLI reference](https://github.com/MykytaStel/repopilot/blob/main/docs/cli.md)
141
+ - [Configuration](https://github.com/MykytaStel/repopilot/blob/main/docs/configuration.md)
142
+ - [Reports and schemas](https://github.com/MykytaStel/repopilot/blob/main/docs/reports.md)
143
+ - [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)
125
146
 
126
147
  ## Development
127
148
 
@@ -129,6 +150,7 @@ RepoPilot does not upload source code, run a hosted scanner, call LLM APIs impli
129
150
  cargo fmt --all -- --check
130
151
  cargo clippy --all-targets --all-features -- -D warnings
131
152
  cargo test --all
153
+ npm run release:contract
132
154
  ./scripts/smoke-product.sh
133
155
  ```
134
156
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "repopilot",
3
- "version": "0.15.0",
4
- "description": "Local-first CLI for repository audit, architecture risk detection, baseline tracking, and CI-friendly code review.",
3
+ "version": "0.17.0",
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": {
7
7
  "type": "git",
@@ -18,7 +18,10 @@
18
18
  "test": "npm run test:npm",
19
19
  "test:npm": "node --test tests/npm_wrapper.test.js",
20
20
  "release:check": "bash scripts/verify-release.sh",
21
- "product:smoke": "bash scripts/smoke-product.sh"
21
+ "product:smoke": "bash scripts/smoke-product.sh",
22
+ "release:contract": "python3 scripts/release-contract.py check",
23
+ "test:release-contract": "python3 -m unittest discover -s scripts/tests -p 'test_*.py'",
24
+ "review:performance": "node scripts/check-review-performance.js"
22
25
  },
23
26
  "files": [
24
27
  "bin",
@@ -26,11 +29,11 @@
26
29
  "LICENSE"
27
30
  ],
28
31
  "optionalDependencies": {
29
- "@repopilot/darwin-arm64": "0.15.0",
30
- "@repopilot/darwin-x64": "0.15.0",
31
- "@repopilot/linux-arm64-gnu": "0.15.0",
32
- "@repopilot/linux-x64-gnu": "0.15.0",
33
- "@repopilot/win32-x64-msvc": "0.15.0"
32
+ "@repopilot/darwin-arm64": "0.17.0",
33
+ "@repopilot/darwin-x64": "0.17.0",
34
+ "@repopilot/linux-arm64-gnu": "0.17.0",
35
+ "@repopilot/linux-x64-gnu": "0.17.0",
36
+ "@repopilot/win32-x64-msvc": "0.17.0"
34
37
  },
35
38
  "keywords": [
36
39
  "cli",