@pourkit/cli 0.0.0-next-20260707180736 → 0.0.0-next-20260708233839

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
  }
@@ -11049,6 +11049,7 @@ function persistStartingPrdRunRecord(repoRoot2, prdRef, existingRecord, start, c
11049
11049
  diagnostics: _diagnostics,
11050
11050
  offendingPaths: _offendingPaths,
11051
11051
  prdBranch: _prdBranch,
11052
+ repairGuidance: _repairGuidance,
11052
11053
  start: _start,
11053
11054
  ...cleanRecord
11054
11055
  } = existingRecord.record ?? { prdRef };
@@ -11553,6 +11554,23 @@ var QUEUE_FAILURE_CODES_WITHOUT_SELECTED_ISSUE = /* @__PURE__ */ new Set([
11553
11554
  "prd-branch-mismatch",
11554
11555
  "missing-child-finalization-evidence"
11555
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
+ }
11556
11574
  function canRetryQueueGuidanceWithoutIssue(options) {
11557
11575
  const { guidance, startReceipt } = options;
11558
11576
  if (guidance.blockedGate !== "queue") return false;
@@ -12269,17 +12287,22 @@ async function launchGithubQueueDrain(options, prdRef, startReceipt, targetName,
12269
12287
  const msg = error instanceof Error ? error.message : String(error);
12270
12288
  const diagnostics = [msg];
12271
12289
  const issue = extractIssueFromQueueError(error);
12290
+ const repair = buildQueueIssueRunRepairMetadata(
12291
+ msg,
12292
+ "queue-exception",
12293
+ prdRef
12294
+ );
12272
12295
  const result = buildLaunchBlockedOutcome(
12273
12296
  options.repoRoot,
12274
12297
  prdRef,
12275
12298
  buildPrdRunRepairGuidance({
12276
12299
  blockedGate: "queue",
12277
12300
  blockedStage: "queue-drain",
12278
- failureCode: "queue-exception",
12301
+ failureCode: repair.failureCode,
12279
12302
  humanReadableReason: msg,
12280
- repairability: "automatic-retry-safe",
12281
- nextAction: "rerun-prd-run-launch",
12282
- nextRecommendedCommand: "pourkit prd-run launch",
12303
+ repairability: repair.repairability,
12304
+ nextAction: repair.nextAction,
12305
+ nextRecommendedCommand: repair.nextRecommendedCommand,
12283
12306
  diagnostics,
12284
12307
  issue
12285
12308
  }),
@@ -12481,17 +12504,22 @@ async function launchBeadsQueueDrain(options, prdRef, startReceipt, targetName,
12481
12504
  startReceipt.queueProcessedCount = processedResults.length;
12482
12505
  } catch (error) {
12483
12506
  const msg = error instanceof Error ? error.message : String(error);
12507
+ const repair = buildQueueIssueRunRepairMetadata(
12508
+ msg,
12509
+ "resume-issue-failed",
12510
+ prdRef
12511
+ );
12484
12512
  return buildLaunchBlockedOutcome(
12485
12513
  options.repoRoot,
12486
12514
  prdRef,
12487
12515
  buildPrdRunRepairGuidance({
12488
12516
  blockedGate: "queue",
12489
12517
  blockedStage: "queue-drain",
12490
- failureCode: "resume-issue-failed",
12518
+ failureCode: repair.failureCode,
12491
12519
  humanReadableReason: msg,
12492
- repairability: "automatic-retry-safe",
12493
- nextAction: "rerun-prd-run-launch",
12494
- nextRecommendedCommand: "pourkit prd-run launch",
12520
+ repairability: repair.repairability,
12521
+ nextAction: repair.nextAction,
12522
+ nextRecommendedCommand: repair.nextRecommendedCommand,
12495
12523
  diagnostics: [msg],
12496
12524
  issue: resumeIssue ? {
12497
12525
  number: fetchedIssue.number,
@@ -12603,6 +12631,11 @@ async function launchBeadsQueueDrain(options, prdRef, startReceipt, targetName,
12603
12631
  });
12604
12632
  } catch (error) {
12605
12633
  const msg = error instanceof Error ? error.message : String(error);
12634
+ const repair = buildQueueIssueRunRepairMetadata(
12635
+ msg,
12636
+ "beads-issue-run-failed",
12637
+ prdRef
12638
+ );
12606
12639
  const beadsChildClosed = msg.startsWith(
12607
12640
  "Projection failure after Beads close"
12608
12641
  );
@@ -12612,11 +12645,11 @@ async function launchBeadsQueueDrain(options, prdRef, startReceipt, targetName,
12612
12645
  buildPrdRunRepairGuidance({
12613
12646
  blockedGate: "queue",
12614
12647
  blockedStage: "queue-drain",
12615
- failureCode: "beads-issue-run-failed",
12648
+ failureCode: repair.failureCode,
12616
12649
  humanReadableReason: msg,
12617
- repairability: "automatic-retry-safe",
12618
- nextAction: "rerun-prd-run-launch",
12619
- nextRecommendedCommand: "pourkit prd-run launch",
12650
+ repairability: repair.repairability,
12651
+ nextAction: repair.nextAction,
12652
+ nextRecommendedCommand: repair.nextRecommendedCommand,
12620
12653
  diagnostics: [msg],
12621
12654
  issue: {
12622
12655
  number: contextResult.issue.number,
@@ -13454,6 +13487,8 @@ function buildManagedAgentInstructions(options) {
13454
13487
 
13455
13488
  Use \`fd\` for file discovery, \`rg\` for text search, and direct file reads for focused context.
13456
13489
 
13490
+ Use the \`explore-codebase\` skill when the user asks to explore or map a codebase, including an external package or repository, find feature/module ownership, identify entry points/tests/docs, or produce a Codebase Navigation Atlas.
13491
+
13457
13492
  For multi-step exploration, prefer the dedicated subagents in \`.opencode/agents\`:
13458
13493
 
13459
13494
  - Use \`codebase-locator\` when you need to find relevant files, directories, or entry points.
@@ -13464,7 +13499,7 @@ For multi-step exploration, prefer the dedicated subagents in \`.opencode/agents
13464
13499
 
13465
13500
  Use direct \`fd\`/\`rg\`/reads for focused checks; use subagents when the search would otherwise require several discovery/read steps.
13466
13501
 
13467
- Use \`opensrc path <package-or-repo>\` whenever implementation requires reading external source code, not only package dependencies. If you would otherwise clone a repository to inspect its source, use \`opensrc\` first, then search or read files under the returned source path with \`rg\` and direct file reads.
13502
+ Use the \`explore-codebase\` skill as the main route for broad external-source exploration. Inside that workflow, use \`opensrc path <package-or-repo>\` whenever implementation requires reading external source code, not only package dependencies. For focused external-source checks, use \`opensrc\` directly. If you would otherwise clone a repository to inspect its source, use \`opensrc\` first, then search or read files under the returned source path with \`rg\` and direct file reads.
13468
13503
 
13469
13504
  Follow the project's domain docs and workflow routes documented in the Pourkit managed block below.
13470
13505
 
@@ -19327,11 +19362,11 @@ function createCliProgram(version) {
19327
19362
  return program;
19328
19363
  }
19329
19364
  async function resolveCliVersion() {
19330
- if (isPackageVersion("0.0.0-next-20260707180736")) {
19331
- return "0.0.0-next-20260707180736";
19365
+ if (isPackageVersion("0.0.0-next-20260708233839")) {
19366
+ return "0.0.0-next-20260708233839";
19332
19367
  }
19333
- if (isReleaseVersion("0.0.0-next-20260707180736")) {
19334
- return "0.0.0-next-20260707180736";
19368
+ if (isReleaseVersion("0.0.0-next-20260708233839")) {
19369
+ return "0.0.0-next-20260708233839";
19335
19370
  }
19336
19371
  try {
19337
19372
  const root = repoRoot();