@oss-autopilot/core 3.11.0 → 3.13.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.
@@ -311,6 +311,9 @@ export const commands = [
311
311
  }
312
312
  return runSearch({ maxResults });
313
313
  }, (data) => {
314
+ if (data.hiddenOwnPRCount > 0) {
315
+ console.log(`Hidden: ${data.hiddenOwnPRCount} candidate(s) were issues you already have open PRs for.`);
316
+ }
314
317
  if (data.candidates.length === 0) {
315
318
  if (data.rateLimitWarning) {
316
319
  console.warn(`\n${data.rateLimitWarning}\n`);
@@ -329,6 +332,14 @@ export const commands = [
329
332
  console.log(`[${recommendation.toUpperCase()}] ${issue.repo}#${issue.number}: ${issue.title}`);
330
333
  console.log(` URL: ${issue.url}`);
331
334
  console.log(` Viability: ${viabilityScore}/100`);
335
+ // #1244: say WHY a result surfaced so the user can calibrate
336
+ // trust in the strategy bias — and see the counterweight work.
337
+ if (candidate.boostReasons && candidate.boostReasons.length > 0) {
338
+ console.log(` Why surfaced: ${candidate.boostReasons.join(', ')}`);
339
+ }
340
+ if (candidate.diversitySlot) {
341
+ console.log(' Diversity slot: outside your usual languages/repos');
342
+ }
332
343
  if (reasonsToApprove.length > 0)
333
344
  console.log(` Approve: ${reasonsToApprove.join(', ')}`);
334
345
  if (reasonsToSkip.length > 0)
@@ -451,6 +462,32 @@ export const commands = [
451
462
  }));
452
463
  },
453
464
  },
465
+ // ── Verify Issue ───────────────────────────────────────────────────────
466
+ {
467
+ name: 'verify-issue',
468
+ register(program) {
469
+ program
470
+ .command('verify-issue <issue-url>')
471
+ .description('Deterministically verify issue state and linked-PR claims before vetting (#1353, #1354)')
472
+ .option('--json', 'Output as JSON')
473
+ .action(async (issueUrl, options) => {
474
+ const { VerifyIssueOutputSchema } = await import('./formatters/json.js');
475
+ await executeAction(options, async () => (await import('./commands/verify-issue.js')).runVerifyIssue({ issueUrl }), (data) => {
476
+ console.log(`\n${data.owner}/${data.repo}#${data.number}: ${data.title}`);
477
+ const reasonLabel = data.stateReason ? ` (${data.stateReason})` : '';
478
+ console.log(` State: ${data.state}${reasonLabel}${data.closedAt ? ` — closed ${data.closedAt}` : ''}`);
479
+ console.log(` Verdict: ${data.verdict} — ${data.verdictReason}`);
480
+ if (data.assignees.length > 0)
481
+ console.log(` Assignees: ${data.assignees.join(', ')}`);
482
+ for (const pr of data.linkedPRs) {
483
+ const own = pr.isOwn ? ' (yours)' : '';
484
+ const draft = pr.isDraft ? ' [draft]' : '';
485
+ console.log(` PR #${pr.number} [${pr.state}]${draft} ${pr.linkType} by ${pr.author ?? 'ghost'}${own}: ${pr.url}`);
486
+ }
487
+ }, VerifyIssueOutputSchema);
488
+ });
489
+ },
490
+ },
454
491
  // ── Vet List ──────────────────────────────────────────────────────────
455
492
  {
456
493
  name: 'vet-list',
@@ -580,17 +617,9 @@ export const commands = [
580
617
  prStatus: options.prStatus,
581
618
  listPath: options.listPath,
582
619
  });
583
- // Convert "URL not in list" into a real CLI error so the JSON
584
- // envelope reports `success: false` and the process exits non-zero.
585
- // The pure transform's success-shaped not-found return is fine for
586
- // library consumers, but as a CLI command "I asked you to mark X
587
- // and you couldn't find X" is a failure the caller must see.
588
- // The "already marked done" case stays as a success-shape return
589
- // (it's idempotent — the caller's intent was achieved).
590
- if (!result.marked && result.reason === 'issue URL not found in the list') {
591
- throw new Error(`Issue URL not found in ${result.filePath}: ${result.url}. ` +
592
- `Verify --list-path and the issue URL.`);
593
- }
620
+ // Not-found now throws ValidationError inside the command (#1406),
621
+ // so library and CLI consumers see the same failure — no CLI-layer
622
+ // re-throw needed (mirrors list-move-tier after #1355).
594
623
  return result;
595
624
  }, (data) => {
596
625
  if (data.marked) {