next-issue 7.8.19 → 7.8.20

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
@@ -188,7 +188,11 @@ the run handles one issue. For each issue:
188
188
  failure unrelated hands it over too, as for the checks on the base.
189
189
  Nothing of the change reaches the base. A run that stops while a
190
190
  command runs keeps the budget, and the next run merges and runs every
191
- command again before any push. The harness then pushes the commit to
191
+ command again before any push. The state file keeps the merged commit
192
+ from the squash until the push, so the next run that resumes the issue
193
+ first puts the issue branch back at that commit, before the setup
194
+ command. A commit that a person adds to the branch after a hand-over
195
+ stays on it. The harness then pushes the commit to
192
196
  the base branch, without force. A push that the remote refuses, for
193
197
  example because the base moved, starts the rebase again, three times at
194
198
  most. When the push fails, the harness fetches the base first, and
@@ -16,13 +16,12 @@ export async function enterReview(job) {
16
16
  return escalateAndFinish(job, `The run stopped during the revert of the change on ${base}. The harness reverted the change on ${base}.`, 'revert stopped');
17
17
  }
18
18
  const landed = state.landed?.at(-1);
19
- await beforeBaseSettled(state, context.base, async () => {
20
- await settleSquash(job);
21
- if (landed !== undefined || state.phase === 'approved') {
19
+ if (landed !== undefined || state.phase === 'approved') {
20
+ await beforeBaseSettled(state, context.base, async () => {
22
21
  const { ports } = context;
23
22
  await ports.discardChanges(job.worktree, await ports.revision(job.worktree), job.branch);
24
- }
25
- });
23
+ });
24
+ }
26
25
  if (landed !== undefined) {
27
26
  return resumeLanding(job, landed);
28
27
  }
@@ -48,7 +47,7 @@ async function settlePush(job) {
48
47
  releaseSettled(state);
49
48
  await writeState(repo, state);
50
49
  }
51
- async function settleSquash(job) {
50
+ export async function settleSquash(job) {
52
51
  const { context, state, worktree, branch } = job;
53
52
  const sha = state.squashing;
54
53
  if (sha === undefined) {
package/dist/pipeline.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { enterReview } from './enter-review.mjs';
1
+ import { enterReview, settleSquash } from './enter-review.mjs';
2
2
  import { branchName } from './git.mjs';
3
3
  import { runStopped } from './children.mjs';
4
4
  import { claimedError, dropClosed, finishClosing, stop, stopNow } from './handover.mjs';
@@ -72,6 +72,7 @@ async function work(context, issue, log, state, start, handedOver, pending) {
72
72
  const { job, setup } = await beforeBaseSettled(state, context.base, async () => {
73
73
  const opened = await openJob(context, issue, log, state, start, handedOver, pending);
74
74
  await settleReview(opened);
75
+ await settleSquash(opened);
75
76
  return { job: opened, setup: await setUp(opened) };
76
77
  });
77
78
  if (setup.done) {
package/dist/state.mjs CHANGED
@@ -87,15 +87,16 @@ export function newState(issue, branch) {
87
87
  return { issue, phase: 'claimed', branch, ciFixes: 0, reviewRounds: 0, reviewLog: [] };
88
88
  }
89
89
  /**
90
- * Drops the budgets and findings; a hand-over (`handedOver`) also cancels an approval, the closing mark and the review start,
90
+ * Drops the budgets and findings; a hand-over (`handedOver`) also cancels an approval, the closing mark, the review start and the squash start,
91
91
  * so a resume that stops before it finishes is resumed again rather than closed as done.
92
92
  */
93
93
  export function resetState(state, handedOver = false) {
94
- const { handedOver: _handedOver, pendingHandOver: _pending, closing, reviewing, ...rest } = state;
94
+ const { handedOver: _handedOver, pendingHandOver: _pending, closing, reviewing, squashing, ...rest } = state;
95
95
  const phase = handedOver && rest.phase === 'approved' ? 'review' : rest.phase;
96
96
  const kept = {
97
97
  ...(!handedOver && closing !== undefined ? { closing } : {}),
98
98
  ...(!handedOver && reviewing !== undefined ? { reviewing } : {}),
99
+ ...(!handedOver && squashing !== undefined ? { squashing } : {}),
99
100
  };
100
101
  return { ...rest, ...kept, phase, ciFixes: 0, commitFixes: 0, reviewRounds: 0, reviewLog: [] };
101
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "7.8.19",
3
+ "version": "7.8.20",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",