Skip to content

Latest commit

 

History

History
89 lines (71 loc) · 3.78 KB

File metadata and controls

89 lines (71 loc) · 3.78 KB

PR Title Preservation Fix

Issue Summary

Users reported that AI/copilot agents were changing PR titles, which was undesired behavior. The original issue stated: "I don't want copilot to change the issue title text. once it has been created it should not be altered (unless there is existing functionality to show/change a status flag like [WIP] at the beginning of the title)."

Root Cause

The problem was in .github/copilot-instructions.md which contained permissive language allowing title changes:

Before (Problematic):

### Title Management
- **Preserve Original Intent**: Maintain the original issue title as much as possible, making improvements only for spelling, grammar, and clarity

This allowed copilots to modify title text for "improvements," which users didn't want.

Solution

Updated the copilot instructions to be strict about title preservation:

After (Fixed):

### Title Management
- **NEVER Change Title Text**: Once a PR title has been created, NEVER modify the core title text. The original title must be preserved exactly as written.
- **Status Tags Only**: The ONLY allowed changes are adding or updating status tags at the beginning of the title:
  - `[WIP]` - Work in Progress (while analysis/implementation is ongoing)
  - `[REVIEW]` - Ready for review by collaborators
  - `[BLOCKED]` - Waiting for input or dependencies
- **Status Tag Format**: If adding a status tag, use format: `[STATUS] Original Title Text` (preserve everything after the status tag exactly)
- **No Text Improvements**: Do NOT make spelling, grammar, or clarity improvements to the title text - preserve it exactly as originally written

⚠️ **CRITICAL**: Changing PR title text (beyond status tags) is explicitly forbidden and will be flagged as incorrect behavior.

What Changed

1. Strict Title Preservation

  • Copilots can NO LONGER modify title text for any reason
  • No spelling corrections, grammar fixes, or clarity improvements
  • Original title text must be preserved exactly as written

2. Status Tags Only

  • The ONLY allowed modification is adding/updating status tags like [WIP], [REVIEW], [BLOCKED]
  • Status tags go at the beginning: [STATUS] Original Title Text
  • Everything after the status tag must remain exactly the same

3. Updated Quality Checklist

The PR update checklist now enforces:

  • Title text is NEVER changed - only status tags may be added/updated
  • Original title text is preserved exactly (no spelling/grammar fixes)
  • Status tags are used correctly if needed

4. Test Coverage

Added comprehensive test suite (src/tests/prTitlePreservation.test.js) that validates:

  • Original titles are never changed
  • Only status tag modifications are allowed
  • Intentional typos/formatting are preserved
  • Various edge cases are handled correctly

Examples

✅ Allowed Changes

Original: "Fix broken authentication flow"
Allowed:  "[WIP] Fix broken authentication flow"
Allowed:  "[REVIEW] Fix broken authentication flow"

❌ Prohibited Changes

Original: "fix broken authentication flow"
Prohibited: "Fix Broken Authentication Flow" (capitalization)
Prohibited: "Fix broken auth flow" (word shortening)
Prohibited: "Fix broken authentication flow with improvements" (additions)
Prohibited: "Fix broken authentication workflow" (word changes)

Impact

  • Copilot agents will no longer modify PR titles beyond adding status tags
  • Users can be confident their original title text will be preserved
  • Status workflow ([WIP], [REVIEW], etc.) still functions as intended
  • Existing PR titles are unaffected (this only affects future behavior)

Testing

Run the test suite to verify the fix:

npm test -- --testPathPattern=prTitlePreservation.test.js

All tests should pass, confirming that title preservation rules are working correctly.