opencode-azure-devops-pr-review 0.2.2 → 0.3.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/AGENTS.md +18 -3
- package/CHANGELOG.md +49 -0
- package/CODE_OF_CONDUCT.md +83 -0
- package/CONTRIBUTING.md +4 -3
- package/README.md +79 -31
- package/docs/ARCHITECTURE.md +37 -6
- package/docs/AZURE_DEVOPS.md +3 -0
- package/docs/COMMENTING.md +79 -0
- package/docs/DEBUGGING.md +7 -6
- package/docs/DEMO.md +45 -1
- package/docs/ENTERPRISE.md +1 -1
- package/docs/QUICKSTART.md +35 -9
- package/docs/RELEASING.md +2 -2
- package/docs/ROADMAP.md +13 -3
- package/docs/VALIDATION.md +313 -42
- package/docs/VALIDATION_HISTORY.md +40 -0
- package/docs/assets/RECORDING.md +9 -2
- package/docs/assets/adjust-findings-teaser.gif +0 -0
- package/docs/assets/adjust-preview.png +0 -0
- package/docs/assets/adjust-publication.png +0 -0
- package/docs/assets/render-terminal-demo.py +1 -1
- package/docs/releases/v0.2.3.md +93 -0
- package/docs/releases/v0.3.0.md +125 -0
- package/install.sh +1 -1
- package/package.json +3 -2
- package/src/attribution.mjs +1 -1
- package/src/azure.mjs +30 -6
- package/src/comment-work.mjs +30 -9
- package/src/comments.mjs +184 -4
- package/src/host.mjs +9 -8
- package/src/output.mjs +71 -0
- package/src/runtime.mjs +108 -26
- package/src/session.mjs +10 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AI development guide
|
|
2
2
|
|
|
3
3
|
This repository targets the OpenCode V2 plugin API (tested with
|
|
4
|
-
`@opencode/cli@2.1.
|
|
4
|
+
`@opencode/cli@2.1.4`), the Azure DevOps Services REST API (api-version 7.1)
|
|
5
5
|
and Ubuntu 22.04. Public source and documentation use English. Follow the user's
|
|
6
6
|
conversation language and current authorization scope.
|
|
7
7
|
|
|
@@ -73,7 +73,9 @@ settings, backups and failure records. Never upload `.local/`.
|
|
|
73
73
|
- All AZPR Azure DevOps traffic shares the queue in `tool-queue.mjs` (concurrency and
|
|
74
74
|
per-call timeout). Release slots in `finally`; never depend on a hook running.
|
|
75
75
|
- Large PRs are handled by sharding, not by compaction: private sessions may not
|
|
76
|
-
compact, and a compaction
|
|
76
|
+
compact, and a compaction the host attempts in a reviewer's turn means "split
|
|
77
|
+
this shard". A refused background summary (`experimental.background_compaction`)
|
|
78
|
+
ends nothing, so the turn's own failure decides its class.
|
|
77
79
|
- There is deliberately no default whole-run timeout and no per-stage step cap;
|
|
78
80
|
see the roadmap's Deferred section before adding either.
|
|
79
81
|
|
|
@@ -113,6 +115,18 @@ settings, backups and failure records. Never upload `.local/`.
|
|
|
113
115
|
behavior.
|
|
114
116
|
- Inline markers are stable (PR, path, normalized anchor, ordinal); do not put a
|
|
115
117
|
review ID or model wording into them.
|
|
118
|
+
- A person's adjustments (`/pr-comment <review-id> --exclude`, `--severity`,
|
|
119
|
+
`--reset`) change only the findings handed to comment planning, never the
|
|
120
|
+
review record or a prompt file; the planner input carries `adjustments` only
|
|
121
|
+
when some exist, so unadjusted reviews plan exactly as before. A review
|
|
122
|
+
adjusted once is posted only from a preview planned after its latest
|
|
123
|
+
adjustment (an adjustment drops the earlier preview in the same save) and is
|
|
124
|
+
neither adjusted nor planned again once its publication started. That save
|
|
125
|
+
and the new preview's save must succeed; never let a failed save report an
|
|
126
|
+
adjustment as applied. Text the runtime renders that names an excluded
|
|
127
|
+
finding holds publication. Items an earlier publication already put on the
|
|
128
|
+
PR are skipped as always; its receipt names those whose text differs, since
|
|
129
|
+
posted comments are never changed.
|
|
116
130
|
- Comment planning pages run side by side, so nothing a page sees or produces
|
|
117
131
|
may depend on which page finishes first: only the first page writes the
|
|
118
132
|
summary note, each page keeps its own continuation state and evidence, and
|
|
@@ -131,7 +145,8 @@ Detect capabilities; do not assume them.
|
|
|
131
145
|
|
|
132
146
|
Run `npm run check` and `npm test`. For changes touching hooks, sessions, tools, Azure access or
|
|
133
147
|
publication, also run `node tests/host-v2-smoke.mjs <opencode binary>` (fresh and
|
|
134
|
-
`--replace`)
|
|
148
|
+
`--replace`), `node tests/host-v2-comment-scale.mjs <opencode binary>` and
|
|
149
|
+
`node tests/host-v2-background-compaction.mjs <opencode binary>`.
|
|
135
150
|
For package entry points, first-run setup or settings-path changes, also run
|
|
136
151
|
`node tests/host-v2-smoke.mjs <opencode binary> --native`; this installs the
|
|
137
152
|
packed artifact through OpenCode's plugin manager in an isolated profile.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0 — 2026-10-26
|
|
4
|
+
|
|
5
|
+
- Choose what reaches the PR after reading a preview:
|
|
6
|
+
`/pr-comment <review-id> --exclude F-1,F-2` leaves findings out, and
|
|
7
|
+
`--severity F-3=low` changes their publication severity. Each option replaces
|
|
8
|
+
its own saved list (`none` clears it); `--reset` clears both. The model plans
|
|
9
|
+
a new preview without rerunning the review, and the original findings and
|
|
10
|
+
report stay unchanged. A severity change does not verify a finding again.
|
|
11
|
+
- `/pr-comment [review-id] --show` displays the saved preview without calling
|
|
12
|
+
a model or Azure DevOps. Excluding every finding plans and posts nothing.
|
|
13
|
+
- Adjustments and the invalidation of the earlier preview are saved together.
|
|
14
|
+
A failed save reports failure and changes nothing; a new preview whose save
|
|
15
|
+
fails is dropped. A review adjusted once, including one reset since, can be
|
|
16
|
+
published only from a saved preview planned after its latest adjustment.
|
|
17
|
+
Once publication starts, adjustments and re-planning are refused.
|
|
18
|
+
- The final preview is checked for excluded finding IDs, including summary
|
|
19
|
+
rows rendered from retained findings. An unresolved reference holds
|
|
20
|
+
publication. Existing PR comments are never edited; for an adjusted review,
|
|
21
|
+
the receipt names those whose text differs from the new preview, including
|
|
22
|
+
comments that appear only when AZPR reads the threads back.
|
|
23
|
+
- The README leads with control over published comments and a real OpenCode
|
|
24
|
+
2.1.4 recording of adjusting findings and publishing; the first-review
|
|
25
|
+
example and quickstart cover adjustments, the new preview and publication.
|
|
26
|
+
The npm package, Git installation and source archive advance to 0.3.0. The
|
|
27
|
+
package description mentions adjusting previews, and the npm package now
|
|
28
|
+
includes the code of conduct that its README and contributing guide link to.
|
|
29
|
+
- CI actions are pinned by commit and updated with Dependabot. Validation
|
|
30
|
+
starts with a summary and records the known limits of the review evidence.
|
|
31
|
+
|
|
32
|
+
## 0.2.3 — 2026-10-24
|
|
33
|
+
|
|
34
|
+
- The tested host is OpenCode CLI 2.1.4. OpenCode 2.1.3 and later embed Bun
|
|
35
|
+
1.4.4, which reports a proxy that refuses the CONNECT tunnel as an
|
|
36
|
+
`ERR_PROXY_TUNNEL` error instead of returning the proxy's answer. AZPR maps
|
|
37
|
+
it to the earlier messages and retry rules: a missing proxy password is again
|
|
38
|
+
explained as HTTP 407 without retries, and a refused tunnel never leaves a
|
|
39
|
+
comment write uncertain.
|
|
40
|
+
- Azure DevOps calls keep the configured `azure.callTimeoutSeconds`. The
|
|
41
|
+
runtime's fetch gave up on a silent request after about six minutes by
|
|
42
|
+
itself, so a longer setting ended early with a retried network error.
|
|
43
|
+
- With OpenCode's opt-in `experimental.background_compaction`, a refused
|
|
44
|
+
background summary no longer turns a later failure into a context-overflow
|
|
45
|
+
split. A permanent error such as HTTP 401 stops the stage without new
|
|
46
|
+
sessions, and a failed follow-up keeps the answer it followed.
|
|
47
|
+
- The README states that AZPR is an independent community project, not built
|
|
48
|
+
by or affiliated with the OpenCode team.
|
|
49
|
+
- A fifth exact-host fixture covers background compaction followed by a
|
|
50
|
+
permanent failure; CI runs it.
|
|
51
|
+
|
|
3
52
|
## 0.2.2 — 2026-10-23
|
|
4
53
|
|
|
5
54
|
- The README leads with reviewing Azure DevOps PRs from a URL without a local
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
+
|
|
9
|
+
## Our Standards
|
|
10
|
+
|
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
+
|
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior include:
|
|
20
|
+
|
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
22
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
23
|
+
* Public or private harassment
|
|
24
|
+
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
|
25
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
26
|
+
|
|
27
|
+
## Enforcement Responsibilities
|
|
28
|
+
|
|
29
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
32
|
+
|
|
33
|
+
## Scope
|
|
34
|
+
|
|
35
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
36
|
+
|
|
37
|
+
## Enforcement
|
|
38
|
+
|
|
39
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at weiting.lai.code@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
|
|
40
|
+
|
|
41
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
42
|
+
|
|
43
|
+
## Enforcement Guidelines
|
|
44
|
+
|
|
45
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
46
|
+
|
|
47
|
+
### 1. Correction
|
|
48
|
+
|
|
49
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
50
|
+
|
|
51
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
52
|
+
|
|
53
|
+
### 2. Warning
|
|
54
|
+
|
|
55
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
56
|
+
|
|
57
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
58
|
+
|
|
59
|
+
### 3. Temporary Ban
|
|
60
|
+
|
|
61
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
62
|
+
|
|
63
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
64
|
+
|
|
65
|
+
### 4. Permanent Ban
|
|
66
|
+
|
|
67
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
68
|
+
|
|
69
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
70
|
+
|
|
71
|
+
## Attribution
|
|
72
|
+
|
|
73
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
74
|
+
|
|
75
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
76
|
+
|
|
77
|
+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
|
78
|
+
|
|
79
|
+
[homepage]: https://www.contributor-covenant.org
|
|
80
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
81
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
82
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
83
|
+
[translations]: https://www.contributor-covenant.org/translations
|
package/CONTRIBUTING.md
CHANGED
|
@@ -29,7 +29,7 @@ can go straight to a pull request.
|
|
|
29
29
|
## Work locally
|
|
30
30
|
|
|
31
31
|
Use Node.js 22.12 or later, POSIX `sh`, Python 3 and Git. The current host
|
|
32
|
-
acceptance target is OpenCode V2 `@opencode/cli@2.1.
|
|
32
|
+
acceptance target is OpenCode V2 `@opencode/cli@2.1.4` on Ubuntu 22.04; other
|
|
33
33
|
environments are not yet validated. The runtime has no npm dependencies or
|
|
34
34
|
build step. From your checkout:
|
|
35
35
|
|
|
@@ -45,16 +45,17 @@ findings and independently verified findings. Add a focused regression test
|
|
|
45
45
|
when fixing behavior, and update the relevant documentation when it changes.
|
|
46
46
|
|
|
47
47
|
Changes to hooks, sessions, tools, Azure access or publication also need all
|
|
48
|
-
|
|
48
|
+
five host fixture runs. Install the tested host into a disposable local directory
|
|
49
49
|
without changing your everyday OpenCode installation:
|
|
50
50
|
|
|
51
51
|
```sh
|
|
52
|
-
npm install --prefix "$PWD/.local/contributor-host" --no-audit --no-fund @opencode/cli@2.1.
|
|
52
|
+
npm install --prefix "$PWD/.local/contributor-host" --no-audit --no-fund @opencode/cli@2.1.4
|
|
53
53
|
AZPR_TEST_HOST="$PWD/.local/contributor-host/node_modules/.bin/opencode"
|
|
54
54
|
node tests/host-v2-smoke.mjs "$AZPR_TEST_HOST"
|
|
55
55
|
node tests/host-v2-smoke.mjs "$AZPR_TEST_HOST" --replace
|
|
56
56
|
node tests/host-v2-smoke.mjs "$AZPR_TEST_HOST" --native
|
|
57
57
|
node tests/host-v2-comment-scale.mjs "$AZPR_TEST_HOST"
|
|
58
|
+
node tests/host-v2-background-compaction.mjs "$AZPR_TEST_HOST"
|
|
58
59
|
```
|
|
59
60
|
|
|
60
61
|
The fixtures need `openssl` and use isolated configuration, a fake model
|
package/README.md
CHANGED
|
@@ -3,29 +3,39 @@
|
|
|
3
3
|
[](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/actions/workflows/ci.yml?query=branch%3Amain)
|
|
4
4
|
[](https://www.npmjs.com/package/opencode-azure-devops-pr-review)
|
|
5
5
|
[](LICENSE)
|
|
6
|
-
[](docs/VALIDATION.md)
|
|
7
7
|
|
|
8
8
|
**Review Azure DevOps pull requests from a URL. No checkout required.**
|
|
9
9
|
|
|
10
|
-
Review
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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.
|
|
14
|
+
|
|
15
|
+
AZPR is an independent community project. It is not built by or affiliated with
|
|
16
|
+
the OpenCode team.
|
|
14
17
|
|
|
15
18
|
[Get started](docs/QUICKSTART.md) · [See the demo](docs/DEMO.md) ·
|
|
16
19
|
[Team setup and data handling](docs/ENTERPRISE.md) ·
|
|
17
20
|
[Validation and limitations](docs/VALIDATION.md) ·
|
|
18
|
-
[Download v0.
|
|
21
|
+
[Download v0.3.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.3.0)
|
|
19
22
|
|
|
20
|
-
[](docs/DEMO.md)
|
|
21
24
|
|
|
22
|
-
*A
|
|
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
|
|
23
28
|
[73-second walkthrough](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/download/v0.2.0/azpr-live-demo.mp4)
|
|
24
|
-
|
|
25
|
-
the Azure portion shows an actual REST read-back in a terminal.*
|
|
29
|
+
of a review, preview and publication.*
|
|
26
30
|
|
|
27
31
|
## Why AZPR?
|
|
28
32
|
|
|
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.
|
|
29
39
|
- **Follow the code beyond the diff.** Reviewers can look up definitions,
|
|
30
40
|
callers and tests using file reads and text search at the selected PR commit,
|
|
31
41
|
without depending on an Azure Code Search index.
|
|
@@ -36,10 +46,6 @@ the Azure portion shows an actual REST read-back in a terminal.*
|
|
|
36
46
|
- **Choose where to spend model effort.** Assign different OpenCode models to
|
|
37
47
|
functional review, risk review and verification, or use one model for all
|
|
38
48
|
roles. Keep a stronger model profile for selected PRs with `/pr-deep`.
|
|
39
|
-
- **Control what reaches the PR.** Preview the summary and inline comments,
|
|
40
|
-
then publish when ready. The runtime rechecks the PR head, skips comments
|
|
41
|
-
already published by AZPR and reads new comments back. Automatic publication
|
|
42
|
-
is available when you opt in.
|
|
43
49
|
- **Configure the Azure connection for your network.** Set a forward proxy and
|
|
44
50
|
additional CA certificates for AZPR's Azure DevOps requests. Model-provider
|
|
45
51
|
connections remain configured in OpenCode.
|
|
@@ -55,7 +61,7 @@ for proxy authentication and retention.
|
|
|
55
61
|
1. Install the npm package using OpenCode's plugin manager:
|
|
56
62
|
|
|
57
63
|
```sh
|
|
58
|
-
opencode plugin add opencode-azure-devops-pr-review@0.
|
|
64
|
+
opencode plugin add opencode-azure-devops-pr-review@0.3.0
|
|
59
65
|
```
|
|
60
66
|
|
|
61
67
|
2. Follow the [quickstart](docs/QUICKSTART.md) to save your PAT in a private
|
|
@@ -74,14 +80,27 @@ reviewers, then separate verification. If the completed review has findings to
|
|
|
74
80
|
comment on, `--preview` prepares their comments in a separate, cancellable run.
|
|
75
81
|
**Nothing is posted by these commands.** Previewing comments also uses a model.
|
|
76
82
|
|
|
77
|
-
Read the report and preview,
|
|
83
|
+
Read the report and preview. Before publishing, you can exclude a finding or
|
|
84
|
+
change its severity using IDs from your report, for example:
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
/pr-comment REVIEW_ID_FROM_RECEIPT --exclude F-1 --severity F-2=low
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
F-1 is excluded from the new preview; F-2 appears as low in the summary, with no
|
|
91
|
+
new inline comment. Adjusting runs comment planning again with a model. Read the
|
|
92
|
+
whole new preview, then publish from the same conversation:
|
|
78
93
|
|
|
79
94
|
```text
|
|
80
95
|
/pr-comment REVIEW_ID_FROM_RECEIPT --publish
|
|
81
96
|
```
|
|
82
97
|
|
|
83
98
|
Use the review ID from the completed receipt. The command posts the saved
|
|
84
|
-
preview as the PAT owner
|
|
99
|
+
preview as the PAT owner and skips matching comments AZPR already posted. It
|
|
100
|
+
never edits them; for an adjusted review, the receipt identifies those whose
|
|
101
|
+
text differs from the new preview. See
|
|
102
|
+
[adjusting findings](#adjusting-findings-after-a-preview) for how repeating an
|
|
103
|
+
option replaces its earlier list. For a lighter first pass, use
|
|
85
104
|
`/pr-quick <PR URL> --preview`; its findings are not independently verified.
|
|
86
105
|
|
|
87
106
|
## Choose a review
|
|
@@ -130,7 +149,7 @@ general review-accuracy score.
|
|
|
130
149
|
|
|
131
150
|
| Component | Tested target |
|
|
132
151
|
| --- | --- |
|
|
133
|
-
| OpenCode | **OpenCode CLI 2.1.
|
|
152
|
+
| OpenCode | **OpenCode CLI 2.1.4** (`@opencode/cli`; V2 plugin API). OpenCode 1.x is not supported. |
|
|
134
153
|
| Operating system | **Ubuntu 22.04** (validation environment: WSL2). Other operating systems are not yet validated. |
|
|
135
154
|
| Azure | **Azure DevOps Services**, REST API **7.1**. Azure DevOps Server is not supported by the current URL handling. |
|
|
136
155
|
| Installation | OpenCode's plugin manager with the npm package or the versioned Git package, or the source installer with POSIX `sh` and Python 3; no plugin build step or npm dependencies. |
|
|
@@ -152,7 +171,9 @@ for both quick and verified reviews.
|
|
|
152
171
|
read-only tools at exact commits.
|
|
153
172
|
2. Two full-scope reviewers (functional and risk) review the changed files in
|
|
154
173
|
bounded **shards**. A shard that fills its model context is split in half
|
|
155
|
-
and run again instead of failing.
|
|
174
|
+
and run again instead of failing. Reviewer sessions never compact, so
|
|
175
|
+
OpenCode's opt-in `experimental.background_compaction` does not apply to
|
|
176
|
+
them: AZPR refuses its summary requests before anything is sent.
|
|
156
177
|
3. A verifier independently re-checks every candidate finding against the
|
|
157
178
|
source, sharded by finding. Answers that break the output contract get a
|
|
158
179
|
short **correction turn** in the same session; whatever is still unusable is
|
|
@@ -205,14 +226,14 @@ Azure DevOps REST API with the runtime's built-in `fetch`.
|
|
|
205
226
|
Install the npm package with OpenCode's plugin manager:
|
|
206
227
|
|
|
207
228
|
```sh
|
|
208
|
-
opencode plugin add opencode-azure-devops-pr-review@0.
|
|
229
|
+
opencode plugin add opencode-azure-devops-pr-review@0.3.0
|
|
209
230
|
```
|
|
210
231
|
|
|
211
232
|
The same release is also a versioned Git package, which needs Git but not the
|
|
212
233
|
npm registry:
|
|
213
234
|
|
|
214
235
|
```sh
|
|
215
|
-
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.
|
|
236
|
+
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.0'
|
|
216
237
|
```
|
|
217
238
|
|
|
218
239
|
Add only one of them. Restart OpenCode, then run `/pr-setup` for setup instructions. Native packages
|
|
@@ -223,7 +244,7 @@ To select another configuration file, use an absolute path in the host config:
|
|
|
223
244
|
```json
|
|
224
245
|
{
|
|
225
246
|
"plugins": [{
|
|
226
|
-
"package": "opencode-azure-devops-pr-review@0.
|
|
247
|
+
"package": "opencode-azure-devops-pr-review@0.3.0",
|
|
227
248
|
"options": { "settingsFile": "/absolute/path/to/azpr/settings.json" }
|
|
228
249
|
}]
|
|
229
250
|
}
|
|
@@ -236,14 +257,14 @@ permissions, archive the old installation with its uninstaller, then add the
|
|
|
236
257
|
package. Keep the PAT file and private state directory in place.
|
|
237
258
|
|
|
238
259
|
To upgrade a native installation, change the version in its existing `plugins`
|
|
239
|
-
entry, for example from `#v0.2.
|
|
260
|
+
entry, for example from `#v0.2.3` to `#v0.3.0` for the Git package. To move a
|
|
240
261
|
Git installation to npm, replace that entry's Git specification with
|
|
241
|
-
`opencode-azure-devops-pr-review@0.
|
|
262
|
+
`opencode-azure-devops-pr-review@0.3.0`. Both use the same external settings.
|
|
242
263
|
Preserve any `options.settingsFile` and other options; keep one AZPR entry.
|
|
243
264
|
Restart the OpenCode service to load the new version. External settings, the
|
|
244
265
|
PAT file and review records stay in place. Exact versions stay pinned, so
|
|
245
266
|
`opencode plugin update` leaves them unchanged. See the
|
|
246
|
-
[0.
|
|
267
|
+
[0.3.0 release notes](docs/releases/v0.3.0.md) for upgrade details and the
|
|
247
268
|
[0.2.0 release notes](docs/releases/v0.2.0.md) for automatic comments, which
|
|
248
269
|
remain disabled unless you configure `afterReview` or request them with a
|
|
249
270
|
review command flag.
|
|
@@ -253,8 +274,8 @@ review command flag.
|
|
|
253
274
|
<details>
|
|
254
275
|
<summary>Source installation and replacement</summary>
|
|
255
276
|
|
|
256
|
-
Download the [v0.
|
|
257
|
-
and extract it, or check out tag `v0.
|
|
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
|
|
258
279
|
Python 3's standard library. From that source directory:
|
|
259
280
|
|
|
260
281
|
```sh
|
|
@@ -472,7 +493,9 @@ troubleshooting.
|
|
|
472
493
|
| `/pr-quick <PR URL> [flag] [context]` | One reviewer per shard for both focuses, no verification; findings are reported, not verified. |
|
|
473
494
|
| `/pr-stop [run-id]` | Cancel this conversation's active command. |
|
|
474
495
|
| `/pr-comment [review-id]` | Preview comments for this conversation's latest completed review. |
|
|
475
|
-
| `/pr-comment [review-id] --publish` | Post the saved preview
|
|
496
|
+
| `/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. |
|
|
497
|
+
| `/pr-comment [review-id] --show` | Show the saved preview again; no model or Azure DevOps request. |
|
|
498
|
+
| `/pr-comment <review-id> --exclude <IDs>` / `--severity <ID=level,…>` / `--reset` | Leave findings out or change their severity after reading the preview, then preview again (see [adjusting findings](docs/COMMENTING.md#adjusting-findings-after-a-preview)). |
|
|
476
499
|
|
|
477
500
|
Supported PR URLs are `https://dev.azure.com/<org>/<project>/_git/<repo>/pullrequest/<id>`
|
|
478
501
|
and `https://<org>.visualstudio.com/[DefaultCollection/]<project>/_git/<repo>/pullrequest/<id>`.
|
|
@@ -527,6 +550,30 @@ coverage), and their inline comments need a location on a changed HEAD file.
|
|
|
527
550
|
When two shards of a quick review report one defect, the planner may combine
|
|
528
551
|
them into one comment under fixed rules (see [commenting](docs/COMMENTING.md)).
|
|
529
552
|
|
|
553
|
+
### Adjusting findings after a preview
|
|
554
|
+
|
|
555
|
+
When a preview contains a finding you disagree with, leave it out or change
|
|
556
|
+
its severity, then read the new preview:
|
|
557
|
+
|
|
558
|
+
```text
|
|
559
|
+
/pr-comment <review-id> --exclude F-1 --severity F-2=low
|
|
560
|
+
```
|
|
561
|
+
|
|
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).
|
|
576
|
+
|
|
530
577
|
### Automatic comments
|
|
531
578
|
|
|
532
579
|
By default nothing follows a review: you preview with `/pr-comment` and post
|
|
@@ -623,6 +670,7 @@ node tests/host-v2-smoke.mjs /absolute/path/to/opencode
|
|
|
623
670
|
node tests/host-v2-smoke.mjs /absolute/path/to/opencode --replace
|
|
624
671
|
node tests/host-v2-smoke.mjs /absolute/path/to/opencode --native
|
|
625
672
|
node tests/host-v2-comment-scale.mjs /absolute/path/to/opencode
|
|
673
|
+
node tests/host-v2-background-compaction.mjs /absolute/path/to/opencode
|
|
626
674
|
sh uninstall.sh --config-dir /absolute/path/to/v2-opencode-config
|
|
627
675
|
sh uninstall.sh --config-dir /absolute/path/to/v2-opencode-config --apply
|
|
628
676
|
```
|
|
@@ -633,8 +681,8 @@ and a loopback fake Azure DevOps REST service in disposable directories under
|
|
|
633
681
|
Uninstall without `--apply` previews; `--apply` archives only this package under
|
|
634
682
|
`azpr-v2-backups` and leaves the private state directory for you to delete.
|
|
635
683
|
For a native installation, remove the entry you added, for example
|
|
636
|
-
`opencode plugin remove opencode-azure-devops-pr-review@0.
|
|
637
|
-
`opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.
|
|
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'`;
|
|
638
686
|
the external settings, PAT file and private review state remain available.
|
|
639
687
|
|
|
640
688
|
[Architecture](docs/ARCHITECTURE.md), [commenting](docs/COMMENTING.md),
|
|
@@ -647,7 +695,7 @@ or personal model selections.
|
|
|
647
695
|
## License and releases
|
|
648
696
|
|
|
649
697
|
[MIT](LICENSE), copyright 2026 WTLAIB. See the [changelog](CHANGELOG.md) for the
|
|
650
|
-
release scope, [v0.
|
|
698
|
+
release scope, [v0.3.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.3.0)
|
|
651
699
|
for downloads, the [npm package](https://www.npmjs.com/package/opencode-azure-devops-pr-review),
|
|
652
700
|
[v0.2.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.2.0)
|
|
653
701
|
for the recorded demonstration, and [releasing](docs/RELEASING.md) for the
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -113,9 +113,14 @@ After preflight, hooks never re-read settings or catalogs.
|
|
|
113
113
|
reviewer files every concrete defect it finds as a finding: a role's focus
|
|
114
114
|
orders its attention and is not a filter, and `report` carries exclusions,
|
|
115
115
|
advice and limitations only.
|
|
116
|
-
3. **Overflow** — private sessions may not compact. A compaction
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
3. **Overflow** — private sessions may not compact. A compaction the host
|
|
117
|
+
attempts in a reviewer's turn opens its message first and is refused, which
|
|
118
|
+
ends the turn; that message (or a 413) marks the stage as `overflow`, and the
|
|
119
|
+
runtime splits that shard in half and runs both halves (labels
|
|
120
|
+
`shard 1/5a`, `1/5b`). OpenCode's opt-in `experimental.background_compaction`
|
|
121
|
+
(2.1.4) asks for a summary through the same request before the context is
|
|
122
|
+
full and publishes nothing; it is refused before anything is sent and the
|
|
123
|
+
turn goes on, so a later failure is classified by its own cause.
|
|
119
124
|
4. **Verification** — findings are grouped by file into shards of at most
|
|
120
125
|
`workflow.shardFindings`; shards end only between files, so every finding on
|
|
121
126
|
a file reaches the same verifier (a file is split only when it alone has
|
|
@@ -254,7 +259,9 @@ object.
|
|
|
254
259
|
`publishableFindings` supplies the findings: CONFIRMED ones and verifier
|
|
255
260
|
additions for review and deep, REPORTED ones for a quick review. A saved
|
|
256
261
|
review without a verification field is trusted only when its profile is review
|
|
257
|
-
or deep.
|
|
262
|
+
or deep. `commentFindings` hands them to planning as a person adjusted them
|
|
263
|
+
after a preview (see below); without adjustments they are exactly the
|
|
264
|
+
publishable findings. Planning (model) uses pages of at most four findings plus report segments
|
|
258
265
|
(on a large PR each page carries the changed files and dispositions of its own
|
|
259
266
|
findings and references to the complete lists), with
|
|
260
267
|
CONTINUE checkpoints when a page needs more reading: at most three continuation
|
|
@@ -305,6 +312,29 @@ markers back (`VERIFIED`). Creation results are `POSTED`, `ALREADY_PRESENT`,
|
|
|
305
312
|
recorded thread whose comment someone deleted on the PR; it is not posted
|
|
306
313
|
again). Re-running publication is safe.
|
|
307
314
|
|
|
315
|
+
A person's adjustments (`/pr-comment <review-id> --exclude`, `--severity`,
|
|
316
|
+
`--reset`) are stored apart from the review, as `review.adjustments`; the
|
|
317
|
+
review record, its findings and its report never change. `commentFindings`
|
|
318
|
+
leaves excluded findings out and applies changed severities, so the existing
|
|
319
|
+
page checks decide titles and inline eligibility, and the planner input gains
|
|
320
|
+
an `adjustments` field only while some are active. Two states matter:
|
|
321
|
+
|
|
322
|
+
- **Active adjustments** shape planning and the summary index. Published text
|
|
323
|
+
must not name an excluded finding: the page checks repair or drop the
|
|
324
|
+
planner's own text, and `excludedReferences` checks the assembled preview,
|
|
325
|
+
including the summary rows rendered from the review's finding summaries,
|
|
326
|
+
and holds publication when one still names an excluded ID.
|
|
327
|
+
- **Ever adjusted** (also after `--reset`) keeps the stricter publication
|
|
328
|
+
rules. An adjustment is saved together with dropping the earlier preview
|
|
329
|
+
before anything else, and a failed save changes nothing; the new preview is
|
|
330
|
+
saved strictly as well and dropped when that fails. Such a review is posted
|
|
331
|
+
only from a preview planned after its latest adjustment, never planned and
|
|
332
|
+
posted in one `--publish`, and once its publication has started it is
|
|
333
|
+
neither adjusted nor planned again. Its publication compares the text of
|
|
334
|
+
items already on the PR (from the first thread list and from the read-back)
|
|
335
|
+
and names in the receipt those that keep their earlier text; nothing posted
|
|
336
|
+
is changed.
|
|
337
|
+
|
|
308
338
|
## Authorization and isolation
|
|
309
339
|
|
|
310
340
|
Private roles (`azpr-<mode>-functional|risk|verifier|dedupe|comment-plan`, and
|
|
@@ -321,7 +351,8 @@ private session gets a grant with the run, role, model and a pending prompt
|
|
|
321
351
|
removed. Ordinary sessions lose only AZPR's tools. Comment pages that read too
|
|
322
352
|
much get their tools removed to force a checkpoint.
|
|
323
353
|
- `model.request`: only primary requests after an authorized context; compaction,
|
|
324
|
-
generation and title requests are refused (compaction
|
|
354
|
+
generation and title requests are refused (a compaction the host attempts
|
|
355
|
+
in the turn ends it as overflow).
|
|
325
356
|
- `retry`: host retries continue only while the grant is active; the announced
|
|
326
357
|
wait does not count as inactivity. OpenCode prepares the resend again
|
|
327
358
|
(`context`, then `model.request`), so it passes the primary-request check.
|
|
@@ -372,6 +403,6 @@ Without `permission.hook` the project boundary for native read tools is left to
|
|
|
372
403
|
the host's own permission rules; `/pr-check` shows a WARNING row and reviews
|
|
373
404
|
still run.
|
|
374
405
|
Receipts note when the detected OpenCode version differs from the tested one
|
|
375
|
-
(`TESTED_HOST_VERSION`, 2.1.
|
|
406
|
+
(`TESTED_HOST_VERSION`, 2.1.4).
|
|
376
407
|
REST paths and the pinned api-version live only in `azure.mjs`; see
|
|
377
408
|
[Azure DevOps access](AZURE_DEVOPS.md) for the API list and version policy.
|
package/docs/AZURE_DEVOPS.md
CHANGED
|
@@ -176,6 +176,9 @@ but AZPR accepts only Azure DevOps Services URLs (`dev.azure.com/<org>` and
|
|
|
176
176
|
|
|
177
177
|
- All calls share one queue (`azure.concurrency`) with a per-call timeout
|
|
178
178
|
(`azure.callTimeoutSeconds`) that aborts the HTTP request and frees the slot.
|
|
179
|
+
AZPR switches off the runtime's own idle limit for these requests (Bun's
|
|
180
|
+
fetch would end a call that receives nothing for five to six minutes), so a
|
|
181
|
+
longer timeout takes effect.
|
|
179
182
|
- Reads retry network errors, timeouts, throttling (429, honouring
|
|
180
183
|
`Retry-After` up to 60 seconds) and 5xx responses twice with backoff.
|
|
181
184
|
- Writes are never retried. A write whose outcome is unknown (timeout, a lost
|
package/docs/COMMENTING.md
CHANGED
|
@@ -227,6 +227,85 @@ Every page is validated item by item:
|
|
|
227
227
|
A low finding never becomes an inline comment, and the verified severity always
|
|
228
228
|
wins over the planner's label.
|
|
229
229
|
|
|
230
|
+
## Adjusting findings after a preview
|
|
231
|
+
|
|
232
|
+
After reading a preview, a person can leave findings out of publication or
|
|
233
|
+
change their severity, and plan the preview again:
|
|
234
|
+
|
|
235
|
+
```text
|
|
236
|
+
/pr-comment <review-id> --exclude F-1,R-2
|
|
237
|
+
/pr-comment <review-id> --severity F-3=low,Q-1001=medium
|
|
238
|
+
/pr-comment <review-id> --exclude F-1 --severity F-3=low
|
|
239
|
+
/pr-comment <review-id> --reset
|
|
240
|
+
/pr-comment [review-id] --show
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
- The review ID is required: every review has its own F-1. IDs are those of
|
|
244
|
+
the review report (`f1` reads as F-1). Only findings the review can publish
|
|
245
|
+
are accepted: confirmed and verifier-added ones of a review or deep review,
|
|
246
|
+
reported ones of a quick review. A merged duplicate names the finding it was
|
|
247
|
+
merged into; any other ID refuses the whole command and changes nothing.
|
|
248
|
+
- Each list is complete and replaces the saved one (`none` empties it): after
|
|
249
|
+
`--exclude F-1`, a later `--exclude F-2` excludes only F-2 and restores F-1,
|
|
250
|
+
so name both (`--exclude F-1,F-2`) to keep both out; the receipt lists what
|
|
251
|
+
was excluded and restored. The other list is kept, except that excluding a
|
|
252
|
+
finding drops its severity change and a severity for an excluded finding
|
|
253
|
+
restores it. A finding named in both lists is refused, and a severity equal
|
|
254
|
+
to the review's is no change. `--reset` clears both.
|
|
255
|
+
- A changed severity changes how a finding is published (its title, whether it
|
|
256
|
+
can get an inline comment, the summary counts); it does not verify the
|
|
257
|
+
finding again or change its evidence, trigger or impact. When the finding
|
|
258
|
+
itself is wrong, exclude it.
|
|
259
|
+
- Each change plans the preview again with a model. The planner receives the
|
|
260
|
+
adjusted findings (without the excluded ones, with the new severities) and an
|
|
261
|
+
`adjustments` field that states them; the summary index and its counts
|
|
262
|
+
follow them. A finding set to low stays in the summary only, and a raised one
|
|
263
|
+
becomes eligible for an inline comment (it still needs a location that can
|
|
264
|
+
carry one and no live thread that covers it). The other comments are written
|
|
265
|
+
again, so their wording may change: read the whole preview before
|
|
266
|
+
publishing. The review itself, its findings and its report are not changed.
|
|
267
|
+
- An excluded finding is never assigned to a page, so it gets no comment of its
|
|
268
|
+
own. Any published text that names the ID of an excluded finding (the body of
|
|
269
|
+
any inline comment, combined ones included, the summary note or
|
|
270
|
+
`summaryDetails`) gets a correction turn; after the last one the comment is
|
|
271
|
+
skipped (its finding stays in the summary index) and the note or details are
|
|
272
|
+
dropped. The assembled preview is checked as well: a summary row is the
|
|
273
|
+
review's own text for its finding, so when a kept finding's summary names an
|
|
274
|
+
excluded one, the preview says which row and publication is held until you
|
|
275
|
+
exclude that finding as well or restore the excluded one. A reference
|
|
276
|
+
without the ID cannot be detected; the preview shows it.
|
|
277
|
+
- Excluding every finding plans nothing and posts nothing: the result is
|
|
278
|
+
`NOTHING_TO_POST`, not the summary of a review without defects.
|
|
279
|
+
`--exclude none` brings the findings back.
|
|
280
|
+
- Adjustments are saved with the review, with the time of each change, survive
|
|
281
|
+
a restart and apply to a later `/pr-comment <review-id>` until `--reset`. The
|
|
282
|
+
preview and the receipt list them; nothing posted to the PR mentions them.
|
|
283
|
+
- A review that was adjusted, also one reset since, is posted only from a
|
|
284
|
+
preview planned after its latest adjustment: every adjustment discards the
|
|
285
|
+
earlier preview in the same save, and `--publish` never plans and posts such
|
|
286
|
+
a review in one step (for example after a failed new preview, or a restart
|
|
287
|
+
while it was planned). An adjustment that cannot be saved changes nothing and
|
|
288
|
+
the receipt says so; a new preview that cannot be saved is dropped and has
|
|
289
|
+
to be planned again.
|
|
290
|
+
- Once publication of an adjusted preview has started (an item was sent, may
|
|
291
|
+
have landed or was found on the PR), the review is neither adjusted nor
|
|
292
|
+
planned again: `--publish` retries the same preview and `--show` shows it;
|
|
293
|
+
run a new review to change what is posted.
|
|
294
|
+
- Adjustments shape only what a publication adds; AZPR never changes or
|
|
295
|
+
replaces a posted comment. An item the PR already has (the same marker, from
|
|
296
|
+
an earlier publication; inline markers follow the anchored lines, not the
|
|
297
|
+
commit) is skipped as for any review and keeps its earlier text. For an
|
|
298
|
+
adjusted review the receipt names those items whose text differs from the
|
|
299
|
+
preview (also when a comment appears only as publication reads the threads
|
|
300
|
+
back), marks the summary and the comments whose severity you changed, and
|
|
301
|
+
counts the other AZPR comments on the PR, where a finding you excluded may
|
|
302
|
+
still be visible; edit them on the PR if they should change.
|
|
303
|
+
- `--show` prints the saved preview, with its adjustments, without a model or
|
|
304
|
+
an Azure DevOps request.
|
|
305
|
+
|
|
306
|
+
Without these options `/pr-comment` works as before: the planner's input and
|
|
307
|
+
system prompt, the saved review and the receipts are unchanged.
|
|
308
|
+
|
|
230
309
|
## Publication
|
|
231
310
|
|
|
232
311
|
Publication is deterministic runtime code using the Azure DevOps REST API
|