next-issue 6.3.1 → 6.3.2
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 +3 -1
- package/dist/agent-reply.mjs +2 -1
- package/dist/git-land.mjs +30 -12
- package/dist/land.mjs +1 -1
- package/dist/prompts.mjs +2 -0
- package/dist/worktree.mjs +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -126,7 +126,9 @@ the run handles one issue. For each issue:
|
|
|
126
126
|
fail again, the fixer gets their logs from the check budget, and its fix lands
|
|
127
127
|
the same way. When the fixer cannot fix them, its fix cannot land, or the
|
|
128
128
|
budget runs out, the harness reverts every commit of the change on the
|
|
129
|
-
base branch, pushes the revert and hands the issue to a person. A
|
|
129
|
+
base branch, pushes the revert and hands the issue to a person. A revert
|
|
130
|
+
push that the remote refuses, for example because the base moved, makes
|
|
131
|
+
the revert again on the new base, three times at most. A resume
|
|
130
132
|
that stopped while the checks of a landed commit ran waits for them
|
|
131
133
|
again, even when more commits landed on the base since, and a fix that
|
|
132
134
|
was committed but not landed lands first. A problem that the reviewer
|
package/dist/agent-reply.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
function lastMatch(text, pattern) {
|
|
2
2
|
return [...text.matchAll(pattern)].at(-1)?.[1]?.trim();
|
|
3
3
|
}
|
|
4
|
+
const PLACEHOLDERS = new Set(['', 'none', 'n/a', '-']);
|
|
4
5
|
export function parseUnrelated(text) {
|
|
5
6
|
const note = lastMatch(text, /^unrelated:\s*(.+)$/gim);
|
|
6
|
-
return note ===
|
|
7
|
+
return note === undefined || PLACEHOLDERS.has(note.toLowerCase()) ? undefined : note;
|
|
7
8
|
}
|
|
8
9
|
export function parseResolved(text) {
|
|
9
10
|
const note = lastMatch(text, /^resolved:\s*(.+)$/gim);
|
package/dist/git-land.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fetchBase, git, remoteRef, revision, succeeds } from './git.mjs';
|
|
2
2
|
import { commitEverything } from './git-commit.mjs';
|
|
3
|
+
export const PUSH_TRIES = 3;
|
|
3
4
|
export async function squashOnto(cwd, base, remote, message) {
|
|
4
5
|
const target = remoteRef(remote, base);
|
|
5
6
|
if (await succeeds(cwd, ['diff', '--quiet', target])) {
|
|
@@ -20,18 +21,35 @@ export async function pushToBase(cwd, remote, base) {
|
|
|
20
21
|
return succeeds(cwd, ['push', remote, `HEAD:refs/heads/${base}`]);
|
|
21
22
|
}
|
|
22
23
|
export async function revertOnBase(cwd, revert) {
|
|
24
|
+
const { branch } = revert;
|
|
25
|
+
let moved = false;
|
|
26
|
+
try {
|
|
27
|
+
moved = await pushRevert(cwd, revert);
|
|
28
|
+
return moved;
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
if (!moved) {
|
|
32
|
+
await succeeds(cwd, ['revert', '--abort']);
|
|
33
|
+
await git(cwd, ['checkout', '--force', branch]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function pushRevert(cwd, revert) {
|
|
23
38
|
const { base, remote, branch, shas, message, reapply } = revert;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
for (let attempt = 1; attempt <= PUSH_TRIES; attempt += 1) {
|
|
40
|
+
const target = await fetchBase(cwd, base, remote);
|
|
41
|
+
await git(cwd, ['checkout', '--force', '--detach', target]);
|
|
42
|
+
await git(cwd, ['clean', '-fd']);
|
|
43
|
+
if (!(await succeeds(cwd, ['revert', '--no-commit', ...shas.toReversed()]))) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
await git(cwd, ['commit', '--no-verify', '-m', message]);
|
|
47
|
+
if (await pushToBase(cwd, remote, base)) {
|
|
48
|
+
await git(cwd, ['revert', '--no-commit', await revision(cwd)]);
|
|
49
|
+
await git(cwd, ['commit', '--no-verify', '-m', reapply]);
|
|
50
|
+
await git(cwd, ['checkout', '-B', branch]);
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
32
53
|
}
|
|
33
|
-
|
|
34
|
-
await git(cwd, ['commit', '--no-verify', '-m', reapply]);
|
|
35
|
-
await git(cwd, ['checkout', '-B', branch]);
|
|
36
|
-
return true;
|
|
54
|
+
return false;
|
|
37
55
|
}
|
package/dist/land.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { rebase } from './conflict.mjs';
|
|
2
2
|
import { checkGate } from './gate.mjs';
|
|
3
|
+
import { PUSH_TRIES } from './git-land.mjs';
|
|
3
4
|
import { escalateAndFinish, finishDone } from './handover.mjs';
|
|
4
5
|
import { oneAtATime } from './lock.mjs';
|
|
5
6
|
import { revertFailedFix } from './revert.mjs';
|
|
6
7
|
import { writeState } from './state.mjs';
|
|
7
|
-
const PUSH_TRIES = 3;
|
|
8
8
|
export function landApproved(job) {
|
|
9
9
|
return landing(job, () => landLoop(job));
|
|
10
10
|
}
|
package/dist/prompts.mjs
CHANGED
|
@@ -101,11 +101,13 @@ export function reviewPrompt(issue, comments, diff, earlier, reply) {
|
|
|
101
101
|
const UNRELATED_RULE = [
|
|
102
102
|
'The checks can fail for a reason this change did not cause: a test that is already broken on the base branch, one that exercises code the diff does not touch, or one that fails only under load.',
|
|
103
103
|
'Establish that before you fix anything. If the failure is not yours, change nothing and end your final message with one line in the form `unrelated: <one sentence on what fails and why it is not this change>`.',
|
|
104
|
+
'If you fix the cause, write no `unrelated` line.',
|
|
104
105
|
'A person then reads it. Do not weaken, skip or re-record a test to make the checks pass.',
|
|
105
106
|
].join('\n');
|
|
106
107
|
const DISPUTE_RULE = [
|
|
107
108
|
'A finding can be wrong: it can miss a convention of this repository, ask for work that the issue does not want, or describe behaviour that the code does not have.',
|
|
108
109
|
'Establish that before you change anything. If every finding is wrong, change nothing and end your final message with one line in the form `unrelated: <one sentence on why the findings are wrong>`.',
|
|
110
|
+
'If you fix the findings, write no `unrelated` line.',
|
|
109
111
|
'If only some of the findings are wrong, fix the correct ones and change nothing for the wrong ones. Write no `unrelated` line in that round. The next round holds only the findings that are left, and you can dispute them there.',
|
|
110
112
|
'A finding can also be right and need no code change, for example when it asks for proof such as a failing test run.',
|
|
111
113
|
'If every finding is settled with no code change, change nothing and end your final message with one line in the form `resolved: <how the findings were settled>`.',
|
package/dist/worktree.mjs
CHANGED
|
@@ -14,6 +14,7 @@ export async function addWorktree(repo, issue, branch, base, remote, start) {
|
|
|
14
14
|
const path = existing ?? worktreePath(repo, issue);
|
|
15
15
|
const target = pushed ? upstream : remoteBase;
|
|
16
16
|
if (existing === undefined) {
|
|
17
|
+
await succeeds(repo.root, ['worktree', 'remove', '--force', path]);
|
|
17
18
|
const args = !start && (await hasWork(repo, branch, pushed, remoteBase))
|
|
18
19
|
? ['worktree', 'add', path, branch]
|
|
19
20
|
: ['worktree', 'add', '-B', branch, path, target];
|