next-issue 7.8.28 → 7.8.30

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 CHANGED
@@ -866,8 +866,11 @@ A run without `--watch` ends when no unseen issue is left. With
866
866
  `next-issue start --watch`, the harness then waits, reads the open issues again
867
867
  and runs another pass, so it picks up an issue that someone opens during the run, or one whose blocker
868
868
  closes. Each pass tries every open issue again, also one that an earlier pass
869
- skipped. An issue that failed in an earlier pass is not tried again until the
870
- next run.
869
+ skipped. An issue that failed with an error before the claim is not tried
870
+ again until the next run. An issue that failed after the claim and was handed
871
+ over with the needs-human label is tried again in a later pass once a person
872
+ answers the hand-over or takes the label off. The hunter counts the same
873
+ issues as ready.
871
874
 
872
875
  The waits follow a fixed back-off in minutes: 1, 2, 3, 5, 10, then 10 from then
873
876
  on. A pass that handles an issue, with any outcome other than `skipped`, resets
package/dist/budget.mjs CHANGED
@@ -22,9 +22,10 @@ export async function refundBudget(job, budget) {
22
22
  await writeState(context.repo, state);
23
23
  }
24
24
  /** Gives the spent budget back if the process is killed (third Ctrl-C) while `body` runs. */
25
- export async function refundOnKill(job, budget, body) {
25
+ export async function refundOnKill(job, budget, body, undo) {
26
26
  const { context, state } = job;
27
27
  const forget = onKill(() => {
28
+ undo?.();
28
29
  state[budget] = Math.max(0, state[budget] - 1);
29
30
  writeStateNow(context.repo, state);
30
31
  });
package/dist/handover.mjs CHANGED
@@ -201,9 +201,11 @@ export async function claimedError(context, log, issue, state, error, started) {
201
201
  // Saved with the hand-over, so later runs land nothing before the base is checked.
202
202
  state.halted = true;
203
203
  }
204
+ let handedOver = false;
204
205
  try {
205
206
  const earlier = error instanceof HandOverFailed ? error.pending : undefined;
206
207
  await handOver(context, log, issue.number, state, handOverReason(error, reason), earlier);
208
+ handedOver = true;
207
209
  }
208
210
  catch (failure) {
209
211
  log.event('hand-over.error', { error: message(failure) }, 'quiet');
@@ -211,7 +213,10 @@ export async function claimedError(context, log, issue, state, error, started) {
211
213
  // The issue ends (and the waiting questions go out) only once the hand-over is done.
212
214
  logIssueError(log, error, started);
213
215
  await cleanUp(context, log, state.branch);
214
- const report = issueReport(issue.number, 'error', state, started, reason);
216
+ const report = {
217
+ ...issueReport(issue.number, 'error', state, started, reason),
218
+ ...(handedOver ? { handedOver } : {}),
219
+ };
215
220
  if (!(error instanceof UnsettledBase)) {
216
221
  return report;
217
222
  }
package/dist/review.mjs CHANGED
@@ -52,7 +52,20 @@ async function changesRequestedRound(job, open, earlier) {
52
52
  const findings = formatFindings(open);
53
53
  state.reviewLog.push({ round: state.reviewRounds, findings });
54
54
  await writeState(job.context.repo, state);
55
- const fix = await fixRound(job, 'The reviewer requested changes.', findings, earlier, 'review');
55
+ const forget = () => {
56
+ state.reviewLog.pop();
57
+ };
58
+ let fix;
59
+ try {
60
+ fix = await refundOnKill(job, 'reviewRounds', () => fixRound(job, 'The reviewer requested changes.', findings, earlier, 'review'), forget);
61
+ }
62
+ catch (error) {
63
+ if (runStopped()) {
64
+ forget();
65
+ await refundBudget(job, 'reviewRounds');
66
+ }
67
+ throw error;
68
+ }
56
69
  if (!fix.committed) {
57
70
  return unfixedRound(job, fix);
58
71
  }
package/dist/watch.mjs CHANGED
@@ -133,7 +133,7 @@ function addReports(reports, pass) {
133
133
  }
134
134
  function recordFailures(failed, reports) {
135
135
  for (const report of reports) {
136
- if (report.outcome === 'error') {
136
+ if (report.outcome === 'error' && report.handedOver !== true) {
137
137
  failed.add(report.issue);
138
138
  }
139
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "7.8.28",
3
+ "version": "7.8.30",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",