next-issue 6.6.90 → 6.6.91

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
@@ -323,7 +323,9 @@ Press `Ctrl-C` to stop the run step by step:
323
323
  starts, so the reviewer sees only the commits of the branch. Files that
324
324
  git ignores, such as build output, stay. When it
325
325
  resumes before the first commit, the implementer runs again and the
326
- commit holds them.
326
+ commit holds them. A review round or a check fix whose reviewer or
327
+ fixer this press kills does not count, so the next run runs that step
328
+ again with the same budget.
327
329
 
328
330
  When the reviewer approved the change and the run stopped before its
329
331
  commit reached the base branch, the next run drops those edits and any
package/dist/budget.mjs CHANGED
@@ -15,3 +15,8 @@ export async function spendBudget(job, budget, note, reason, beforeHandOver) {
15
15
  await writeState(context.repo, state);
16
16
  return undefined;
17
17
  }
18
+ export async function refundBudget(job, budget) {
19
+ const { context, state } = job;
20
+ state[budget] = Math.max(0, state[budget] - 1);
21
+ await writeState(context.repo, state);
22
+ }
package/dist/gate.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { budgetUse } from './budget.mjs';
1
+ import { budgetUse, refundBudget } from './budget.mjs';
2
2
  import { checkWaiting } from './check-poll.mjs';
3
3
  import { runStopped } from './children.mjs';
4
4
  import { asError, message } from './errors.mjs';
@@ -85,6 +85,7 @@ async function failedChecksFix(job, sha) {
85
85
  logs = await ports.failedBaseLogs(repo, sha, base, config.logMaxChars);
86
86
  }
87
87
  catch (error) {
88
+ await refundStopped(job);
88
89
  return escalateError(job, error, `The read of the failed checks on ${base} failed`, 'logs error');
89
90
  }
90
91
  log.event('main-checks.logs', { chars: logs.length });
@@ -93,6 +94,7 @@ async function failedChecksFix(job, sha) {
93
94
  fix = await fixRound(job, `The checks on ${base} failed after the change landed there.`, logs, [], 'checks');
94
95
  }
95
96
  catch (error) {
97
+ await refundStopped(job);
96
98
  return escalateError(job, error, `The fixer for the failed checks on ${base} failed`, 'fixer error');
97
99
  }
98
100
  if (!fix.committed) {
@@ -102,6 +104,11 @@ async function failedChecksFix(job, sha) {
102
104
  job.repairing = true;
103
105
  return GATE_FIXED;
104
106
  }
107
+ async function refundStopped(job) {
108
+ if (runStopped()) {
109
+ await refundBudget(job, 'ciFixes');
110
+ }
111
+ }
105
112
  export async function escalateError(job, error, note, reason) {
106
113
  if (runStopped()) {
107
114
  throw error;
package/dist/review.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { REVIEWING } from './agents.mjs';
2
2
  import { runStopped } from './children.mjs';
3
- import { budgetUse, spendBudget } from './budget.mjs';
3
+ import { budgetUse, refundBudget, spendBudget } from './budget.mjs';
4
4
  import { message } from './errors.mjs';
5
5
  import { fixRound } from './fix.mjs';
6
6
  import { escalateAndFinish } from './handover.mjs';
@@ -18,9 +18,19 @@ export async function reviewRound(job) {
18
18
  if (exhausted) {
19
19
  return exhausted;
20
20
  }
21
- await setStatus(context, issue.number, config.labels.inReview);
22
21
  const earlier = history(state.reviewLog);
23
- const verdict = parseVerdict(await runReviewer(job, earlier));
22
+ let text;
23
+ try {
24
+ await setStatus(context, issue.number, config.labels.inReview);
25
+ text = await runReviewer(job, earlier);
26
+ }
27
+ catch (error) {
28
+ if (runStopped()) {
29
+ await refundBudget(job, 'reviewRounds');
30
+ }
31
+ throw error;
32
+ }
33
+ const verdict = parseVerdict(text);
24
34
  if (verdict === undefined) {
25
35
  return escalateAndFinish(job, 'The reviewer gave no verdict.', 'no verdict');
26
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.90",
3
+ "version": "6.6.91",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",