opencode-azure-devops-pr-review 0.3.0 → 0.3.2

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 (53) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +189 -109
  3. package/package.json +2 -11
  4. package/src/attribution.mjs +2 -2
  5. package/src/azure.mjs +18 -3
  6. package/src/config.mjs +5 -0
  7. package/src/host.mjs +44 -0
  8. package/src/plugin.js +2 -1
  9. package/src/runtime.mjs +27 -5
  10. package/src/setup.mjs +49 -21
  11. package/AGENTS.md +0 -164
  12. package/CODE_OF_CONDUCT.md +0 -83
  13. package/CONTRIBUTING.md +0 -84
  14. package/SECURITY.md +0 -38
  15. package/config/settings.example.json +0 -55
  16. package/config/settings.schema.json +0 -316
  17. package/docs/ARCHITECTURE.md +0 -408
  18. package/docs/AZURE_DEVOPS.md +0 -214
  19. package/docs/COMMENTING.md +0 -399
  20. package/docs/DEBUGGING.md +0 -144
  21. package/docs/DEMO.md +0 -195
  22. package/docs/ENTERPRISE.md +0 -205
  23. package/docs/QUICKSTART.md +0 -219
  24. package/docs/RELEASING.md +0 -95
  25. package/docs/ROADMAP.md +0 -241
  26. package/docs/VALIDATION.md +0 -2066
  27. package/docs/VALIDATION_HISTORY.md +0 -1845
  28. package/docs/VERIFICATION.md +0 -42
  29. package/docs/assets/RECORDING.md +0 -131
  30. package/docs/assets/adjust-findings-teaser.gif +0 -0
  31. package/docs/assets/adjust-preview.png +0 -0
  32. package/docs/assets/adjust-publication.png +0 -0
  33. package/docs/assets/example-comments.md +0 -38
  34. package/docs/assets/generate-demo-gif.py +0 -25
  35. package/docs/assets/generate-demo.mjs +0 -141
  36. package/docs/assets/live-azure-readback.png +0 -0
  37. package/docs/assets/live-preview.png +0 -0
  38. package/docs/assets/live-review-teaser.gif +0 -0
  39. package/docs/assets/live-review.png +0 -0
  40. package/docs/assets/quick-review-demo.gif +0 -0
  41. package/docs/assets/record-terminal.py +0 -124
  42. package/docs/assets/render-terminal-demo.py +0 -168
  43. package/docs/assets/review-example.svg +0 -1
  44. package/docs/assets/walkthrough.svg +0 -1
  45. package/docs/releases/v0.1.0.md +0 -74
  46. package/docs/releases/v0.2.0.md +0 -107
  47. package/docs/releases/v0.2.1.md +0 -65
  48. package/docs/releases/v0.2.2.md +0 -76
  49. package/docs/releases/v0.2.3.md +0 -93
  50. package/docs/releases/v0.3.0.md +0 -125
  51. package/install.sh +0 -171
  52. package/scripts/merge-settings.py +0 -120
  53. package/uninstall.sh +0 -50
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.2 — 2026-10-30
4
+
5
+ - The README starts with actual Azure DevOps output: an inline comment with its
6
+ code context and, in an expandable section, the complete PR summary from the
7
+ same review. The first-review steps come before the 15-second recording, and
8
+ a documentation table points to the guide for each task. The demo records how
9
+ the screenshots were captured and edited, and lists the pictured comment
10
+ bodies as text.
11
+ - Receipts say that COMPLETE means no source-commit change was detected. A
12
+ final version recheck that fails adds a warning and leaves the review
13
+ COMPLETE; publication still rechecks the PR before posting.
14
+ - The npm package contains only the runtime, README, changelog and license:
15
+ 32 files and about 170 KB instead of 76 files and 1.35 MB. Documentation,
16
+ media, installers, the settings example and schema and the repository guides
17
+ remain in the repository and the source archive; npmjs.com shows the
18
+ README's links and images from GitHub.
19
+ - The README and architecture guide list the commands that answer without a
20
+ background run, the README and commenting guide state that repeating the
21
+ saved adjustments plans nothing, and the architecture guide counts AZPR's
22
+ six tools.
23
+
24
+ ## 0.3.1 — 2026-10-27
25
+
26
+ - Installation and upgrades are documented as they behave on OpenCode 2.1.4:
27
+ `opencode plugin add` loads the plugin into a running service without a
28
+ restart, and adding a second version leaves the first one running. The
29
+ README's new Upgrading section adds the new version and removes the
30
+ previous one only when the download succeeded. Saved settings still need a
31
+ restart, and every message that asks for one names `opencode service restart`.
32
+ - `/pr-check` names the installation that answered and warns when another
33
+ AZPR entry is configured but not running, such as a second version that
34
+ OpenCode lists as a duplicate plugin ID. User names, passwords and query
35
+ strings in package specifications are masked.
36
+ - `/pr-setup` takes the organization from a PR or organization URL and,
37
+ without `--pat-file`, uses `${XDG_CONFIG_HOME:-~/.config}/azpr/pat` (or, with
38
+ `--replace`, the PAT file already set); its receipt names both.
39
+ - The quickstart runs the terminal steps first and needs one restart. The team
40
+ guide separates package downloads, model providers and Azure DevOps on
41
+ company networks, and the Azure DevOps guide names the actual settings
42
+ locations. Two links in the validation history now point at the version
43
+ that still had their sections.
44
+
3
45
  ## 0.3.0 — 2026-10-26
4
46
 
5
47
  - Choose what reaches the PR after reading a preview:
package/README.md CHANGED
@@ -7,66 +7,52 @@
7
7
 
8
8
  **Review Azure DevOps pull requests from a URL. No checkout required.**
9
9
 
10
- Review pull requests across your configured Azure DevOps organization with your
11
- own OpenCode models, without cloning each repository. Preview the comments,
12
- leave out findings or change their severity, and publish when you are ready.
13
- No MCP server or CI pipeline setup is required.
10
+ Use your own OpenCode models to review code, inspect the proposed comments,
11
+ and choose what gets published. No MCP server or CI pipeline setup is required.
14
12
 
15
13
  AZPR is an independent community project. It is not built by or affiliated with
16
14
  the OpenCode team.
17
15
 
18
- [Get started](docs/QUICKSTART.md) · [See the demo](docs/DEMO.md) ·
19
- [Team setup and data handling](docs/ENTERPRISE.md) ·
20
- [Validation and limitations](docs/VALIDATION.md) ·
21
- [Download v0.3.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.3.0)
16
+ [Get started](#your-first-review) · [15-second recording](#watch-the-workflow) ·
17
+ [Full demo](docs/DEMO.md) · [Documentation](#documentation)
22
18
 
23
- [![Real OpenCode run on a dedicated Azure DevOps test PR: a preview with three verified findings, one finding excluded and one lowered to low, the new preview, and publication read back from Azure DevOps.](docs/assets/adjust-findings-teaser.gif)](docs/DEMO.md)
19
+ ## See the review in Azure DevOps
24
20
 
25
- *A 15-second edit of a real OpenCode 2.1.4 run: exclude one finding, lower
26
- another to low, read the new preview, then publish. Waiting time is shortened.
27
- Read the [demo and recording details](docs/DEMO.md), or watch the earlier
28
- [73-second walkthrough](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/download/v0.2.0/azpr-live-demo.mp4)
29
- of a review, preview and publication.*
21
+ Findings include a source location, evidence and a suggested fix. Preview the
22
+ planned comments in OpenCode, then publish them as inline comments and a PR
23
+ summary.
30
24
 
31
- ## Why AZPR?
25
+ [![Actual Azure DevOps inline comment on fulfillment.py: the changed line replaces a deep copy with a shallow copy; the review explains the shared-state defect, cites evidence and suggests a fix.](docs/assets/azure-inline-review.png)](docs/assets/azure-inline-review.png)
32
26
 
33
- - **You decide what gets posted.** Preview the AI's comments, exclude findings
34
- you don't want to publish, and adjust severity. AZPR prepares a new preview
35
- without rerunning the review. Read it, then publish when ready. Your original
36
- review stays intact.
37
- - **Publish safely.** AZPR rechecks the PR head, skips matching comments it
38
- already posted, and reads new comments back. Automatic publication is opt-in.
39
- - **Follow the code beyond the diff.** Reviewers can look up definitions,
40
- callers and tests using file reads and text search at the selected PR commit,
41
- without depending on an Azure Code Search index.
42
- - **Give findings a separate check.** Functional and risk reviewers propose
43
- findings; independent verifier sessions re-read the source and look for
44
- counterevidence. Quick mode skips this second check when you want a lighter
45
- pass.
46
- - **Choose where to spend model effort.** Assign different OpenCode models to
47
- functional review, risk review and verification, or use one model for all
48
- roles. Keep a stronger model profile for selected PRs with `/pr-deep`.
49
- - **Configure the Azure connection for your network.** Set a forward proxy and
50
- additional CA certificates for AZPR's Azure DevOps requests. Model-provider
51
- connections remain configured in OpenCode.
52
-
53
- Content search downloads a bounded repository archive into memory; source
54
- context is sent through your selected model providers, and review records are
55
- saved locally. See [content-search limits](docs/AZURE_DEVOPS.md#who-calls-what)
56
- for archive and file-size bounds, and [team setup and data handling](docs/ENTERPRISE.md)
57
- for proxy authentication and retention.
27
+ *Actual output on a dedicated test PR with seeded defects, from a different run
28
+ than the recording below. The image joins cropped excerpts of the diff and the
29
+ comment, with identifying UI removed; code and review text are unchanged. It
30
+ shows the output format, not review accuracy. Click the image to enlarge, or
31
+ [read the pictured comments and capture details](docs/DEMO.md#actual-azure-devops-comments).*
32
+
33
+ <details>
34
+ <summary>See the complete PR summary from the same review</summary>
35
+
36
+ [![Actual Azure DevOps PR summary: zero high, three medium and zero low findings, with a review note and a finding index pointing to fulfillment.py lines 24, 29 and 37.](docs/assets/azure-review-summary.png)](docs/assets/azure-review-summary.png)
37
+
38
+ The summary keeps the full finding index in one place. Like the image above, it
39
+ is an actual capture excerpt with identifying UI removed and its text unchanged.
40
+
41
+ </details>
58
42
 
59
43
  ## Your first review
60
44
 
61
- 1. Install the npm package using OpenCode's plugin manager:
45
+ 1. Install the npm package using OpenCode's plugin manager (already installed?
46
+ see [upgrading](#upgrading); behind a company proxy, see
47
+ [company networks](docs/ENTERPRISE.md#company-networks) first):
62
48
 
63
49
  ```sh
64
- opencode plugin add opencode-azure-devops-pr-review@0.3.0
50
+ opencode plugin add opencode-azure-devops-pr-review@0.3.2
65
51
  ```
66
52
 
67
53
  2. Follow the [quickstart](docs/QUICKSTART.md) to save your PAT in a private
68
54
  file and run `/pr-setup` with your organization and one model. Restart the
69
- OpenCode service to load the settings.
55
+ OpenCode service (`opencode service restart`) to load the settings.
70
56
  3. In one OpenCode conversation, check access, then review and preview:
71
57
 
72
58
  ```text
@@ -79,6 +65,11 @@ before starting the review; it uses no model. The review runs functional and ris
79
65
  reviewers, then separate verification. If the completed review has findings to
80
66
  comment on, `--preview` prepares their comments in a separate, cancellable run.
81
67
  **Nothing is posted by these commands.** Previewing comments also uses a model.
68
+ For a lighter first pass, use `/pr-quick <PR URL> --preview`; its findings are
69
+ not independently verified.
70
+
71
+ <details>
72
+ <summary>Optional: adjust findings and publish after reading the preview</summary>
82
73
 
83
74
  Read the report and preview. Before publishing, you can exclude a finding or
84
75
  change its severity using IDs from your report, for example:
@@ -100,8 +91,39 @@ preview as the PAT owner and skips matching comments AZPR already posted. It
100
91
  never edits them; for an adjusted review, the receipt identifies those whose
101
92
  text differs from the new preview. See
102
93
  [adjusting findings](#adjusting-findings-after-a-preview) for how repeating an
103
- option replaces its earlier list. For a lighter first pass, use
104
- `/pr-quick <PR URL> --preview`; its findings are not independently verified.
94
+ option replaces its earlier list.
95
+
96
+ </details>
97
+
98
+ ## Why AZPR?
99
+
100
+ - **Control what gets posted.** Read a preview, exclude findings or change
101
+ severity, then inspect the newly planned comments. The original review stays
102
+ intact. Publication rechecks the PR head, skips matching comments and reads
103
+ new comments back; automatic publication is opt-in.
104
+ - **Read beyond the diff.** Reviewers can follow definitions, callers and
105
+ tests at the selected PR commit, without a local checkout or an Azure Code
106
+ Search index.
107
+ - **Give findings a separate check.** Functional and risk reviewers propose
108
+ findings; verifier sessions re-read the source and look for counterevidence.
109
+ Quick mode skips that independent check for a lighter pass.
110
+ - **Use the models you already have.** Assign models per role, use one model
111
+ for all roles, or configure stronger models for selected PRs with `/pr-deep`.
112
+
113
+ For company networks, configure a proxy and additional CA certificates for
114
+ AZPR's Azure requests; model-provider connections stay in OpenCode. Content
115
+ search downloads a bounded repository archive into memory, source context goes
116
+ to your selected model providers, and review records are saved locally. See
117
+ [team setup and data handling](docs/ENTERPRISE.md) and
118
+ [content-search limits](docs/AZURE_DEVOPS.md#who-calls-what).
119
+
120
+ ## Watch the workflow
121
+
122
+ [![Real OpenCode run: exclude one finding, lower another to low, inspect the new preview, then publish and read the comments back from Azure DevOps.](docs/assets/adjust-findings-teaser.gif)](docs/DEMO.md#adjust-findings-before-publishing)
123
+
124
+ *A 15-second edit of a real OpenCode 2.1.4 session on a dedicated test PR.
125
+ Waiting time is shortened, so the length is not the review duration.
126
+ [Recording details and longer walkthrough](docs/DEMO.md).*
105
127
 
106
128
  ## Choose a review
107
129
 
@@ -160,6 +182,18 @@ same runtime. A fresh installation exposes `/pr-setup` before
160
182
  reviewing is enabled; the [quickstart](docs/QUICKSTART.md) configures one model
161
183
  for both quick and verified reviews.
162
184
 
185
+ ## Documentation
186
+
187
+ | I want to… | Start here |
188
+ | --- | --- |
189
+ | Install AZPR and run a first review | [Step-by-step quickstart](docs/QUICKSTART.md) |
190
+ | Upgrade an existing installation | [Upgrade instructions](#upgrading) |
191
+ | Choose models, language or settings | [Configuration](#configuration) |
192
+ | Adjust, preview or publish comments | [Commenting guide](docs/COMMENTING.md) |
193
+ | Set up a company proxy or understand data handling | [Team setup](docs/ENTERPRISE.md) |
194
+ | Understand what has been tested | [Validation and limitations](docs/VALIDATION.md) |
195
+ | Troubleshoot or contribute | [Debugging](docs/DEBUGGING.md) · [Contributing](CONTRIBUTING.md) |
196
+
163
197
  ## How reviews work
164
198
 
165
199
  <details>
@@ -205,9 +239,12 @@ regressions that the everyday model missed, at many times its cost and time
205
239
  (see [deep versus review](docs/VALIDATION.md#deep-versus-review-2026-10-19)).
206
240
  `/pr-check` says when `/pr-deep` is off or its models repeat the review models.
207
241
 
208
- Every command acknowledges `STARTED` immediately and continues in the current
209
- OpenCode process; short `PROGRESS` notices and a final receipt return to the
210
- invoking conversation. Use the displayed `/pr-stop <run-id>` to cancel.
242
+ Readiness checks, reviews, comment planning, adjustments and publication
243
+ acknowledge `STARTED` and continue in the current OpenCode process; short
244
+ `PROGRESS` notices and a final receipt return to the invoking conversation. Use
245
+ the displayed `/pr-stop <run-id>` to cancel. `/pr-setup` (including `--help`),
246
+ `/pr-stop`, `/pr-comment --show`, an adjustment that changes nothing and a
247
+ refused command answer directly, without a background run.
211
248
  Completed reviews, previews and publication ledgers are saved privately and
212
249
  survive an OpenCode restart.
213
250
 
@@ -226,17 +263,20 @@ Azure DevOps REST API with the runtime's built-in `fetch`.
226
263
  Install the npm package with OpenCode's plugin manager:
227
264
 
228
265
  ```sh
229
- opencode plugin add opencode-azure-devops-pr-review@0.3.0
266
+ opencode plugin add opencode-azure-devops-pr-review@0.3.2
230
267
  ```
231
268
 
232
269
  The same release is also a versioned Git package, which needs Git but not the
233
270
  npm registry:
234
271
 
235
272
  ```sh
236
- opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.0'
273
+ opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.2'
237
274
  ```
238
275
 
239
- Add only one of them. Restart OpenCode, then run `/pr-setup` for setup instructions. Native packages
276
+ Add only one of them. OpenCode 2.1.4 loads the plugin into a running OpenCode
277
+ service within a few seconds; if `/pr-setup` does not appear in a new
278
+ conversation, run `opencode service restart`. Then run `/pr-setup` for setup
279
+ instructions. Native packages
240
280
  use `${XDG_CONFIG_HOME:-~/.config}/azpr/settings.json`; configuration and the
241
281
  separate PAT file stay outside the package cache when the plugin is updated.
242
282
  To select another configuration file, use an absolute path in the host config:
@@ -244,7 +284,7 @@ To select another configuration file, use an absolute path in the host config:
244
284
  ```json
245
285
  {
246
286
  "plugins": [{
247
- "package": "opencode-azure-devops-pr-review@0.3.0",
287
+ "package": "opencode-azure-devops-pr-review@0.3.2",
248
288
  "options": { "settingsFile": "/absolute/path/to/azpr/settings.json" }
249
289
  }]
250
290
  }
@@ -256,15 +296,43 @@ copy its settings to the external configuration path with owner-only
256
296
  permissions, archive the old installation with its uninstaller, then add the
257
297
  package. Keep the PAT file and private state directory in place.
258
298
 
259
- To upgrade a native installation, change the version in its existing `plugins`
260
- entry, for example from `#v0.2.3` to `#v0.3.0` for the Git package. To move a
261
- Git installation to npm, replace that entry's Git specification with
262
- `opencode-azure-devops-pr-review@0.3.0`. Both use the same external settings.
263
- Preserve any `options.settingsFile` and other options; keep one AZPR entry.
264
- Restart the OpenCode service to load the new version. External settings, the
265
- PAT file and review records stay in place. Exact versions stay pinned, so
266
- `opencode plugin update` leaves them unchanged. See the
267
- [0.3.0 release notes](docs/releases/v0.3.0.md) for upgrade details and the
299
+ ### Upgrading
300
+
301
+ Keep one AZPR entry in the `plugins` list. **Running only `opencode plugin add`
302
+ with a new version adds a second entry**: OpenCode keeps running the version
303
+ listed first and reports the new one as `Duplicate plugin ID: azpr` (from
304
+ 0.3.1, `/pr-check` also warns about it). Upgrade when no AZPR command is
305
+ running, since
306
+ OpenCode 2.1.4 replaces the running plugin as soon as its entry changes.
307
+
308
+ For an entry that `opencode plugin add` created, add the new version and,
309
+ only when that succeeds, remove the previous one:
310
+
311
+ ```sh
312
+ opencode plugin add opencode-azure-devops-pr-review@0.3.2 &&
313
+ opencode plugin remove opencode-azure-devops-pr-review@PREVIOUS_VERSION
314
+ ```
315
+
316
+ The first command downloads the new version in your terminal, with that
317
+ terminal's proxy settings. If it fails, `&&` skips the removal and nothing
318
+ changes; do not remove the previous entry by itself after a failed download.
319
+ Once the removal runs, the running OpenCode service switches to the new
320
+ version within a few seconds, with no restart. Use the same commands with the
321
+ `github:` specifications for the Git package, or to move between npm and Git.
322
+
323
+ For an entry with options (an object with `package` and `options`), change
324
+ only its `package` value and keep the options. The OpenCode service then
325
+ downloads the new version itself, with the service's network settings (see
326
+ [company networks](docs/ENTERPRISE.md#company-networks)); if that download fails,
327
+ AZPR's commands disappear until the package is available and the service
328
+ restarts.
329
+
330
+ External settings, the PAT file and review records stay in place; a working
331
+ configuration needs no new `/pr-setup`. `opencode plugin list` should then
332
+ show a single `azpr` row with the new version (from 0.3.1, `/pr-check` names
333
+ it too); if it still shows the previous one, run `opencode service restart`.
334
+ Exact versions stay pinned, so `opencode plugin update` leaves them unchanged.
335
+ See the [0.3.2 release notes](docs/releases/v0.3.2.md) for what changed and the
268
336
  [0.2.0 release notes](docs/releases/v0.2.0.md) for automatic comments, which
269
337
  remain disabled unless you configure `afterReview` or request them with a
270
338
  review command flag.
@@ -274,8 +342,8 @@ review command flag.
274
342
  <details>
275
343
  <summary>Source installation and replacement</summary>
276
344
 
277
- Download the [v0.3.0 source archive](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/archive/refs/tags/v0.3.0.tar.gz)
278
- and extract it, or check out tag `v0.3.0`. The installer needs POSIX `sh` and
345
+ Download the [v0.3.2 source archive](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/archive/refs/tags/v0.3.2.tar.gz)
346
+ and extract it, or check out tag `v0.3.2`. The installer needs POSIX `sh` and
279
347
  Python 3's standard library. From that source directory:
280
348
 
281
349
  ```sh
@@ -349,9 +417,10 @@ Keep `LICENSE` with copied or redistributed packages.
349
417
 
350
418
  Run `/pr-setup` to see the active settings path. Native packages use the
351
419
  external configuration described above; source installations retain their
352
- installed `plugins/azpr-v2/settings.json`. Edit that file and restart OpenCode.
353
- A changed file blocks new commands until the restart; running commands keep the
354
- settings they started with.
420
+ installed `plugins/azpr-v2/settings.json`. Edit that file and restart the
421
+ OpenCode service (`opencode service restart`, or your own `opencode serve`
422
+ process). A changed file blocks new commands until the restart; running
423
+ commands keep the settings they started with.
355
424
 
356
425
  For initial setup, one command sets the organization, existing PAT file and
357
426
  the same model for review and quick roles without calling a model or Azure:
@@ -360,10 +429,14 @@ the same model for review and quick roles without calling a model or Azure:
360
429
  /pr-setup --organization YOUR_ORG --model YOUR_PROVIDER/YOUR_MODEL --pat-file "/absolute/path/to/pat"
361
430
  ```
362
431
 
363
- An existing file requires `--replace`; unrelated advanced settings and deep
432
+ `--organization` also accepts a PR or organization URL. Without `--pat-file`,
433
+ setup uses `${XDG_CONFIG_HOME:-~/.config}/azpr/pat`, the file the
434
+ [quickstart](docs/QUICKSTART.md#2-save-the-pat-in-a-private-file-terminal)
435
+ creates. An existing file requires `--replace`, which keeps the PAT file
436
+ already set unless you name another; unrelated advanced settings and deep
364
437
  models are preserved. Setup checks the model catalog and PAT file before
365
- saving. It never accepts the PAT itself as a command argument. Restart after
366
- saving, then run `/pr-check` to verify Azure read access.
438
+ saving. It never accepts the PAT itself as a command argument. Restart the
439
+ OpenCode service after saving, then run `/pr-check` to verify Azure read access.
367
440
 
368
441
  ```json
369
442
  {
@@ -421,7 +494,7 @@ every concrete defect it finds, in any area, as a finding.
421
494
  | `afterReview.quick` / `.review` / `.deep` | `none` each: nothing follows a review; run `/pr-comment` yourself. `preview` plans a comment preview after a COMPLETE review of that mode (a model runs; nothing is posted); `publish` plans and posts it as the PAT owner; a comment that a safeguard holds back waits for a person. A flag after the PR URL overrides it for one run. See [automatic comments](#automatic-comments). |
422
495
  | `azure.organization` | Required. The `<org>` of `https://dev.azure.com/<org>`; PR URLs of other organizations are refused. |
423
496
  | `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. |
424
- | `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 OpenCode. Set either this or `azure.pat`. |
497
+ | `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`. |
425
498
  | `azure.concurrency` | `3` simultaneous Azure DevOps calls across all AZPR commands. |
426
499
  | `azure.callTimeoutSeconds` | `120`; a hung call is aborted and its slot released (reads are retried). |
427
500
  | `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. |
@@ -453,24 +526,24 @@ a PAT scoped to **one organization** (global "all accessible organizations"
453
526
  PATs stop working on 2026-12-01) with **Code: Read** and **Pull Request Threads:
454
527
  Read & write**, which cover every call AZPR makes, and give it an expiry you
455
528
  renew. Keep it alone in a file that only you can read and point `azure.patFile`
456
- at it, so `settings.json` holds no secret (the prompt does not echo the PAT and
457
- it stays out of your shell history):
458
-
459
- ```sh
460
- umask 077 && mkdir -p ~/.config/azpr
461
- read -rs -p 'Azure DevOps PAT: ' AZPR_PAT && printf '%s' "$AZPR_PAT" > ~/.config/azpr/pat; unset AZPR_PAT; echo
462
- ```
463
-
464
- Then set `"patFile"` to that file's absolute path (for example
465
- `/home/you/.config/azpr/pat`) and leave `"pat"` empty in the installed
466
- `settings.json`, and restart OpenCode. `azure.pat` can hold the PAT instead; the
529
+ at it, so `settings.json` holds no secret: the
530
+ [quickstart](docs/QUICKSTART.md#2-save-the-pat-in-a-private-file-terminal) shows
531
+ how to create that file without echoing the PAT, recording it in your shell
532
+ history or overwriting an existing file, and `/pr-setup` sets `azure.patFile`.
533
+
534
+ To set it by hand, put that file's absolute path (for example
535
+ `/home/you/.config/azpr/pat`) in `"patFile"`, leave `"pat"` empty in the
536
+ settings file `/pr-setup` names, and restart the OpenCode service. `azure.pat`
537
+ can hold the PAT instead; the
467
538
  installer keeps `settings.json` at mode 600. A file only you can read protects
468
539
  the PAT from other accounts, not from programs you run yourself, so keep its
469
540
  scopes minimal and its lifetime short. Keep the PAT out of this repository,
470
541
  shared settings profiles, chat and environment variables that child processes
471
542
  inherit. Behind a corporate proxy, also set `azure.proxy`, and `azure.caFile`
472
543
  when the proxy inspects HTTPS (see
473
- [proxies and TLS inspection](docs/AZURE_DEVOPS.md#proxies-and-tls-inspection)).
544
+ [proxies and TLS inspection](docs/AZURE_DEVOPS.md#proxies-and-tls-inspection),
545
+ and [company networks](docs/ENTERPRISE.md#company-networks) for package
546
+ downloads and model providers).
474
547
 
475
548
  Reviewers read source through six read-only AZPR tools (`azpr_read_diff`,
476
549
  `azpr_read_file`, `azpr_search_code`, `azpr_find_files`, `azpr_list_files`,
@@ -508,9 +581,9 @@ only. PR content, comments and tool responses are untrusted data.
508
581
 
509
582
  Status meanings:
510
583
 
511
- - **COMPLETE**: verification produced structured decisions and the PR source did
512
- not change. Findings without a usable decision are listed as UNREVIEWED and
513
- are never posted. Only COMPLETE reviews can be commented on.
584
+ - **COMPLETE**: verification produced structured decisions and no source-commit
585
+ change was detected. Findings without a usable decision are listed as
586
+ UNREVIEWED and are never posted. Only COMPLETE reviews can be commented on.
514
587
  - **STALE**: the PR source commit changed during the review; run a new one.
515
588
  - **PARTIAL**: no verification session produced a structured result; initial
516
589
  observations are shown for reference only.
@@ -520,19 +593,24 @@ Status meanings:
520
593
  A quick review states its status, coverage and verification separately; its
521
594
  receipt starts like `[AZPR 1a2b3c4d] COMPLETE; coverage incomplete;
522
595
  verification none (quick review)`. COMPLETE means at least one shard produced a
523
- usable result (a parsed answer is not enough) and the source did not change;
524
- its findings are REPORTED when they passed the runtime's checks (fields, a
525
- location that exists at that commit, a file the session read) and NEEDS_INFO
526
- otherwise, and only REPORTED ones can be commented on. Coverage says whether
527
- every changed file was reviewed, so zero findings never hide unreviewed files.
528
- A quick reviewer whose answer is PARTIAL and names unfinished work is asked
529
- once, in the same session, to continue (receipt `follow-up=completed`,
596
+ usable result (a parsed answer is not enough) and no source-commit change was
597
+ detected; its findings are REPORTED when they passed the runtime's checks
598
+ (fields, a location that exists at that commit, a file the session read) and
599
+ NEEDS_INFO otherwise, and only REPORTED ones can be commented on. Coverage says
600
+ whether every changed file was reviewed, so zero findings never hide unreviewed
601
+ files. A quick reviewer whose answer is PARTIAL and names unfinished work is
602
+ asked once, in the same session, to continue (receipt `follow-up=completed`,
530
603
  `still-partial`, `unusable` or `failed`); a follow-up that fails or gives no
531
604
  usable answer keeps the answer it followed. When the quick review found a
532
605
  high-severity issue or left coverage incomplete, the receipt suggests
533
606
  `/pr-review` before publishing; the hint is advisory, also when automatic
534
607
  publication follows (see [automatic comments](#automatic-comments)).
535
608
 
609
+ A failed final version recheck adds a warning; it does not by itself prevent
610
+ COMPLETE in any review mode. Read the receipt warnings. Publication separately
611
+ rechecks that the PR is active and its source commit is unchanged before
612
+ posting.
613
+
536
614
  ## Comments
537
615
 
538
616
  `/pr-comment` plans one general summary plus inline comments for confirmed high
@@ -559,20 +637,22 @@ its severity, then read the new preview:
559
637
  /pr-comment <review-id> --exclude F-1 --severity F-2=low
560
638
  ```
561
639
 
562
- Each command plans the comments again with a model, so combine both options in
563
- one command when you use both. The comments are planned without the excluded
564
- findings and with the new severities, so their wording may change; the summary
565
- index follows them, and nothing on the PR mentions the adjustment. Each option
566
- replaces its whole saved list: `--exclude F-1` and then `--exclude F-2` excludes
567
- only F-2. A changed severity changes how a finding is published, not the finding
568
- itself; when a finding is wrong, exclude it. Excluding every finding posts
569
- nothing. `--reset` clears the adjustments, and `/pr-comment <review-id> --show`
570
- shows the saved preview without a model. An adjusted review is posted only
571
- from the preview planned after its latest adjustment; once its publication has
572
- started, it is neither adjusted nor planned again. Comments that an earlier
573
- publication put on the PR are never changed: they are skipped as always, and
574
- the receipt of an adjusted review names those whose text differs from the
575
- preview. See [adjusting findings](docs/COMMENTING.md#adjusting-findings-after-a-preview).
640
+ Changed adjustments trigger new model planning when findings remain, so
641
+ combine both options in one command when you use both. Repeating the saved
642
+ adjustments changes nothing and does not plan again. Comments are planned
643
+ without the excluded findings and with the new severities, so their wording
644
+ may change; the summary index follows them, and nothing on the PR mentions the
645
+ adjustment. Each option replaces its whole saved list: `--exclude F-1` and then
646
+ `--exclude F-2` excludes only F-2. A changed severity changes how a finding is
647
+ published, not the finding itself; when a finding is wrong, exclude it.
648
+ Excluding every finding posts nothing. `--reset` clears the adjustments, and
649
+ `/pr-comment <review-id> --show` shows the saved preview without a model. An
650
+ adjusted review is posted only from the preview planned after its latest
651
+ adjustment; once its publication has started, it is neither adjusted nor
652
+ planned again. Comments that an earlier publication put on the PR are never
653
+ changed: they are skipped as always, and the receipt of an adjusted review
654
+ names those whose text differs from the preview. See
655
+ [adjusting findings](docs/COMMENTING.md#adjusting-findings-after-a-preview).
576
656
 
577
657
  ### Automatic comments
578
658
 
@@ -681,8 +761,8 @@ and a loopback fake Azure DevOps REST service in disposable directories under
681
761
  Uninstall without `--apply` previews; `--apply` archives only this package under
682
762
  `azpr-v2-backups` and leaves the private state directory for you to delete.
683
763
  For a native installation, remove the entry you added, for example
684
- `opencode plugin remove opencode-azure-devops-pr-review@0.3.0` or
685
- `opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.0'`;
764
+ `opencode plugin remove opencode-azure-devops-pr-review@0.3.2` or
765
+ `opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.2'`;
686
766
  the external settings, PAT file and private review state remain available.
687
767
 
688
768
  [Architecture](docs/ARCHITECTURE.md), [commenting](docs/COMMENTING.md),
@@ -695,7 +775,7 @@ or personal model selections.
695
775
  ## License and releases
696
776
 
697
777
  [MIT](LICENSE), copyright 2026 WTLAIB. See the [changelog](CHANGELOG.md) for the
698
- release scope, [v0.3.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.3.0)
778
+ release scope, [v0.3.2](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.3.2)
699
779
  for downloads, the [npm package](https://www.npmjs.com/package/opencode-azure-devops-pr-review),
700
780
  [v0.2.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.2.0)
701
781
  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.0",
3
+ "version": "0.3.2",
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": {
@@ -34,18 +34,9 @@
34
34
  "files": [
35
35
  "server.js",
36
36
  "src/",
37
- "config/",
38
- "scripts/merge-settings.py",
39
- "install.sh",
40
- "uninstall.sh",
41
37
  "README.md",
42
38
  "CHANGELOG.md",
43
- "LICENSE",
44
- "docs/",
45
- "AGENTS.md",
46
- "CONTRIBUTING.md",
47
- "CODE_OF_CONDUCT.md",
48
- "SECURITY.md"
39
+ "LICENSE"
49
40
  ],
50
41
  "publishConfig": {
51
42
  "access": "public"
@@ -279,8 +279,8 @@ export function renderReceipt(run, report, status, error, settings) {
279
279
  : run.mode === 'comment'
280
280
  ? ''
281
281
  : run.mode === 'quick'
282
- ? '\nStatus: COMPLETE means at least one quick review session produced a usable result and the PR source did not change. Quick findings are not independently verified: the runtime checked only their form and source, and findings that failed those checks are NEEDS_INFO. Coverage says whether every changed file was reviewed. STALE means the source changed during the review. PARTIAL means no session produced a usable result. None of these approves the PR.\n'
283
- : '\nStatus: COMPLETE means verification produced structured decisions and the PR source did not change; findings without a usable decision are listed as UNREVIEWED. STALE means the source changed during the review. PARTIAL keeps unverified results. None of these approves the PR.\n';
282
+ ? '\nStatus: COMPLETE means at least one quick review session produced a usable result and no source-commit change was detected. Quick findings are not independently verified: the runtime checked only their form and source, and findings that failed those checks are NEEDS_INFO. Coverage says whether every changed file was reviewed. STALE means the PR source commit changed during the review. PARTIAL means no session produced a usable result. None of these approves the PR.\n'
283
+ : '\nStatus: COMPLETE means verification produced structured decisions and no source-commit change was detected; findings without a usable decision are listed as UNREVIEWED. STALE means the PR source commit changed during the review. PARTIAL keeps unverified results. None of these approves the PR.\n';
284
284
  if (run.mode === 'quick' && status === 'COMPLETE' && run.quickSummary && (run.quickSummary.high > 0 || !run.quickSummary.coverage?.complete)) {
285
285
  const hint = [run.quickSummary.high > 0 ? `${run.quickSummary.high} high-severity finding(s)` : '', !run.quickSummary.coverage?.complete ? 'incomplete coverage' : ''].filter(Boolean).join(' and ');
286
286
  // Automatic publication follows the user's explicit choice; the hint stays advisory.
package/src/azure.mjs CHANGED
@@ -52,6 +52,21 @@ const clean = value => String(value ?? '').replace(/[\x00-\x1f\x7f]+/g, ' ').rep
52
52
  export const normalizePath = path => (path.startsWith('/') ? path : '/' + path);
53
53
  export const isCommitSha = sha;
54
54
 
55
+ /** An organization name as given, or the organization of an HTTPS dev.azure.com/<org>/… or <org>.visualstudio.com URL. */
56
+ export function organizationName(raw) {
57
+ if (typeof raw !== 'string' || !/^https?:\/\//i.test(raw.trim())) return raw;
58
+ let url;
59
+ try { url = new URL(raw.trim()); } catch { url = null; }
60
+ if (!url || url.protocol !== 'https:' || url.username || url.password || url.port) {
61
+ throw new Error('[AZPR] Use an organization name, or an HTTPS Azure DevOps URL without credentials or a custom port.');
62
+ }
63
+ if (url.hostname.toLowerCase() === 'dev.azure.com') {
64
+ try { return decodeURIComponent(url.pathname.split('/').filter(Boolean)[0] ?? ''); } catch { return ''; }
65
+ }
66
+ if (/^[a-z0-9-]+\.visualstudio\.com$/i.test(url.hostname)) return url.hostname.split('.')[0];
67
+ throw new Error('[AZPR] Only dev.azure.com and <organization>.visualstudio.com URLs name an organization.');
68
+ }
69
+
55
70
  /**
56
71
  * Parse an Azure DevOps Services PR URL. Only cloud URLs are supported; the
57
72
  * REST client always talks to dev.azure.com/<organization>.
@@ -317,7 +332,7 @@ export function createAzureClient({ organization, pat, baseUrl = DEFAULT_BASE_UR
317
332
  function intermediaryFailure(status, label, method, forwarded = true) {
318
333
  if (status === 407) {
319
334
  return new AzureError(`A proxy refused ${label}: it requires authentication (HTTP 407).`, { kind: 'proxy', status,
320
- hint: 'Put the proxy user name and password in azure.proxy (http://user:password@host:port, percent-encoded) and restart OpenCode.' });
335
+ hint: 'Put the proxy user name and password in azure.proxy (http://user:password@host:port, percent-encoded) and restart the OpenCode service (opencode service restart).' });
321
336
  }
322
337
  // A gateway that already forwarded a write may have delivered it.
323
338
  return new AzureError(`A proxy or gateway answered ${label} with HTTP ${status} instead of Azure DevOps (no Azure DevOps response headers).`, {
@@ -332,7 +347,7 @@ export function createAzureClient({ organization, pat, baseUrl = DEFAULT_BASE_UR
332
347
  const detail = clean(body?.message);
333
348
  const suffix = `${code ? ` ${code}` : ''}${detail ? `: ${detail}` : ''}`;
334
349
  if (status === 203 || status === 401 || (status >= 300 && status < 400)) {
335
- return new AzureError(`Azure DevOps rejected the PAT for organization "${organization}" (HTTP ${status}). Check that the PAT (azure.pat, or the file named by azure.patFile) is valid, not expired and created for this organization, then restart OpenCode.`, { kind: 'auth', status });
350
+ return new AzureError(`Azure DevOps rejected the PAT for organization "${organization}" (HTTP ${status}). Check that the PAT (azure.pat, or the file named by azure.patFile) is valid, not expired and created for this organization, then restart the OpenCode service (opencode service restart).`, { kind: 'auth', status });
336
351
  }
337
352
  if (status === 403) return new AzureError(`Azure DevOps refused ${label} (HTTP 403${suffix}). The PAT needs Code (Read) and Pull Request Threads (Read & write) for this organization.`, { kind: 'permission', status, code });
338
353
  if (status === 404) return new AzureError(`Azure DevOps could not find ${label} (HTTP 404${suffix}).`, { kind: 'not-found', status, code });
@@ -367,7 +382,7 @@ export function createAzureClient({ organization, pat, baseUrl = DEFAULT_BASE_UR
367
382
  // A rejected certificate fails the handshake before anything is sent; retrying cannot help.
368
383
  if (CERTIFICATE_CODES.test(known)) {
369
384
  throw new AzureError(`Azure DevOps ${label} failed: the server's TLS certificate was not accepted (${clean(known)}).`, { kind: 'tls', code: known, cause: error,
370
- hint: 'If a proxy inspects HTTPS, set azure.caFile to its root CA certificate (PEM) and restart OpenCode.' });
385
+ hint: 'If a proxy inspects HTTPS, set azure.caFile to its root CA certificate (PEM) and restart the OpenCode service (opencode service restart).' });
371
386
  }
372
387
  throw new AzureError(`Azure DevOps ${label} failed: network error${code ? ` (${clean(code)})` : ''}.`, { kind: 'network', transient: true, cause: error,
373
388
  uncertain: method !== 'GET' && !NOT_SENT_CODES.test(known),
package/src/config.mjs CHANGED
@@ -5,6 +5,11 @@ import { REVIEW_TOOL_NAMES } from './review-tools.mjs';
5
5
  export const MODES = Object.freeze(['review', 'deep', 'quick']);
6
6
  export const COMMANDS = Object.freeze({ 'pr-check': 'check', 'pr-review': 'review', 'pr-deep': 'deep', 'pr-quick': 'quick', 'pr-stop': 'stop', 'pr-comment': 'comment' });
7
7
 
8
+ // How the host identifies this plugin and its published packages in its plugin list.
9
+ export const PLUGIN_ID = 'azpr';
10
+ export const PACKAGE_NAME = 'opencode-azure-devops-pr-review';
11
+ export const REPOSITORY = 'WTLAIB/opencode-azure-devops-pr-review-v2';
12
+
8
13
  // Native tools no private role may use. Shell is governed by the `shell` setting.
9
14
  export const NATIVE_TOOL_PERMISSIONS = Object.freeze({
10
15
  execute: 'deny', edit: 'deny', write: 'deny', patch: 'deny', skill: 'deny', subagent: 'deny',