@diffpal/diffpal 0.1.18 → 0.1.20
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.
- package/README.md +100 -31
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -5,12 +5,23 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/@diffpal/diffpal)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
**
|
|
8
|
+
**Open-source, provider-agnostic AI review for pull requests.**
|
|
9
9
|
|
|
10
|
-
DiffPal
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
DiffPal is an open-source PR review system that turns changed code into
|
|
11
|
+
structured findings, clear summaries, inline feedback, artifacts, and merge
|
|
12
|
+
gates. Teams bring their own AI provider or ACP-compatible CLI, so there is no
|
|
13
|
+
mandatory hosted DiffPal review service and no required per-seat review
|
|
14
|
+
platform.
|
|
15
|
+
|
|
16
|
+
DiffPal exists to make AI code review something teams control, not another
|
|
17
|
+
review platform they rent. It runs in your CI, uses the AI provider you choose,
|
|
18
|
+
and turns every pull request into clear summaries, actionable inline feedback,
|
|
19
|
+
review artifacts, and merge gates.
|
|
20
|
+
|
|
21
|
+
Bring your own provider account, keep your costs and credentials with you, and
|
|
22
|
+
keep the review workflow in your repository. DiffPal's goal is to make AI PR
|
|
23
|
+
review portable, affordable, and enforceable across GitHub, GitLab, and Azure
|
|
24
|
+
DevOps.
|
|
14
25
|
|
|
15
26
|
| Works with | Publishes | Gates on |
|
|
16
27
|
| --- | --- | --- |
|
|
@@ -28,24 +39,43 @@ pull request diff
|
|
|
28
39
|
-> platform publisher and CI artifacts
|
|
29
40
|
```
|
|
30
41
|
|
|
31
|
-
DiffPal
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
DiffPal coordinates the review workflow around the model call. Your provider
|
|
43
|
+
supplies the review intelligence; DiffPal keeps PR feedback, artifacts, and
|
|
44
|
+
merge policy consistent across hosts.
|
|
45
|
+
|
|
46
|
+
Review instructions are produced by DiffPal's versioned Prompt Pack. Findings
|
|
47
|
+
artifacts include the prompt id, prompt version, purpose, and findings schema
|
|
48
|
+
version, so a review can be traced back to the exact prompt contract that
|
|
49
|
+
generated it. See the [config reference](docs/config-reference.md#prompt-pack)
|
|
50
|
+
and [findings schema](docs/findings-schema.md) for the current metadata.
|
|
51
|
+
|
|
52
|
+
## Bring Your Own Provider
|
|
53
|
+
|
|
54
|
+
DiffPal decouples AI review from any one vendor or hosted service. Choose
|
|
55
|
+
Codex, Copilot, OpenCode, Gemini, Claude Code, a hosted API provider, an ordered
|
|
56
|
+
provider pool, or any ACP-compatible CLI without rebuilding your PR review
|
|
57
|
+
workflow.
|
|
58
|
+
|
|
59
|
+
That model keeps cost and account control in your provider account. DiffPal
|
|
60
|
+
does not require a hosted review service or per-seat platform subscription to
|
|
61
|
+
collect diffs, publish PR feedback, write artifacts, or enforce merge gates.
|
|
35
62
|
|
|
36
63
|
## Quick Start: GitHub Actions
|
|
37
64
|
|
|
38
|
-
This is the fastest production-shaped setup
|
|
39
|
-
|
|
40
|
-
in GitHub Secrets.
|
|
65
|
+
This is the fastest production-shaped setup using the default Codex API-key
|
|
66
|
+
recipe: DiffPal installs itself through the GitHub Action, Codex is selected as
|
|
67
|
+
the review provider, and `OPENAI_API_KEY` stays in GitHub Secrets. You can swap
|
|
68
|
+
the provider recipe while keeping the same DiffPal review workflow.
|
|
41
69
|
|
|
42
|
-
1.
|
|
70
|
+
1. Generate the config:
|
|
43
71
|
|
|
44
72
|
```bash
|
|
45
|
-
|
|
46
|
-
cp examples/configs/codex-api-key/config.yaml .config/diffpal/config.yaml
|
|
73
|
+
npx -y @diffpal/diffpal@latest init --wizard --setup codex-api-key --platform github
|
|
47
74
|
```
|
|
48
75
|
|
|
76
|
+
This writes `.config/diffpal/config.yaml` with a visible `ci` profile. Existing
|
|
77
|
+
files are kept unless you pass `--force`.
|
|
78
|
+
|
|
49
79
|
2. Add a repository secret:
|
|
50
80
|
|
|
51
81
|
| Secret | Purpose |
|
|
@@ -70,15 +100,16 @@ Expected result:
|
|
|
70
100
|
- a failed job only when `gate: true` and blocking findings exist, or when setup
|
|
71
101
|
or publishing fails
|
|
72
102
|
|
|
73
|
-
The
|
|
74
|
-
|
|
75
|
-
|
|
103
|
+
The GitHub Action installs the latest DiffPal CLI by default. After your first
|
|
104
|
+
successful run, pin `diffpal-version`, provider CLIs, and bridge packages when
|
|
105
|
+
you need fully reproducible credentialed CI.
|
|
76
106
|
|
|
77
107
|
## Supported CI Systems
|
|
78
108
|
|
|
79
|
-
Use the same `.config/diffpal/config.yaml` shape in every CI system.
|
|
80
|
-
|
|
81
|
-
platform token, and runs
|
|
109
|
+
Use the same `.config/diffpal/config.yaml` shape in every CI system. GitHub,
|
|
110
|
+
GitLab, and Azure are publishing targets; the core workflow only changes how CI
|
|
111
|
+
checks out code, installs the provider, passes the platform token, and runs
|
|
112
|
+
DiffPal.
|
|
82
113
|
|
|
83
114
|
| CI system | Examples | Output surfaces |
|
|
84
115
|
| --- | --- | --- |
|
|
@@ -91,7 +122,9 @@ platform token, and runs DiffPal.
|
|
|
91
122
|
Azure Pipelines users can install the public
|
|
92
123
|
[DiffPal Review extension](https://marketplace.visualstudio.com/items?itemName=diffpal.diffpal)
|
|
93
124
|
from the Azure DevOps Marketplace and add the `DiffPalReview@1` task to PR
|
|
94
|
-
validation pipelines.
|
|
125
|
+
validation pipelines. Extension source and release automation live in the
|
|
126
|
+
separate [diffpal-azure-devops](https://github.com/diffpal/azure-devops)
|
|
127
|
+
repository.
|
|
95
128
|
|
|
96
129
|
The task installs `@diffpal/diffpal` by default, then runs `diffpal review ado`.
|
|
97
130
|
You still need a committed DiffPal config, a provider credential such as
|
|
@@ -99,7 +132,8 @@ You still need a committed DiffPal config, a provider credential such as
|
|
|
99
132
|
checkout. See the [Azure Pipelines setup guide](docs/ci-examples.md#azure-pipelines)
|
|
100
133
|
for copy-paste examples.
|
|
101
134
|
|
|
102
|
-
GitHub Actions can use the
|
|
135
|
+
GitHub Actions users can use the
|
|
136
|
+
[DiffPal Review action](https://github.com/marketplace/actions/diffpal-review):
|
|
103
137
|
|
|
104
138
|
```yaml
|
|
105
139
|
name: diffpal
|
|
@@ -134,9 +168,8 @@ jobs:
|
|
|
134
168
|
env:
|
|
135
169
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
136
170
|
|
|
137
|
-
- uses: diffpal/
|
|
171
|
+
- uses: diffpal/action@v1
|
|
138
172
|
with:
|
|
139
|
-
diffpal-version: 0.1.7
|
|
140
173
|
base: ${{ github.event.pull_request.base.sha }}
|
|
141
174
|
head: ${{ github.event.pull_request.head.sha }}
|
|
142
175
|
profile: ci
|
|
@@ -146,6 +179,8 @@ jobs:
|
|
|
146
179
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
147
180
|
```
|
|
148
181
|
|
|
182
|
+
If you prefer copying files manually, use
|
|
183
|
+
[`examples/configs/codex-api-key/config.yaml`](examples/configs/codex-api-key/config.yaml).
|
|
149
184
|
For full copy-paste files and host-specific notes, read
|
|
150
185
|
[`docs/ci-examples.md`](docs/ci-examples.md).
|
|
151
186
|
|
|
@@ -170,6 +205,10 @@ diffpal:
|
|
|
170
205
|
block_on: high
|
|
171
206
|
review:
|
|
172
207
|
language: en
|
|
208
|
+
prompt_profile: v2
|
|
209
|
+
strict_evidence: true
|
|
210
|
+
strict_injection: true
|
|
211
|
+
allow_nearby_context: true
|
|
173
212
|
instructions: |
|
|
174
213
|
Prefer actionable findings that are directly supported by the diff.
|
|
175
214
|
checks:
|
|
@@ -187,6 +226,11 @@ profiles:
|
|
|
187
226
|
diffpal:
|
|
188
227
|
gate:
|
|
189
228
|
block_on: high
|
|
229
|
+
review:
|
|
230
|
+
prompt_profile: v2
|
|
231
|
+
strict_evidence: true
|
|
232
|
+
strict_injection: true
|
|
233
|
+
allow_nearby_context: true
|
|
190
234
|
```
|
|
191
235
|
|
|
192
236
|
Review checks are intentionally simple. They ask the agent what to focus on;
|
|
@@ -199,15 +243,24 @@ DiffPal does not hardcode individual signal slugs:
|
|
|
199
243
|
| `performance` | performance |
|
|
200
244
|
| `best-practices` | maintainability, testing, style |
|
|
201
245
|
|
|
246
|
+
Severity is impact-based across all categories. The full critical/high/medium/low
|
|
247
|
+
matrix is in the [config reference](docs/config-reference.md#severity-matrix).
|
|
248
|
+
|
|
202
249
|
Use `diffpal.review.instructions`, the `instructions` action input, or
|
|
203
250
|
`--instructions-file` for repository-specific review guidance.
|
|
204
251
|
|
|
205
|
-
|
|
252
|
+
The review rollout fields are safe to canary per profile. Keep the repository
|
|
253
|
+
default conservative if needed, then set `profiles.ci.diffpal.review` to
|
|
254
|
+
`prompt_profile: v2`, `strict_evidence: true`, `strict_injection: true`, and
|
|
255
|
+
`allow_nearby_context: true` before making the gate blocking.
|
|
206
256
|
|
|
207
|
-
|
|
208
|
-
`diffpal.provider`, which points at a provider under `runtime.providers`.
|
|
257
|
+
## Provider Recipes and Runtime Types
|
|
209
258
|
|
|
210
|
-
|
|
259
|
+
DiffPal delegates review to `diffpal.provider`, which points at a provider
|
|
260
|
+
under `runtime.providers`.
|
|
261
|
+
|
|
262
|
+
Ready-made config recipes. These are the same names accepted by
|
|
263
|
+
`diffpal init --wizard --setup ...`:
|
|
211
264
|
|
|
212
265
|
| Setup | Config | Secret |
|
|
213
266
|
| --- | --- | --- |
|
|
@@ -246,8 +299,14 @@ authenticated:
|
|
|
246
299
|
| `pool` | Ordered provider failover |
|
|
247
300
|
|
|
248
301
|
Hosted providers receive DiffPal's read-only review tools during each review:
|
|
249
|
-
`list_files`, `read_file`, and
|
|
250
|
-
not provider config. ACP
|
|
302
|
+
`git_changed_files`, `git_diff`, `list_files`, `read_file`, and
|
|
303
|
+
`search_files`. These are request-level tools, not provider config. ACP
|
|
304
|
+
providers keep their own tool surface.
|
|
305
|
+
|
|
306
|
+
For hosted providers, DiffPal records review tool usage in the findings bundle
|
|
307
|
+
and rejects a result when the provider did not inspect the diff with `git_diff`.
|
|
308
|
+
ACP providers use their native Git and filesystem tools, so DiffPal records that
|
|
309
|
+
runtime inspection proof is not available for that provider class.
|
|
251
310
|
|
|
252
311
|
## MCP Servers
|
|
253
312
|
|
|
@@ -319,6 +378,16 @@ diffpal doctor --mode github
|
|
|
319
378
|
diffpal review local --base origin/main --head HEAD --profile ci
|
|
320
379
|
```
|
|
321
380
|
|
|
381
|
+
To inspect the prompt contract without calling any provider:
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
diffpal debug prompt --base origin/main --head HEAD --profile ci --format text
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
The debug command renders the system prompt, the review task snapshot, and a
|
|
388
|
+
schema-valid mock findings bundle through the normal review validation path.
|
|
389
|
+
It does not require API keys.
|
|
390
|
+
|
|
322
391
|
## Documentation
|
|
323
392
|
|
|
324
393
|
- [Quickstart](docs/quickstart.md)
|
package/package.json
CHANGED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"license": "SEE LICENSE IN LICENSE",
|
|
15
15
|
"name": "@diffpal/diffpal",
|
|
16
16
|
"optionalDependencies": {
|
|
17
|
-
"@diffpal/diffpal-darwin-arm64": "0.1.
|
|
18
|
-
"@diffpal/diffpal-darwin-x64": "0.1.
|
|
19
|
-
"@diffpal/diffpal-linux-arm64": "0.1.
|
|
20
|
-
"@diffpal/diffpal-linux-x64": "0.1.
|
|
21
|
-
"@diffpal/diffpal-win32-x64": "0.1.
|
|
17
|
+
"@diffpal/diffpal-darwin-arm64": "0.1.20",
|
|
18
|
+
"@diffpal/diffpal-darwin-x64": "0.1.20",
|
|
19
|
+
"@diffpal/diffpal-linux-arm64": "0.1.20",
|
|
20
|
+
"@diffpal/diffpal-linux-x64": "0.1.20",
|
|
21
|
+
"@diffpal/diffpal-win32-x64": "0.1.20"
|
|
22
22
|
},
|
|
23
|
-
"version": "0.1.
|
|
23
|
+
"version": "0.1.20"
|
|
24
24
|
}
|