next-issue 2.13.0 → 2.14.1

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
@@ -104,7 +104,7 @@ and exits with code 1. For each issue:
104
104
 
105
105
  ## Issue format
106
106
 
107
- Every agent prompt holds the body and the comments of the issue. An issue reads best with these sections, in this order:
107
+ Every agent prompt holds the body of the issue and the comments of users with write or admin access to the repository. An issue reads best with these sections, in this order:
108
108
 
109
109
  1. `Problem`
110
110
  2. `Context and findings`
@@ -208,12 +208,15 @@ Every agent can run a shell command. The implementer and the fixer run with the
208
208
  permission checks off; the reviewer runs with a smaller tool set, but its shell
209
209
  has no limit on the commands. They all start in the worktree, but nothing holds
210
210
  them there: they can run any command, with your rights, anywhere on the machine.
211
- The prompt holds the title, the body and the comments of the issue, which come
212
- from GitHub.
213
-
214
- Thus a person who can write an issue or a comment can try to give an
215
- instruction to the agent. Use the harness only on a repository where you trust
216
- the issue authors, or run it in a container.
211
+ The prompt holds the title and the body of the issue, which come from GitHub.
212
+ It also holds the comments of the issue, but only those by users with write or
213
+ admin access to the repository. The harness leaves out every other comment and
214
+ writes a `comment.skip` event with its author to the run log. If an access check
215
+ fails for a reason other than a 404, the issue stops with an error.
216
+
217
+ Thus a person who can write an issue, or a writer who can comment, can try to
218
+ give an instruction to the agent. Use the harness only on a repository where you
219
+ trust the issue authors, or run it in a container.
217
220
 
218
221
  ## Observability
219
222
 
package/dist/github.mjs CHANGED
@@ -72,7 +72,7 @@ export async function viewIssue(repo, issue) {
72
72
  export async function issueComments(repo, issue) {
73
73
  const raw = await gh(repo, ['issue', 'view', String(issue), '--json', 'comments']);
74
74
  const parsed = JSON.parse(raw);
75
- return parsed.comments.map((comment) => `@${comment.author.login}: ${comment.body}`);
75
+ return parsed.comments.map((comment) => ({ author: comment.author.login, body: comment.body }));
76
76
  }
77
77
  export async function threadComments(repo, number) {
78
78
  const raw = await repeatable([
package/dist/handover.mjs CHANGED
@@ -40,6 +40,20 @@ export async function waitingQuestions(repo, config, ports) {
40
40
  }
41
41
  return questions;
42
42
  }
43
+ export async function writerComments(context, log, issue) {
44
+ const { repo, ports } = context;
45
+ const writer = writers(repo, ports);
46
+ const kept = [];
47
+ for (const comment of await ports.issueComments(repo, issue)) {
48
+ if (await writer(comment.author)) {
49
+ kept.push(`@${comment.author}: ${comment.body}`);
50
+ }
51
+ else {
52
+ log.event('comment.skip', { author: comment.author }, 'quiet');
53
+ }
54
+ }
55
+ return kept;
56
+ }
43
57
  export async function handOverReply(context, issue, pr) {
44
58
  const { repo, ports } = context;
45
59
  const comments = await ports.threadComments(repo, pr ?? issue);
package/dist/pipeline.mjs CHANGED
@@ -2,7 +2,7 @@ import { CODING } from './agents.mjs';
2
2
  import { commitWork } from './fix.mjs';
3
3
  import { checkGate } from './gate.mjs';
4
4
  import { branchName } from './git.mjs';
5
- import { cleanUp, escalate, finish, handOver, handOverReply, skipped, stop } from './handover.mjs';
5
+ import { cleanUp, escalate, finish, handOver, handOverReply, skipped, stop, writerComments, } from './handover.mjs';
6
6
  import { openPr, setStatus } from './job.mjs';
7
7
  import { afterMerge, fixBase } from './merge.mjs';
8
8
  import { message } from './observe.mjs';
@@ -144,7 +144,7 @@ async function work(context, issue, log, state, start, handedOver) {
144
144
  await setStatus(context, issue.number, state.pr, config.labels.inProgress);
145
145
  await writeState(repo, state);
146
146
  });
147
- const comments = await log.step('comments', {}, () => ports.issueComments(repo, issue.number));
147
+ const comments = await log.step('comments', {}, () => writerComments(context, log, issue.number));
148
148
  const reply = handedOver
149
149
  ? await log.step('reply', {}, () => handOverReply(context, issue.number, state.pr))
150
150
  : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "2.13.0",
3
+ "version": "2.14.1",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",