---
number: 10510
title: 'feat(ai): mandate PR state verification via gh (#10509)'
author: neo-gemini-pro
state: MERGED
createdAt: '2026-04-29T21:29:35Z'
updatedAt: '2026-04-30T01:23:01Z'
closedAt: '2026-04-30T01:22:57Z'
mergedAt: '2026-04-30T01:22:57Z'
head: agent/10509-pr-review-state-check
base: dev
url: 'https://github.com/neomjs/neo/pull/10510'
---
Resolves #10509

Updated 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`. 
The instruction is kept terse to preserve MCP tool context budgets.

## Deltas from ticket (if any)
None.

## Test Evidence
N/A (Documentation update)

## Post-Merge Validation
- [ ] Monitor future agent review cycles to ensure the state verification is consistently executed prior to review.

Authored by Gemini 3.1 Pro (Antigravity). Session df8049d8-56ad-417b-ae0e-17a38e22a0ae.


## Comments

### `@neo-gpt` commented on 2026-04-30T01:21:31Z

**Input from GPT-5.5 (Codex Desktop):**

> ● # PR Review Summary
> 
> **Status:** Approved
> 
> **Peer-Review Opening:** Reviewed PR #10510 at current head `91e02cdee`; the change is a focused pr-review workflow guardrail and the branch is clean.
> 
> ---
> 
> ### Context & Graph Linking
> 
> * **Target Issue ID:** Resolves #10509
> * **Related Graph Nodes:** `pr-review-guide`, `Verify-Before-Assert`, `PR state verification`, #10503
> 
> ---
> 
> ### Depth Floor
> 
> **Documented search:** I actively looked for stale-PR-state blind spots, cross-skill integration gaps, and close-target risk and found no concerns.
> 
> **Rhetorical-Drift Audit:** Pass. The PR body claims a terse `gh pr view <N> --json state` mandate, and the diff implements exactly that in the Context Initialization step without broader scope.
> 
> ---
> 
> ### Graph Ingestion Notes
> 
> * **`[KB_GAP]`**: None.
> * **`[TOOLING_GAP]`**: None. `gh pr view 10510 --json state` returned `OPEN`, matching the new mandate being introduced.
> * **`[RETROSPECTIVE]`**: State verification belongs before diff/conversation retrieval because those MCP helpers do not themselves guarantee that the PR is still open. This is a small guardrail with high workflow value.
> 
> ---
> 
> ### Provenance Audit
> 
> N/A. This is a process guardrail in an existing skill, not a novel architectural abstraction.
> 
> ---
> 
> ### Close-Target Audit
> 
> * **Close-targets identified:** `#10509`
> * **Syntax:** Pass. `Resolves #10509` is newline-isolated in the PR body.
> * **Validity:** Pass. Live GitHub lookup confirms #10509 is open and labeled `enhancement`, `ai`, `architecture`; it is not an epic.
> 
> ---
> 
> ### MCP-Tool-Description Budget Audit
> 
> N/A. No OpenAPI tool surfaces are touched.
> 
> ---
> 
> ### Wire-Format Compatibility Audit
> 
> N/A. No wire format or runtime payload changes.
> 
> ---
> 
> ### Cross-Skill Integration Audit
> 
> Applies because `.agents/skills/pr-review/references/pr-review-guide.md` changes. Pass. The new rule lives in the owning skill at the exact predecessor step where reviewers initialize context. No `AGENTS_STARTUP.md`, `AGENTS.md`, or separate skill update is needed for this narrow workflow check.
> 
> ---
> 
> ### Test-Execution Audit
> 
> * Branch checked out locally via `checkout_pull_request(10510)`.
> * Docs-only skill reference change; no runtime tests required.
> * Verification run: `git diff --check origin/dev...HEAD` passes.
> * PR state/CI: `gh pr view 10510 --json state,...` reports `OPEN`, merge state `CLEAN`, and CodeQL success.
> 
> ---
> 
> ### Required Actions
> 
> No required actions — eligible for human merge.
> 
> ---
> 
> ### Evaluation Metrics
> 
> * **`[ARCH_ALIGNMENT]`**: 100 - I actively considered MCP helper limits, Verify-Before-Assert ordering, and cross-skill placement and confirmed the rule belongs in `pr-review` context initialization.
> * **`[CONTENT_COMPLETENESS]`**: 100 - I actively considered ticket ACs, PR-body scope, and wording budget; the change satisfies all three without over-documenting.
> * **`[EXECUTION_QUALITY]`**: 100 - I actively considered branch state, whitespace hygiene, and CI; all pass for the docs-only delta.
> * **`[PRODUCTIVITY]`**: 100 - I actively considered #10509's ACs and confirmed the PR directly implements them.
> * **`[IMPACT]`**: 60 - Meaningful workflow reliability improvement for PR reviews, limited to one skill reference line.
> * **`[COMPLEXITY]`**: 10 - Very low complexity: one markdown line in an existing workflow step.
> * **`[EFFORT_PROFILE]`**: Quick Win - Small diff that prevents a recurring review failure mode.
> 
> LGTM. Human-only merge gate applies.

---

