next-issue 14.4.22 → 14.5.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/shared/loop.mjs +1 -1
- package/dist/shared/prompts.mjs +3 -0
- package/dist/shared/watch.mjs +7 -28
- package/dist/worker/pipeline.mjs +1 -2
- package/dist/worker/run.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ A small harness that works through the open issues of a GitHub repository with t
|
|
|
6
6
|
|
|
7
7
|
The harness claims the oldest open issue with the `status:todo` label and gives it its own git worktree and branch. An implementer agent does the work and the harness commits it. A reviewer agent judges the diff, and a fixer agent deals with any open finding, and the review runs again. With no open finding left, the harness rebases the change onto the base branch as one commit, pushes it there with no pull request and waits for the checks of that commit. On a red build the harness reruns the failed jobs of each failed workflow run once, and only a run that fails again goes to the fixer, whose fix lands the same way. When the checks pass, the issue is closed and gets `status:done`. When a budget runs out or the work cannot go on, the issue gets `status:needs-human` and goes to a person. Then the harness takes the next issue.
|
|
8
8
|
|
|
9
|
-
The harness is built for a flow with as few people in it as possible: people write issues and answer hand-overs, and the harness does the rest. [ADR
|
|
9
|
+
The harness is built for a flow with as few people in it as possible: people write issues and answer hand-overs, and the harness does the rest. [ADR 0002](https://github.com/ravshansbox/next-issue/blob/main/docs/adr/0002-humanless-flow.md) records this principle, its accepted risks and the setup it recommends.
|
|
10
10
|
|
|
11
11
|
```mermaid
|
|
12
12
|
flowchart TD
|
package/dist/shared/loop.mjs
CHANGED
|
@@ -125,7 +125,7 @@ async function claimIssues(loop, seen, tried, pool) {
|
|
|
125
125
|
}
|
|
126
126
|
seen.add(issue.number);
|
|
127
127
|
const slot = pool.slots.claim();
|
|
128
|
-
pool.running.set(issue.number, loop.process(issue,
|
|
128
|
+
pool.running.set(issue.number, loop.process(issue, slot).then((report) => ({ issue: issue.number, slot, report }), (failure) => ({ issue: issue.number, slot, failure })));
|
|
129
129
|
}
|
|
130
130
|
return { claiming: true, unclaimed: false };
|
|
131
131
|
}
|
package/dist/shared/prompts.mjs
CHANGED
|
@@ -226,6 +226,9 @@ export function history(rounds) {
|
|
|
226
226
|
const HUNT_DEFAULT = [
|
|
227
227
|
'Read the whole repository and look for bugs: wrong results, unhandled errors, races, security holes and documentation that contradicts the code.',
|
|
228
228
|
'Prove each finding from the code. A guess is not a finding.',
|
|
229
|
+
'File only a finding that a user hits in normal use. Name the steps of that use and what goes wrong for the user. Leave out a finding that needs an unusual mix of signals, timings, stops or failures.',
|
|
230
|
+
'Start the `## Problem` section with a `Severity: high`, `Severity: medium` or `Severity: low` line, and file only high findings. A finding is high when a user in normal use loses work, gets a wrong result or has a run, a push or the base branch break.',
|
|
231
|
+
'When the bug is in code that was added to fix an earlier issue, propose to remove or simplify that code instead of adding another guard, and name the earlier issue.',
|
|
229
232
|
].join('\n');
|
|
230
233
|
export function huntPrompt(instructions, ready, source, count, repository) {
|
|
231
234
|
const issues = count === 1 ? '1 issue' : `${count} issues`;
|
package/dist/shared/watch.mjs
CHANGED
|
@@ -5,17 +5,16 @@ export async function watchIssues(watch) {
|
|
|
5
5
|
const running = new Set();
|
|
6
6
|
const failed = new Set();
|
|
7
7
|
const ended = new AbortController();
|
|
8
|
-
const claims = claimAlarm();
|
|
9
8
|
const hunting = watch.hunter === undefined
|
|
10
9
|
? undefined
|
|
11
|
-
: huntIssues(watch.hunter, watch.hunting ?? onOff(true), running, failed,
|
|
10
|
+
: huntIssues(watch.hunter, watch.hunting ?? onOff(true), running, failed, watch.issues, watch.refreshed, () => ended.signal.aborted || watch.stop(), ended.signal);
|
|
12
11
|
try {
|
|
13
12
|
return await watchPasses(failed, {
|
|
14
13
|
...watch,
|
|
15
|
-
process: async (issue,
|
|
14
|
+
process: async (issue, slot) => {
|
|
16
15
|
running.add(issue.number);
|
|
17
16
|
try {
|
|
18
|
-
const report = await watch.process(issue,
|
|
17
|
+
const report = await watch.process(issue, slot);
|
|
19
18
|
recordFailures(failed, [report]);
|
|
20
19
|
return report;
|
|
21
20
|
}
|
|
@@ -30,25 +29,6 @@ export async function watchIssues(watch) {
|
|
|
30
29
|
await hunting;
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
function claimAlarm() {
|
|
34
|
-
let rung = false;
|
|
35
|
-
let controller = new AbortController();
|
|
36
|
-
return {
|
|
37
|
-
ring: () => {
|
|
38
|
-
rung = true;
|
|
39
|
-
controller.abort();
|
|
40
|
-
},
|
|
41
|
-
take: () => {
|
|
42
|
-
const was = rung;
|
|
43
|
-
rung = false;
|
|
44
|
-
return was;
|
|
45
|
-
},
|
|
46
|
-
signal: () => {
|
|
47
|
-
controller = new AbortController();
|
|
48
|
-
return controller.signal;
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
32
|
function aborted(signal) {
|
|
53
33
|
return new Promise((resolve) => {
|
|
54
34
|
if (signal.aborted) {
|
|
@@ -59,7 +39,7 @@ function aborted(signal) {
|
|
|
59
39
|
}
|
|
60
40
|
});
|
|
61
41
|
}
|
|
62
|
-
async function huntIssues(hunter, hunting, running, failed,
|
|
42
|
+
async function huntIssues(hunter, hunting, running, failed, issues, refreshes, stopped, signal) {
|
|
63
43
|
let step = 0;
|
|
64
44
|
while (!stopped()) {
|
|
65
45
|
if (!hunting.on()) {
|
|
@@ -71,7 +51,6 @@ async function huntIssues(hunter, hunting, running, failed, claims, issues, refr
|
|
|
71
51
|
if (stopped()) {
|
|
72
52
|
return;
|
|
73
53
|
}
|
|
74
|
-
claims.take();
|
|
75
54
|
const waiting = ready?.filter((issue) => !running.has(issue.number)).length;
|
|
76
55
|
if (waiting !== undefined && waiting < hunter.cap && hunting.on()) {
|
|
77
56
|
if (await hunter.hunt(hunter.cap - waiting)) {
|
|
@@ -79,16 +58,16 @@ async function huntIssues(hunter, hunting, running, failed, claims, issues, refr
|
|
|
79
58
|
await issues().catch(() => undefined);
|
|
80
59
|
}
|
|
81
60
|
}
|
|
82
|
-
if (
|
|
61
|
+
if (stopped() || !hunting.on()) {
|
|
83
62
|
continue;
|
|
84
63
|
}
|
|
85
64
|
const changed = hunting.changed();
|
|
86
65
|
const refreshed = refreshes?.() ?? new AbortController().signal;
|
|
87
|
-
await hunter.wait(backOffMinutes(step), AbortSignal.any([signal,
|
|
66
|
+
await hunter.wait(backOffMinutes(step), AbortSignal.any([signal, changed, refreshed]));
|
|
88
67
|
if (changed.aborted || refreshed.aborted) {
|
|
89
68
|
step = 0;
|
|
90
69
|
}
|
|
91
|
-
else
|
|
70
|
+
else {
|
|
92
71
|
step += 1;
|
|
93
72
|
}
|
|
94
73
|
}
|
package/dist/worker/pipeline.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { hasLabel } from '../shared/labels.mjs';
|
|
|
11
11
|
import { newState, readState, resetState, } from '../shared/state.mjs';
|
|
12
12
|
import { beforeBaseSettled } from '../shared/unsettled.mjs';
|
|
13
13
|
import { setUp } from './worktree-setup.mjs';
|
|
14
|
-
export async function processIssue(context, issue,
|
|
14
|
+
export async function processIssue(context, issue, slot) {
|
|
15
15
|
const { repo } = context;
|
|
16
16
|
const started = Date.now();
|
|
17
17
|
const log = context.recorder.scope({ issue: issue.number });
|
|
@@ -35,7 +35,6 @@ export async function processIssue(context, issue, claimed = () => undefined, sl
|
|
|
35
35
|
if (skip !== undefined) {
|
|
36
36
|
return skip;
|
|
37
37
|
}
|
|
38
|
-
claimed();
|
|
39
38
|
log.event('issue.start', { title: issue.title, createdAt: issue.createdAt });
|
|
40
39
|
const state = startState(issue, saved, handedOver);
|
|
41
40
|
let report;
|
package/dist/worker/run.mjs
CHANGED
|
@@ -47,7 +47,7 @@ async function handle(args, config, repo, recorder, controls) {
|
|
|
47
47
|
const context = await startRun(args, config, repo, recorder, interrupts);
|
|
48
48
|
const loop = {
|
|
49
49
|
issues: () => pendingIssues(context),
|
|
50
|
-
process: (issue,
|
|
50
|
+
process: (issue, slot) => processIssue(context, issue, slot),
|
|
51
51
|
stop: interrupts.afterIssue,
|
|
52
52
|
concurrency: config.concurrency,
|
|
53
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-issue",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.5.0",
|
|
4
4
|
"description": "Autonomous issue harness driven by the Claude Agent SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"node": ">=24"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
|
-
"build": "tsc -p tsconfig.build.json",
|
|
34
|
+
"build": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json",
|
|
35
35
|
"start": "node src/cli.mts",
|
|
36
36
|
"test": "node --test \"test/**/*.test.mts\"",
|
|
37
37
|
"typecheck": "tsc --noEmit",
|