next-issue 6.6.56 → 6.6.58

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
@@ -157,7 +157,11 @@ the run handles one issue. For each issue:
157
157
  even when another check (such as a release workflow) ends `success`:
158
158
  the harness hands the issue to a person with the reason
159
159
  `main checks cancelled` and halts, and the issue stays open. A repository
160
- that reports no check keeps asking for `checkGraceSeconds`. A pending state
160
+ that reports no check keeps asking for `checkGraceSeconds`. When every
161
+ check passes, the harness keeps asking until `checkGraceSeconds` have gone
162
+ by since it first read the checks, since GitHub can add a check a few
163
+ seconds after the others; a check that shows up in that time counts, and
164
+ one that shows up later does not. A pending state
161
165
  waits again, up to `checkTimeoutMinutes`. A read that fails is tried three
162
166
  times. When the checks pass, the harness closes the issue and sets
163
167
  `status:done`, fetches the remote and fast-forwards the local base branch
@@ -251,6 +255,11 @@ and comments the reason on the issue, when:
251
255
  network fails. A `gh issue comment` is
252
256
  tried once, so a lost reply never makes a duplicate.
253
257
 
258
+ After a halt, a running issue that reaches the landing does not land on the
259
+ broken base branch: it ends `stopped` with the reason `run halted` and keeps
260
+ its state, branch and labels. The next run resumes it and lands it with no new
261
+ review.
262
+
254
263
  The fixer sees the findings of all earlier rounds, not only the last one, with
255
264
  its own disputes next to them. From round two, the reviewer judges only the
256
265
  earlier findings and any regression.
@@ -452,7 +461,7 @@ because no pull request is opened.
452
461
  | `maxCommitFixes` | `10` | The budget for fixes of a commit that a git hook stopped, per issue |
453
462
  | `maxReviewRounds` | `5` | The budget for review rounds per issue |
454
463
  | `checkIntervalSeconds` | `15` | The time between two check states, at most `2147483` |
455
- | `checkGraceSeconds` | `60` | The time to wait for the first check to show |
464
+ | `checkGraceSeconds` | `60` | The time to wait for the first check to show, and for more checks after they all pass |
456
465
  | `checkTimeoutMinutes` | `60` | The limit for one check wait, at most `35791` |
457
466
  | `agentTimeoutMinutes` | `30` | The limit for one agent call, at most `35791` |
458
467
  | `setupTimeoutMinutes` | `15` | The limit for the setup command, at most `35791` |
@@ -46,8 +46,8 @@ export async function pollChecks(probe, options, clock = REAL_CLOCK) {
46
46
  }
47
47
  }
48
48
  function settled(state, waitedMs, graceMs) {
49
- if (state === 'none') {
50
- return waitedMs >= graceMs ? 'none' : undefined;
49
+ if (state === 'none' || state === 'pass') {
50
+ return waitedMs >= graceMs ? state : undefined;
51
51
  }
52
52
  return state === 'behind' || state === 'pending' ? undefined : state;
53
53
  }
@@ -1,6 +1,6 @@
1
1
  import { escalateAndFinish } from './handover.mjs';
2
2
  import { ROUND_CONTINUE } from './job.mjs';
3
- import { resumeLanding } from './land.mjs';
3
+ import { landApproved, resumeLanding } from './land.mjs';
4
4
  import { reapplyMessage } from './revert.mjs';
5
5
  import { writeState } from './state.mjs';
6
6
  export async function enterReview(job) {
@@ -15,9 +15,10 @@ export async function enterReview(job) {
15
15
  if (landed !== undefined) {
16
16
  return resumeLanding(job, landed);
17
17
  }
18
+ const approved = state.phase === 'approved';
18
19
  state.phase = 'review';
19
20
  await writeState(context.repo, state);
20
- return ROUND_CONTINUE;
21
+ return approved ? landApproved(job) : ROUND_CONTINUE;
21
22
  }
22
23
  async function settlePush(job) {
23
24
  const { context, state, worktree } = job;
package/dist/handover.mjs CHANGED
@@ -41,9 +41,9 @@ async function updateLocalBase(job) {
41
41
  log.event('base.behind', { base }, 'quiet');
42
42
  }
43
43
  }
44
- export function stop(job) {
45
- job.log.event('issue.stop', { phase: job.state.phase }, 'quiet');
46
- return jobReport(job, 'stopped');
44
+ export function stop(job, reason) {
45
+ job.log.event('issue.stop', { phase: job.state.phase, reason }, 'quiet');
46
+ return jobReport(job, 'stopped', reason);
47
47
  }
48
48
  export function stopNow(log, issue, state, started) {
49
49
  log.event('issue.stop', { phase: state.phase }, 'quiet');
@@ -70,10 +70,11 @@ export async function finish(job, outcome, reason) {
70
70
  await deleteBranches(context, log, branch);
71
71
  await dropState(repo, issue.number);
72
72
  }
73
- return {
74
- ...jobReport(job, outcome, reason),
75
- ...(job.mainBroken && outcome !== 'done' ? { halt: true } : {}),
76
- };
73
+ const halt = job.mainBroken && outcome !== 'done';
74
+ if (halt) {
75
+ context.halted = true;
76
+ }
77
+ return { ...jobReport(job, outcome, reason), ...(halt ? { halt: true } : {}) };
77
78
  }
78
79
  async function deleteBranches(context, log, branch) {
79
80
  const { repo, ports } = context;
package/dist/land.mjs CHANGED
@@ -2,7 +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 { escalateAndFinish, finishDone } from './handover.mjs';
5
+ import { escalateAndFinish, finishDone, stop } from './handover.mjs';
6
6
  import { oneAtATime } from './lock.mjs';
7
7
  import { revertFailedFix } from './revert.mjs';
8
8
  import { writeState } from './state.mjs';
@@ -32,7 +32,14 @@ async function holdsUnlandedFix(job, sha) {
32
32
  return !(await ports.isLanded(worktree, base, config.remote));
33
33
  }
34
34
  function landing(job, work) {
35
- return oneAtATime(`${job.context.repo.root}#land`, work);
35
+ return oneAtATime(`${job.context.repo.root}#land`, async () => {
36
+ if (!job.context.halted) {
37
+ return work();
38
+ }
39
+ job.state.phase = 'approved';
40
+ await writeState(job.context.repo, job.state);
41
+ return { done: true, report: stop(job, 'run halted') };
42
+ });
36
43
  }
37
44
  async function landLoop(job) {
38
45
  for (;;) {
package/dist/run.mjs CHANGED
@@ -113,6 +113,7 @@ async function startRun(args, config, repo, recorder, interrupts) {
113
113
  base,
114
114
  reset: args.reset,
115
115
  stopAfterRound: interrupts.afterRound,
116
+ halted: false,
116
117
  recorder,
117
118
  ports: PORTS,
118
119
  };
package/dist/state.mjs CHANGED
@@ -31,7 +31,7 @@ function parseState(path, text) {
31
31
  }
32
32
  return parsed;
33
33
  }
34
- const PHASES = ['claimed', 'implemented', 'review'];
34
+ const PHASES = ['claimed', 'implemented', 'review', 'approved'];
35
35
  function isOptional(value, type) {
36
36
  return value === undefined || typeof value === type;
37
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.56",
3
+ "version": "6.6.58",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",