next-issue 6.3.4 → 6.3.5
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 +2 -2
- package/dist/hunt.mjs +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -522,14 +522,14 @@ 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, have no open blocker and are not running. 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
|
|
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, have no open blocker and are not running. 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. 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;
|
|
529
529
|
- files one issue, for its most serious finding, with the `labels.ready` label, the `labels.hunt` label and the sections of the [issue format](#issue-format), after a search for duplicates. The `labels.hunt` label, `source:hunt` by default, marks the issue as one the hunter filed, and the harness creates it before the hunt when it is missing. It files nothing when it finds no real problem or a duplicate exists;
|
|
530
530
|
- runs no test suite and changes no file. It gets the tools of the reviewer.
|
|
531
531
|
|
|
532
|
-
The hunter ends its reply with an `issue:` line, and the run log holds it as a `hunt.issue` event with the `url`, or `none`. A hunt that fails writes a `hunt.error` event and the watch goes on. The hunter then waits before the next hunt, with a `hunt.wait` event and the same back-off, so a failure that repeats waits 1, 2, 3, 5, 10, then 10 minutes, and the back-off goes back to 1 minute after a hunt that
|
|
532
|
+
The hunter ends its reply with an `issue:` line, and the run log holds it as a `hunt.issue` event with the `url`, or `none`. A hunt that fails writes a `hunt.error` event and the watch goes on. The hunter then waits before the next hunt, with a `hunt.wait` event and the same back-off, so a failure, or a hunt that files nothing, that repeats waits 1, 2, 3, 5, 10, then 10 minutes, and the back-off goes back to 1 minute after a hunt that files an issue. The next pass claims the new issue like any other. At the first `Ctrl-C` the hunter stops after its current hunt, and the watch ends once the hunt and the running issues end. A first `Ctrl-C` during the watch wait tells you so while a hunt runs, and the third press stops the hunter at once. The hunter stops too when the watch ends for another reason.
|
|
533
533
|
|
|
534
534
|
## Worker
|
|
535
535
|
|
package/dist/hunt.mjs
CHANGED
|
@@ -26,7 +26,7 @@ export async function huntWorktree(repo, base, remote) {
|
|
|
26
26
|
}
|
|
27
27
|
export async function hunt(context) {
|
|
28
28
|
const { repo, config, base, recorder, ports } = context;
|
|
29
|
-
|
|
29
|
+
return recorder.step('hunt', {}, async () => {
|
|
30
30
|
const cwd = await oneAtATime(repo.root, () => ports.huntWorktree(repo, base, config.remote));
|
|
31
31
|
await ports.ensureLabel(repo, config.labels.hunt);
|
|
32
32
|
const instructions = await readTextIfPresent(join(repo.root, HUNT_FILE));
|
|
@@ -37,7 +37,9 @@ export async function hunt(context) {
|
|
|
37
37
|
profile: REVIEWING,
|
|
38
38
|
timeoutMs: minutesToMs(config.agentTimeoutMinutes),
|
|
39
39
|
});
|
|
40
|
-
|
|
40
|
+
const url = FILED.exec(result.text)?.[1] ?? 'none';
|
|
41
|
+
recorder.event('hunt.issue', { url }, 'quiet');
|
|
42
|
+
return /^https?:\/\//.test(url);
|
|
41
43
|
});
|
|
42
44
|
}
|
|
43
45
|
export function hunter(context) {
|
|
@@ -55,8 +57,7 @@ export function hunter(context) {
|
|
|
55
57
|
hunt: async () => {
|
|
56
58
|
hunting = true;
|
|
57
59
|
try {
|
|
58
|
-
await hunt(context);
|
|
59
|
-
return true;
|
|
60
|
+
return await hunt(context);
|
|
60
61
|
}
|
|
61
62
|
catch {
|
|
62
63
|
return false;
|