@pourkit/cli 0.0.0-next-20260705165838 → 0.0.0-next-20260707210730

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/dist/cli.js CHANGED
@@ -1422,6 +1422,9 @@ function buildRunContextMarkdown(options) {
1422
1422
  sections = ALL_RUN_CONTEXT_SECTIONS
1423
1423
  } = options;
1424
1424
  const parts = ["# Pourkit Run Context", ""];
1425
+ if (sections.includes("verification-commands")) {
1426
+ parts.push(...renderCommandList(target, "Verification Commands", repoRoot2));
1427
+ }
1425
1428
  if (sections.includes("issue")) {
1426
1429
  const issueBody = stripIssueSections(issue.body, [
1427
1430
  "Parent",
@@ -1467,9 +1470,6 @@ function buildRunContextMarkdown(options) {
1467
1470
  ""
1468
1471
  );
1469
1472
  }
1470
- if (sections.includes("verification-commands")) {
1471
- parts.push(...renderCommandList(target, "Verification Commands", repoRoot2));
1472
- }
1473
1473
  if (sections.includes("review-criteria")) {
1474
1474
  parts.push(...renderCriteria(reviewerCriteria));
1475
1475
  }
@@ -10288,19 +10288,14 @@ function runQueueLoopEffect(options, results) {
10288
10288
  };
10289
10289
  }
10290
10290
  const newResults = [...results, outcome];
10291
- if (options.queueRunContext?.resumeIssueNumber !== void 0) {
10292
- return {
10293
- drained: true,
10294
- processedCount: newResults.length,
10295
- results: newResults,
10296
- selected: null,
10297
- reason: "Resumed issue processed.",
10298
- code: "drained",
10299
- allProcessedIssuesFinalizedIntoPrdBranch: Boolean(options.queueRunContext?.prdBranch) && newResults.length > 0 && newResults.every(
10300
- (result) => result.runResult.publicationStatus === "merged"
10301
- )
10302
- };
10303
- }
10291
+ const nextOptions = options.queueRunContext?.resumeIssueNumber !== void 0 ? {
10292
+ ...options,
10293
+ queueRunContext: {
10294
+ prdRef: options.queueRunContext.prdRef,
10295
+ prdBranch: options.queueRunContext.prdBranch,
10296
+ ...options.queueRunContext.beadsChild ? { beadsChild: options.queueRunContext.beadsChild } : {}
10297
+ }
10298
+ } : options;
10304
10299
  const processedIssue = yield* Effect9.tryPromise({
10305
10300
  try: () => options.issueProvider.fetchIssue(outcome.selected.number),
10306
10301
  catch: (e) => {
@@ -10311,9 +10306,9 @@ function runQueueLoopEffect(options, results) {
10311
10306
  }
10312
10307
  });
10313
10308
  if (processedIssue.state === "closed") {
10314
- yield* reconcileBlockedEffect(options);
10309
+ yield* reconcileBlockedEffect(nextOptions);
10315
10310
  }
10316
- return yield* runQueueLoopEffect(options, newResults);
10311
+ return yield* runQueueLoopEffect(nextOptions, newResults);
10317
10312
  });
10318
10313
  }
10319
10314
  function runQueueLoop(options) {
@@ -11054,6 +11049,7 @@ function persistStartingPrdRunRecord(repoRoot2, prdRef, existingRecord, start, c
11054
11049
  diagnostics: _diagnostics,
11055
11050
  offendingPaths: _offendingPaths,
11056
11051
  prdBranch: _prdBranch,
11052
+ repairGuidance: _repairGuidance,
11057
11053
  start: _start,
11058
11054
  ...cleanRecord
11059
11055
  } = existingRecord.record ?? { prdRef };
@@ -11558,6 +11554,23 @@ var QUEUE_FAILURE_CODES_WITHOUT_SELECTED_ISSUE = /* @__PURE__ */ new Set([
11558
11554
  "prd-branch-mismatch",
11559
11555
  "missing-child-finalization-evidence"
11560
11556
  ]);
11557
+ var ISSUE_FINAL_REVIEW_HANDOFF_PREFIX = "Issue Final Review requires human handoff";
11558
+ function buildQueueIssueRunRepairMetadata(message, fallbackFailureCode, prdRef) {
11559
+ if (!message.startsWith(ISSUE_FINAL_REVIEW_HANDOFF_PREFIX)) {
11560
+ return {
11561
+ failureCode: fallbackFailureCode,
11562
+ repairability: "automatic-retry-safe",
11563
+ nextAction: "rerun-prd-run-launch",
11564
+ nextRecommendedCommand: "pourkit prd-run launch"
11565
+ };
11566
+ }
11567
+ return {
11568
+ failureCode: "issue-final-review-human-handoff",
11569
+ repairability: "operator-action",
11570
+ nextAction: "inspect-issue-final-review-handoff",
11571
+ nextRecommendedCommand: `pourkit prd-run status ${prdRef}`
11572
+ };
11573
+ }
11561
11574
  function canRetryQueueGuidanceWithoutIssue(options) {
11562
11575
  const { guidance, startReceipt } = options;
11563
11576
  if (guidance.blockedGate !== "queue") return false;
@@ -12274,17 +12287,22 @@ async function launchGithubQueueDrain(options, prdRef, startReceipt, targetName,
12274
12287
  const msg = error instanceof Error ? error.message : String(error);
12275
12288
  const diagnostics = [msg];
12276
12289
  const issue = extractIssueFromQueueError(error);
12290
+ const repair = buildQueueIssueRunRepairMetadata(
12291
+ msg,
12292
+ "queue-exception",
12293
+ prdRef
12294
+ );
12277
12295
  const result = buildLaunchBlockedOutcome(
12278
12296
  options.repoRoot,
12279
12297
  prdRef,
12280
12298
  buildPrdRunRepairGuidance({
12281
12299
  blockedGate: "queue",
12282
12300
  blockedStage: "queue-drain",
12283
- failureCode: "queue-exception",
12301
+ failureCode: repair.failureCode,
12284
12302
  humanReadableReason: msg,
12285
- repairability: "automatic-retry-safe",
12286
- nextAction: "rerun-prd-run-launch",
12287
- nextRecommendedCommand: "pourkit prd-run launch",
12303
+ repairability: repair.repairability,
12304
+ nextAction: repair.nextAction,
12305
+ nextRecommendedCommand: repair.nextRecommendedCommand,
12288
12306
  diagnostics,
12289
12307
  issue
12290
12308
  }),
@@ -12486,17 +12504,22 @@ async function launchBeadsQueueDrain(options, prdRef, startReceipt, targetName,
12486
12504
  startReceipt.queueProcessedCount = processedResults.length;
12487
12505
  } catch (error) {
12488
12506
  const msg = error instanceof Error ? error.message : String(error);
12507
+ const repair = buildQueueIssueRunRepairMetadata(
12508
+ msg,
12509
+ "resume-issue-failed",
12510
+ prdRef
12511
+ );
12489
12512
  return buildLaunchBlockedOutcome(
12490
12513
  options.repoRoot,
12491
12514
  prdRef,
12492
12515
  buildPrdRunRepairGuidance({
12493
12516
  blockedGate: "queue",
12494
12517
  blockedStage: "queue-drain",
12495
- failureCode: "resume-issue-failed",
12518
+ failureCode: repair.failureCode,
12496
12519
  humanReadableReason: msg,
12497
- repairability: "automatic-retry-safe",
12498
- nextAction: "rerun-prd-run-launch",
12499
- nextRecommendedCommand: "pourkit prd-run launch",
12520
+ repairability: repair.repairability,
12521
+ nextAction: repair.nextAction,
12522
+ nextRecommendedCommand: repair.nextRecommendedCommand,
12500
12523
  diagnostics: [msg],
12501
12524
  issue: resumeIssue ? {
12502
12525
  number: fetchedIssue.number,
@@ -12608,6 +12631,11 @@ async function launchBeadsQueueDrain(options, prdRef, startReceipt, targetName,
12608
12631
  });
12609
12632
  } catch (error) {
12610
12633
  const msg = error instanceof Error ? error.message : String(error);
12634
+ const repair = buildQueueIssueRunRepairMetadata(
12635
+ msg,
12636
+ "beads-issue-run-failed",
12637
+ prdRef
12638
+ );
12611
12639
  const beadsChildClosed = msg.startsWith(
12612
12640
  "Projection failure after Beads close"
12613
12641
  );
@@ -12617,11 +12645,11 @@ async function launchBeadsQueueDrain(options, prdRef, startReceipt, targetName,
12617
12645
  buildPrdRunRepairGuidance({
12618
12646
  blockedGate: "queue",
12619
12647
  blockedStage: "queue-drain",
12620
- failureCode: "beads-issue-run-failed",
12648
+ failureCode: repair.failureCode,
12621
12649
  humanReadableReason: msg,
12622
- repairability: "automatic-retry-safe",
12623
- nextAction: "rerun-prd-run-launch",
12624
- nextRecommendedCommand: "pourkit prd-run launch",
12650
+ repairability: repair.repairability,
12651
+ nextAction: repair.nextAction,
12652
+ nextRecommendedCommand: repair.nextRecommendedCommand,
12625
12653
  diagnostics: [msg],
12626
12654
  issue: {
12627
12655
  number: contextResult.issue.number,
@@ -19332,11 +19360,11 @@ function createCliProgram(version) {
19332
19360
  return program;
19333
19361
  }
19334
19362
  async function resolveCliVersion() {
19335
- if (isPackageVersion("0.0.0-next-20260705165838")) {
19336
- return "0.0.0-next-20260705165838";
19363
+ if (isPackageVersion("0.0.0-next-20260707210730")) {
19364
+ return "0.0.0-next-20260707210730";
19337
19365
  }
19338
- if (isReleaseVersion("0.0.0-next-20260705165838")) {
19339
- return "0.0.0-next-20260705165838";
19366
+ if (isReleaseVersion("0.0.0-next-20260707210730")) {
19367
+ return "0.0.0-next-20260707210730";
19340
19368
  }
19341
19369
  try {
19342
19370
  const root = repoRoot();