next-issue 8.8.0 → 8.9.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 +18 -8
- package/dist/handover.mjs +0 -9
- package/dist/land.mjs +2 -0
- package/dist/local-base.mjs +9 -0
- package/dist/revert.mjs +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@ npx -y next-issue@latest start
|
|
|
11
11
|
|
|
12
12
|
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.
|
|
13
13
|
|
|
14
|
+
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 0004](https://github.com/ravshansbox/next-issue/blob/main/docs/adr/0004-humanless-flow.md) records this principle, its accepted risks and the setup it recommends.
|
|
15
|
+
|
|
14
16
|
```mermaid
|
|
15
17
|
flowchart TD
|
|
16
18
|
claim[Claim the oldest status:todo issue] --> worktree[Add a worktree and branch]
|
|
@@ -216,7 +218,11 @@ the run handles one issue. For each issue:
|
|
|
216
218
|
holds the commit during the push, so a run stopped meanwhile, or the
|
|
217
219
|
resume after that hand-over (once a person answers or takes the label
|
|
218
220
|
off), checks the base and waits for the checks of the commit when it
|
|
219
|
-
landed. Until then, no run lands another change (see below).
|
|
221
|
+
landed. Until then, no run lands another change (see below). Once the
|
|
222
|
+
commit lands, the harness fetches the remote and fast-forwards the local
|
|
223
|
+
base branch to it when that is safe. A fetch that fails or a
|
|
224
|
+
fast-forward that is not safe leaves the local base branch as it is and
|
|
225
|
+
writes a `base.behind` event, and the landing goes on. The
|
|
220
226
|
harness then waits for the checks of the pushed commit on the base
|
|
221
227
|
branch: the GitHub Actions workflow runs that a `push` of the base
|
|
222
228
|
branch started on it, its commit statuses and the check runs of every
|
|
@@ -274,12 +280,8 @@ the run handles one issue. For each issue:
|
|
|
274
280
|
file and removes the worktree, the local branches and the state file,
|
|
275
281
|
with no new push, revert, label, close or hand-over. A label or close
|
|
276
282
|
that fails for another reason hands the issue over, and it then waits
|
|
277
|
-
for a person like any other hand-over. Then the
|
|
278
|
-
|
|
279
|
-
when that is safe, and the worktree, the local branch and the state
|
|
280
|
-
file go away. A fetch that fails or a fast-forward that is
|
|
281
|
-
not safe leaves the local base branch as it is and writes a `base.behind`
|
|
282
|
-
event, and the issue is still done. When the checks fail, the harness
|
|
283
|
+
for a person like any other hand-over. Then the worktree, the local
|
|
284
|
+
branch and the state file go away. When the checks fail, the harness
|
|
283
285
|
reruns the failed jobs of each failed GitHub Actions workflow run once
|
|
284
286
|
with `gh run rerun <id> --failed`, records a `main-checks.rerun` event
|
|
285
287
|
and waits again once the runs restart. A failed run whose failed jobs
|
|
@@ -309,7 +311,9 @@ the run handles one issue. For each issue:
|
|
|
309
311
|
other `push unknown`. A revert
|
|
310
312
|
push that the remote refuses, for example because the base moved, makes
|
|
311
313
|
the revert again on the new base, three times at most. A failed revert
|
|
312
|
-
push that the base holds after a fetch counts as landed.
|
|
314
|
+
push that the base holds after a fetch counts as landed. Once the revert
|
|
315
|
+
lands, the harness fast-forwards the local base branch to it, as after a
|
|
316
|
+
landed commit. When that fetch
|
|
313
317
|
fails too, the revert may be on the base with checks nobody awaited: the
|
|
314
318
|
harness reports it so, saves the halt and blocks later landings. The state file holds the
|
|
315
319
|
revert commit during the push, so a run stopped meanwhile checks the base
|
|
@@ -569,6 +573,12 @@ on a repository where you trust the writers, or run it in a container.
|
|
|
569
573
|
[ADR 0001](https://github.com/ravshansbox/next-issue/blob/main/docs/adr/0001-reviewer-isolation.md) records why the reviewer
|
|
570
574
|
keeps a full shell, and which other options were considered.
|
|
571
575
|
|
|
576
|
+
No person checks a change before it lands. To replace those checks,
|
|
577
|
+
[ADR 0004](https://github.com/ravshansbox/next-issue/blob/main/docs/adr/0004-humanless-flow.md)
|
|
578
|
+
recommends a non-empty `checks` gate, a different model for the reviewer than
|
|
579
|
+
for the implementer and the fixer in `models`, and running the whole harness in
|
|
580
|
+
a container.
|
|
581
|
+
|
|
572
582
|
## Observability
|
|
573
583
|
|
|
574
584
|
Every run has an id, `<timestamp>`, and writes these under `.next-issue/runs/`:
|
package/dist/handover.mjs
CHANGED
|
@@ -44,7 +44,6 @@ export async function finishDone(job) {
|
|
|
44
44
|
await setStatus(context, issue.number, context.config.labels.done);
|
|
45
45
|
await context.ports.closeIssue(context.repo, issue.number);
|
|
46
46
|
}
|
|
47
|
-
await updateLocalBase(job);
|
|
48
47
|
return { done: true, report: await finish(job, 'done') };
|
|
49
48
|
}
|
|
50
49
|
export async function finishClosing(context, issue, log, state, started) {
|
|
@@ -83,14 +82,6 @@ export async function dropClosed(context, log, issue, branch) {
|
|
|
83
82
|
ms: 0,
|
|
84
83
|
};
|
|
85
84
|
}
|
|
86
|
-
async function updateLocalBase(job) {
|
|
87
|
-
const { context, log } = job;
|
|
88
|
-
const { repo, ports, config, base } = context;
|
|
89
|
-
const updated = await oneAtATime(repo.root, () => ports.fastForwardBase(repo, base, config.remote)).catch(() => false);
|
|
90
|
-
if (!updated) {
|
|
91
|
-
log.event('base.behind', { base }, 'quiet');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
85
|
export function stop(job, reason) {
|
|
95
86
|
job.log.event('issue.stop', { phase: job.state.phase, reason }, 'quiet');
|
|
96
87
|
return jobReport(job, 'stopped', reason);
|
package/dist/land.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { runStopped } from './children.mjs';
|
|
|
2
2
|
import { rebase } from './conflict.mjs';
|
|
3
3
|
import { checkGate, escalateError } from './gate.mjs';
|
|
4
4
|
import { PUSH_TRIES } from './git-land.mjs';
|
|
5
|
+
import { updateLocalBase } from './local-base.mjs';
|
|
5
6
|
import { localChecks } from './local-checks.mjs';
|
|
6
7
|
import { escalateAndFinish, finishDone, stop } from './handover.mjs';
|
|
7
8
|
import { oneAtATime } from './lock.mjs';
|
|
@@ -146,6 +147,7 @@ async function pushChange(job) {
|
|
|
146
147
|
await writeState(repo, state);
|
|
147
148
|
if (pushed) {
|
|
148
149
|
job.repairing = false;
|
|
150
|
+
await updateLocalBase(job);
|
|
149
151
|
return sha;
|
|
150
152
|
}
|
|
151
153
|
attempt += 1;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { oneAtATime } from './lock.mjs';
|
|
2
|
+
export async function updateLocalBase(job) {
|
|
3
|
+
const { context, log } = job;
|
|
4
|
+
const { repo, ports, config, base } = context;
|
|
5
|
+
const updated = await oneAtATime(repo.root, () => ports.fastForwardBase(repo, base, config.remote)).catch(() => false);
|
|
6
|
+
if (!updated) {
|
|
7
|
+
log.event('base.behind', { base }, 'quiet');
|
|
8
|
+
}
|
|
9
|
+
}
|
package/dist/revert.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { runStopped } from './children.mjs';
|
|
2
2
|
import { message } from './errors.mjs';
|
|
3
|
+
import { updateLocalBase } from './local-base.mjs';
|
|
3
4
|
import { writeState } from './state.mjs';
|
|
4
5
|
import { HALT_NOTE, releaseSettled } from './unsettled.mjs';
|
|
5
6
|
export async function revertFailedFix(job) {
|
|
@@ -80,5 +81,6 @@ export async function revert(job) {
|
|
|
80
81
|
restoreChange(state);
|
|
81
82
|
releaseSettled(state);
|
|
82
83
|
await writeState(repo, state);
|
|
84
|
+
await updateLocalBase(job);
|
|
83
85
|
return ` The harness reverted the change on ${base}.`;
|
|
84
86
|
}
|