next-issue 7.0.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 +22 -2
- package/dist/prompts.mjs +14 -0
- 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,
|
|
@@ -945,7 +957,14 @@ Releases are automatic and need no pull request. Push a
|
|
|
945
957
|
[conventional commit](https://www.conventionalcommits.org/) to `main`. The
|
|
946
958
|
workflow reads the commits since the last tag and picks the bump: `feat` gives a
|
|
947
959
|
minor, `fix` gives a patch, and a `!` mark or a `BREAKING CHANGE` body gives a
|
|
948
|
-
major. Any other type releases nothing.
|
|
960
|
+
major. Any other type releases nothing. The notes of the GitHub release list the
|
|
961
|
+
subject and short hash of each breaking, `feat` and `fix` commit since the
|
|
962
|
+
previous tag, grouped by type, and end with the compare link from that tag.
|
|
963
|
+
|
|
964
|
+
The release is the `release` job of the `ci` workflow, and it runs only after
|
|
965
|
+
the `check` job of the same commit passes. A commit that fails the typecheck,
|
|
966
|
+
lint, format check, tests or build releases nothing. As the release is part of
|
|
967
|
+
the `push` run, the harness waits for it like any other check.
|
|
949
968
|
|
|
950
969
|
The workflow then gives `next-issue` and `@ravshansbox/pi-next-issue` the same
|
|
951
970
|
new version and publishes both packages to npm with a
|
|
@@ -962,7 +981,8 @@ version, and makes the GitHub release if it is missing. A package that npm
|
|
|
962
981
|
refuses as a version it already holds, but does not serve yet, counts as
|
|
963
982
|
published. So when a step fails after the tag push, the next run finishes that
|
|
964
983
|
release before it makes a new one. To repair a release without a new commit,
|
|
965
|
-
run the workflow by hand;
|
|
984
|
+
run the `ci` workflow by hand; after the checks pass, the release job only
|
|
985
|
+
repairs and does nothing else.
|
|
966
986
|
The job uses the npm that comes with Node 24 and never installs another one.
|
|
967
987
|
Trusted publishing needs npm 11.5.1 or later, so the job stops with an error
|
|
968
988
|
before anything else when the bundled npm is older.
|
package/dist/prompts.mjs
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { ISSUE_SECTIONS } from './issue-format.mjs';
|
|
2
2
|
import { paragraphs } from './text.mjs';
|
|
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.',
|
|
9
|
+
].join('\n');
|
|
3
10
|
const COMMIT_RULES = [
|
|
4
11
|
'Do not run git, gh or any push command. The harness commits for you.',
|
|
5
12
|
'End your final message with one line in the form `commit: <conventional commit subject>`.',
|
|
@@ -27,6 +34,7 @@ export function implementPrompt(issue, comments, reply = []) {
|
|
|
27
34
|
replyBlock(reply),
|
|
28
35
|
'## Rules',
|
|
29
36
|
'Read the repository conventions first. Keep the change minimal and focused on the issue.',
|
|
37
|
+
ENGINEERING_RULES,
|
|
30
38
|
'Add or update tests when the repository has a test suite.',
|
|
31
39
|
'For a behaviour change, write the test first and run it before the change. Then quote its failing output in your final message.',
|
|
32
40
|
COMMIT_RULES,
|
|
@@ -66,6 +74,10 @@ function reviewScope(earlier) {
|
|
|
66
74
|
? [
|
|
67
75
|
'Check correctness, scope, repository conventions and test cover.',
|
|
68
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.',
|
|
69
81
|
].join('\n')
|
|
70
82
|
: [
|
|
71
83
|
'This is a later round. Judge two things only:',
|
|
@@ -93,6 +105,7 @@ export function reviewPrompt(issue, comments, diff, earlier, reply) {
|
|
|
93
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.',
|
|
94
106
|
'The harness discards each change that you make, so a change is only lost work.',
|
|
95
107
|
reviewScope(earlier),
|
|
108
|
+
'Give the file and line, or the command output, that supports each finding. A guess is not a finding.',
|
|
96
109
|
'Mark a finding blocking only for a wrong result, a missing part of the issue, a regression or a broken convention.',
|
|
97
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>"}]}.',
|
|
98
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.',
|
|
@@ -146,6 +159,7 @@ export function fixPrompt(issue, comments, reason, detail, earlier, kind, reply
|
|
|
146
159
|
replyBlock(reply),
|
|
147
160
|
'## Rules',
|
|
148
161
|
'Fix the cause, not the symptom. Keep the change minimal.',
|
|
162
|
+
ENGINEERING_RULES,
|
|
149
163
|
KIND_RULES[kind],
|
|
150
164
|
COMMIT_RULES,
|
|
151
165
|
]);
|