next-issue 7.1.0 → 7.2.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 +12 -8
- package/dist/prompts.mjs +13 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -283,6 +283,18 @@ Every agent prompt holds the body of the issue and the comments of users with wr
|
|
|
283
283
|
|
|
284
284
|
The list lives in `src/issue-format.mts`. The `create-issue` skill of [`@ravshansbox/pi-next-issue`](../pi-next-issue) writes an issue in this format, and a contract test fails when its template and the list disagree. The harness does not reject an issue without the format.
|
|
285
285
|
|
|
286
|
+
## Rules for the agents
|
|
287
|
+
|
|
288
|
+
The implementer and the fixer get these rules in their prompt, and the first reviewer checks them:
|
|
289
|
+
|
|
290
|
+
- update the documentation for a change of behaviour or a feature that is added or removed;
|
|
291
|
+
- remove the tests of a feature or behaviour that is removed;
|
|
292
|
+
- test behaviour that a user can observe, and give each test a description that names the actor, the action and the observable outcome;
|
|
293
|
+
- reuse existing code and patterns, stay consistent with the repository and pick the simpler option;
|
|
294
|
+
- check an API, a command or a url in the repository or its dependencies before using it, and invent none.
|
|
295
|
+
|
|
296
|
+
The reviewer rates a missing documentation update or a test that is not observable as a finding. In every round, it gives the file and line, or the command output, that supports each finding. Personal style rules, such as spelling, code comments or binding names, belong in the `AGENTS.md` of each repository.
|
|
297
|
+
|
|
286
298
|
## Stops for a loop
|
|
287
299
|
|
|
288
300
|
The harness hands the issue to a person, with the `status:needs-human` label,
|
|
@@ -683,14 +695,6 @@ issue to the next. The implementer and the fixer may add a short note to it, and
|
|
|
683
695
|
the prompt asks them to keep only what still holds. The reviewer and the hunter
|
|
684
696
|
only read it.
|
|
685
697
|
|
|
686
|
-
Every agent also reads each `AGENTS.md` that pi finds, such as the one in your
|
|
687
|
-
home folder and the one in the repository. The other rules there, such as code
|
|
688
|
-
conventions and test style, still apply. But the harness owns the issue, the
|
|
689
|
-
worktree, the branch, git, the commit, the push and the checks, and the prompt
|
|
690
|
-
says so: a workflow rule in `AGENTS.md` about these, such as "push to main" or
|
|
691
|
-
"watch ci", does not apply to the agent. The hunter still files its issues with
|
|
692
|
-
`gh issue create`.
|
|
693
|
-
|
|
694
698
|
## Retry an issue that waits for a person
|
|
695
699
|
|
|
696
700
|
When the implementer makes no change, the hand-over comment holds its full
|
package/dist/prompts.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ISSUE_SECTIONS } from './issue-format.mjs';
|
|
2
2
|
import { paragraphs } from './text.mjs';
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
'
|
|
6
|
-
|
|
3
|
+
const ENGINEERING_RULES = [
|
|
4
|
+
'Update the documentation when you change behaviour or add or remove a feature.',
|
|
5
|
+
'Remove the tests of a feature or behaviour that you remove.',
|
|
6
|
+
'Test behaviour that a user can observe, not internals. Give each test a description that names the actor, the action and the observable outcome.',
|
|
7
|
+
'Reuse existing code and patterns, stay consistent with the repository and pick the simpler option.',
|
|
8
|
+
'Check an API, a command or a url in the repository or its dependencies before you use it. Do not invent one.',
|
|
7
9
|
].join('\n');
|
|
8
10
|
const COMMIT_RULES = [
|
|
9
|
-
HARNESS_RULES,
|
|
10
11
|
'Do not run git, gh or any push command. The harness commits for you.',
|
|
11
12
|
'End your final message with one line in the form `commit: <conventional commit subject>`.',
|
|
12
13
|
].join('\n');
|
|
@@ -33,6 +34,7 @@ export function implementPrompt(issue, comments, reply = []) {
|
|
|
33
34
|
replyBlock(reply),
|
|
34
35
|
'## Rules',
|
|
35
36
|
'Read the repository conventions first. Keep the change minimal and focused on the issue.',
|
|
37
|
+
ENGINEERING_RULES,
|
|
36
38
|
'Add or update tests when the repository has a test suite.',
|
|
37
39
|
'For a behaviour change, write the test first and run it before the change. Then quote its failing output in your final message.',
|
|
38
40
|
COMMIT_RULES,
|
|
@@ -72,6 +74,10 @@ function reviewScope(earlier) {
|
|
|
72
74
|
? [
|
|
73
75
|
'Check correctness, scope, repository conventions and test cover.',
|
|
74
76
|
'Raise a finding when a behaviour change has no failing run of its test in the reply of the implementer.',
|
|
77
|
+
'Check that the change updates the documentation when it changes behaviour or adds or removes a feature, and that it removes the tests of a removed feature or behaviour.',
|
|
78
|
+
'Check that each test checks behaviour that a user can observe, and that its description names the actor, the action and the observable outcome.',
|
|
79
|
+
'Check that the change reuses existing code and patterns, stays consistent with the repository and picks the simpler option, and that it uses no invented API, command or url.',
|
|
80
|
+
'A missing documentation update or a test that is not observable is a finding.',
|
|
75
81
|
].join('\n')
|
|
76
82
|
: [
|
|
77
83
|
'This is a later round. Judge two things only:',
|
|
@@ -98,8 +104,8 @@ export function reviewPrompt(issue, comments, diff, earlier, reply) {
|
|
|
98
104
|
'Read files and run commands to prove what you say: the tests, the type check or the linter.',
|
|
99
105
|
'The worktree is ready to use. Do not change a file. Do not write with git or gh, and do not check out another commit or branch.',
|
|
100
106
|
'The harness discards each change that you make, so a change is only lost work.',
|
|
101
|
-
HARNESS_RULES,
|
|
102
107
|
reviewScope(earlier),
|
|
108
|
+
'Give the file and line, or the command output, that supports each finding. A guess is not a finding.',
|
|
103
109
|
'Mark a finding blocking only for a wrong result, a missing part of the issue, a regression or a broken convention.',
|
|
104
110
|
'End your final message with the result as a json block in a ```json fence, in the form {"summary": "<short summary>", "findings": [{"severity": "blocking" or "minor", "detail": "<what is wrong and where>"}]}.',
|
|
105
111
|
'Give one entry per finding, and an empty list when nothing is wrong. The findings decide the outcome, so a problem that you leave out counts as no problem.',
|
|
@@ -153,6 +159,7 @@ export function fixPrompt(issue, comments, reason, detail, earlier, kind, reply
|
|
|
153
159
|
replyBlock(reply),
|
|
154
160
|
'## Rules',
|
|
155
161
|
'Fix the cause, not the symptom. Keep the change minimal.',
|
|
162
|
+
ENGINEERING_RULES,
|
|
156
163
|
KIND_RULES[kind],
|
|
157
164
|
COMMIT_RULES,
|
|
158
165
|
]);
|
|
@@ -185,8 +192,6 @@ export function huntPrompt(instructions, ready, source, count, repository) {
|
|
|
185
192
|
'## Rules',
|
|
186
193
|
[
|
|
187
194
|
'Run no test suite and no build. Change no file. Do not commit or push.',
|
|
188
|
-
'The harness owns the worktree, git and the checks. The workflow rules of `AGENTS.md` about these do not apply to you.',
|
|
189
|
-
OTHER_RULES,
|
|
190
195
|
`File up to ${issues}, your most serious findings first. File nothing when you find no real problem.`,
|
|
191
196
|
`Before you file an issue, search the open and closed issues for a duplicate, for example with \`gh issue list --repo ${repository} --state all --search "<words>"\`. Do not file a finding when a duplicate exists.`,
|
|
192
197
|
`File each issue with \`gh issue create --repo ${repository}${label} --title "<conventional commit subject>" --body-file -\`.`,
|