You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- If no previous version exists (new service), note this and skip the comparison.
162
-
-**Record the previous version path** - it will be needed in Step 4a to classify issues as new vs. existing.
162
+
-**Record the previous version path** - it will be needed in Step 5 to classify issues as new vs. existing.
163
163
164
164
**How to fetch previous versions:** Use GitHub MCP `get_file_contents` with `ref: "main"` (or the PR's base branch) to fetch files from the previous API version folder. To discover which prior version folders exist, use `get_file_contents` to list the directory (e.g., `specification/<service>/resource-manager/<ResourceProviderNamespace>/stable/`) on the base branch.
165
165
@@ -198,7 +198,7 @@ When a PR adds or modifies a `readme.md` file that contains `directive` / `suppr
198
198
199
199
Apply the full "TypeSpec Review Checklist Summary" from `typespec-review.instructions.md`. Key areas include project structure, decorators, versioning, ARM resource patterns, secret detection, suppressions, and anti-patterns.
200
200
201
-
### Step 4a: New vs. Existing Issue Classification
201
+
### Step 5: New vs. Existing Issue Classification
202
202
203
203
After completing the systematic review of the new version, classify every identified issue as **New** or **Existing** by checking whether the same violation is present in the previous API version:
204
204
@@ -217,7 +217,7 @@ After completing the systematic review of the new version, classify every identi
217
217
218
218
4.**Verification:** Do not guess - always load and read the previous version's spec file to confirm whether an issue is pre-existing. A wrong classification wastes reviewer time.
219
219
220
-
### Step 5: Cross-File Consistency
220
+
### Step 6: Cross-File Consistency
221
221
222
222
When a PR modifies multiple files or versions:
223
223
@@ -228,11 +228,29 @@ When a PR modifies multiple files or versions:
228
228
- Verify `readme.md` suppressions are consistent across versions - run the suppression continuity analysis described in Step 4 ("For `readme.md` suppression files").
229
229
- For TypeSpec projects: verify generated OpenAPI under `stable/` or `preview/` is consistent with the `.tsp` source. If both are modified, confirm the JSON was regenerated (not hand-edited).
230
230
231
-
### Step 6: Report Findings
231
+
### Step 6a: Check CI Results Before Posting
232
+
233
+
Before reporting a finding, check whether the same violation is already flagged by a CI check. If a CI check already reports it, **do not post a duplicate comment**. Instead, add depth that the CI check cannot: explain _why_ it matters and _how_ to fix it.
234
+
235
+
Key CI checks to cross-reference:
236
+
237
+
| CI Check Name | What It Catches | How to Avoid Duplicates |
|`TypeSpec Validation`| TypeSpec compilation errors | Skip if already failing in CI |
245
+
|`Swagger Avocado`| readme.md input-file references don't match actual files | Flag if agent finds missing files in tag configs |
246
+
247
+
When the agent finds an issue also caught by CI, the comment should reference the CI check: "_This is also flagged by the `Swagger LintDiff` CI check. See [aka.ms/ci-fix](https://aka.ms/ci-fix) for guidance on resolving CI failures._"
248
+
249
+
### Step 7: Report Findings
232
250
233
251
**Line number requirement:** Before writing any finding, you MUST resolve the exact line number of the violation. Read the file content, count or search for the specific line, and cite it as `line <N>` (e.g., `line 42`). For multi-line issues, cite the range `line <start>-<end>` (e.g., `line 10-15`). Vague references like "near end of file", "around line N", or "in the middle of the file" are **forbidden** - every finding must have a verifiable line number. For OpenAPI JSON, also include the JSON path (e.g., `$.paths['/foo'].put.responses.200`).
234
252
235
-
Organize your report as follows. Every issue **MUST** be tagged as `[NEW]` or `[EXISTING]` based on the classification from Step 4a:
253
+
Organize your report as follows. Every issue **MUST** be tagged as `[NEW]` or `[EXISTING]` based on the classification from Step 5:
236
254
237
255
```markdown
238
256
## API Review: `<service-name>/<api-version>`
@@ -294,7 +312,45 @@ These issues also exist in the previous version (`<previous-version>`) and were
294
312
295
313
Use the rule IDs from the instruction files (e.g., `RPC-Put-V1-01`, `RPC-Patch-V1-10`, `ARG001`, `TSP-2.1`). For generic rules without an explicit ID, cite the section name (e.g., "Section 6.1 - Naming", "Section 9 - Collections & Pagination").
296
314
297
-
### Step 7: Post Review Comments on PR
315
+
### Severity Calibration
316
+
317
+
#### 🔴 Blocking (must fix before merge)
318
+
319
+
Use only when the rule says **MUST** and the violation is unambiguous:
320
+
321
+
- Security: secrets in GET/PUT/PATCH responses, missing `x-ms-secret`
322
+
- Breaking changes: removed properties, changed types, new required fields
-**`source`**: Always `agent` for comments posted via this interactive agent. Automated Copilot Code Review uses `code-review` instead, enabling telemetry to distinguish the two posting mechanisms.
334
391
-**`rule`**: The rule ID of the finding (e.g., `RPC-Put-V1-01`, `OAPI027`, `SEC-SECRET-DETECT`). Use `summary` for summary comments that don't flag a single rule.
335
392
-**`severity`**: One of `blocking`, `warning`, or `suggestion`.
336
393
-**`classification`**: One of `new` (introduced in this PR) or `existing` (pre-existing technical debt).
This marker is invisible in rendered markdown but enables querying agent-posted comments via the GitHub API, computing telemetry (comments per day, top rule violations, new-vs-existing ratio), and distinguishing agent comments from human comments during reconciliation. Do not omit this marker. All fields after `posted-by` are required.
341
398
@@ -351,17 +408,28 @@ After presenting the review findings to the human reviewer for approval:
351
408
- Wait for the reviewer to approve the plan before executing.
352
409
11. Do NOT post comments without the human reviewer's approval.
353
410
354
-
### Step 8: Update PR Labels
411
+
#### Comment Volume Control
412
+
413
+
Do not flood a PR with comments. Prioritize and cap:
414
+
415
+
1.**Security issues** -- always post (no cap)
416
+
2.**Breaking changes** -- always post (no cap)
417
+
3.**ARM contract violations** -- post up to 15
418
+
4.**Property design / naming** -- post up to 5
419
+
5.**Documentation gaps** -- post up to 3
420
+
421
+
If more findings exist beyond the cap, summarize them in a single comment: "_N additional warnings/suggestions were identified but not posted individually. Key themes: [list]. The author should review the full checklist in `armapi-review.instructions.md`._"
422
+
423
+
### Step 9: Update PR Labels
355
424
356
425
After successfully posting review comments to the PR:
357
426
358
-
1.**Propose label changes** to the human reviewer:
359
-
-**Add** the `ARMChangesRequested` label to signal that the PR author needs to address review feedback.
360
-
-**Remove**the `WaitForARMFeedback`label (if present) since ARM feedback has now been provided.
427
+
1.**Propose label changes** to the human reviewer based on findings:
428
+
-**If any `🔴 Blocking` findings were posted:****Add**`ARMChangesRequested` and **remove**`WaitForARMFeedback` (if present).
429
+
-**If no blocking findings were posted:****Remove**`WaitForARMFeedback` (if present) to indicate ARM feedback has been provided. Do **not** add `ARMChangesRequested` -- there are no blocking changes to request.
361
430
2.**Wait for explicit confirmation** from the human reviewer before adding or removing any labels. Do NOT modify labels without approval.
362
431
3. Once approved, apply the label changes using the GitHub tools.
363
-
4. If the PR does not have the `WaitForARMFeedback` label, skip the removal step and only propose adding `ARMChangesRequested`.
364
-
5. Report to the human reviewer which labels were added and removed.
432
+
4. Report to the human reviewer which labels were added and removed.
To detect agent-posted comments during reconciliation, check for the substring `posted-by: arm-api-reviewer-agent` (matches both old and new marker formats).
189
190
@@ -265,9 +266,16 @@ comment. Reply to the thread noting the line shift.
265
266
Do not post new comments. Note that existing threads cover all issues.
266
267
267
268
**Scenario E -- Violation has been fixed:**
268
-
If an existing unresolved comment flags a violation that no longer exists, reply
269
-
to the thread noting the fix: "_The violation flagged here appears to have been
270
-
addressed in the latest changes._"
269
+
If an existing unresolved comment flags a violation that no longer exists in
270
+
the latest code:
271
+
272
+
- If the comment body contains the substring `posted-by: arm-api-reviewer-agent`
273
+
(agent-posted): reply noting the fix and resolve the comment: "_This issue
274
+
has been addressed in the latest changes. Resolving._"
275
+
- If the comment was from a human reviewer (no agent marker): do NOT resolve
276
+
it. Instead, reply noting the fix: "_The violation flagged in this comment
277
+
appears to have been addressed in the latest code changes. The original
0 commit comments