opencode-azure-devops-pr-review 0.3.6 → 0.4.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.
- package/CHANGELOG.md +104 -0
- package/README.md +146 -65
- package/package.json +1 -1
- package/src/attribution.mjs +48 -11
- package/src/comments.mjs +26 -0
- package/src/config.mjs +57 -19
- package/src/output.mjs +64 -5
- package/src/prompts/common.md +27 -12
- package/src/prompts/final.md +12 -8
- package/src/prompts/rating.md +22 -0
- package/src/review-tools.mjs +6 -1
- package/src/review-work.mjs +77 -4
- package/src/runtime.mjs +174 -32
- package/src/search.mjs +3 -2
- package/src/setup.mjs +2 -1
- package/src/store.mjs +27 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,109 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0 — 2026-11-14
|
|
4
|
+
|
|
5
|
+
Two defaults change. They apply where a settings file does not name the
|
|
6
|
+
setting, as in the file `/pr-setup` writes; a file that names it, as one
|
|
7
|
+
installed with `install.sh` does, keeps its values.
|
|
8
|
+
|
|
9
|
+
- A comment preview now follows every COMPLETE review: `afterReview` is
|
|
10
|
+
`preview` for each mode (it was `none`). The preview is planned with a model
|
|
11
|
+
and posts nothing. Add `--no-comment` after the PR URL for a review without
|
|
12
|
+
one, or set `afterReview` to `none`. Publication is still never a default.
|
|
13
|
+
- `workflow.parallelSessions` is 8 (was 4) and `azure.concurrency` is 6 (was
|
|
14
|
+
3). They matter for a PR of more than one shard. Lower `parallelSessions`
|
|
15
|
+
when your provider limits the request rate, or with OpenCode's claude-agent
|
|
16
|
+
provider on a machine with little memory.
|
|
17
|
+
|
|
18
|
+
Commands:
|
|
19
|
+
|
|
20
|
+
- No `/pr-comment` command needs a review ID any more: `--exclude`,
|
|
21
|
+
`--severity` and `--reset` act on the conversation's current review, as
|
|
22
|
+
`--publish` and `--show` already did. The current review is the one that was
|
|
23
|
+
completed or used there last, so naming a review by its ID once makes it the
|
|
24
|
+
current one; in one of a review's own sessions it is that review.
|
|
25
|
+
- The start notice and the receipt of every comment run name the review and
|
|
26
|
+
its PR, for example `Acted on review 1a2b3c4d (/pr-review) of PR #123 in
|
|
27
|
+
project/repository`.
|
|
28
|
+
- A preview's receipt ends with the commands for the next step, without the
|
|
29
|
+
review ID and with that review's finding IDs. Each adjustment list replaces
|
|
30
|
+
the saved one, so an example keeps the adjustments already saved.
|
|
31
|
+
- New `/pr-comment --list`: the reviews saved for the conversation, with their
|
|
32
|
+
IDs, PRs and state. No model or Azure DevOps request.
|
|
33
|
+
- Every command answers `--help` (or `-h`) with its usage and examples,
|
|
34
|
+
without a model or Azure DevOps request.
|
|
35
|
+
- Command descriptions start with what the command is for and point to
|
|
36
|
+
`--help`: OpenCode's command list shows one line of a description and cuts
|
|
37
|
+
what does not fit.
|
|
38
|
+
- A review's receipt lists the comment commands without the ID first and keeps
|
|
39
|
+
the ID form for acting on that review later.
|
|
40
|
+
|
|
41
|
+
Reports:
|
|
42
|
+
|
|
43
|
+
- A review that ran without content search says so. When the repository
|
|
44
|
+
archive is larger than `azure.archiveMegabytes` allows, or is one AZPR cannot
|
|
45
|
+
read (ZIP64, encrypted, damaged), `azpr_search_code` answers that search is
|
|
46
|
+
unavailable; until now only the models saw that. The report's limitations
|
|
47
|
+
and the receipt (`Content search notice`) state that sessions could find and
|
|
48
|
+
read files but not search their contents, and name the setting's value where
|
|
49
|
+
a larger one would help. The debug record's `result.json` lists the reasons
|
|
50
|
+
under `searchUnavailable`.
|
|
51
|
+
- A verifier that confirms a finding whose suggestion is only a placeholder
|
|
52
|
+
("N/A", "No correction needed.") is asked in the same session to state the
|
|
53
|
+
correction or to reject the finding. Left as it is after the correction
|
|
54
|
+
turns, the finding is NEEDS_INFO: it stays in the report and gets no comment.
|
|
55
|
+
|
|
56
|
+
Documentation:
|
|
57
|
+
|
|
58
|
+
- The README's examples show several finding IDs in one list
|
|
59
|
+
(`--exclude F-1,R-2`), and the `afterReview` row of the settings table has
|
|
60
|
+
one value per line.
|
|
61
|
+
- The roadmap no longer lists three changes as planned that the work on 0.3.7
|
|
62
|
+
examined and dropped, and says why. The README states what a smaller model
|
|
63
|
+
in `models.review` costs in issues found.
|
|
64
|
+
- The instructions for reviewers and verifiers are unchanged, and an
|
|
65
|
+
installation has the same set of files as 0.3.7. See
|
|
66
|
+
[validation](docs/VALIDATION.md#040-release-candidate-acceptance-2026-11-14).
|
|
67
|
+
|
|
68
|
+
## 0.3.7 — 2026-11-12
|
|
69
|
+
|
|
70
|
+
- A change that breaks something that worked before is at least medium: an
|
|
71
|
+
input, configuration or call that the base commit handled and that now fails
|
|
72
|
+
or gives a wrong result, however rarely it is used. Documented steps that
|
|
73
|
+
worked before the change and fail after it count as such a regression, even
|
|
74
|
+
though the failure shows at once, and a question about intent is medium
|
|
75
|
+
instead of low when the behavior stops something that worked. An easy fix
|
|
76
|
+
and an effect the reviewer could not confirm are no longer reasons for a
|
|
77
|
+
lower severity.
|
|
78
|
+
- The verifier no longer sees the reviewer's severity: candidates reach it
|
|
79
|
+
without one, and it sets each finding's level from what it verified.
|
|
80
|
+
- New optional setting `models.review.rater` / `models.deep.rater`: a model
|
|
81
|
+
for a **severity rating**. After verification, a session without tools reads
|
|
82
|
+
the confirmed findings as they will be reported, 25 at a time, and sets each
|
|
83
|
+
one's final severity; a finding it does not rate keeps the verifier's. Left
|
|
84
|
+
out or empty, no rating runs and the verifier's severity is final. It is
|
|
85
|
+
meant for a rater stronger than the reviewers' model.
|
|
86
|
+
- A finding states one defect. A second defect a reviewer notices on the way
|
|
87
|
+
becomes its own finding instead of a clause in another one's evidence, and a
|
|
88
|
+
merge in verification no longer drops a defect that only the merged finding
|
|
89
|
+
named.
|
|
90
|
+
- Before asking whether the author meant a behavior, a reviewer looks for a
|
|
91
|
+
statement of that intent in the tests, the comments and documents beside the
|
|
92
|
+
code, the PR description and the commit messages.
|
|
93
|
+
- Before answering, a reviewer makes the read that would settle a suspicion.
|
|
94
|
+
- NEEDS_INFO is for behavior the verifier could not establish. A verified
|
|
95
|
+
behavior that only the author, or a specification outside the repository, can
|
|
96
|
+
call intended is confirmed as a question to the author instead.
|
|
97
|
+
- The reviewer rules above apply in every review mode. `/pr-quick` keeps its
|
|
98
|
+
flow: no verifier, no rating, and the reviewer's severity.
|
|
99
|
+
- A source installation copies one more file, `src/prompts/rating.md` (32
|
|
100
|
+
files). Upgrading with `install.sh --replace` adds the empty `rater` settings
|
|
101
|
+
and changes nothing else in `settings.json`.
|
|
102
|
+
- The changes were run with `/pr-deep` and `/pr-review` on the ReviewBench test
|
|
103
|
+
set before release, and ReviewBench's judging pipeline scored the Claude
|
|
104
|
+
Opus 5.5 run; see
|
|
105
|
+
[validation](docs/VALIDATION.md#severity-from-verified-harm-2026-11-11-and-12).
|
|
106
|
+
|
|
3
107
|
## 0.3.6 — 2026-11-10
|
|
4
108
|
|
|
5
109
|
- Reviewers file a correctness or security defect on lines the PR adds or
|
package/README.md
CHANGED
|
@@ -52,46 +52,57 @@ is an actual capture excerpt with identifying UI removed and its text unchanged.
|
|
|
52
52
|
[company networks](docs/ENTERPRISE.md#company-networks) first):
|
|
53
53
|
|
|
54
54
|
```sh
|
|
55
|
-
opencode plugin add opencode-azure-devops-pr-review@0.
|
|
55
|
+
opencode plugin add opencode-azure-devops-pr-review@0.4.0
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
2. Follow the [quickstart](docs/QUICKSTART.md) to save your PAT in a private
|
|
59
59
|
file and run `/pr-setup` with your organization and one model. Restart the
|
|
60
60
|
OpenCode service (`opencode service restart`) to load the settings.
|
|
61
|
-
3. In one OpenCode conversation, check access, then review
|
|
61
|
+
3. In one OpenCode conversation, check access, then review:
|
|
62
62
|
|
|
63
63
|
```text
|
|
64
64
|
/pr-check https://dev.azure.com/YOUR_ORG/YOUR_PROJECT/_git/YOUR_REPO/pullrequest/123
|
|
65
|
-
/pr-review https://dev.azure.com/YOUR_ORG/YOUR_PROJECT/_git/YOUR_REPO/pullrequest/123
|
|
65
|
+
/pr-review https://dev.azure.com/YOUR_ORG/YOUR_PROJECT/_git/YOUR_REPO/pullrequest/123
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
Replace the sample URL with your PR. Wait for `/pr-check` to report `READY`
|
|
69
69
|
before starting the review; it uses no model. The review runs functional and risk
|
|
70
70
|
reviewers, then separate verification. If the completed review has findings to
|
|
71
|
-
comment on,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
comment on, a **comment preview** follows in a separate, cancellable run and
|
|
72
|
+
shows the comments as they would be posted. **Nothing is posted by these
|
|
73
|
+
commands** unless you set `afterReview` to `publish`. Previewing comments also
|
|
74
|
+
uses a model; add `--no-comment` after the URL for a review without a preview.
|
|
75
|
+
For a lighter first pass, use `/pr-quick <PR URL>`; its findings are not
|
|
76
|
+
independently verified. Every command answers `--help` with its options,
|
|
77
|
+
without a model.
|
|
75
78
|
|
|
76
79
|
<details>
|
|
77
80
|
<summary>Optional: adjust findings and publish after reading the preview</summary>
|
|
78
81
|
|
|
79
|
-
Read the
|
|
80
|
-
|
|
82
|
+
Read the preview; it ends with the commands for the next step. Before
|
|
83
|
+
publishing, you can leave findings out or change their severity, using the
|
|
84
|
+
finding IDs the preview and the report show:
|
|
81
85
|
|
|
82
86
|
```text
|
|
83
|
-
/pr-comment
|
|
87
|
+
/pr-comment --exclude F-1,R-2 leave two findings out
|
|
88
|
+
/pr-comment --severity F-3=low,R-4=medium change two severities
|
|
89
|
+
/pr-comment --exclude F-1,R-2 --severity F-3=low both in one command
|
|
84
90
|
```
|
|
85
91
|
|
|
86
|
-
F-1
|
|
87
|
-
|
|
88
|
-
whole new preview, then publish from the
|
|
92
|
+
With the last line, F-1 and R-2 are excluded from the new preview and F-3
|
|
93
|
+
appears as low in the summary, with no inline comment. Adjusting runs comment
|
|
94
|
+
planning again with a model. Read the whole new preview, then publish from the
|
|
95
|
+
same conversation:
|
|
89
96
|
|
|
90
97
|
```text
|
|
91
|
-
/pr-comment
|
|
98
|
+
/pr-comment --publish
|
|
92
99
|
```
|
|
93
100
|
|
|
94
|
-
|
|
101
|
+
None of these commands needs a review ID: they act on the conversation's
|
|
102
|
+
current review, the one completed or used there last, and each receipt names
|
|
103
|
+
that review and its PR. To act on an older review, put its ID first
|
|
104
|
+
(`/pr-comment 1a2b3c4d --publish`); `/pr-comment --list` shows the saved
|
|
105
|
+
reviews. The command posts the saved
|
|
95
106
|
preview as the PAT owner and skips matching comments AZPR already posted. It
|
|
96
107
|
never edits them; for an adjusted review, the receipt identifies those whose
|
|
97
108
|
text differs from the new preview. See
|
|
@@ -184,6 +195,12 @@ and reasoning effort** on the same 50 PRs:
|
|
|
184
195
|
- **Why not higher or lower?** `high` scored about the same at a higher cost,
|
|
185
196
|
`xhigh` added more marginal findings, and `low` missed more issues, including
|
|
186
197
|
High-severity ones.
|
|
198
|
+
- **`/pr-review` depends on its models in the same way.** In that comparison
|
|
199
|
+
`/pr-review` with GPT-6 Luna at its default effort posted 91 comments and
|
|
200
|
+
matched 27.8% of the expected issues; the recommended deep setup posted 323
|
|
201
|
+
and matched 65.2% (one run each, scored by our local judge). A smaller model
|
|
202
|
+
in `models.review` trades issues found for cost and time, so run `/pr-deep`,
|
|
203
|
+
or set stronger review models, where a missed defect costs more.
|
|
187
204
|
|
|
188
205
|
The full method, the comparison of all 12 combinations and the limits are in
|
|
189
206
|
the [validation record](docs/VALIDATION.md#martian-code-review-bench-2026-11-05-and-06).
|
|
@@ -206,17 +223,28 @@ ourselves, so this is not a leaderboard result.
|
|
|
206
223
|
| :--- | ---: | ---: | ---: | ---: |
|
|
207
224
|
| 0.3.5 | 35.5% | 95.6% | 55.3% | 70.0 |
|
|
208
225
|
| 0.3.6 | 39.5% | 96.5% | 55.3% | 65.5 |
|
|
226
|
+
| 0.3.7 | 37.5% | 97.4% | 54.7% | 83.0 |
|
|
209
227
|
|
|
210
|
-
|
|
211
|
-
for in advance. The last one is agreement with the judge on
|
|
212
|
-
deserve an inline comment; it fell because more findings the
|
|
213
|
-
medium or high were labeled low, 8 of them questions about intent,
|
|
214
|
-
|
|
228
|
+
For 0.3.6, none of the four measures fell by more than the run-to-run
|
|
229
|
+
variation allowed for in advance. The last one is agreement with the judge on
|
|
230
|
+
which findings deserve an inline comment; it fell because more findings the
|
|
231
|
+
judge rated medium or high were labeled low, 8 of them questions about intent,
|
|
232
|
+
which that release's rule rates low. Our local judge scored these runs and a pair with GPT-6.1
|
|
215
233
|
Sol. With Sol all four measures rose slightly; with Claude Opus 5.5 it rated
|
|
216
234
|
2.4 points fewer of 0.3.6's findings valid, more than allowed. The criteria,
|
|
217
235
|
both judges' results and the limits are in the
|
|
218
236
|
[validation record](docs/VALIDATION.md#defects-in-moved-code-and-unknown-intent-2026-11-09).
|
|
219
237
|
|
|
238
|
+
0.3.7 changes how severity is set for that reason: a change that breaks what
|
|
239
|
+
worked before is at least medium, and the verifier sets each level without
|
|
240
|
+
seeing the reviewer's label. It reviewed the same pull requests once, with the
|
|
241
|
+
same setup, and was scored the same way. Agreement on inline comments rose
|
|
242
|
+
from 65.5 to 83.0: 27% of the findings the judge rated medium or high were
|
|
243
|
+
labeled low, against 51% for 0.3.6. Recall fell by 2.0 points and the high and
|
|
244
|
+
medium issues found by 0.6, both within the variation allowed for 0.3.6. The
|
|
245
|
+
runs and their limits are under
|
|
246
|
+
[severity from verified harm](docs/VALIDATION.md#severity-from-verified-harm-2026-11-11-and-12).
|
|
247
|
+
|
|
220
248
|
## Watch the workflow
|
|
221
249
|
|
|
222
250
|
[](docs/DEMO.md#adjust-findings-before-publishing)
|
|
@@ -243,8 +271,9 @@ and cost, not a proven accuracy improvement. See [model configuration](#configur
|
|
|
243
271
|
|
|
244
272
|
For a small PR that fits in one shard and one comment-planning page, quick
|
|
245
273
|
usually needs one review session plus one planning session; review needs two
|
|
246
|
-
reviewer sessions, a verifier
|
|
247
|
-
|
|
274
|
+
reviewer sessions, a verifier and comment planning, plus a short severity
|
|
275
|
+
rating when `models.review.rater` is set.
|
|
276
|
+
**Sessions are not API requests:** each can make multiple requests, and repairs, retries, larger PRs
|
|
248
277
|
and extra planning pages add work. Previewing comments also uses a model.
|
|
249
278
|
See [measured runs and their limits](docs/VALIDATION.md) for cost and timing
|
|
250
279
|
examples, rather than treating a session count as a price guarantee.
|
|
@@ -317,13 +346,19 @@ for both quick and verified reviews.
|
|
|
317
346
|
verifier moved one there, or the file had more findings than one verifier
|
|
318
347
|
holds), a short **duplicate check** with the verifier model merges only true
|
|
319
348
|
duplicates; it never drops a finding.
|
|
320
|
-
4. The
|
|
349
|
+
4. The verifier's severity is final unless `models.<mode>.rater` names a
|
|
350
|
+
model. Then a **severity rating** session without tools reads the confirmed
|
|
351
|
+
findings as they will be reported and sets each one's final severity. It
|
|
352
|
+
sees neither the reviewer's nor the verifier's level, and a finding it does
|
|
353
|
+
not rate keeps the verifier's severity.
|
|
354
|
+
5. The runtime rechecks the PR versions. Only a changed **source** commit makes
|
|
321
355
|
the review STALE; a moved base is reported as a warning.
|
|
322
|
-
|
|
356
|
+
6. `/pr-comment` plans a preview with a model. With `--publish`, the runtime
|
|
323
357
|
posts the saved text itself, skipping comments that already exist and
|
|
324
358
|
reading every created comment back from Azure DevOps. Re-running a publish
|
|
325
|
-
is safe.
|
|
326
|
-
a
|
|
359
|
+
is safe. A COMPLETE review is followed by a preview unless `afterReview` or
|
|
360
|
+
a flag after the PR URL says otherwise
|
|
361
|
+
([automatic comments](#automatic-comments)).
|
|
327
362
|
|
|
328
363
|
`/pr-quick` is the lighter alternative for small or routine PRs: one reviewer
|
|
329
364
|
per shard covers both the functional and the risk focus and checks its own
|
|
@@ -331,7 +366,8 @@ findings against the source it read; no verifier or duplicate check runs. The
|
|
|
331
366
|
runtime checks only the form and source of those findings, so they are
|
|
332
367
|
reported, not verified, and the report, the receipt and the posted comments
|
|
333
368
|
say so. A small PR needs one review session (plus one planning session for
|
|
334
|
-
comments) instead of three
|
|
369
|
+
comments) instead of three, or four with a rating model; each session still
|
|
370
|
+
makes several model requests.
|
|
335
371
|
|
|
336
372
|
`/pr-deep` is the heavier alternative for PRs that justify a stronger model: it
|
|
337
373
|
runs the same review as `/pr-review` with the models of `models.deep`, so its
|
|
@@ -364,14 +400,14 @@ Azure DevOps REST API with the runtime's built-in `fetch`.
|
|
|
364
400
|
Install the npm package with OpenCode's plugin manager:
|
|
365
401
|
|
|
366
402
|
```sh
|
|
367
|
-
opencode plugin add opencode-azure-devops-pr-review@0.
|
|
403
|
+
opencode plugin add opencode-azure-devops-pr-review@0.4.0
|
|
368
404
|
```
|
|
369
405
|
|
|
370
406
|
The same release is also a versioned Git package, which needs Git but not the
|
|
371
407
|
npm registry:
|
|
372
408
|
|
|
373
409
|
```sh
|
|
374
|
-
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.
|
|
410
|
+
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.4.0'
|
|
375
411
|
```
|
|
376
412
|
|
|
377
413
|
Add only one of them. OpenCode 2.2.4 loads the plugin into a running OpenCode
|
|
@@ -385,7 +421,7 @@ To select another configuration file, use an absolute path in the host config:
|
|
|
385
421
|
```json
|
|
386
422
|
{
|
|
387
423
|
"plugins": [{
|
|
388
|
-
"package": "opencode-azure-devops-pr-review@0.
|
|
424
|
+
"package": "opencode-azure-devops-pr-review@0.4.0",
|
|
389
425
|
"options": { "settingsFile": "/absolute/path/to/azpr/settings.json" }
|
|
390
426
|
}]
|
|
391
427
|
}
|
|
@@ -410,7 +446,7 @@ For an entry that `opencode plugin add` created, add the new version and,
|
|
|
410
446
|
only when that succeeds, remove the previous one:
|
|
411
447
|
|
|
412
448
|
```sh
|
|
413
|
-
opencode plugin add opencode-azure-devops-pr-review@0.
|
|
449
|
+
opencode plugin add opencode-azure-devops-pr-review@0.4.0 &&
|
|
414
450
|
opencode plugin remove opencode-azure-devops-pr-review@PREVIOUS_VERSION
|
|
415
451
|
```
|
|
416
452
|
|
|
@@ -433,9 +469,10 @@ configuration needs no new `/pr-setup`. `opencode plugin list` should then
|
|
|
433
469
|
show a single `azpr` row with the new version (from 0.3.1, `/pr-check` names
|
|
434
470
|
it too); if it still shows the previous one, run `opencode service restart`.
|
|
435
471
|
Exact versions stay pinned, so `opencode plugin update` leaves them unchanged.
|
|
436
|
-
See the [0.
|
|
437
|
-
[0.2.0 release notes](docs/releases/v0.2.0.md) for automatic comments
|
|
438
|
-
|
|
472
|
+
See the [0.4.0 release notes](docs/releases/v0.4.0.md) for what changed and the
|
|
473
|
+
[0.2.0 release notes](docs/releases/v0.2.0.md) for automatic comments. A
|
|
474
|
+
preview follows each COMPLETE review unless `afterReview` says otherwise;
|
|
475
|
+
automatic publication stays off unless you configure it or request it with a
|
|
439
476
|
review command flag.
|
|
440
477
|
|
|
441
478
|
### Source archive or checkout
|
|
@@ -443,8 +480,8 @@ review command flag.
|
|
|
443
480
|
<details>
|
|
444
481
|
<summary>Source installation and replacement</summary>
|
|
445
482
|
|
|
446
|
-
Download the [v0.
|
|
447
|
-
and extract it, or check out tag `v0.
|
|
483
|
+
Download the [v0.4.0 source archive](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/archive/refs/tags/v0.4.0.tar.gz)
|
|
484
|
+
and extract it, or check out tag `v0.4.0`. The installer needs POSIX `sh` and
|
|
448
485
|
Python 3's standard library. From that source directory:
|
|
449
486
|
|
|
450
487
|
```sh
|
|
@@ -470,7 +507,7 @@ sh install.sh --config-dir /absolute/path/to/v2-opencode-config --replace
|
|
|
470
507
|
### Manual copying without Git
|
|
471
508
|
|
|
472
509
|
Keep these relative paths under one source directory, then run its installer.
|
|
473
|
-
These **
|
|
510
|
+
These **32 files** include the runtime and its license:
|
|
474
511
|
|
|
475
512
|
<details>
|
|
476
513
|
<summary>Show the required files</summary>
|
|
@@ -504,6 +541,7 @@ src/prompts/functional.md
|
|
|
504
541
|
src/prompts/risk.md
|
|
505
542
|
src/prompts/final.md
|
|
506
543
|
src/prompts/dedupe.md
|
|
544
|
+
src/prompts/rating.md
|
|
507
545
|
src/prompts/quick.md
|
|
508
546
|
src/prompts/comment-policy.md
|
|
509
547
|
src/prompts/comment-plan.md
|
|
@@ -568,12 +606,16 @@ include a measured choice for `models.deep`. Likewise `/pr-quick` needs `models.
|
|
|
568
606
|
and a command checks only the models it uses, so an unavailable quick model
|
|
569
607
|
never blocks `/pr-review`. Comment planning uses the review's risk model
|
|
570
608
|
(`models.deep.risk` for a deep review, the quick reviewer for a quick review).
|
|
609
|
+
`models.review` and `models.deep` also take an optional `rater`: a model that
|
|
610
|
+
turns on the severity rating. Left out or empty, no rating runs and the
|
|
611
|
+
verifier's severity is final.
|
|
571
612
|
|
|
572
613
|
| Role | Focus and useful model capabilities |
|
|
573
614
|
| --- | --- |
|
|
574
615
|
| `functional` | Requirements, boundaries, state changes, API compatibility and regressions. Strong code comprehension in the project's language. |
|
|
575
616
|
| `risk` | Failures, retries, concurrency, authorization and data consistency. Evidence-based reasoning across call paths and reliable tool use. Also plans comments. |
|
|
576
|
-
| `verifier` | Independent source re-checks, counterevidence,
|
|
617
|
+
| `verifier` | Independent source re-checks, counterevidence, a first severity, duplicate merging (including the same-file duplicate check) and the final report. Strong evidence judgment and instruction following. |
|
|
618
|
+
| `rater` (optional) | Turns on the severity rating: the final severity of each confirmed finding, judged from the finding's text alone in a session without tools. Empty (the default): no rating, the verifier's severity is final. Set it to a model stronger than the reviewers': the step reads only the findings, so a stronger model costs little here, while a model rating its own review adds little. It needs no tool support. |
|
|
577
619
|
| `quick.reviewer` | `/pr-quick` only: both focuses in one session per shard, its own source checks, and comment planning for quick reviews. Strong code comprehension, evidence judgment and reliable tool use. |
|
|
578
620
|
|
|
579
621
|
A role's focus orders its attention and is not a filter: every reviewer files
|
|
@@ -586,7 +628,8 @@ reviewer's confidence, the size of the fix or the kind of issue:
|
|
|
586
628
|
what the change is for not working, or causes serious harm such as a
|
|
587
629
|
security breach, lost or exposed data, or silently wrong results.
|
|
588
630
|
- **medium** (should fix in this change): realistic use hits a failure that
|
|
589
|
-
people notice and recover from,
|
|
631
|
+
people notice and recover from, a rare trigger causes serious harm, or the
|
|
632
|
+
change breaks something that worked before, however rarely it is used.
|
|
590
633
|
- **low** (can wait): anything else, such as a recoverable failure that only a
|
|
591
634
|
rare trigger reaches, or an issue with no effect on behavior.
|
|
592
635
|
|
|
@@ -595,16 +638,27 @@ findings. Neither does the code's history: a defect on lines the PR adds or
|
|
|
595
638
|
moves is a finding even when the same code existed before (a function moved to
|
|
596
639
|
a new file), marked as carried over. Nor does a possible intention: behavior
|
|
597
640
|
that is wrong only if the author did not mean it, with nothing showing whether
|
|
598
|
-
they did, is a low finding
|
|
599
|
-
whose
|
|
600
|
-
|
|
601
|
-
|
|
641
|
+
they did, is a low finding (medium when it stops something that worked before
|
|
642
|
+
from working) whose summary asks whether the author meant it and whose
|
|
643
|
+
suggestion asks them to confirm or document the intent. Before asking, a
|
|
644
|
+
reviewer looks for a statement of that intent in the tests, the comments and
|
|
645
|
+
documents beside the code, the PR description and the commit messages.
|
|
646
|
+
An easy fix and an effect the reviewer could not confirm are not reasons for a
|
|
647
|
+
lower level. The verifier receives candidates without the reviewer's severity
|
|
648
|
+
and sets its own, which is final unless a `rater` is configured: then the
|
|
649
|
+
severity rating sets the final one from the finished finding. `/pr-quick` keeps
|
|
650
|
+
the reviewer's. Concrete gaps the change leaves are findings too, rated
|
|
602
651
|
by their effect: a changed behavior no test would catch where the project
|
|
603
652
|
already tests comparable code, a test that cannot fail, a comment or document
|
|
604
653
|
that now contradicts the code, and duplicated or dead code the change adds. A
|
|
605
654
|
missing test is low unless the test is what the change delivers, and a
|
|
606
|
-
document is rated by what following it does
|
|
607
|
-
|
|
655
|
+
document is rated by what following it does; documented steps that worked
|
|
656
|
+
before the change and fail after it are a regression (medium) even though the
|
|
657
|
+
failure shows at once. A verified behavior that only the author, or a
|
|
658
|
+
specification outside the repository, can call intended is confirmed as a
|
|
659
|
+
question, not set aside as NEEDS_INFO. A finding states one defect: a
|
|
660
|
+
second one noticed on the way is filed on its own. A mistake repeated in places
|
|
661
|
+
that each need their own fix is one finding per place. Identical copies of one file
|
|
608
662
|
count as one place when one reviewer has them; in a large PR split into shards,
|
|
609
663
|
copies that different reviewers get can each produce a finding.
|
|
610
664
|
|
|
@@ -622,19 +676,19 @@ copies that different reviewers get can each produce a finding.
|
|
|
622
676
|
| `shell` | `deny`: private reviewers cannot run shell commands (the tool is hidden). `ask`: each command needs your approval in OpenCode. `inherit`: host permissions decide. |
|
|
623
677
|
| `progressNotices` | `true`: short PROGRESS notices in the invoking conversation. |
|
|
624
678
|
| `deletePrivateSessions` | `true`: AZPR deletes its private reviewer sessions once they are no longer needed (see [retention](#retention-and-privacy)); `false` keeps every session. |
|
|
625
|
-
| `afterReview.quick` / `.review` / `.deep` |
|
|
679
|
+
| `afterReview.quick` / `.review` / `.deep` | What follows a COMPLETE review of that mode; `preview` each.<br>`preview`: plan a comment preview (a model runs; nothing is posted).<br>`none`: nothing follows; run `/pr-comment` yourself.<br>`publish`: plan the comments and post them as the PAT owner; a comment that a safeguard holds back waits for a person.<br>A flag after the PR URL (`--preview`, `--publish`, `--no-comment`) overrides it for one run. See [automatic comments](#automatic-comments). |
|
|
626
680
|
| `azure.organization` | Required. The `<org>` of `https://dev.azure.com/<org>`; PR URLs of other organizations are refused. |
|
|
627
681
|
| `azure.pat` | A personal access token for that organization with **Code (Read)** and **Pull Request Threads (Read & write)**, or `""` when `azure.patFile` is set. Sent only to `https://dev.azure.com/<org>` and never logged. |
|
|
628
682
|
| `azure.patFile` | `""`. Recommended: the absolute path of a file that holds only the PAT, so `settings.json` holds no secret. It must be a regular file you own that only you can access (mode 600, not a symbolic link). AZPR reads it at start and before each command; after replacing it, restart the OpenCode service. Set either this or `azure.pat`. |
|
|
629
|
-
| `azure.concurrency` | `
|
|
683
|
+
| `azure.concurrency` | `6` (1–8) simultaneous Azure DevOps calls across all AZPR commands. |
|
|
630
684
|
| `azure.callTimeoutSeconds` | `120`; a hung call is aborted and its slot released (reads are retried). |
|
|
631
|
-
| `azure.archiveMegabytes` | `100` (1–1024): the largest repository zip that content search downloads per run and commit; a larger repository is not searched. It is held in memory during a review. |
|
|
685
|
+
| `azure.archiveMegabytes` | `100` (1–1024): the largest repository zip that content search downloads per run and commit; a larger repository is not searched, and the review's report and receipt say so. It is held in memory during a review. |
|
|
632
686
|
| `azure.proxy` | `""`: no AZPR proxy (`HTTPS_PROXY` and `NO_PROXY` in OpenCode's environment still apply; a host in `NO_PROXY` bypasses a set proxy too). A forward proxy for AZPR's Azure DevOps calls only, such as `http://proxy.example.com:8080`; credentials go in the URL as `http://user:password@host:port` (percent-encoded) and are never shown. See [proxies](docs/AZURE_DEVOPS.md#proxies-and-tls-inspection). |
|
|
633
687
|
| `azure.caFile` | `""`. The absolute path of a PEM file with CA certificates AZPR trusts in addition to the built-in roots, for a proxy that inspects HTTPS. |
|
|
634
688
|
| `azure.verifyTls` | `true`. `false` skips certificate checks for AZPR's Azure DevOps calls (like `curl -k`), so anyone who can intercept the connection can read the PAT; prefer `azure.caFile`. `/pr-check` warns while it is off. |
|
|
635
689
|
| `workflow.shardFiles` | `25` changed files per initial-review session. |
|
|
636
690
|
| `workflow.shardFindings` | At most `15` findings per verification session; one file's findings stay in the same session (a file is split only when it alone has more). |
|
|
637
|
-
| `workflow.parallelSessions` | `
|
|
691
|
+
| `workflow.parallelSessions` | `8` (1–16) reviewer sessions at once within a command; it matters only for a PR of more than one shard. Lower it, to `4` for example, when the provider limits your request rate, or with OpenCode's claude-agent provider on a machine with little memory: each of its sessions keeps a process of about 200 MB for minutes after it ends. Comment planning runs at most two pages at once (one when this is `1`). |
|
|
638
692
|
| `workflow.repairAttempts` | `2` correction turns when an answer breaks the output contract. A quick review's one follow-up turn for unfinished work uses the same budget. |
|
|
639
693
|
| `workflow.stageRetries` | `1` new-session retry after a transient failure (provider 429/5xx, interrupted stream) or an inactivity stop. A used-up usage or spend limit (provider quota, ChatGPT or OpenCode Go usage limit, OpenCode free-model or spend limit) is named and not retried, whatever its status, and AZPR refuses OpenCode's own retries of it. |
|
|
640
694
|
| `workflow.stageIdleSeconds` | `600` (`0` turns it off, otherwise 60–7200): a reviewer stage that shows no activity this long while it waits on OpenCode (the model stream, a tool or the host stopped responding) is stopped with `failure=idle` and an error naming its last activity, then retried in a new session. Every model request, streamed chunk of output, tool start or end and announced host retry restarts the window, so a stage that keeps working, including a long answer that keeps streaming, is never cut. With shell allowed, an approval or a command that takes longer counts as inactivity. |
|
|
@@ -696,10 +750,19 @@ troubleshooting.
|
|
|
696
750
|
| `/pr-deep <PR URL> [flag] [context]` | The same review with the stronger models of `models.deep`; usually slower and costlier. |
|
|
697
751
|
| `/pr-quick <PR URL> [flag] [context]` | One reviewer per shard for both focuses, no verification; findings are reported, not verified. |
|
|
698
752
|
| `/pr-stop [run-id]` | Cancel this conversation's active command. |
|
|
699
|
-
| `/pr-comment [review-id]` | Preview comments for this conversation's
|
|
753
|
+
| `/pr-comment [review-id]` | Preview comments for this conversation's current review. |
|
|
700
754
|
| `/pr-comment [review-id] --publish` | Post the saved preview. A review that was never adjusted is planned first if needed; an adjusted one needs its new preview. Safe to repeat. |
|
|
701
755
|
| `/pr-comment [review-id] --show` | Show the saved preview again; no model or Azure DevOps request. |
|
|
702
|
-
| `/pr-comment
|
|
756
|
+
| `/pr-comment [review-id] --exclude <IDs>` / `--severity <ID=level,…>` / `--reset` | Leave findings out or change their severity after reading the preview, then preview again, for example `--exclude F-1,R-2` (see [adjusting findings](docs/COMMENTING.md#adjusting-findings-after-a-preview)). |
|
|
757
|
+
| `/pr-comment --list` | The reviews saved for this conversation, with their IDs, PRs and state; no model or Azure DevOps request. |
|
|
758
|
+
| `/<command> --help` | The command's usage and examples; no model or Azure DevOps request. |
|
|
759
|
+
|
|
760
|
+
A `/pr-comment` command without a review ID acts on the conversation's
|
|
761
|
+
**current review**: the one completed or used there last (in one of a review's
|
|
762
|
+
own sessions, that review). Its STARTED notice and receipt name the review and
|
|
763
|
+
its PR, and a preview ends with the commands for the next step. OpenCode's
|
|
764
|
+
command list shows one line per command and cuts what does not fit, so the
|
|
765
|
+
options are in `--help`.
|
|
703
766
|
|
|
704
767
|
Supported PR URLs are `https://dev.azure.com/<org>/<project>/_git/<repo>/pullrequest/<id>`
|
|
705
768
|
and `https://<org>.visualstudio.com/[DefaultCollection/]<project>/_git/<repo>/pullrequest/<id>`.
|
|
@@ -761,13 +824,22 @@ them into one comment under fixed rules (see [commenting](docs/COMMENTING.md)).
|
|
|
761
824
|
|
|
762
825
|
### Adjusting findings after a preview
|
|
763
826
|
|
|
764
|
-
When a preview contains
|
|
765
|
-
|
|
827
|
+
When a preview contains findings you disagree with, leave them out or change
|
|
828
|
+
their severity, then read the new preview. Several IDs go in one list,
|
|
829
|
+
separated by commas:
|
|
766
830
|
|
|
767
831
|
```text
|
|
768
|
-
/pr-comment
|
|
832
|
+
/pr-comment --exclude F-1,R-2 leave F-1 and R-2 out
|
|
833
|
+
/pr-comment --severity F-3=low,R-4=medium publish F-3 as low and R-4 as medium
|
|
834
|
+
/pr-comment --exclude F-1,R-2 --severity F-3=low both in one command
|
|
835
|
+
/pr-comment --exclude none put every finding back
|
|
836
|
+
/pr-comment --reset undo every adjustment
|
|
769
837
|
```
|
|
770
838
|
|
|
839
|
+
The commands act on the conversation's current review; put a review ID first
|
|
840
|
+
to adjust another one (`/pr-comment 1a2b3c4d --exclude F-1`). The finding IDs
|
|
841
|
+
are those of the report and the preview, and `f1` reads as F-1.
|
|
842
|
+
|
|
771
843
|
Changed adjustments trigger new model planning when findings remain, so
|
|
772
844
|
combine both options in one command when you use both. Repeating the saved
|
|
773
845
|
adjustments changes nothing and does not plan again. Comments are planned
|
|
@@ -777,7 +849,7 @@ adjustment. Each option replaces its whole saved list: `--exclude F-1` and then
|
|
|
777
849
|
`--exclude F-2` excludes only F-2. A changed severity changes how a finding is
|
|
778
850
|
published, not the finding itself; when a finding is wrong, exclude it.
|
|
779
851
|
Excluding every finding posts nothing. `--reset` clears the adjustments, and
|
|
780
|
-
`/pr-comment
|
|
852
|
+
`/pr-comment --show` shows the saved preview without a model. An
|
|
781
853
|
adjusted review is posted only from the preview planned after its latest
|
|
782
854
|
adjustment; once its publication has started, it is neither adjusted nor
|
|
783
855
|
planned again. Comments that an earlier publication put on the PR are never
|
|
@@ -787,24 +859,33 @@ names those whose text differs from the preview. See
|
|
|
787
859
|
|
|
788
860
|
### Automatic comments
|
|
789
861
|
|
|
790
|
-
By default
|
|
791
|
-
|
|
792
|
-
|
|
862
|
+
By default a comment preview follows a COMPLETE review: it shows the comments
|
|
863
|
+
as they would be posted and posts nothing, and you post them with
|
|
864
|
+
`/pr-comment --publish`. `afterReview` sets, per mode, what follows a COMPLETE
|
|
865
|
+
review, and a flag right after the PR URL sets it for one run:
|
|
793
866
|
|
|
794
867
|
```json
|
|
795
|
-
{ "afterReview": { "quick": "preview", "review": "
|
|
868
|
+
{ "afterReview": { "quick": "preview", "review": "preview", "deep": "none" } }
|
|
796
869
|
```
|
|
797
870
|
|
|
798
871
|
```text
|
|
872
|
+
/pr-review <PR URL> what afterReview.review says (a preview unless you changed it)
|
|
799
873
|
/pr-review <PR URL> --preview plan a preview after a COMPLETE review
|
|
800
874
|
/pr-review <PR URL> --publish plan and post the comments after a COMPLETE review
|
|
801
875
|
/pr-review <PR URL> --no-comment nothing follows this review, whatever afterReview says
|
|
802
876
|
```
|
|
803
877
|
|
|
878
|
+
Set a mode to `none` when you mostly read the report and comment rarely, for
|
|
879
|
+
example for `/pr-deep` with a costly model: the preview is planned by that
|
|
880
|
+
mode's `risk` model (the quick reviewer for a quick review), one request for
|
|
881
|
+
about four findings. A settings file
|
|
882
|
+
that names `afterReview` keeps its values on an upgrade; one that does not,
|
|
883
|
+
such as the file `/pr-setup` writes, follows this default.
|
|
884
|
+
|
|
804
885
|
The step runs after the review's receipt as a separate comment command with
|
|
805
886
|
its own run ID, `STARTED` notice and receipt; `/pr-stop` stops it like any
|
|
806
887
|
command. It is the same planning and publication as `/pr-comment`, so a
|
|
807
|
-
preview uses a model, and `/pr-comment
|
|
888
|
+
preview uses a model, and `/pr-comment --publish` later posts exactly that
|
|
808
889
|
preview. Nothing follows a review that is not COMPLETE, or that was stopped
|
|
809
890
|
while its report was delivered. A review without
|
|
810
891
|
findings to comment on gets one notice instead, with no planning, model
|
|
@@ -833,13 +914,13 @@ written. A
|
|
|
833
914
|
quick review is posted when you chose
|
|
834
915
|
it: its comments keep the disclosure `quick review, not independently
|
|
835
916
|
verified`, and its summary names incomplete coverage; its verification hint
|
|
836
|
-
is advisory (
|
|
917
|
+
is advisory (leave `afterReview.quick` at `preview` to read the comments first).
|
|
837
918
|
When every finding is already discussed on the PR, typically by AZPR's own
|
|
838
919
|
comment from an earlier run, there is nothing new to post: the receipt says
|
|
839
920
|
`NOTHING_TO_POST` and the plan is saved (the summary's marker follows the
|
|
840
921
|
inline comments, so re-reviewing an unchanged PR would otherwise add a summary
|
|
841
922
|
each time). Publication itself still rechecks that the PR is active and
|
|
842
|
-
unchanged. A command you type, such as `/pr-comment
|
|
923
|
+
unchanged. A command you type, such as `/pr-comment --publish`, posts
|
|
843
924
|
every item of the saved preview, held ones included.
|
|
844
925
|
|
|
845
926
|
### Publication
|
|
@@ -892,8 +973,8 @@ and a loopback fake Azure DevOps REST service in disposable directories under
|
|
|
892
973
|
Uninstall without `--apply` previews; `--apply` archives only this package under
|
|
893
974
|
`azpr-v2-backups` and leaves the private state directory for you to delete.
|
|
894
975
|
For a native installation, remove the entry you added, for example
|
|
895
|
-
`opencode plugin remove opencode-azure-devops-pr-review@0.
|
|
896
|
-
`opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.
|
|
976
|
+
`opencode plugin remove opencode-azure-devops-pr-review@0.4.0` or
|
|
977
|
+
`opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.4.0'`;
|
|
897
978
|
the external settings, PAT file and private review state remain available.
|
|
898
979
|
|
|
899
980
|
[Architecture](docs/ARCHITECTURE.md), [commenting](docs/COMMENTING.md),
|
|
@@ -906,7 +987,7 @@ or personal model selections.
|
|
|
906
987
|
## License and releases
|
|
907
988
|
|
|
908
989
|
[MIT](LICENSE), copyright 2026 WTLAIB. See the [changelog](CHANGELOG.md) for the
|
|
909
|
-
release scope, [v0.
|
|
990
|
+
release scope, [v0.4.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.4.0)
|
|
910
991
|
for downloads, the [npm package](https://www.npmjs.com/package/opencode-azure-devops-pr-review),
|
|
911
992
|
[v0.2.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.2.0)
|
|
912
993
|
for the recorded demonstration, and [releasing](docs/RELEASING.md) for the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-azure-devops-pr-review",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Azure DevOps PR reviews from a URL in OpenCode, with no checkout, configurable models, separate verification, and comment previews you can adjust before posting",
|
|
6
6
|
"scripts": {
|