next-issue 6.6.63 → 6.6.65

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
@@ -88,8 +88,11 @@ the run handles one issue. For each issue:
88
88
  The budget is `maxCommitFixes`. Any other git failure in the commit stops
89
89
  the run with an error. An implementer that makes no change hands the issue
90
90
  to a person, unless the branch is already ahead of the base, for example
91
- after the state file was lost: the run then carries on with the commits on
92
- the branch, and the newest of them gives the subject of the landed commit.
91
+ when an issue resumes from saved state in phase `claimed`, or when the remote
92
+ holds branch `<n>`: the run then carries on with the commits on the branch,
93
+ and the newest of them gives the subject of the landed commit. A lost state
94
+ file does not count, since an issue with no saved state resets its local
95
+ branch (step 3).
93
96
  5. Let the reviewer agent judge the diff, at most `diffMaxChars` of it. The
94
97
  reviewer reads files and runs commands in the worktree, so it can prove a
95
98
  finding with the tests or the type check. The harness then throws away every
@@ -125,7 +128,12 @@ the run handles one issue. For each issue:
125
128
  implementer's commit replaces it, and a fix for failed checks after the
126
129
  landing lands under the fixer's own subject. The reapply commit after a
127
130
  revert uses the subject of the change. When git merges the base cleanly,
128
- no agent runs. When git reports conflicted files, the fixer gets the
131
+ no agent runs. When a conflicted file holds no conflict marker, for
132
+ example a file that one side deletes and the other changes, a renamed
133
+ file or a binary file that both sides change, no agent runs: the
134
+ harness undoes the merge and hands the issue to a person with the
135
+ reason `merge conflict`, since git leaves only one side in the file.
136
+ When git reports conflicted files, the fixer gets the
129
137
  list from the check budget, `maxCiFixes`, removes the conflict markers,
130
138
  and the harness commits the merge. A merge that the fixer commits itself
131
139
  counts only when the branch then holds the base commit that was merged
@@ -668,7 +676,9 @@ affect another. The worker:
668
676
  from GitHub, so the list is the same after a restart. It sends them when a
669
677
  client connects, for its repository, after each issue of a run
670
678
  ends, and when a client sends `{ "type": "questions", "root": "<path>" }`.
671
- An issue that no longer has the label leaves the list. An issue with the
679
+ An issue that no longer has the label leaves the list, and so does an issue
680
+ whose hand-over has an answer from a writer, the same answer that lets a run
681
+ claim it. An issue with the
672
682
  label but no hand-over comment is in the list with an empty reason and url.
673
683
  The issues are read one at a time. A client never gets an older list after
674
684
  a newer one. When the client adds an `"id"` to its message, the list that
package/dist/conflict.mjs CHANGED
@@ -8,9 +8,13 @@ export async function rebase(job) {
8
8
  const { config, ports, base } = context;
9
9
  const title = state.title ?? fallbackTitle(issue);
10
10
  const before = await ports.revision(worktree);
11
- const { target, files } = await log.step('rebase', { base }, () => ports.startMerge(worktree, base, config.remote));
11
+ const { target, files, unmarked } = await log.step('rebase', { base }, () => ports.startMerge(worktree, base, config.remote));
12
12
  if (files !== undefined) {
13
13
  log.event('rebase.conflicts', { files }, 'quiet');
14
+ if (unmarked.length > 0) {
15
+ await ports.abortMerge(worktree, before);
16
+ return escalateAndFinish(job, `The change conflicts with ${base} in files that hold no conflict marker, such as a deleted, renamed or binary file: ${unmarked.join(', ')}.`, 'merge conflict');
17
+ }
14
18
  const merged = await mergeBase(job, { before, target, files });
15
19
  if (merged !== undefined) {
16
20
  return merged;
@@ -8,14 +8,20 @@ export async function startMerge(cwd, base, remote) {
8
8
  const target = await git(cwd, ['rev-parse', await fetchBase(cwd, base, remote)]);
9
9
  const result = await run('git', ['merge', '--no-ff', '--no-commit', target], { cwd });
10
10
  if (succeeded(result)) {
11
- return { target, files: (await merging(cwd)) ? [] : undefined };
11
+ return { target, files: (await merging(cwd)) ? [] : undefined, unmarked: [] };
12
12
  }
13
13
  const listed = await git(cwd, ['diff', '--name-only', '--diff-filter=U']);
14
14
  const files = lines(listed);
15
15
  if (files.length === 0) {
16
16
  throw new Error(`git merge ${target} failed: ${result.stderr.trim()}`);
17
17
  }
18
- return { target, files };
18
+ const unmarked = [];
19
+ for (const file of files) {
20
+ if (!(await hasConflictMarkers(cwd, [file]))) {
21
+ unmarked.push(file);
22
+ }
23
+ }
24
+ return { target, files, unmarked };
19
25
  }
20
26
  async function merging(cwd) {
21
27
  return succeeds(cwd, ['rev-parse', '--quiet', '--verify', 'MERGE_HEAD']);
@@ -46,12 +46,24 @@ export async function waitingQuestions(repo, config, ports) {
46
46
  const issues = await ports.openIssues(repo, config.issueLimit, [config.labels.needsHuman]);
47
47
  const questions = [];
48
48
  for (const issue of issues) {
49
- questions.push(await waitingQuestion(repo, config, ports, writer, issue));
49
+ const question = await waitingQuestion(repo, config, ports, writer, issue);
50
+ if (question) {
51
+ questions.push(question);
52
+ }
50
53
  }
51
54
  return questions;
52
55
  }
56
+ async function replyAfter(comments, last, writer) {
57
+ if (last === -1) {
58
+ return [];
59
+ }
60
+ return writerQuotes(comments.slice(last + 1).filter((comment) => !fromHarness(comment)), writer);
61
+ }
53
62
  async function waitingQuestion(repo, config, ports, writer, issue) {
54
63
  const { comments, last } = await handOverThread(repo, ports, writer, issue.number);
64
+ if ((await replyAfter(comments, last, writer)).length > 0) {
65
+ return undefined;
66
+ }
55
67
  const comment = comments[last];
56
68
  return {
57
69
  issue: issue.number,
@@ -71,8 +83,5 @@ export async function handOverReply(context, issue) {
71
83
  const { repo, ports } = context;
72
84
  const writer = writers(repo, ports);
73
85
  const { comments, last } = await handOverThread(repo, ports, writer, issue);
74
- if (last === -1) {
75
- return [];
76
- }
77
- return writerQuotes(comments.slice(last + 1).filter((comment) => !fromHarness(comment)), writer);
86
+ return replyAfter(comments, last, writer);
78
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.63",
3
+ "version": "6.6.65",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",