Skip to content

Pattern miner: Add PR Fix Assistant archetype for slash-command-driven branch pushes - #287

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
pattern-miner/pr-fix-assistant-cc275d7691e3306e
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
pattern-miner/pr-fix-assistant-cc275d7691e3306e

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Caution

Protected files were modified in this change.
This pull request is in request_review mode and requires explicit human scrutiny before merge.

Protected files: .github/copilot-instructions.md

Upstream evidence

Mined githubnext/agentics workflow sources under /tmp/gh-aw/data/upstream/githubnext-agentics/files/workflows/, cross-checked against github/gh-aw docs under /tmp/gh-aw/data/upstream/github-gh-aw/files/.github/aw/.

Recurring pattern: a slash-command-triggered agent that fixes an existing pull request by pushing corrections directly to its branch with the push-to-pull-request-branch safe output, instead of opening a new pull request. Six upstream workflows demonstrate this shape:

  • workflows/pr-fix.mdslash_command: pr-fix + reaction: eyes, safe-outputs: push-to-pull-request-branch, create-issue, add-comment
  • workflows/efficiency-improver.mdpush-to-pull-request-branch: { target: "*", required-title-prefix: "[efficiency-improver] " }
  • workflows/perf-improver.md — same push-to-pull-request-branch + required-title-prefix shape, slash-command-gated follow-up path
  • workflows/test-improver.md — same shape
  • workflows/repo-assist.md — same shape, with protected-files: allowed
  • workflows/lean-squad.md — same shape, with protected-files: allowed

This is also documented as the canonical mapping in github-gh-aw/files/.github/aw/designer-mappings.md ("commit a fix to the PR branch" → push-to-pull-request-branch) and specced in detail in github-gh-aw/files/.github/aw/safe-outputs-management.md (recommended required-title-prefix/required-labels restrictions, target: "*" warnings, checkout fetch: ["*"] requirement).

Why the existing library did not cover it

I checked /tmp/gh-aw/data/current-library.json and every archetype file under patterns/archetypes/. push-to-pull-request-branch was defined only as a generic safe-output alias in patterns/workflow-generation.json (outputs["push-to-pull-request-branch"]) but was never used as a recommended_tools/recommended_safe_outputs entry by any archetype, and no archetype's tips mention it. The closest existing archetypes are distinct:

  • pr-iteration-loop — schedule-triggered, one long-running draft PR, not a slash-command on-demand fixer for an arbitrary existing PR.
  • nitpick-reviewer — slash-command-triggered but comment-only, never pushes code.
  • code-improvement — schedule-triggered, opens new PRs via create-pull-request, not push-to-existing-branch.

None of these represent "push a fix straight onto the branch of the PR that invoked you," so this is additive, not a duplicate.

What changed

  • Added patterns/archetypes/pr-fix-assistant.json — new curated archetype (success_rate: null, count: 0, top_repos: []) with slash_command + reaction triggers, pull-requests safe outputs, push-to-pull-request-branch recommended tool, and tips drawn directly from the upstream evidence above (required-title-prefix/required-labels scoping, verify-before-push, comment summary, min-integrity: none rationale).
  • Appended pr-fix-assistant to archetypes in patterns/manifest.json.
  • Added a pr-fix-assistant entry to patterns/workflow-generation.json (icon, capabilities, permissions, github toolsets, instructions, a slash_command trigger override restricting events to pull_request_comment, prompt body, and min_integrity: none) so the wizard can render this archetype.
  • Updated .github/copilot-instructions.md to list the new curated archetype in the "no measured success rate" set and bumped the "user-facing archetypes" count from 29 to 30.
  • Updated test/copilot-instructions.test.js — bumped the hardcoded curated-archetype count from 20 to 21 to match the new manifest entry.

Candidates deliberately left out

  • Chart/trending narrative workflows (repo-chronicle.md, weekly-issue-activity.md, multi-device-docs-tester.md using matplotlib/seaborn + upload-asset): already covered by the existing generic extras.charts capability (upload-assets safe output) in patterns/workflow-generation.json, which any archetype can already opt into — not a gap.
  • Discussion-based periodic narrative reports (plan.md, weekly-issue-activity.md, repo-chronicle.md): already covered by the existing community-digest archetype (schedule + create-discussion).
  • glossary-maintainer.md / duplicate-code-detector.md / weekly-repo-map.md: single-instance shapes with no second corroborating upstream workflow or explicit doc recommendation, so they don't meet the two-upstream-workflows bar.
  • vex-generator.md: a one-off workflow_dispatch-with-typed-inputs generator; no second upstream example or docs recommendation of this exact shape.

Validation

  • npm test: 326/327 tests pass. The one pre-existing failure (test/copilot-instructions.test.js — "describes the committed pattern-library corpus, not stale scan data") already fails identically on main before this change (verified via git stash); it is caused by a stale generated_at date in patterns/manifest.json versus the date hardcoded in .github/copilot-instructions.md, unrelated to this PR.
  • npm run build: succeeds, dist/patterns/archetypes/pr-fix-assistant.json is emitted.

Generated by Pattern Miner · copilot · auto · 223.4 AIC · ⌖ 11.6 AIC · ⊞ 8.7K ·

Mines a recurring pattern across upstream githubnext/agentics workflows:
slash-command-triggered agents that push fixes directly to an existing
PR branch via push-to-pull-request-branch, rather than opening a new PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protected files were modified in this pull request and require manual scrutiny before merge.

Please verify that each protected-file change is intentional, policy-compliant, and safe:

  • Protected files: .github/copilot-instructions.md

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.

0 participants