next-issue 6.5.1 → 6.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/hunt.mjs +6 -2
- package/dist/watch.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -522,7 +522,7 @@ The watch stops:
|
|
|
522
522
|
|
|
523
523
|
## Hunt for bugs
|
|
524
524
|
|
|
525
|
-
With `--hunt`, which turns on `--watch`, the harness runs a hunter agent at the same time as the issues. Before each hunt it reads the open issues with the `labels.ready` label and counts those that are ready to claim
|
|
525
|
+
With `--hunt`, which turns on `--watch`, the harness runs a hunter agent at the same time as the issues. Before each hunt it reads the open issues with the `labels.ready` label and counts those that are ready to claim and are not running. It counts a blocked issue only when each of its open blockers is in the same repository and is running or ready to claim, since those blockers can land and close; a blocker that cannot move, such as one with `labels.needsHuman`, `labels.skip` or `labels.done`, one without `labels.ready`, or one in another repository, leaves it out. It looks only at the direct blockers. It hunts only while that count is less than `huntCap`, 1 by default. Otherwise it waits and checks again, with the same back-off as the watch: 1, 2, 3, 5, 10, then 10 minutes, back to 1 minute after a hunt that files an issue. Each wait writes a `hunt.wait` event with the `minutes` to the run log. A hunt that files nothing backs off like a failed one. When the harness claims an issue, the hunter wakes: it ends its wait at once, or skips the wait after a hunt that is going, and checks the count again. A wake keeps the back-off where it was. The hunter:
|
|
526
526
|
|
|
527
527
|
- works in its own worktree at `.worktrees/hunt`, at the remote base branch, which the harness fetches and resets before each hunt;
|
|
528
528
|
- follows `next-issue.hunt.md` in the repository root, or a short built-in prompt when the file is missing;
|
package/dist/hunt.mjs
CHANGED
|
@@ -53,10 +53,14 @@ export function hunter(context) {
|
|
|
53
53
|
let hunting = false;
|
|
54
54
|
return {
|
|
55
55
|
cap: config.huntCap,
|
|
56
|
-
ready: async () => {
|
|
56
|
+
ready: async (running) => {
|
|
57
57
|
const open = (await ports.openIssues(repo, config.issueLimit, labels)).filter((issue) => skipReason(issue, config, false) === undefined);
|
|
58
|
+
const claimable = new Set(open.map((issue) => issue.number));
|
|
58
59
|
const blockers = await Promise.all(open.map((issue) => ports.openBlockers(repo, issue.number)));
|
|
59
|
-
return open.filter((_issue, index) => blockers[index].
|
|
60
|
+
return open.filter((_issue, index) => blockers[index].every((blocker) => {
|
|
61
|
+
const number = Number(/^#(\d+)$/.exec(blocker)?.[1]);
|
|
62
|
+
return running.has(number) || claimable.has(number);
|
|
63
|
+
}));
|
|
60
64
|
},
|
|
61
65
|
hunt: async (count) => {
|
|
62
66
|
hunting = true;
|
package/dist/watch.mjs
CHANGED
|
@@ -49,7 +49,7 @@ function claimAlarm() {
|
|
|
49
49
|
async function huntIssues(hunter, running, claims, stopped, signal) {
|
|
50
50
|
let step = 0;
|
|
51
51
|
while (!stopped()) {
|
|
52
|
-
const ready = await hunter.ready().catch(() => undefined);
|
|
52
|
+
const ready = await hunter.ready(running).catch(() => undefined);
|
|
53
53
|
claims.take();
|
|
54
54
|
const waiting = ready?.filter((issue) => !running.has(issue.number)).length;
|
|
55
55
|
if (waiting !== undefined && waiting < hunter.cap) {
|