next-issue 12.4.3 → 12.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 +7 -5
- package/dist/config.mjs +1 -1
- package/dist/editors.mjs +8 -1
- package/dist/hunt.mjs +1 -0
- package/dist/job.mjs +1 -1
- package/dist/pipeline.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -88,14 +88,14 @@ The harness hands the issue to a person, with the `status:needs-human` label, an
|
|
|
88
88
|
- the push to the base branch fails while the base did not move, or fails three times;
|
|
89
89
|
- the checks on the base branch fail and the fixer cannot fix them, an error stops the fix, or they do not finish in time. The base branch is then broken, so the run claims no new issue and ends once the running issues end. It halts this way even when the hand-over fails; the issue then ends in error with both the reason and the hand-over error;
|
|
90
90
|
- the implementer asks questions about the issue (reason `questions`);
|
|
91
|
-
- a person without write access last changed the title or body of the issue (reason `untrusted editor`, see [Safety](#safety));
|
|
91
|
+
- a person without write access last changed the title or body of the issue (reason `untrusted editor`, see [Safety](#safety)). On a resume whose state holds a landed commit, or a push or revert that may have reached the base, this check runs before the harness checks the base, so it then also halts the run, as a failed setup does;
|
|
92
92
|
- an agent does not finish in `agentTimeoutMinutes`;
|
|
93
93
|
- the setup command fails, or does not finish in `setupTimeoutMinutes`. On a resume whose state holds a landed commit, or a push or revert that may have reached the base, the setup runs before the harness checks the base, so it then also halts the run, with the commits and state kept for the next run. The comment says what may be on the base and that its checks were not awaited;
|
|
94
94
|
- a step of the run fails with an error. A `gh` call that is safe to repeat, such as a read or a label edit, is tried up to three times first when the network fails. So is a `gh run rerun`: when GitHub took the first try, it refuses the next as already running, which counts as a started rerun. A `gh issue comment` is tried once, so a lost reply never makes a duplicate. On a resume whose state holds a landed commit, or a push or revert that may have reached the base, an error before the harness checks the base (for example a failed fetch of the base, or a worktree that cannot be made) also halts the run, as `push unknown` does. The issue ends in error, the comment says what may be on the base and that its checks were not awaited, and the state keeps the commits for the next run.
|
|
95
95
|
|
|
96
96
|
After a halt, a running issue that reaches the landing does not land on the broken base branch: it ends `stopped` with the reason `run halted` and keeps its state, branch and labels. The next run resumes it and lands it with no new review.
|
|
97
97
|
|
|
98
|
-
A halt that leaves a commit on the base, or a push or revert that may be on it, with checks nobody awaited (`checks error`, `push unknown`, `main checks timeout`, `main checks cancelled`, `main checks cut short`, an error
|
|
98
|
+
A halt that leaves a commit on the base, or a push or revert that may be on it, with checks nobody awaited (`checks error`, `push unknown`, `main checks timeout`, `main checks cancelled`, `main checks cut short`, an error, a failed setup or an `untrusted editor` hand-over on such a resume before the base is checked, or a stop or kill while the run pushes a change to the base, waits for the checks of a commit it landed, or fixes the failed checks of that commit before the fix lands or the revert of that commit ends) is saved in the state file of its issue. A stopped issue resumes in the next run; any other waits for a person, so later runs skip it. Either way, no later run lands another change meanwhile: an issue that reaches the landing ends `stopped` with the reason `base unchecked`, keeps its state, branch and labels, and the run claims no more issues; the log holds a `land.blocked` event with the waiting issues. Runs take such a halted issue before the others, and a running one still resumes, so an older issue that reaches the landing first does not keep it from checking the base. Once a person answers or takes the label off, the issue resumes, checks the base and waits for the checks of its commit; when those are known (the issue is done, or its commits are reverted or found not on the base), the issue drops the halt from its state and the next run lands the held issues again. A later landing of that issue blocks other runs only if it halts again. A person who gives such an issue up instead (the `skip` label, which **Give up** in pi adds) releases the block: the next run skips the issue, drops its halt from the state and logs a `land.released` event, so other issues land again on a base whose last checks nobody read. The state keeps the commits, so taking the `skip` label off later resumes the issue and checks them. Such a resume is not held back by another halted issue while it only checks its commit already on the base; a fix it has to land waits like any other change. The hand-over comment says so. A halted issue that was deleted or moved to another repository can no longer be answered or given up, so the next run that gets a not-found error when it reads the issue releases it the same way: it drops the halt from the state, keeps the commits and logs a `land.released` event with the reason `issue not found`. Any other read error (for example a network error) keeps the block for that run.
|
|
99
99
|
|
|
100
100
|
The fixer sees the findings of all earlier rounds, not only the last one, with its own disputes next to them. From round two, the reviewer judges only the earlier findings and any regression.
|
|
101
101
|
|
|
@@ -162,7 +162,7 @@ The console shows the run and issue milestones, verdicts, hand-overs, errors, ea
|
|
|
162
162
|
- git 2.40 or later (every commit runs `git hook run`, every conflict with the base runs `git check-attr --source`). A run or `serve` run on an older git stops before it claims an issue, with an error that names both versions.
|
|
163
163
|
- `gh`, authenticated with write access to the repository
|
|
164
164
|
- a `remote` on GitHub: `github.com`, or a GitHub Enterprise host. Every `gh` call names the host of the remote url (`--repo <host>/<owner>/<name>`, `gh api --hostname <host>`) when it is not `github.com`, so `gh` must be logged in to that host. For an ssh url the harness reads the real host of an ssh alias with `ssh -G`. The host `ssh.github.com` (GitHub's ssh over port 443) means `github.com`. Other hosts, such as GitLab, are not supported.
|
|
165
|
-
- pi, logged in to a model provider. The agents use the model, the thinking level, the extensions and the skills from your pi settings, except the extension and the skills of the `pi-next-issue` package. A repository under a folder named `pi-next-issue` keeps its project extensions and skills. The implementer and the fixer get the default tools of your pi settings, the `grep`, `find` and `ls` tools and the tools of your extensions. The reviewer gets all of them except `edit` and `write`. The agents run with `GIT_OPTIONAL_LOCKS=0`, so a `git status` from an agent or an extension does not hold the index lock while the harness commits. While an agent runs, `process.argv[1]` is the pi CLI, so an extension that starts a child pi with `process.execPath` and `process.argv[1]` (such as a `subagent` tool) runs pi, not next-issue.
|
|
165
|
+
- pi, logged in to a model provider. The agents use the model (unless `models` sets one), the thinking level, the extensions and the skills from your pi settings, except the extension and the skills of the `pi-next-issue` package. A repository under a folder named `pi-next-issue` keeps its project extensions and skills. The implementer and the fixer get the default tools of your pi settings, the `grep`, `find` and `ls` tools and the tools of your extensions. The reviewer gets all of them except `edit` and `write`. The agents run with `GIT_OPTIONAL_LOCKS=0`, so a `git status` from an agent or an extension does not hold the index lock while the harness commits. While an agent runs, `process.argv[1]` is the pi CLI, so an extension that starts a child pi with `process.execPath` and `process.argv[1]` (such as a `subagent` tool) runs pi, not next-issue.
|
|
166
166
|
|
|
167
167
|
## Configuration
|
|
168
168
|
|
|
@@ -209,7 +209,9 @@ With no file, every field keeps its default. A field that is not in the file kee
|
|
|
209
209
|
"maxCommitFixes": 10,
|
|
210
210
|
"maxReviewRounds": 5,
|
|
211
211
|
"models": {
|
|
212
|
+
"default": null,
|
|
212
213
|
"fixer": null,
|
|
214
|
+
"hunter": null,
|
|
213
215
|
"implementer": null,
|
|
214
216
|
"reviewer": null
|
|
215
217
|
},
|
|
@@ -238,7 +240,7 @@ With no file, every field keeps its default. A field that is not in the file kee
|
|
|
238
240
|
| `maxCiFixes` | `5` | The budget for check fixes per issue |
|
|
239
241
|
| `maxCommitFixes` | `10` | The budget for fixes of a commit that a git hook stopped, per issue |
|
|
240
242
|
| `maxReviewRounds` | `5` | The budget for review rounds per issue |
|
|
241
|
-
| `models` | `null` per role | The pi model per agent role, as `provider/model`: `implementer`, `reviewer`, `fixer`
|
|
243
|
+
| `models` | `null` per role | The pi model per agent role, as `provider/model`: `default`, `implementer`, `reviewer`, `fixer`, `hunter` |
|
|
242
244
|
| `remote` | `origin` | The git remote for the repository and the branches |
|
|
243
245
|
| `setupCommand` | from the lock file | A shell command to run in a new worktree, before the implementer, and after each merge of the base before the `checks` |
|
|
244
246
|
| `setupTimeoutMinutes` | `15` | The limit for the setup command, at most `35791` |
|
|
@@ -253,7 +255,7 @@ The harness compares the labels on an issue with the configured names without ca
|
|
|
253
255
|
|
|
254
256
|
The log gives the reason for a skipped issue as `stop-label`, `not-ready`, `in-flight` or `blocked`, the last one with the open blockers.
|
|
255
257
|
|
|
256
|
-
A role set to `null`, or with no entry in `models`, uses the default model of your pi settings.
|
|
258
|
+
A role set to `null`, or with no entry in `models`, uses `models.default`. When `models.default` is `null` or missing too, it uses the default model of your pi settings.
|
|
257
259
|
|
|
258
260
|
Without a `setupCommand`, the harness looks for a lock file in the new worktree, and in the worktree after each merge of the base before the `checks`, and runs the install command that goes with it:
|
|
259
261
|
|
package/dist/config.mjs
CHANGED
|
@@ -65,7 +65,7 @@ const WHOLE_FIELDS = [
|
|
|
65
65
|
['keepRunDays', 0],
|
|
66
66
|
['checksTimeoutMinutes', 1, MAX_MINUTES],
|
|
67
67
|
];
|
|
68
|
-
const MODEL_ROLES = ['implementer', 'reviewer', 'fixer'];
|
|
68
|
+
const MODEL_ROLES = ['default', 'implementer', 'reviewer', 'fixer', 'hunter'];
|
|
69
69
|
const LABEL_NAMES = [
|
|
70
70
|
'ready',
|
|
71
71
|
'inProgress',
|
package/dist/editors.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { escalateAndFinish } from './handover.mjs';
|
|
2
|
+
import { heldOnBase, unsettledNote } from './unsettled.mjs';
|
|
2
3
|
/** Hands the issue over when a person without write access last changed its title or body; otherwise gives the job the title and body checked. */
|
|
3
4
|
export async function untrustedEditors(job) {
|
|
4
5
|
const { context, issue, log } = job;
|
|
@@ -21,5 +22,11 @@ export async function untrustedEditors(job) {
|
|
|
21
22
|
.map(({ part, login }) => `the ${part} was last changed by @${login}, who has no write access to the repository`)
|
|
22
23
|
.join('; ');
|
|
23
24
|
const parts = untrusted.map(({ part }) => `the ${part}`).join(' and ');
|
|
24
|
-
|
|
25
|
+
const held = heldOnBase(job.state, context.base);
|
|
26
|
+
if (held !== '') {
|
|
27
|
+
job.mainBroken = true;
|
|
28
|
+
job.state.halted = true;
|
|
29
|
+
}
|
|
30
|
+
const unsettled = held === '' ? '' : unsettledNote(held, 'This resume stopped');
|
|
31
|
+
return escalateAndFinish(job, `The worker did not send the issue to an agent: ${changed}. A person with write access can check the issue, then change ${parts} to go on.${unsettled}`, 'untrusted editor');
|
|
25
32
|
}
|
package/dist/hunt.mjs
CHANGED
|
@@ -60,6 +60,7 @@ export async function hunt(context, count) {
|
|
|
60
60
|
cwd,
|
|
61
61
|
prompt: await withNotes(repo.root, huntPrompt(instructions, config.labels.ready, config.labels.hunt, count, repoArg(repo)), false),
|
|
62
62
|
profile: REVIEWING,
|
|
63
|
+
model: config.models.hunter ?? config.models.default,
|
|
63
64
|
timeoutMs: minutesToMs(config.agentTimeoutMinutes),
|
|
64
65
|
});
|
|
65
66
|
const urls = await issuesOf(context, [...result.text.matchAll(FILED)].map((match) => match[1]));
|
package/dist/job.mjs
CHANGED
|
@@ -26,7 +26,7 @@ export async function runRole(job, role, prompt, profile) {
|
|
|
26
26
|
cwd: job.worktree,
|
|
27
27
|
prompt: await withNotes(repo.root, prompt, writable),
|
|
28
28
|
profile,
|
|
29
|
-
model: config.models[role],
|
|
29
|
+
model: config.models[role] ?? config.models.default,
|
|
30
30
|
timeoutMs: minutesToMs(config.agentTimeoutMinutes),
|
|
31
31
|
};
|
|
32
32
|
const took = (await job.slot?.take()) === true;
|
package/dist/pipeline.mjs
CHANGED
|
@@ -82,7 +82,7 @@ async function work(context, issue, log, state, start, handedOver, pending, slot
|
|
|
82
82
|
if (setup.done) {
|
|
83
83
|
return setup.report;
|
|
84
84
|
}
|
|
85
|
-
const untrusted = await untrustedEditors(job);
|
|
85
|
+
const untrusted = await beforeBaseSettled(state, context.base, () => untrustedEditors(job));
|
|
86
86
|
if (untrusted !== undefined) {
|
|
87
87
|
return untrusted.report;
|
|
88
88
|
}
|