Brutal PR Finding Fixer
Drain generated provider findings, not work-store issues.
Required Context
- Read
../brutal-shared/integration-resolver.md,
../brutal-shared/support/contracts.md, and the selected code-host module.
- Reuse a managed fix phase’s validated integrations, exact pull request,
review id, and base/head snapshot. Otherwise resolve the same open pull
request used by
brutal-pr-review.
- Read full conversation comments, review comments, and thread state before
selecting work. A cached count is not proof that the queue is drained.
Hard Rules
- Treat the code host as queue truth. Do not update the work store.
- Require a clean worktree unless compatible existing changes were explicitly
allowed. Process one occurrence at a time.
- Add or update a focused failing test when practical.
- Make one focused commit per code-changing occurrence, push normally, and
record its disposition. Never force-push.
- Stop on verification failure, push rejection, stale/ambiguous PR identity,
incomplete thread state, changed base identity, or inherited safety guards.
- Mark invalid, stale, or already-fixed occurrences skipped without a commit.
Queue Identity
Select owned finding comments beginning with:
<!-- brutal-pr-review:v2:<fingerprint> -->
<!-- brutal-pr-review-occurrence:<review_id>:<reviewed_head_sha> -->
Reject summaries, quoted markers, and disposition replies. The queue identity
is (fingerprint, review_id). A later occurrence for the same fingerprint is
new work. An occurrence is handled only when a provider comment starts with:
<!-- brutal-pr-finding-fixer:v2:<fingerprint>:<review_id> -->
Recognize legacy generated/handled markers for compatibility. Sort unhandled
occurrences CRITICAL, MAJOR, MINOR, NIT. In a material-convergence fix phase,
scan and drain the full all-severity queue; do not stop after the material
subset or after a cached count reaches zero.
Workflow
- Snapshot PR identity, base/head, fork state, checks, comments, and threads.
- Select and revalidate the next unhandled occurrence against the current
implementation.
- Implement the smallest correct fix and focused test.
- Run focused verification and required checks.
- Inspect, commit, push, and re-read the PR head.
- Reply inline or post a top-level disposition beginning with the handled
marker and recording source, reviewed/current heads, commit, verification,
and concise notes.
- Re-read the complete queue and repeat until no unhandled occurrence for the
review remains or a hard guard stops.
In managed mode, perform only the fix phase for the supplied review queue.
Exit without running the next review. Same-thread resume is only for an
interrupted fix attempt.
Redirect verbose test, diff, and provider output to run-local temporary logs.
Return status and duration; on failure include no more than the last 200 lines
or 16 KiB, whichever is smaller.
Final Response
Report provider, pull request, reviewed and final snapshots, occurrence totals
and actions by severity, commits/pushes, verification, dispositions, a fresh
remaining-queue scan, and any blocker.
1---2name: brutal-pr-finding-fixer3description: Fix generated pull-request finding occurrences through the BRUTAL.md code-host adapter, one focused change at a time, with complete queue scans for material-convergence passes.4---56# Brutal PR Finding Fixer78Drain generated provider findings, not work-store issues.910## Required Context11121. Read `../brutal-shared/integration-resolver.md`,13 `../brutal-shared/support/contracts.md`, and the selected code-host module.142. Reuse a managed fix phase’s validated integrations, exact pull request,15 review id, and base/head snapshot. Otherwise resolve the same open pull16 request used by `brutal-pr-review`.173. Read full conversation comments, review comments, and thread state before18 selecting work. A cached count is not proof that the queue is drained.1920## Hard Rules2122- Treat the code host as queue truth. Do not update the work store.23- Require a clean worktree unless compatible existing changes were explicitly24 allowed. Process one occurrence at a time.25- Add or update a focused failing test when practical.26- Make one focused commit per code-changing occurrence, push normally, and27 record its disposition. Never force-push.28- Stop on verification failure, push rejection, stale/ambiguous PR identity,29 incomplete thread state, changed base identity, or inherited safety guards.30- Mark invalid, stale, or already-fixed occurrences skipped without a commit.3132## Queue Identity3334Select owned finding comments beginning with:3536 <!-- brutal-pr-review:v2:<fingerprint> -->37 <!-- brutal-pr-review-occurrence:<review_id>:<reviewed_head_sha> -->3839Reject summaries, quoted markers, and disposition replies. The queue identity40is `(fingerprint, review_id)`. A later occurrence for the same fingerprint is41new work. An occurrence is handled only when a provider comment starts with:4243 <!-- brutal-pr-finding-fixer:v2:<fingerprint>:<review_id> -->4445Recognize legacy generated/handled markers for compatibility. Sort unhandled46occurrences CRITICAL, MAJOR, MINOR, NIT. In a material-convergence fix phase,47scan and drain the full all-severity queue; do not stop after the material48subset or after a cached count reaches zero.4950## Workflow51521. Snapshot PR identity, base/head, fork state, checks, comments, and threads.532. Select and revalidate the next unhandled occurrence against the current54 implementation.553. Implement the smallest correct fix and focused test.564. Run focused verification and required checks.575. Inspect, commit, push, and re-read the PR head.586. Reply inline or post a top-level disposition beginning with the handled59 marker and recording source, reviewed/current heads, commit, verification,60 and concise notes.617. Re-read the complete queue and repeat until no unhandled occurrence for the62 review remains or a hard guard stops.6364In managed mode, perform only the `fix` phase for the supplied review queue.65Exit without running the next review. Same-thread resume is only for an66interrupted fix attempt.6768Redirect verbose test, diff, and provider output to run-local temporary logs.69Return status and duration; on failure include no more than the last 200 lines70or 16 KiB, whichever is smaller.7172## Final Response7374Report provider, pull request, reviewed and final snapshots, occurrence totals75and actions by severity, commits/pushes, verification, dispositions, a fresh76remaining-queue scan, and any blocker.