next-issue 8.9.0 → 9.0.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 CHANGED
@@ -283,7 +283,7 @@ the run handles one issue. For each issue:
283
283
  for a person like any other hand-over. Then the worktree, the local
284
284
  branch and the state file go away. When the checks fail, the harness
285
285
  reruns the failed jobs of each failed GitHub Actions workflow run once
286
- with `gh run rerun <id> --failed`, records a `main-checks.rerun` event
286
+ with `gh run rerun <id> --failed`, records a `ci-checks.rerun` event
287
287
  and waits again once the runs restart. A failed run whose failed jobs
288
288
  were already rerun (its attempt on GitHub is above 1) is not rerun
289
289
  again, so a resumed run reruns only the runs not rerun yet. A failure
@@ -300,7 +300,7 @@ the run handles one issue. For each issue:
300
300
  harness still waits for the checks again, counting each restarted run as
301
301
  running until a later attempt of it completes, so the fixer never runs
302
302
  while a rerun is queued or in progress. When the rerun cannot start (no
303
- run restarted, a `main-checks.rerun-failed` event), or the checks
303
+ run restarted, a `ci-checks.rerun-failed` event), or the checks
304
304
  fail again with no run left to rerun, the fixer gets their logs from the check budget (for a check
305
305
  from another CI service, only its name and link), and its fix
306
306
  lands the same way. When the fixer cannot fix them, its fix cannot land,
@@ -603,7 +603,7 @@ get the full summary object there instead, so the harness fits in a pipe. All
603
603
  progress goes to standard error.
604
604
 
605
605
  Recorded for each step: `claim`, `comments`, `reply`, `worktree`, `setup`,
606
- `editors`, `implement`, `review`, `fix`, `commit-fix`, `rebase`, `land`, `main-checks`, `revert` and `hunt`, each with a
606
+ `editors`, `implement`, `review`, `fix`, `commit-fix`, `rebase`, `land`, `ci-checks`, `revert` and `hunt`, each with a
607
607
  `.start`, `.end` or `.error` event and a duration in `ms`. Every `git` and `gh`
608
608
  command is recorded with its exit code and duration. A `tool` event holds the
609
609
  tool name, and for a `bash` tool the command too. Each agent call adds a `usage`
@@ -116,7 +116,7 @@ function baseState(runs, external) {
116
116
  }
117
117
  return checks.some((entry) => entry.conclusion === CUT) ? 'cut' : 'pass';
118
118
  }
119
- export function waitForBaseChecks(repo, sha, branch, options, restarted = [], ignored = []) {
119
+ export function waitForCiChecks(repo, sha, branch, options, restarted = [], ignored = []) {
120
120
  let read = {
121
121
  runs: [],
122
122
  external: [],
@@ -132,7 +132,7 @@ export function waitForBaseChecks(repo, sha, branch, options, restarted = [], ig
132
132
  watch: async () => (read.rerunning ? 'pending' : baseState(read.runs, read.external)),
133
133
  }, options);
134
134
  }
135
- export async function rerunFailedBase(repo, sha, branch, started = () => { }, ignored = []) {
135
+ export async function rerunFailedCi(repo, sha, branch, started = () => { }, ignored = []) {
136
136
  const failed = (await baseRuns(repo, sha, branch, ignored)).filter(rerunnable);
137
137
  for (const entry of failed) {
138
138
  await rerun(repo, entry.databaseId);
@@ -164,7 +164,7 @@ async function waitForRestart(repo, sha, branch, failed, ignored) {
164
164
  await delay(secondsToMs(1));
165
165
  }
166
166
  }
167
- export async function failedBaseLogs(repo, sha, branch, maxChars, ignored = []) {
167
+ export async function failedCiLogs(repo, sha, branch, maxChars, ignored = []) {
168
168
  const failed = (await baseRuns(repo, sha, branch, ignored)).filter(failedRun).flatMap((entry) => entry.jobs === undefined
169
169
  ? [{ heading: `## ${entry.name}`, view: [String(entry.databaseId)] }]
170
170
  : entry.jobs.filter(failedRun).map((job) => ({
package/dist/gate.mjs CHANGED
@@ -50,8 +50,8 @@ export async function checkGate(job, sha) {
50
50
  async function waitForChecks(job, sha, fields = {}, restarted = []) {
51
51
  const { context, log } = job;
52
52
  const { repo, config, ports } = context;
53
- const checks = await log.step('main-checks', { sha, ...fields }, () => ports.waitForBaseChecks(repo, sha, context.base, checkWaiting(config, true), restarted, config.ignoredChecks));
54
- log.event('main-checks.state', { state: checks, ...fields });
53
+ const checks = await log.step('ci-checks', { sha, ...fields }, () => ports.waitForCiChecks(repo, sha, context.base, checkWaiting(config, true), restarted, config.ignoredChecks));
54
+ log.event('ci-checks.state', { state: checks, ...fields });
55
55
  return checks;
56
56
  }
57
57
  /** Reruns the failed jobs of each failed workflow run once; GitHub keeps the attempts, so a resume reruns only runs not rerun yet. */
@@ -73,22 +73,22 @@ async function rerunFailed(job, sha) {
73
73
  const { context, log } = job;
74
74
  const restarted = [];
75
75
  try {
76
- const runs = await context.ports.rerunFailedBase(context.repo, sha, context.base, (run) => {
76
+ const runs = await context.ports.rerunFailedCi(context.repo, sha, context.base, (run) => {
77
77
  restarted.push(run);
78
78
  }, context.config.ignoredChecks);
79
79
  // An empty list tells why the fixer starts with no rerun: no failed workflow run is left to rerun.
80
- log.event('main-checks.rerun', { sha, runs });
80
+ log.event('ci-checks.rerun', { sha, runs });
81
81
  }
82
82
  catch (error) {
83
83
  if (runStopped()) {
84
84
  throw error;
85
85
  }
86
86
  if (restarted.length === 0) {
87
- log.event('main-checks.rerun-failed', { sha, error: asError(error).message });
87
+ log.event('ci-checks.rerun-failed', { sha, error: asError(error).message });
88
88
  return restarted;
89
89
  }
90
90
  // Some runs restarted, so the fixer waits for them rather than getting a failure with no log.
91
- log.event('main-checks.rerun', {
91
+ log.event('ci-checks.rerun', {
92
92
  sha,
93
93
  runs: restarted.map((run) => String(run.id)),
94
94
  error: asError(error).message,
@@ -108,13 +108,13 @@ async function failedChecksFix(job, sha, refused) {
108
108
  await writeState(repo, state);
109
109
  let logs;
110
110
  try {
111
- logs = await refundOnKill(job, 'ciFixes', () => ports.failedBaseLogs(repo, sha, base, config.logMaxChars, config.ignoredChecks));
111
+ logs = await refundOnKill(job, 'ciFixes', () => ports.failedCiLogs(repo, sha, base, config.logMaxChars, config.ignoredChecks));
112
112
  }
113
113
  catch (error) {
114
114
  await refundStopped(job);
115
115
  return escalateError(job, error, `The read of the failed checks on ${base} failed`, 'logs error');
116
116
  }
117
- log.event('main-checks.logs', { chars: logs.length });
117
+ log.event('ci-checks.logs', { chars: logs.length });
118
118
  let fix;
119
119
  try {
120
120
  fix = await refundOnKill(job, 'ciFixes', () => fixRound(job, `The checks on ${base} failed after the change landed there.${refusedNote(refused)}`, logs, [], 'checks'));
package/dist/ports.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { runAgent } from './agents.mjs';
2
- import { failedBaseLogs, rerunFailedBase, waitForBaseChecks } from './base-checks.mjs';
2
+ import { failedCiLogs, rerunFailedCi, waitForCiChecks } from './ci-checks.mjs';
3
3
  import { run } from './exec.mjs';
4
4
  import { commitAll } from './git-commit.mjs';
5
5
  import { pushToBase, reapplyRevert, revertOnBase, squashOnto } from './git-land.mjs';
@@ -34,7 +34,7 @@ export const PORTS = {
34
34
  disputeBranches,
35
35
  editIssueBody,
36
36
  ensureLabel,
37
- failedBaseLogs,
37
+ failedCiLogs,
38
38
  fastForwardBase,
39
39
  findWorktree,
40
40
  huntWorktree,
@@ -52,7 +52,7 @@ export const PORTS = {
52
52
  removeWorktree,
53
53
  reopenIssue,
54
54
  repositorySlug,
55
- rerunFailedBase,
55
+ rerunFailedCi,
56
56
  resetToBase,
57
57
  revertOnBase,
58
58
  revision,
@@ -67,5 +67,5 @@ export const PORTS = {
67
67
  startMerge,
68
68
  threadComments,
69
69
  viewIssue,
70
- waitForBaseChecks,
70
+ waitForCiChecks,
71
71
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "8.9.0",
3
+ "version": "9.0.0",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",