Repository navigation
Add ARM API Review Critic agent - #43494
Merged
Merged
Conversation
…fixtures - Added three new evaluation files: eval-fast-path-triage.yaml, eval-suppressions-yaml.yaml, and eval-report-format.yaml. - Updated README.md to reflect the addition of new evaluation files and increased test case counts from 35 to 41. - Introduced new test cases for fast-path triage, suppressions.yaml continuity, and report format validation. - Created fixtures for suppressions.yaml tests, including scenarios for missing reasons and vague justifications for security rules. - Improved existing evaluation definitions to ensure comprehensive coverage of ARM API Reviewer functionality.
Next Steps to MergeNext steps that must be taken to merge this PR:
Comment generated by summarize-checks workflow run. |
Ravi Eda (ravimeda)
marked this pull request as ready for review
May 25, 2026 16:14
Ravi Eda (ravimeda)
requested review from
a team,
Arthur Ma (ArthurMa1978),
Crystal YU (chunyu3),
Haoling Dong (haolingdong-msft),
laxmankumar12,
Renhe Li (lirenhe) and
Suhas Rao (ARM) (raosuhas)
as code owners
May 25, 2026 16:14
- Updated PR resolution rules for clarity and consistency in formatting. - Added a new step for API Graph & Data-Flow Analysis to improve systemic problem detection. - Introduced multi-perspective reviewer passes to enhance review quality. - Clarified cleanup procedures and emphasized mandatory cleanup after reviews. - Improved language for better readability and understanding throughout the document.
…logy in documentation
…or Copilot Code Review
Ravi Eda (ravimeda)
requested a review
from Praveen Kuttappan (praveenkuttappan)
as a code owner
May 26, 2026 12:37
Praveen Kuttappan (praveenkuttappan)
approved these changes
May 26, 2026
Haoling Dong (haolingdong-msft)
approved these changes
May 27, 2026
…for ARM API Review Critic
This was referenced Jun 1, 2026
Ravi Eda (ravimeda)
enabled auto-merge (squash)
June 1, 2026 21:08
laxmankumar12
approved these changes
Jun 1, 2026
Ravi Eda (ravimeda)
disabled auto-merge
June 1, 2026 21:51
Member
Author
|
Praveen Kuttappan (@praveenkuttappan) , Mariana Rios Flores (@maririos) please could you approve. |
Ravi Eda (ravimeda)
enabled auto-merge (squash)
June 2, 2026 23:13
Praveen Kuttappan (praveenkuttappan)
approved these changes
Jun 3, 2026
Ravi Eda (ravimeda)
disabled auto-merge
June 3, 2026 13:19
…from `armapi-review.instructions.md` to `arm-api-review.instructions.md` across multiple documentation files. This includes updates in instruction files, README, design decisions, linter rule coverage, and evaluation YAML files to ensure consistency and accuracy in rule citations.
Praveen Kuttappan (praveenkuttappan)
approved these changes
Jun 3, 2026
Ravi Eda (ravimeda)
enabled auto-merge (squash)
June 3, 2026 21:10
Mike Harder (mikeharder)
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a new ARM API Review Critic agent, a read-only adversarial verifier that independently re-validates findings produced by the ARM API Reviewer before any are presented to a human for posting on a PR.
Restructures the Reviewer around a shared Reviewer / Critic wire protocol (
.github/agents/protocols/reviewer-critic.protocol.md) that defines the input contract, verdict tracks, telemetry markers, and override-reason validator both agents must honor. Adds session-SHA pinning (the entire review is bound to one commit; SHA drift mid-session invalidates the run), an existing-comment reconciliation plan (Step 5.5) that de-duplicates against prior comments and verifies fix-claims before auto-resolving threads, and a downstream-CI impact check (Step 4.5) that blocks suggested fixes which would collide with required LintDiff rules.Adds multi-perspective passes (Security Skeptic / SDK Ergonomics / SRE) and a mandatory API graph & data-flow step (Step 3.5) to the Reviewer, so the same surface is examined through several biases and the API is reasoned about as a graph (resource, operation, sensitive-data-flow, version-delta) rather than a flat list of rules. The Critic independently re-derives these graphs and graph-diff is a primary missed-violation signal; graph fabrication is a non-overridable FAIL.
Adds fast-path triage to the Reviewer (examples-only and description-only PRs skip deep schema, breaking-change, and graph analysis but never skip the Critic), tightens the Critic loop with convergence-based iteration capped at 3, adds a consensus rule for
Blockingseverity (a finding only posts as Blocking when both the Reviewer and the Critic concur at High or Medium confidence; otherwise auto-capped to Warning), and ships eval suites that exercise the new behaviors end-to-end.Motivation
The Reviewer operates on a public repo where every posted comment is durable, citable, and indexed. A single wrong finding becomes precedent. Precision dominates recall: dropping a borderline finding is cheap; posting a wrong
Blockingfinding is not. The Critic exists as a safety gate to catch false positives, wrong line numbers, misquoted rules, misclassified[NEW]/[EXISTING]tags, fabricated graph nodes, unjustified thread auto-resolutions, and suggested fixes that would break required downstream CI, all before the human sees the report.Linear, file-by-file rule scanning is good at catching named-rule violations but bad at catching systemic problems such as orphan resources, asymmetric CRUD,
$refcycles, and secrets that enter via PUT and leak via LIST. Forcing the model to build resource / operation / data-flow graphs (and rendering them as Mermaid so the Critic can re-derive and diff) catches structural issues that no single rule would flag.Separately, the Reviewer was previously running full deep-schema review on PRs that only touched example payloads or description text, and was re-posting findings already covered by prior threads on the same PR. The fast path and the Step 5.5 reconciliation plan fix both, conservatively.
Changes
New agent
.github/agents/arm-api-review-critic.agent.md: read-only critic with no mutating tools, enforced by an explicit allowlist plus a pre-tool self-check. Per-finding re-verification (file re-fetch at the session SHA, verbatim rule quote, line-number check including conflict-marker handling,[NEW]/[EXISTING]re-classification, confidence assignment, override-reason validation). Six bias-filter passes for missed-violation hunting (future-breaking shape, operational pain, silent breaking changes, security smell, naming rot, what's missing). Independent graph re-derivation that diffs against the Reviewer's Mermaid output. Independent re-verification of the Step 5.5 reconciliation plan: every SKIP-COVERED, RESOLVE-AND-REPOST, REPLY-LINE-SHIFT, THANK-AND-RESOLVE, and PROPOSE-HUMAN-RESOLVE entry is re-checked with an anchored proof-of-fix.Finding accuracy,Graph integrity(binding whenFAIL: fabrication),Reconciliation accuracy(binding on FAIL because wrong fix-claims would silently close still-broken threads), andCoverage quality. A fifth stateFinding accuracy = INVALIDATEDoverrides every other track and kills the session when the SHA the Reviewer judged no longer matches the PR head.Shared protocol
.github/agents/protocols/reviewer-critic.protocol.md: the canonical wire contract. Defines the ten Critic inputs, the<!-- review-state: ... -->per-response marker, the 6-field per-comment telemetry marker (includinghead-sha,critic,downstream-rule,override-reason, and thetelemetry: degradedfallback form), the Override-reason validator (length + boilerplate denylist + structured-anchor / verbatim-quote requirement), the session-handoff verification checks, and the non-overridable FAIL catalog..github/agents/protocols/critic-inputs.template.md: the verbatim YAML template (# critic-inputs/v1) the Reviewer pastes into every Critic dispatch.Reviewer updates
.github/agents/arm-api-reviewer.agent.md: restructured into ten numbered steps with a Pre-Presentation Invariant at the top that gates any user-visible findings on one of four explicit states (Critic ran / session-handoff pending / Critic unavailable with disclosure banner / session invalidated). Key additions:<details>blocks. Size guardrails downgrade rendering on extreme-scale RPs but still run the sensitive-data-flow analysis. Failure-recovery ladder distinguishesgraphs-produced: false(fast path, silent) fromdegraded(failed even after retry, requires a[!CAUTION]banner).linter-rule-coverage.md). Findings that would collide are re-authored as three-option recommendations with a properly-rendered suppressionwhere:clause; the Critic FAILs the run non-overridably ondownstream-ci-conflictorsuppression-path-mismatch.downstream-ci-conflict,suppression-path-mismatch,unescaped-mention, andoverride-reason-invalidare non-overridable.resolveReviewThread; full Chat-PR Parity rule (posted bodies are byte-for-byte identical to the Step 6 canonical body).@-mentions (TypeSpec decorators, library handles) and#<number>autolinks in posted bodies; both are non-overridable FAILs.ProvisioningStateMustBeReadOnly$ref+sibling issue,LroPostMustNotUseOriginalUriAsFinalState,XmsPageableMustHaveCorrespondingResponse).<!-- review-state: critic-mode=... -->(response-scope: mode/iteration/PR) and a per-comment<!-- posted-by: arm-api-reviewer-agent | ... -->(finding-scope: rule/severity/classification/critic-verdict/head-sha + optionaldownstream-ruleandoverride-reason, with atelemetry: degradedfallback when fields can't be assembled).Azure/azure-rest-api-specsandAzure/azure-rest-api-specs-pr(private); explicitghCLI fallback path for the private repo when MCP tools are unavailable.Shared references (under
.github/skills/azure-api-review/references/)downstream-ci-impact.md: scope criteria, five required-shape rules, suppressionwhere:exact-match guarantee.linter-rule-coverage.md: known LintDiff rule IDs in scope for the Step 4.5 check.think-in-graphs.md: canonical Step 3.5 specification (node/edge definitions, partition thresholds, the catalogue of graph-only findings).reviewer-posted-parity.md: byte-for-byte parity contract between Step 6 chat-rendered findings and posted PR comment bodies.suppression-review-criteria.md: shared criteria for evaluating bothreadme.mddirectives andsuppressions.yamlentries.guid-and-uuid-on-arm.md: GUID/UUID handling guidance on ARM resources (covers the R3017 conflict-aware area referenced by Step 4.5).Evals
.github/skills/evals/arm-api-reviewer/vally/:eval-fast-path-triage.yaml,eval-report-format.yaml,eval-suppressions-yaml.yaml,eval-citation-and-parity.yaml,eval-protocol-safety.yaml,eval-typespec-required.yaml, plus expanded fixtures (TypeSpec anti-patterns, suppressions-yaml fixtures, additional version-pair fixtures).README.mdunder the eval skill for the current catalog).Docs
documentation/api-reviewer-agent.md: documents the Critic, fast path, multi-perspective passes, graph step, reconciliation plan, downstream-CI check, and suppression continuity..github/agents/README.md: agent-folder conventions.Validation
fix(evals): Update regex pattern...,Refine evaluation patterns...).2026-03-02, #40595). The Reviewer produced the required graph artifacts, reconciled against a prior agent review of the same PR, and surfaced two net-new findings (one BlockingOAPI027on areadOnlyproperty inSnapshotUpdateProperties, one Warning onImmutabilityPolicyLockData.minimum: 0inconsistency) that the prior pass had not covered. See the Evidence section below.Evidence: example graphs from a real review (PR #40595)
These are the actual Step 3.5 artifacts produced by the updated reviewer on PR #40595 (
Microsoft.ComputeDisk RP, newstable/2026-03-02API version adding snapshot immutability policy,confidentialVMVersion, andsnapshotAccessState). All graphs are derivable fromDiskRP.jsonat the PR head, so the Critic could independently re-derive and diff them.Resource graph (6 nodes, 7 edges)
Sensitive-data-flow graph (secrets confined to explicit access-grant operations; no new leaks)
Operation graph for Snapshots (new immutability surface highlighted)
graph LR subgraph Snapshots SList["Snapshots_List"] SListRG["Snapshots_ListByResourceGroup"] SGet["Snapshots_Get"] SPut["Snapshots_CreateOrUpdate"] SPatch["Snapshots_Update"] SDel["Snapshots_Delete"] SGrant["Snapshots_GrantAccess"] SRevoke["Snapshots_RevokeAccess"] SImmut["Snapshots_UpdateImmutabilityPolicy (NEW, async)"] SLock["Snapshots_UpdateImmutabilityPolicyLock (NEW, async)"] end SList --- SGet SListRG --- SGet SGet --- SPut SGet --- SPatch SGet --- SDel SGet --- SGrant SGrant --- SRevoke SGet --- SImmut SImmut --- SLockNo structural asymmetries detected: full CRUD + LIST + LIST-by-subscription + grant/revoke + the two new immutability POSTs. Both new POSTs declare
Azure-AsyncOperationheaders andfinal-state-via: azure-async-operation. ✅Findings surfaced from the graph view that would have been hard to catch from the rule checklist alone:
beginGetAccessPOSTs).Snapshotresource (correctly), and the newAzure-AsyncOperationheader is consistently present on both. A one-pass rule scan would have checked them independently and could have missed the consistency issue if it had been there.snapshotAccessStateonSnapshotUpdatePropertiesas a node mismatch (it appears on the request-body side of the operation graph but isreadOnly), which led to the BlockingOAPI027finding the prior pass had missed.Safety notes
Warningwhen the Reviewer and Critic disagree on a Blocking finding; humans can still upgrade via the structured override workflow (critic: overridetelemetry marker plus anoverride-reasonthat passes the three-check validator: length + denylist + structured-anchor or verbatim rule quote).fix-not-verified,fix-anchor-wrong,fix-anchor-unreachable,skip-not-justified,shift-misclassified),Graph integrity = FAIL: fabrication,downstream-ci-conflict,suppression-path-mismatch,unescaped-mention, andoverride-reason-invalid. Each has a documented recovery path (correct and re-invoke, drop, demote, or escalate toMANUAL DECISION REQUIRED); thecritic: overridemarker cannot silently clear them.Finding accuracy = INVALIDATEDand forces an explicit restart-or-abandon choice; no findings are presented from a stale tree.[!CAUTION]"Independent critic verification was NOT performed" banner so the human cannot mistake self-check for independent verification.Related issues
Umbrella:
Structural improvements introduced by this PR (each tracked separately so they remain discoverable after merge):