next-issue 7.8.21 → 7.8.22

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
@@ -360,7 +360,9 @@ and comments the reason on the issue, when:
360
360
  in a file that the change added or changed is never unrelated: when the
361
361
  failed logs name such a file (by its path, or by a tail of its path that
362
362
  keeps a folder), the harness refuses the claim and gives the fixer another
363
- round from `maxCiFixes`, with a note that names the file;
363
+ round from `maxCiFixes`, with a note that names the file. A later hand-over
364
+ comment of the same run, such as for a fix that fails its checks too or
365
+ fails to land, still names the dispute branch of each refused round;
364
366
  - a fixer disputes or settles the findings and leaves a change behind, either
365
367
  in the worktree or in a commit of its own. A dispute carries a reason, not a
366
368
  diff, and a retry of the issue cleans the worktree before the next review,
package/dist/fix.mjs CHANGED
@@ -9,16 +9,11 @@ import { fallbackTitle, runRole } from './job.mjs';
9
9
  import { fixPrompt, hookPrompt } from './prompts.mjs';
10
10
  import { writeState } from './state.mjs';
11
11
  import { keepTail } from './text.mjs';
12
- export function escalateCheckFix(job, unrelated, checks, after = '', aside) {
12
+ export function escalateCheckFix(job, unrelated, checks, after = '') {
13
13
  if (unrelated === undefined) {
14
14
  return escalateAndFinish(job, `The fixer added no commit for the failed ${checks}.${after}`, 'no fix commit');
15
15
  }
16
- return escalateAndFinish(job, `The ${checks} fail for a reason this change did not cause: ${unrelated}${savedIn(aside)}${after}`, 'unrelated failure');
17
- }
18
- export function savedIn(aside) {
19
- return aside === undefined
20
- ? ''
21
- : ` The fixer left a change behind; it is saved in the branch \`${aside}\`.`;
16
+ return escalateAndFinish(job, `The ${checks} fail for a reason this change did not cause: ${unrelated}${after}`, 'unrelated failure');
22
17
  }
23
18
  export async function fixRound(job, reason, detail, earlier, kind) {
24
19
  const { context, issue, log, worktree } = job;
@@ -71,6 +66,7 @@ async function disputedFix(job, before, reason, note, kind) {
71
66
  }
72
67
  const aside = `${branch}-dispute-${disputed.slice(0, 7)}`;
73
68
  await ports.setAside(worktree, before, aside);
69
+ job.asides.push(aside);
74
70
  log.event('fix.aside', { branch: aside, saved }, 'quiet');
75
71
  return disputedNote(job, reason, note, { stray: true, aside });
76
72
  }
package/dist/gate.mjs CHANGED
@@ -136,7 +136,7 @@ async function failedChecksFix(job, sha, refused) {
136
136
  }
137
137
  if (!fix.committed) {
138
138
  const reverted = await revertFailedChecks(job);
139
- return escalateCheckFix(job, fix.unrelated, `checks on ${base}`, reverted, fix.aside);
139
+ return escalateCheckFix(job, fix.unrelated, `checks on ${base}`, reverted);
140
140
  }
141
141
  job.repairing = true;
142
142
  return GATE_FIXED;
package/dist/handover.mjs CHANGED
@@ -12,7 +12,7 @@ import { UnsettledBase } from './unsettled.mjs';
12
12
  export async function escalateAndFinish(job, note, reason) {
13
13
  const reverted = await revertFailedFix(job);
14
14
  try {
15
- await handOver(job.context, job.log, job.issue.number, job.state, `${note}${reverted}`);
15
+ await handOver(job.context, job.log, job.issue.number, job.state, `${note}${savedIn(job.asides)}${reverted}`);
16
16
  }
17
17
  catch (error) {
18
18
  if (!job.mainBroken || runStopped()) {
@@ -27,6 +27,15 @@ export async function escalateAndFinish(job, note, reason) {
27
27
  }
28
28
  return { done: true, report: await finish(job, 'needs-human', reason) };
29
29
  }
30
+ function savedIn(asides) {
31
+ const branches = asides.map((aside) => `\`${aside}\``);
32
+ if (branches.length < 2) {
33
+ return branches.length === 0
34
+ ? ''
35
+ : ` The fixer left a change behind; it is saved in the branch ${branches[0]}.`;
36
+ }
37
+ return ` The fixer left changes behind; they are saved in the branches ${branches.slice(0, -1).join(', ')} and ${branches.at(-1)}.`;
38
+ }
30
39
  export async function finishDone(job) {
31
40
  const { context, issue } = job;
32
41
  if (issue.closed !== true) {
@@ -51,6 +60,7 @@ export async function finishClosing(context, issue, log, state, started) {
51
60
  started,
52
61
  mainBroken: false,
53
62
  repairing: false,
63
+ asides: [],
54
64
  };
55
65
  return (await finishDone(job)).report;
56
66
  }
@@ -114,7 +124,10 @@ export async function finish(job, outcome, reason) {
114
124
  if (halt) {
115
125
  context.halted = true;
116
126
  }
117
- return { ...jobReport(job, outcome, reason), ...(halt ? { halt: true } : {}) };
127
+ return {
128
+ ...jobReport(job, outcome, reason),
129
+ ...(halt ? { halt: true } : {}),
130
+ };
118
131
  }
119
132
  async function deleteBranches(context, log, branch) {
120
133
  const { repo, ports } = context;
@@ -73,7 +73,7 @@ async function failedCheck(job, command, result) {
73
73
  throw error;
74
74
  }
75
75
  if (!fix.committed) {
76
- return escalateCheckFix(job, fix.unrelated, `local checks (\`${command}\`)`, '', fix.aside);
76
+ return escalateCheckFix(job, fix.unrelated, `local checks (\`${command}\`)`);
77
77
  }
78
78
  return false;
79
79
  }
package/dist/open-job.mjs CHANGED
@@ -27,6 +27,7 @@ export async function openJob(context, issue, log, state, start, handedOver, pen
27
27
  started,
28
28
  mainBroken: false,
29
29
  repairing: false,
30
+ asides: [],
30
31
  };
31
32
  }
32
33
  async function openWorktree(context, issue, log, branch, start) {
package/dist/review.mjs CHANGED
@@ -2,7 +2,7 @@ import { REVIEWING } from './agents.mjs';
2
2
  import { runStopped } from './children.mjs';
3
3
  import { budgetUse, refundBudget, refundOnKill, spendBudget } from './budget.mjs';
4
4
  import { message } from './errors.mjs';
5
- import { fixRound, savedIn } from './fix.mjs';
5
+ import { fixRound } from './fix.mjs';
6
6
  import { escalateAndFinish } from './handover.mjs';
7
7
  import { ROUND_CONTINUE, runRole, setStatus } from './job.mjs';
8
8
  import { landApproved } from './land.mjs';
@@ -122,7 +122,7 @@ async function unfixedRound(job, fix) {
122
122
  return escalateAndFinish(job, 'The fixer added no commit for the review findings.', 'no fix commit');
123
123
  }
124
124
  if (fix.stray === true) {
125
- return escalateAndFinish(job, `The fixer ${fix.unrelated === undefined ? 'settled' : 'disputed'} the findings: ${note}${savedIn(fix.aside)}`, 'dispute with changes');
125
+ return escalateAndFinish(job, `The fixer ${fix.unrelated === undefined ? 'settled' : 'disputed'} the findings: ${note}`, 'dispute with changes');
126
126
  }
127
127
  const round = state.reviewLog.at(-1);
128
128
  if (fix.unrelated === undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "7.8.21",
3
+ "version": "7.8.22",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",