next-issue 6.6.91 → 6.6.92

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
@@ -595,7 +595,10 @@ that still has the label is not claimed, unless it has an answer to the
595
595
  hand-over: then the run claims it and takes the label off. When the label of a
596
596
  hand-over reaches GitHub but its comment does not, an answer to an earlier
597
597
  hand-over does not count: the issue waits, and the worker lists it, until a
598
- person takes the label off or a writer comments after that hand-over.
598
+ person takes the label off or a writer comments after that hand-over. Either
599
+ way, the next run that claims it counts it as a hand-over: it puts the budgets
600
+ and the findings back to zero and passes on the comments posted after it. When
601
+ the label edit itself fails, the next run keeps the budgets and the findings.
599
602
 
600
603
  To give guidance, answer the hand-over with a comment on the issue. When the run
601
604
  resumes the issue, it reads the comments posted after its last
package/dist/handover.mjs CHANGED
@@ -145,11 +145,10 @@ async function handOver(context, log, issue, state, reason) {
145
145
  const { pendingHandOver: _pending, ...rest } = state;
146
146
  try {
147
147
  const since = await threadEnd(context, issue);
148
- await writeState(repo, {
149
- ...rest,
150
- pendingHandOver: { reason, ...(since === undefined ? {} : { since }) },
151
- });
148
+ const pending = { reason, ...(since === undefined ? {} : { since }) };
149
+ await writeState(repo, { ...rest, pendingHandOver: pending });
152
150
  await setStatus(context, issue, config.labels.needsHuman);
151
+ await writeState(repo, { ...rest, pendingHandOver: { ...pending, labelled: true } });
153
152
  await ports.commentOnIssue(repo, issue, handOverComment(reason));
154
153
  }
155
154
  catch (error) {
package/dist/pipeline.mjs CHANGED
@@ -47,12 +47,17 @@ export async function processIssue(context, issue, claimed = () => undefined) {
47
47
  log.event('issue.end', { outcome: report.outcome, reason: report.reason, ms: report.ms }, 'quiet');
48
48
  return report;
49
49
  }
50
- /** A hand-over whose comment failed counts once the issue is claimed with its label still on, that is with an answer. */
50
+ /**
51
+ * A hand-over whose comment failed counts once its label reached GitHub (a person who takes it off retries),
52
+ * or once the issue is claimed with its label still on, that is with an answer.
53
+ */
51
54
  function wasHandedOver(context, issue, saved) {
52
55
  if (saved?.handedOver === true) {
53
56
  return true;
54
57
  }
55
- return (saved?.pendingHandOver !== undefined && hasLabel(issue.labels, context.config.labels.needsHuman));
58
+ const pending = saved?.pendingHandOver;
59
+ return (pending !== undefined &&
60
+ (pending.labelled === true || hasLabel(issue.labels, context.config.labels.needsHuman)));
56
61
  }
57
62
  function startState(context, issue, saved, handedOver) {
58
63
  if (saved === undefined) {
package/dist/state.mjs CHANGED
@@ -46,7 +46,10 @@ function isReviewRound(value) {
46
46
  isOptional(value.settled, 'string'));
47
47
  }
48
48
  function isPending(value) {
49
- return isRecord(value) && typeof value.reason === 'string' && isOptional(value.since, 'string');
49
+ return (isRecord(value) &&
50
+ typeof value.reason === 'string' &&
51
+ isOptional(value.since, 'string') &&
52
+ isOptional(value.labelled, 'boolean'));
50
53
  }
51
54
  function isState(value) {
52
55
  return (isRecord(value) &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "6.6.91",
3
+ "version": "6.6.92",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",