next-issue 7.8.6 → 7.8.7

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 CHANGED
@@ -107,7 +107,9 @@ the run handles one issue. For each issue:
107
107
  heading, or adds that heading at the end of the body when it has none.
108
108
  When that read or body edit fails, the harness records a
109
109
  `questions.body-failed` event in the run log and still hands the issue over
110
- with the questions in the comment.
110
+ with the questions in the comment. It also keeps the questions in the state
111
+ of the issue, so the implementer of the run that resumes the issue finds
112
+ them next to the answer of a person, not in the issue body.
111
113
  5. Let the reviewer agent judge the diff, at most `diffMaxChars` of it. The
112
114
  reviewer reads files and runs commands in the worktree, so it can prove a
113
115
  finding with the tests or the type check. The harness then throws away every
@@ -763,8 +765,11 @@ resumes the issue, it reads the comments posted after its last
763
765
  access to the repository count, for the hand-over comment too. A comment that
764
766
  starts with one of the headings of the harness never counts as an answer. The
765
767
  implementer and every fixer of that run get them in their prompt, under the
766
- heading `Answer of a person to the hand-over`. A short reply such as "ready,
767
- take it" is enough. With no such comment, the run resumes with no guidance.
768
+ heading `Answer of a person to the hand-over`. When the questions of the
769
+ implementer did not reach the issue body, the implementer also gets them under
770
+ that heading, before the answer, or alone when no comment answers them. A short
771
+ reply such as "ready, take it" is enough. With no such comment, the run resumes
772
+ with no guidance.
768
773
 
769
774
  The `--reset` flag does the same for any issue that the run handles, whether or
770
775
  not it was handed over. It touches only an issue that the run handles, so the
@@ -10,8 +10,9 @@ import { writeState } from './state.mjs';
10
10
  export async function implement(job) {
11
11
  const { context, issue, log, state, worktree, comments, reply } = job;
12
12
  const before = await context.ports.revision(worktree);
13
- const result = await log.step('implement', {}, () => runRole(job, 'implementer', implementPrompt(issue, comments, reply), CODING));
13
+ const result = await log.step('implement', {}, () => runRole(job, 'implementer', implementPrompt(issue, comments, reply, state.unpostedQuestions), CODING));
14
14
  state.implementerReply = result.text;
15
+ delete state.unpostedQuestions;
15
16
  const questions = parseQuestions(result.text);
16
17
  if (questions.length > 0) {
17
18
  return askQuestions(job, before, questions);
@@ -28,7 +29,7 @@ export async function implement(job) {
28
29
  return ROUND_CONTINUE;
29
30
  }
30
31
  async function askQuestions(job, before, questions) {
31
- const { context, issue, log, worktree, branch } = job;
32
+ const { context, issue, log, state, worktree, branch } = job;
32
33
  const { repo, ports } = context;
33
34
  await ports.discardChanges(worktree, before, branch);
34
35
  try {
@@ -37,6 +38,7 @@ async function askQuestions(job, before, questions) {
37
38
  }
38
39
  catch (error) {
39
40
  log.event('questions.body-failed', { error: message(error) }, 'quiet');
41
+ state.unpostedQuestions = questions;
40
42
  }
41
43
  return escalateAndFinish(job, `The implementer has questions about the issue.\n\n${numbered(questions)}`, 'questions');
42
44
  }
package/dist/prompts.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { ISSUE_SECTIONS } from './issue-format.mjs';
1
+ import { ISSUE_SECTIONS, numbered } from './issue-format.mjs';
2
2
  import { paragraphs } from './text.mjs';
3
3
  const ENGINEERING_RULES = [
4
4
  'Update the documentation when you change behaviour or add or remove a feature.',
@@ -29,20 +29,26 @@ function issueBlock(issue, comments) {
29
29
  comments.length > 0 ? `## Comments\n${comments.join('\n\n')}` : '',
30
30
  ]);
31
31
  }
32
- function replyBlock(reply) {
33
- return reply.length > 0
34
- ? [
35
- '## Answer of a person to the hand-over',
36
- 'The last run handed the issue to a person. A person with write access to the repository answered as below. Follow this guidance.',
37
- reply.join('\n\n'),
38
- ].join('\n\n')
39
- : '';
32
+ function replyBlock(reply, questions = []) {
33
+ if (reply.length === 0 && questions.length === 0) {
34
+ return '';
35
+ }
36
+ return paragraphs([
37
+ '## Answer of a person to the hand-over',
38
+ reply.length > 0
39
+ ? 'The last run handed the issue to a person. A person with write access to the repository answered as below. Follow this guidance.'
40
+ : 'The last run handed the issue to a person. No person with write access to the repository answered in a comment.',
41
+ questions.length > 0
42
+ ? `The implementer of the last run asked these questions:\n\n${numbered(questions)}`
43
+ : '',
44
+ reply.join('\n\n'),
45
+ ]);
40
46
  }
41
- export function implementPrompt(issue, comments, reply = []) {
47
+ export function implementPrompt(issue, comments, reply = [], questions = []) {
42
48
  return paragraphs([
43
49
  'You are the implementer. Solve the issue below in this worktree.',
44
50
  issueBlock(issue, comments),
45
- replyBlock(reply),
51
+ replyBlock(reply, questions),
46
52
  '## Rules',
47
53
  'Read the repository conventions first. Keep the change minimal and focused on the issue.',
48
54
  QUESTION_RULES,
package/dist/state.mjs CHANGED
@@ -35,8 +35,8 @@ const PHASES = ['claimed', 'implemented', 'review', 'approved'];
35
35
  function isOptional(value, type) {
36
36
  return value === undefined || typeof value === type;
37
37
  }
38
- function isLanded(value) {
39
- return Array.isArray(value) && value.every((sha) => typeof sha === 'string');
38
+ function isStrings(value) {
39
+ return Array.isArray(value) && value.every((item) => typeof item === 'string');
40
40
  }
41
41
  function isReviewRound(value) {
42
42
  return (isRecord(value) &&
@@ -59,10 +59,11 @@ function isState(value) {
59
59
  isOptional(value.title, 'string') &&
60
60
  isOptional(value.changeTitle, 'string') &&
61
61
  isOptional(value.implementerReply, 'string') &&
62
+ (value.unpostedQuestions === undefined || isStrings(value.unpostedQuestions)) &&
62
63
  isOptional(value.fixerReply, 'string') &&
63
64
  typeof value.ciFixes === 'number' &&
64
65
  isOptional(value.commitFixes, 'number') &&
65
- (value.landed === undefined || isLanded(value.landed)) &&
66
+ (value.landed === undefined || isStrings(value.landed)) &&
66
67
  isOptional(value.pushing, 'string') &&
67
68
  isOptional(value.reverting, 'string') &&
68
69
  isOptional(value.squashing, 'string') &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "7.8.6",
3
+ "version": "7.8.7",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",