@ravshansbox/pi-next-issue 2.16.0 → 2.18.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 +8 -6
- package/index.ts +10 -9
- package/package.json +1 -1
- package/skills/create-issue/SKILL.md +17 -6
- package/src/worker.ts +1 -0
package/README.md
CHANGED
|
@@ -14,9 +14,9 @@ Run this in pi, inside a git repository:
|
|
|
14
14
|
|
|
15
15
|
- `/next-issue` starts a run of this repository when none is going, and stops the run when one is going. A stop takes effect after the current round, and the issue keeps its saved state, so the next run resumes it.
|
|
16
16
|
- The `next_issue_start` tool lets the model start a run. When no run is going, it starts a run like `/next-issue`. When a run is going, it starts nothing and reports the current run, which picks up new issues by itself. It never stops a run, and it does not ask for confirmation. Its result says whether it started a run.
|
|
17
|
-
- The `next_issue_status` tool lets the model see the run of this repository. It returns the footer line, then one line per handled issue with its outcome, for example `#190 done`. When the worker has no run of this repository, it returns `
|
|
17
|
+
- The `next_issue_status` tool lets the model see the run of this repository. It returns the footer line, then one line per handled issue with its outcome, for example `#190 done`. When the worker has no run of this repository, it returns `no run of <root>`. When no worker is going, it returns `no worker is running` and does not start one. It reports no other repository.
|
|
18
18
|
|
|
19
|
-
The footer shows each running issue with its stage, the number of tool calls and the time spent on it, for example
|
|
19
|
+
The footer shows each running issue with the number of open issues at the latest fetch, its stage, the number of tool calls and the time spent on it, for example `#12/7 · review 2/5 · 37 tools · 4m12s | #13/7 · implement · 5 tools · 40s`. The open count includes the running issues and issues the run skips. A stage with a limited number of rounds shows the round and its limit: `review 2/5`, `review fix 2/5`, `checks fix 1/5` or `commit fix 1/10`. Other lines read, for example, `looking for issues`, `finished: 2 done` or `stopped: 1 done, 1 needs a human`. After a run ends, it keeps the last summary. In the terminal, it uses the dim colour of the theme, like the rest of the footer. A note appears when an issue is done, needs a human or fails while pi is open. Pi does not repeat the notes of a run that ended before it opened.
|
|
20
20
|
|
|
21
21
|
## Answer questions
|
|
22
22
|
|
|
@@ -36,11 +36,13 @@ The package ships the `create-issue` skill. Ask pi to write an issue, or run `/s
|
|
|
36
36
|
|
|
37
37
|
1. restates the problem, reads the code when the problem touches it, and finds the open issues that must be done first;
|
|
38
38
|
2. asks numbered questions until none is open;
|
|
39
|
-
3.
|
|
40
|
-
4.
|
|
41
|
-
5.
|
|
39
|
+
3. runs `gh issue create --body-file` with the body from [`template.md`](skills/create-issue/template.md) and the `status:todo` label, without showing the body first;
|
|
40
|
+
4. links each blocker with `gh issue edit --add-blocked-by`, so the worker waits for it;
|
|
41
|
+
5. gives you the issue url and asks once whether to start a run, leave it or change it, and changes it with `gh issue edit --body-file` or `--title` until you start a run or leave it;
|
|
42
42
|
6. calls `next_issue_start` when you asked for a run.
|
|
43
43
|
|
|
44
|
+
The issue gets `status:todo` when it is created, so a run that is already going may claim it before you review it.
|
|
45
|
+
|
|
44
46
|
Pi does not implement the issue in that session. The worker does the work. The body holds the sections of the [issue format](../next-issue/README.md#issue-format).
|
|
45
47
|
|
|
46
48
|
## Worker
|
|
@@ -53,4 +55,4 @@ The extension does no work itself. On `/next-issue` or `next_issue_start` it con
|
|
|
53
55
|
- The worker stays when every pi is closed. Stop it with `npx next-issue stop`.
|
|
54
56
|
- When the extension is newer than the worker, the worker closes once no run is going, and the extension starts the newer worker.
|
|
55
57
|
|
|
56
|
-
Each run asks the worker to merge the pull requests. See the [`next-issue` README](../next-issue/README.md) for what a run does, its labels, its state and its config.
|
|
58
|
+
Each run asks the worker to merge the pull requests. [ADR 0002](https://github.com/ravshansbox/next-issue/blob/main/docs/adr/0002-merge-setting.md) compares where the merge setting could live. See the [`next-issue` README](../next-issue/README.md) for what a run does, its labels, its state and its config.
|
package/index.ts
CHANGED
|
@@ -72,27 +72,28 @@ export function formatStatus(progress: Progress, now: number): string {
|
|
|
72
72
|
switch (progress.status) {
|
|
73
73
|
case 'running': {
|
|
74
74
|
if (running.length === 0) {
|
|
75
|
-
return '
|
|
75
|
+
return 'looking for issues';
|
|
76
76
|
}
|
|
77
|
+
const count = progress.open === undefined ? '' : `/${progress.open}`;
|
|
77
78
|
const lines = running.map((item) => {
|
|
78
|
-
const parts = [`#${item.issue}`, item.stage ?? 'prepare', `${item.tools} tools`];
|
|
79
|
+
const parts = [`#${item.issue}${count}`, item.stage ?? 'prepare', `${item.tools} tools`];
|
|
79
80
|
if (item.startedAt !== undefined) {
|
|
80
81
|
parts.push(duration(now - item.startedAt));
|
|
81
82
|
}
|
|
82
83
|
return parts.join(' · ');
|
|
83
84
|
});
|
|
84
|
-
return
|
|
85
|
+
return lines.join(' | ');
|
|
85
86
|
}
|
|
86
87
|
case 'stopping': {
|
|
87
88
|
const issues = running.map((item) => `#${item.issue}`);
|
|
88
|
-
return
|
|
89
|
+
return `${issues.length === 0 ? '#?' : issues.join(' ')} · stopping`;
|
|
89
90
|
}
|
|
90
91
|
case 'stopped':
|
|
91
|
-
return `
|
|
92
|
+
return `stopped: ${outcomes(progress)}`;
|
|
92
93
|
case 'finished':
|
|
93
|
-
return `
|
|
94
|
+
return `finished: ${outcomes(progress)}`;
|
|
94
95
|
case 'failed':
|
|
95
|
-
return `
|
|
96
|
+
return `failed: ${progress.error ?? 'unknown error'}`;
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -354,11 +355,11 @@ export function createExtension(options: Options) {
|
|
|
354
355
|
const client = shared(options.client);
|
|
355
356
|
await client.attach();
|
|
356
357
|
if (!client.connected) {
|
|
357
|
-
return report('
|
|
358
|
+
return report('no worker is running', root);
|
|
358
359
|
}
|
|
359
360
|
const progress = client.runs[root];
|
|
360
361
|
if (progress === undefined) {
|
|
361
|
-
return report(`
|
|
362
|
+
return report(`no run of ${root}`, root);
|
|
362
363
|
}
|
|
363
364
|
const lines = [
|
|
364
365
|
formatStatus(progress, Date.now()),
|
package/package.json
CHANGED
|
@@ -11,23 +11,34 @@ Turn the problem of the user into one GitHub issue in the format of `template.md
|
|
|
11
11
|
2. Investigate the code when the problem touches it. Read the relevant files and note what you find, with file paths. Run `gh issue list` and note each open issue that must be done first, including the issues you create in the same session.
|
|
12
12
|
3. Ask numbered questions about anything that is unclear: the scope, the expected behaviour, the acceptance criteria. Label options with letters and recommend one. Ask again until no question is open.
|
|
13
13
|
4. Write the body from `template.md` into a temporary file. Keep every heading of the template and its order. Leave `Open questions` empty.
|
|
14
|
-
5.
|
|
15
|
-
6. Only after the user picks a or b, create the issue:
|
|
14
|
+
5. Create the issue without showing the body first:
|
|
16
15
|
|
|
17
16
|
```bash
|
|
18
17
|
gh issue create --title "<title>" --body-file <file> --label status:todo
|
|
19
18
|
```
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
6. Link each blocker:
|
|
22
21
|
|
|
23
22
|
```bash
|
|
24
23
|
gh issue edit <number> --add-blocked-by <blocker>
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
7. Give the user the issue url. Ask once: a) start a run, b) leave it, c) change the issue.
|
|
27
|
+
8. When the user picks c, make the change on GitHub and ask again. Write the new body into the temporary file and run:
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
```bash
|
|
30
|
+
gh issue edit <number> --body-file <file>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
To change the title, run:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
gh issue edit <number> --title "<title>"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
9. Only when the user picks a, call the `next_issue_start` tool, and tell the user what it reports.
|
|
40
|
+
|
|
41
|
+
Once the issue exists, do not implement it in this session. The next-issue worker does the work. Once the user picks a or b, do not ask about a run again.
|
|
31
42
|
|
|
32
43
|
## Sections
|
|
33
44
|
|