next-issue 6.6.75 → 6.6.77

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
@@ -358,7 +358,9 @@ Every run has an id, `<timestamp>`, and writes these under `.next-issue/runs/`:
358
358
  - `<id>.jsonl` — one JSON object per event, with `ts`, `runId`, `kind`, and the
359
359
  `issue`, `role` or `round` in scope;
360
360
  - `<id>.summary.json` — token totals per agent role, event counts, and
361
- one report per issue with the outcome, the reason and the budgets used;
361
+ one report per issue with the outcome, the reason and the budgets used (in a
362
+ watch run, an issue skipped in several passes gets one report, and an issue
363
+ handled in more than one pass keeps a report for each);
362
364
  - `<id>/sessions/` — the full pi session of each agent call, with every
363
365
  message, tool call and tool result. The session id in a `usage` event is
364
366
  part of the file name.
@@ -1,7 +1,7 @@
1
1
  import { escalateAndFinish } from './handover.mjs';
2
2
  import { ROUND_CONTINUE } from './job.mjs';
3
3
  import { landApproved, resumeLanding } from './land.mjs';
4
- import { reapplyMessage } from './revert.mjs';
4
+ import { reapplyMessage, restoreChange } from './revert.mjs';
5
5
  import { writeState } from './state.mjs';
6
6
  export async function enterReview(job) {
7
7
  const { context, state } = job;
@@ -66,7 +66,7 @@ async function settleRevert(job) {
66
66
  reverted: sha,
67
67
  reapply: reapplyMessage(job),
68
68
  });
69
- state.landed = undefined;
69
+ restoreChange(state);
70
70
  }
71
71
  state.reverting = undefined;
72
72
  await writeState(repo, state);
package/dist/revert.mjs CHANGED
@@ -27,6 +27,11 @@ export function reapplyMessage(job) {
27
27
  const { number } = job.issue;
28
28
  return `${job.state.changeTitle ?? job.state.title ?? `fix: resolve issue #${number}`}\n\nRefs #${number}`;
29
29
  }
30
+ export function restoreChange(state) {
31
+ state.landed = undefined;
32
+ state.title = state.changeTitle ?? state.title;
33
+ state.changeTitle = undefined;
34
+ }
30
35
  export async function revert(job) {
31
36
  const { context, issue, log, state, branch, worktree } = job;
32
37
  const { repo, config, ports, base } = context;
@@ -48,7 +53,7 @@ export async function revert(job) {
48
53
  await writeState(repo, state);
49
54
  return ` The revert of the change on ${base} failed, so the landed commits stay on ${base}.`;
50
55
  }
51
- state.landed = undefined;
56
+ restoreChange(state);
52
57
  await writeState(repo, state);
53
58
  return ` The harness reverted the change on ${base}.`;
54
59
  }
package/dist/watch.mjs CHANGED
@@ -76,7 +76,7 @@ async function watchPasses(args, failed, watch) {
76
76
  let step = 0;
77
77
  for (;;) {
78
78
  const pass = await runIssues({ once: false, max: limit === undefined ? undefined : limit - handled(reports) }, watch, new Set(failed));
79
- reports.push(...pass.reports);
79
+ addReports(reports, pass.reports);
80
80
  recordFailures(failed, pass.reports);
81
81
  if (handled(pass.reports) > 0) {
82
82
  await watch.passEnd(pass.reports);
@@ -95,6 +95,18 @@ async function watchPasses(args, failed, watch) {
95
95
  }
96
96
  }
97
97
  }
98
+ function addReports(reports, pass) {
99
+ for (const report of pass) {
100
+ const skip = reports.findIndex((entry) => entry.issue === report.issue && entry.outcome === 'skipped');
101
+ if (report.outcome !== 'skipped' && skip >= 0) {
102
+ reports[skip] = report;
103
+ }
104
+ else if (report.outcome !== 'skipped' ||
105
+ reports.every((entry) => entry.issue !== report.issue)) {
106
+ reports.push(report);
107
+ }
108
+ }
109
+ }
98
110
  function recordFailures(failed, reports) {
99
111
  for (const report of reports) {
100
112
  if (report.outcome === 'error') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.75",
3
+ "version": "6.6.77",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",