next-issue 5.2.0 → 5.3.0
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 +5 -0
- package/dist/job.mjs +10 -3
- package/dist/prompts.mjs +14 -0
- package/dist/state.mjs +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -411,6 +411,11 @@ run stopped. A state file that is not valid JSON, or that does not hold a valid
|
|
|
411
411
|
state, gives the issue an `error` outcome that names the file, rather than a
|
|
412
412
|
silent skip.
|
|
413
413
|
|
|
414
|
+
Every agent prompt holds `.next-issue/notes.md` when it exists, so lessons
|
|
415
|
+
such as test commands, tool quirks and deliberate behaviour carry over from one
|
|
416
|
+
issue to the next. The implementer and the fixer may add a short note to it, and
|
|
417
|
+
the prompt asks them to keep only what still holds. The reviewer only reads it.
|
|
418
|
+
|
|
414
419
|
## Retry an issue that waits for a person
|
|
415
420
|
|
|
416
421
|
A hand-over marks the state file as handed over. To give the issue another try,
|
package/dist/job.mjs
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { managedLabels } from './config.mjs';
|
|
2
2
|
import { minutesToMs } from './durations.mjs';
|
|
3
|
+
import { readTextIfPresent } from './files.mjs';
|
|
4
|
+
import { notesBlock } from './prompts.mjs';
|
|
5
|
+
import { notesPath } from './state.mjs';
|
|
6
|
+
import { paragraphs } from './text.mjs';
|
|
3
7
|
export const ROUND_CONTINUE = { done: false };
|
|
4
8
|
export const GATE_PASSED = { done: false, fixed: false };
|
|
5
9
|
export const GATE_FIXED = { done: false, fixed: true };
|
|
@@ -9,12 +13,15 @@ export function gateRound(gate) {
|
|
|
9
13
|
}
|
|
10
14
|
return gate.fixed ? ROUND_CONTINUE : undefined;
|
|
11
15
|
}
|
|
12
|
-
export function runRole(job, role, prompt, profile) {
|
|
13
|
-
const { config, ports } = job.context;
|
|
16
|
+
export async function runRole(job, role, prompt, profile) {
|
|
17
|
+
const { config, ports, repo } = job.context;
|
|
18
|
+
const path = notesPath(repo.root);
|
|
19
|
+
const notes = await readTextIfPresent(path);
|
|
20
|
+
const writable = role === 'implementer' || role === 'fixer';
|
|
14
21
|
return ports.runAgent(job.log, {
|
|
15
22
|
name: role,
|
|
16
23
|
cwd: job.worktree,
|
|
17
|
-
prompt,
|
|
24
|
+
prompt: paragraphs([notesBlock(path, notes, writable), prompt]),
|
|
18
25
|
profile,
|
|
19
26
|
model: config.models[role],
|
|
20
27
|
timeoutMs: minutesToMs(config.agentTimeoutMinutes),
|
package/dist/prompts.mjs
CHANGED
|
@@ -41,6 +41,20 @@ export function hookPrompt(issue, comments, role, output) {
|
|
|
41
41
|
COMMIT_RULES,
|
|
42
42
|
]);
|
|
43
43
|
}
|
|
44
|
+
export function notesBlock(path, notes, writable) {
|
|
45
|
+
const kept = notes?.trim() ?? '';
|
|
46
|
+
return paragraphs([
|
|
47
|
+
kept === ''
|
|
48
|
+
? ''
|
|
49
|
+
: `## Shared notes\nEarlier agents left these notes for this repository.\n\n${kept}`,
|
|
50
|
+
writable
|
|
51
|
+
? [
|
|
52
|
+
`When you learn something that the next issue needs, such as a test command, a tool quirk or deliberate behaviour, add a short note to ${path}.`,
|
|
53
|
+
'Keep the file short: keep only what still holds, and remove a note that no longer holds.',
|
|
54
|
+
].join('\n')
|
|
55
|
+
: '',
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
44
58
|
export function capDiff(diff, maxChars) {
|
|
45
59
|
return diff.length <= maxChars
|
|
46
60
|
? diff
|
package/dist/state.mjs
CHANGED
|
@@ -7,6 +7,9 @@ export const STATE_DIR = '.next-issue';
|
|
|
7
7
|
export function stateDir(root) {
|
|
8
8
|
return join(root, STATE_DIR);
|
|
9
9
|
}
|
|
10
|
+
export function notesPath(root) {
|
|
11
|
+
return join(stateDir(root), 'notes.md');
|
|
12
|
+
}
|
|
10
13
|
export function runsDir(root) {
|
|
11
14
|
return join(stateDir(root), 'runs');
|
|
12
15
|
}
|