Skip to content

fix: add scope-guard, acceptance criteria, and version-bump constraints to prevent PR scope drift#33127

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/copilot-opt-fix-scope-drift
Closed

fix: add scope-guard, acceptance criteria, and version-bump constraints to prevent PR scope drift#33127
Copilot wants to merge 2 commits into
mainfrom
copilot/copilot-opt-fix-scope-drift

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

185 closed-without-merge Copilot PRs show a recurring pattern: the agent reinterprets the issue mid-session and pivots to a related but distinct change, causing maintainers to close the PR as a scope mismatch. This adds three targeted guardrails to stop that.

Changes

AGENTS.md — Checkpoint 2b: Scope-Guard

New mandatory step inserted directly after the existing Checkpoint 2 (pre-report_progress validation). Agents must confirm all three align before opening a PR:

  • Branch name ↔ what was actually changed
  • Changed files ↔ original issue scope
  • PR title/description ↔ issue request

If any diverge → call report_incomplete instead of opening the PR.

AGENTS.md — Acceptance Criteria and Scope Anchoring

New mandatory section in Critical Requirements. Before writing code, agents must extract from the issue:

  1. Which files must change
  2. Which tests must pass
  3. What the reviewer needs to see (one-sentence restatement)

Explicit prohibitions: no fixing unrelated bugs, no regenerating artifacts not in scope, no out-of-scope refactoring.

AGENTS.md — Quick Reference updated

Checkpoint 2b summary added to the condensed reference block at the bottom so it's visible on a quick scan.

.github/aw/upgrade-agentic-workflows.md — Version-Bump Scope Constraint

New best-practice item (#6): version-bump upgrades are constrained to the version identifier + recompile only. Agents must not regenerate agent files, prompt templates, or other artifacts unless the changelog explicitly requires it. Unexpected diffs beyond lock files must be documented before inclusion in the PR.

…ts to prevent PR scope drift

- Add Checkpoint 2b (Scope-Guard) to AGENTS.md Critical Requirements: agents must
  verify branch name, changed files, and PR title all match issue scope before
  calling report_progress; call report_incomplete if any diverge
- Add Acceptance Criteria and Scope Anchoring mandatory section to AGENTS.md:
  agents extract files/tests/reviewer question from issue before writing code
- Update Quick Reference section in AGENTS.md to include Checkpoint 2b
- Add Version-Bump Scope Constraint best practice to upgrade-agentic-workflows.md:
  only update the target version constant and recompile; do not regenerate
  unrelated artifacts

Closes #[this issue]

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix scope drift in closed Copilot PRs fix: add scope-guard, acceptance criteria, and version-bump constraints to prevent PR scope drift May 18, 2026
Copilot AI requested a review from pelikhan May 18, 2026 19:03
@pelikhan pelikhan closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[copilot-opt] opt: scope-drift in closed Copilot PRs signals missing acceptance criteria in workflow prompts

2 participants