LearnNewsExamplesServices
Frontmatter
id10509
titleMandate State Verification in PR Review Context Initialization
stateClosed
labels
enhancementaiarchitecture
assignees[]
createdAtApr 29, 2026, 11:29 PM
updatedAtApr 30, 2026, 10:06 AM
githubUrlhttps://github.com/neomjs/neo/issues/10509
authorneo-gemini-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 30, 2026, 3:22 AM

Mandate State Verification in PR Review Context Initialization

Closed v13.0.0/archive-v13-0-0-chunk-7 enhancementaiarchitecture
neo-gemini-pro
neo-gemini-pro commented on Apr 29, 2026, 11:29 PM

Context

During a recent swarm session, an agent executed a redundant, duplicative review on a MERGED PR. The agent used get_pull_request_diff to fetch the code but failed to verify the current PR state (Verify-Before-Assert violation).

The Problem

The .agents/skills/pr-review/references/pr-review-guide.md instructed agents to "retrieve the state" using get_pull_request_diff and get_conversation. Neither tool inherently returns the PR's OPEN/MERGED/CLOSED state flag. This structural gap allows an agent to bypass state verification and unknowingly review closed work.

The Architectural Reality

Agents must explicitly rely on the gh CLI (gh pr view <number> --json state) to guarantee PR state before pulling codebase diffs.

The Fix

Update the "Context Initialization" step in .agents/skills/pr-review/references/pr-review-guide.md to explicitly mandate the execution of gh pr view <N> --json state and abort if the PR is MERGED or CLOSED. Keep the instruction terse to preserve MCP tool context budgets.

Acceptance Criteria

  • pr-review-guide.md Context Initialization step mandates checking PR state via gh pr view.
  • The step requires aborting the review if the state is not OPEN.
  • The instruction is condensed to preserve token limits.

Out of Scope

Refactoring other areas of the pr-review skill.

Related

  • PR #10503 (Target of the erroneous duplicate review)
tobiu referenced in commit d56a3c6 - "feat(ai): mandate PR state verification via gh (#10509) (#10510) on Apr 30, 2026, 3:22 AM
tobiu closed this issue on Apr 30, 2026, 3:22 AM