1- # PRHunt procedure, version 1
1+ # PRHunt procedure, version 2
22
33This is the procedure for every Mailman coordinator, regardless of model.
44Read it on ` /PRHunt N ` , ` $prhunt N ` , or a request to hunt for N pull requests.
@@ -16,20 +16,35 @@ Claude CLI adapters. Confirm each selected CLI is installed and authenticated
1616with a harmless local fixture before spending a target run.
1717
1818Create the hunt with `mailman hunt init N --primary ADAPTER --primary-model ID
19- --reviewer ADAPTER --reviewer-model ID` . ` mailman hunt status HUNT_ID` gives the
20- next missing step and last-check timestamp. Update it after each run. Its
21- records survive a new conversation. The coordinator performs the actions;
22- the command does not spawn a background agent or discover targets itself.
19+ --reviewer ADAPTER --reviewer-model ID` . It prints a lease with an ` owner`
20+ token. Keep that token: every action that changes the hunt takes `--owner
21+ TOKEN` . ` mailman hunt status HUNT_ID` gives the next missing step and last-check
22+ timestamp. Update it after each run. Its records survive a new conversation.
23+ The coordinator performs the actions; the command does not spawn a background
24+ agent or discover targets itself.
25+
26+ One hunt has one coordinator. If ` hunt status ` shows a live lease you do not
27+ hold, you are the second task on someone else's hunt. Do not poll it and do not
28+ work around it. Either take a separate hunt of your own, or, when the other
29+ coordinator is genuinely gone, take over with `mailman hunt lease HUNT_ID
30+ --owner YOUR_TOKEN --takeover --reason "..."`, which records what you took and
31+ why. Waiting on another coordinator is not progress; it costs the same model
32+ allowance and produces nothing.
33+
34+ Renew the lease with ` mailman hunt lease ` during long stages. Release it with
35+ ` mailman hunt release --owner TOKEN ` when you stop.
2336
2437## Find and screen
2538
26391 . Read the target's contributor instructions and AI policy. Run
2740 ` mailman screen-target OWNER/REPO --refresh ` . Reject a failed screen.
2841 Human-only authorship declarations, assignment requirements and bans on
2942 generated descriptions are reasons to pick another target for this flow.
30- 2 . Search open and closed PRs by exact affected symbol, behaviour and issue
31- number, using more than one query where needed. Read overlapping patches
32- and maintainer responses. A broad empty search is not sufficient evidence.
43+ 2 . Search narrow first. Give ` duplicate-search ` the issue number and the
44+ symbols the change touches with ` --symbol ` ; the broad listing runs after.
45+ A record whose ` decided_by ` is ` narrow ` already found a duplicate and the
46+ candidate is finished. Read overlapping patches and maintainer responses. A
47+ broad empty search is not sufficient evidence, and neither is a narrow one.
33483 . Initialize a run at an exact current upstream commit with the hunt's model
3449 configuration. Add it with ` mailman hunt add HUNT_ID RUN_ID ` .
35504 . Run ` fetch-issue ` , ` duplicate-search ` , ` prior-art ` , ` target-intel ` and
@@ -48,9 +63,11 @@ the command does not spawn a background agent or discover targets itself.
4863 missing dependencies from the reported defect. Run ` reproduce ` , then
4964 ` check-target ` . A bug that no longer reproduces means replace the candidate.
50658 . Use ` build-prompts RUN_ID -- EXECUTABLE ARG ... ` to record verification argv.
51- ` orchestrate RUN_ID ` reads that same command. Do not supply custom prompts
52- or call ` run-agent ` to bypass this sequence. Both model roles must use the
53- same recorded procedure and the independent verification gate.
66+ Everything after ` -- ` is run as a program, so it starts with an executable
67+ and carries no Mailman option; the CLI refuses the common mistakes but not
68+ all of them. ` orchestrate RUN_ID ` reads that same command. Do not supply
69+ custom prompts or call ` run-agent ` to bypass this sequence. Both model roles
70+ must use the same recorded procedure and the independent verification gate.
5471
5572## Repair without escalating routine work
5673
@@ -61,6 +78,16 @@ the command does not spawn a background agent or discover targets itself.
6178 before another edit. Never retry an identical command indefinitely.
6279 For an unusable review, preserve the patch, repair the environment, then
6380 run ` resume-review ` . Do not restart a dirty primary workspace.
81+ Reviewer passes are budgeted per run, not per command: ` --max-review-cycles `
82+ counts across every ` orchestrate ` and ` resume-review ` . When a run blocks on
83+ a spent budget, replace the candidate or raise the budget deliberately and
84+ say why. Do not resume repeatedly to buy more passes.
85+ A run whose ` hunt status ` carries a ` health ` state stopped for a reason
86+ outside the candidate. ` USAGE_LIMIT ` means the account, not the code, and
87+ the record holds the stage and the exact resume command; retrying the
88+ candidate spends the same allowance again. ` INFRASTRUCTURE ` means the host,
89+ such as an unwritable temporary directory. Neither is a candidate defect and
90+ neither is a reason to drop a target.
649111 . Drop duplicate, assigned, prohibited, unreproducible or unsuitable targets.
6592 Record why and continue searching until N candidates pass. A dropped run
6693 costs no user decision. A failed candidate may be replaced after bounded
@@ -85,11 +112,20 @@ the command does not spawn a background agent or discover targets itself.
85112 exact local branch and final body. Run ` handoff-check ` . Keep all filings
86113 and upstream writes pending. For a self-sourced defect, prepare any required
87114 issue text alongside the PR and ask for approval of the ordered filings.
88- 15 . ` mailman hunt finish HUNT_ID ` must exit 0. It counts only SEND decisions
115+ 15 . Refresh the aging evidence for every ready candidate together with
116+ ` mailman hunt refresh HUNT_ID --owner TOKEN ` immediately before finishing.
117+ Duplicate searches and claim reads expire in an hour, and refreshing them
118+ one at a time is how a hunt with two ready candidates reported zero.
119+ 16 . ` mailman hunt finish HUNT_ID --owner TOKEN ` must exit 0. It counts only SEND decisions
89120 with passing filing checks and generates the existing packet format.
90121 Inspect that generated packet visually. Never hand-write review HTML.
91122 Present the packet and ask for approval of the exact filings once.
92123
124+ Do not hold finished work back until the quota is met. ` hunt status ` writes a
125+ checkpoint page as soon as any candidate is ready. Show it. A candidate that is
126+ ready and invisible is indistinguishable to the user from no candidate at all,
127+ and that is what fifteen hours of silence looked like.
128+
93129## What reaches the user
94130
95131Only escalate unavailable user-controlled authentication, an explicit budget
0 commit comments