next-issue 6.6.55 → 6.6.57

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
@@ -251,6 +251,11 @@ and comments the reason on the issue, when:
251
251
  network fails. A `gh issue comment` is
252
252
  tried once, so a lost reply never makes a duplicate.
253
253
 
254
+ After a halt, a running issue that reaches the landing does not land on the
255
+ broken base branch: it ends `stopped` with the reason `run halted` and keeps
256
+ its state, branch and labels. The next run resumes it and lands it with no new
257
+ review.
258
+
254
259
  The fixer sees the findings of all earlier rounds, not only the last one, with
255
260
  its own disputes next to them. From round two, the reviewer judges only the
256
261
  earlier findings and any regression.
@@ -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.55",
3
+ "version": "6.6.57",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",