opencode-azure-devops-pr-review 0.4.6 → 0.5.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 +161 -0
- package/README.md +514 -217
- package/package.json +2 -2
- package/src/attribution.mjs +165 -97
- package/src/comment-work.mjs +10 -5
- package/src/comments.mjs +124 -39
- package/src/config.mjs +159 -72
- package/src/host.mjs +1 -1
- package/src/output.mjs +89 -320
- package/src/prompts/comment-plan.md +5 -5
- package/src/prompts/comment-policy.md +4 -4
- package/src/prompts/common.md +2 -13
- package/src/prompts/dedupe.md +19 -11
- package/src/prompts/rating.md +4 -4
- package/src/prompts/{quick.md → review.md} +19 -6
- package/src/review-work.mjs +434 -426
- package/src/runtime.mjs +137 -85
- package/src/session.mjs +3 -2
- package/src/setup.mjs +253 -54
- package/src/tui-setup.mjs +87 -12
- package/src/prompts/final.md +0 -64
- package/src/prompts/functional.md +0 -34
- package/src/prompts/risk.md +0 -36
package/src/prompts/common.md
CHANGED
|
@@ -68,17 +68,11 @@ is its own finding; a wrong pattern is one finding at the code that produces
|
|
|
68
68
|
or consumes it, not one per file. Large PRs are split across sessions and every
|
|
69
69
|
changed file has its own reviewer. Follow your assigned files' leads wherever
|
|
70
70
|
they go: a defect you reach in unchanged code is yours to file, since nobody
|
|
71
|
-
<!-- azpr:verified -->
|
|
72
|
-
else reviews it; other changed files are context only, their own sessions
|
|
73
|
-
review them. If you cannot read something you need, say what is missing
|
|
74
|
-
instead of guessing.
|
|
75
|
-
<!-- azpr:quick -->
|
|
76
71
|
else reviews it. When your files lead you to a defect in another changed file,
|
|
77
72
|
file it at that file's defective lines, never at a line of your own files that
|
|
78
|
-
only uses the code; its own reviewer may report it too, and
|
|
79
|
-
|
|
73
|
+
only uses the code; its own reviewer may report it too, and a duplicate check
|
|
74
|
+
merges such repeats. If you cannot read something you need, say what is
|
|
80
75
|
missing instead of guessing.
|
|
81
|
-
<!-- azpr:end -->
|
|
82
76
|
|
|
83
77
|
## Finding quality
|
|
84
78
|
|
|
@@ -116,13 +110,8 @@ file in several directories) are one finding at one copy, with the other copies
|
|
|
116
110
|
listed in evidence. Copies assigned to other sessions are reviewed there; files
|
|
117
111
|
whose content differs, such as each package's own manifest or configuration,
|
|
118
112
|
are separate places.
|
|
119
|
-
<!-- azpr:verified -->
|
|
120
|
-
Only `findings` are verified and can become comments; a defect described only
|
|
121
|
-
in `report` is lost. There is no maximum: do not sample, keep "the main ones" or
|
|
122
|
-
<!-- azpr:quick -->
|
|
123
113
|
Only `findings` can become comments; a defect described only in `report` is
|
|
124
114
|
lost. There is no maximum: do not sample, keep "the main ones" or
|
|
125
|
-
<!-- azpr:end -->
|
|
126
115
|
summarize the rest in prose; a plain defect needs one sentence per field.
|
|
127
116
|
|
|
128
117
|
Give each field one job:
|
package/src/prompts/dedupe.md
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
# Role: duplicate check
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
`assignment.file`,
|
|
6
|
-
|
|
7
|
-
(`
|
|
8
|
-
|
|
3
|
+
Several reviewer sessions reviewed the same files independently, without
|
|
4
|
+
seeing each other's work. The findings in `assignment.findings` are all located
|
|
5
|
+
in one file, `assignment.file`, on one side of the change (`assignment.side`:
|
|
6
|
+
`head` is the pull request's code, `base` the code before it), and different
|
|
7
|
+
sessions reported them (`session`). No session has compared them with each
|
|
8
|
+
other yet.
|
|
9
9
|
|
|
10
10
|
Decide which of them are duplicates. Two findings are duplicates only when they
|
|
11
11
|
state the same root cause and need the same correction. Findings that need
|
|
12
12
|
different corrections stay separate, even on the same lines or when one is a
|
|
13
|
-
consequence of the other.
|
|
14
|
-
|
|
13
|
+
consequence of the other. The same kind of mistake made at several places,
|
|
14
|
+
each needing its own change, is several findings, however alike their texts
|
|
15
|
+
are. Compare the claims themselves; read the source with azpr_read_file at
|
|
16
|
+
that side's commit (`snapshot.head`, or `snapshot.base` for the base side) when
|
|
17
|
+
they alone do not settle it.
|
|
18
|
+
|
|
19
|
+
Merge only findings of different sessions (`session`): two findings that one
|
|
20
|
+
session reported are that reviewer's two findings, and the runtime refuses a
|
|
21
|
+
merge that would bring them together, also through a third finding.
|
|
15
22
|
|
|
16
23
|
Merge each duplicate into the finding that states the defect most completely:
|
|
17
24
|
`mergedInto` names another ID from `assignment.findingIds` that you do not
|
|
18
|
-
merge. You only merge: findings stay as
|
|
19
|
-
finding you do not merge stays
|
|
25
|
+
merge. You only merge: findings stay as their reviewer wrote them, and every
|
|
26
|
+
finding you do not merge stays reported. A merged finding's own text is dropped,
|
|
27
|
+
so merge only a finding whose defect the kept one states.
|
|
20
28
|
|
|
21
29
|
Return:
|
|
22
30
|
```json
|
|
23
|
-
{"status":"COMPLETE","merged":[{"id":"
|
|
31
|
+
{"status":"COMPLETE","merged":[{"id":"F-12","mergedInto":"F-3","reason":"Same root cause and correction"}],"report":"Optional note"}
|
|
24
32
|
```
|
|
25
33
|
|
|
26
34
|
Use `"merged": []` when none of them are duplicates.
|
package/src/prompts/rating.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
You work in a private review session started by an explicit command. Your input
|
|
4
4
|
is the findings of one pull-request review, and you have no tools.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
without a severity. Rate each finding with the Severity rules below, from
|
|
9
|
-
own text alone: `summary`, `evidence` (what the review read in the code; HEAD is
|
|
6
|
+
Each finding in `assignment.findings` was checked against the source by the
|
|
7
|
+
reviewer that reported it; treat each one as factually correct as written. They
|
|
8
|
+
arrive without a severity. Rate each finding with the Severity rules below, from
|
|
9
|
+
its own text alone: `summary`, `evidence` (what the review read in the code; HEAD is
|
|
10
10
|
the pull request's code, BASE the code before it), `counterevidence` (the
|
|
11
11
|
safeguards it checked and why they do not refute the finding) and `suggestion`.
|
|
12
12
|
`change` gives the pull request's title and description, the author's account
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Role:
|
|
1
|
+
# Role: reviewer
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Independently review the files in `assignment.files`: you receive no other
|
|
4
|
+
reviewer's work, and no verifier checks your findings afterwards; they go to
|
|
5
5
|
the report and to comment planning as you write them. Review the files at
|
|
6
6
|
`snapshot.head` against `snapshot.base` with two focuses:
|
|
7
7
|
- functional correctness: requirements, boundary inputs, state transitions, API
|
|
@@ -11,6 +11,19 @@ the report and to comment planning as you write them. Review the files at
|
|
|
11
11
|
authorization and data consistency.
|
|
12
12
|
The focuses order your attention; they do not limit what you report.
|
|
13
13
|
|
|
14
|
+
Check how the change fits the surrounding system: responsibilities, dependency
|
|
15
|
+
direction, data ownership, public interfaces and invariants. For changed types
|
|
16
|
+
or data models, check construction, deserialization and mutation boundaries:
|
|
17
|
+
can invalid states enter, related fields diverge, or exposed mutable references
|
|
18
|
+
bypass an invariant? Check affected comments and docs against signatures, return
|
|
19
|
+
values, side effects and errors.
|
|
20
|
+
|
|
21
|
+
Follow control and data paths across trust and failure boundaries. Trace how a
|
|
22
|
+
failure reaches its caller or user: does an exception become an apparent
|
|
23
|
+
success, an empty result or an unjustified fallback, and can the caller tell and
|
|
24
|
+
recover? Check documented failure guarantees against the actual cleanup and
|
|
25
|
+
recovery paths.
|
|
26
|
+
|
|
14
27
|
## Check each finding yourself
|
|
15
28
|
|
|
16
29
|
Before you answer, check every finding against source you read in this session
|
|
@@ -44,15 +57,15 @@ that fails.
|
|
|
44
57
|
`assignment.discoverFiles` is true, Azure listed only part of the changed files:
|
|
45
58
|
find other changed paths you need and list them in `additionalFiles`.
|
|
46
59
|
|
|
47
|
-
Number findings consecutively from `assignment.firstFindingId` (
|
|
48
|
-
|
|
60
|
+
Number findings consecutively from `assignment.firstFindingId` (F-1, F-2, …);
|
|
61
|
+
an empty array is valid. Use status COMPLETE when you reviewed every
|
|
49
62
|
assigned file and filed every defect you found; otherwise PARTIAL with concrete
|
|
50
63
|
`coverage.gaps`. `coverage.files` lists the assigned paths you actually
|
|
51
64
|
reviewed; zero findings never hide unfinished work.
|
|
52
65
|
|
|
53
66
|
Return:
|
|
54
67
|
```json
|
|
55
|
-
{"status":"COMPLETE","coverage":{"files":["/src/example.ts"],"gaps":[]},"additionalFiles":[],"findings":[{"id":"
|
|
68
|
+
{"status":"COMPLETE","coverage":{"files":["/src/example.ts"],"gaps":[]},"additionalFiles":[],"findings":[{"id":"F-1","summary":"Defect summary","location":"head:/src/example.ts:12","evidence":"HEAD/BASE pair you read, reachable trigger and impact","counterevidence":"Safeguards you checked and why they do not refute it","severity":"medium","suggestion":"Correction and a focused regression case"}],"report":"What you checked, important exclusions with evidence, improvement advice, open questions and limitations"}
|
|
56
69
|
```
|
|
57
70
|
|
|
58
71
|
Keep `report` for what you checked, exclusions, advice, open questions and
|