@oss-autopilot/core 3.33.0 → 3.34.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.
Files changed (86) hide show
  1. package/dist/cli-pre-action.js +20 -20
  2. package/dist/cli-registry.js +59 -23
  3. package/dist/cli.bundle.cjs +140 -129
  4. package/dist/commands/check-integration.d.ts +2 -2
  5. package/dist/commands/comments.js +3 -3
  6. package/dist/commands/compliance-score.js +1 -1
  7. package/dist/commands/config.js +1 -1
  8. package/dist/commands/daily-render.js +6 -13
  9. package/dist/commands/daily.d.ts +1 -2
  10. package/dist/commands/daily.js +8 -4
  11. package/dist/commands/dashboard-cache.js +1 -1
  12. package/dist/commands/dashboard-data.js +7 -6
  13. package/dist/commands/dashboard-lifecycle.js +3 -5
  14. package/dist/commands/dashboard-server.js +3 -3
  15. package/dist/commands/detect-formatters.d.ts +1 -1
  16. package/dist/commands/dismiss.js +2 -2
  17. package/dist/commands/doctor.js +3 -3
  18. package/dist/commands/eval.d.ts +11 -0
  19. package/dist/commands/eval.js +11 -0
  20. package/dist/commands/features.js +1 -1
  21. package/dist/commands/guidelines.js +5 -5
  22. package/dist/commands/index.d.ts +1 -0
  23. package/dist/commands/index.js +1 -0
  24. package/dist/commands/init.js +1 -1
  25. package/dist/commands/ledger-backfill.d.ts +40 -0
  26. package/dist/commands/ledger-backfill.js +216 -0
  27. package/dist/commands/local-repos.d.ts +1 -1
  28. package/dist/commands/overnight.js +13 -18
  29. package/dist/commands/parse-list.d.ts +2 -2
  30. package/dist/commands/parse-list.js +7 -7
  31. package/dist/commands/repo-vet.js +3 -3
  32. package/dist/commands/search.js +9 -10
  33. package/dist/commands/setup.js +8 -8
  34. package/dist/commands/startup.js +1 -1
  35. package/dist/commands/status.d.ts +1 -1
  36. package/dist/commands/vet-list.js +17 -7
  37. package/dist/commands/vet.js +5 -3
  38. package/dist/core/__fixtures__/prompt-injection-payloads.js +1 -1
  39. package/dist/core/anti-llm-policy.js +3 -3
  40. package/dist/core/checklist-analysis.d.ts +3 -0
  41. package/dist/core/checklist-analysis.js +67 -16
  42. package/dist/core/ci-analysis.js +1 -1
  43. package/dist/core/close-reason.d.ts +25 -0
  44. package/dist/core/close-reason.js +28 -0
  45. package/dist/core/comment-decision.js +1 -1
  46. package/dist/core/compliance-score.js +2 -2
  47. package/dist/core/daily-logic.d.ts +12 -0
  48. package/dist/core/daily-logic.js +11 -2
  49. package/dist/core/display-utils.js +1 -1
  50. package/dist/core/errors.js +4 -5
  51. package/dist/core/eval-report.d.ts +55 -0
  52. package/dist/core/eval-report.js +211 -0
  53. package/dist/core/follow-up-history.d.ts +1 -2
  54. package/dist/core/follow-up-history.js +1 -1
  55. package/dist/core/github-stats.d.ts +9 -0
  56. package/dist/core/github-stats.js +27 -1
  57. package/dist/core/guidelines-store.js +2 -2
  58. package/dist/core/http-cache.js +1 -2
  59. package/dist/core/index.d.ts +3 -2
  60. package/dist/core/index.js +3 -2
  61. package/dist/core/issue-conversation.js +1 -1
  62. package/dist/core/issue-effort.js +12 -6
  63. package/dist/core/paths.d.ts +7 -0
  64. package/dist/core/paths.js +25 -3
  65. package/dist/core/pick-snapshot.d.ts +23 -0
  66. package/dist/core/pick-snapshot.js +51 -0
  67. package/dist/core/pr-comments-fetcher.js +1 -1
  68. package/dist/core/review-analysis.js +5 -9
  69. package/dist/core/state-persistence.js +1 -1
  70. package/dist/core/state-schema.d.ts +117 -0
  71. package/dist/core/state-schema.js +48 -0
  72. package/dist/core/state.d.ts +22 -1
  73. package/dist/core/state.js +65 -12
  74. package/dist/core/strategy.js +2 -3
  75. package/dist/core/types.d.ts +1 -1
  76. package/dist/core/untrusted-content.js +9 -9
  77. package/dist/core/urls.js +1 -1
  78. package/dist/dashboard/assets/chart-panel-DPKNBUts.js +3 -0
  79. package/dist/dashboard/assets/{confetti.module-BYDB1iN2.js → confetti.module-D2UmBLOm.js} +1 -1
  80. package/dist/dashboard/assets/index-B25bZOYX.js +55 -0
  81. package/dist/dashboard/index.html +1 -1
  82. package/dist/formatters/json.d.ts +10 -2
  83. package/dist/formatters/json.js +2 -2
  84. package/package.json +1 -1
  85. package/dist/dashboard/assets/chart-panel-CmNIsCjO.js +0 -3
  86. package/dist/dashboard/assets/index-CTKGc-Ns.js +0 -55
@@ -30,7 +30,26 @@ export function installPreAction(program, localOnlySet) {
30
30
  }
31
31
  cmd = cmd.parent;
32
32
  }
33
- if (!isLocalOnly) {
33
+ if (isLocalOnly) {
34
+ // #1431: localOnly skips the AUTH GATE, not gist persistence. Mutating
35
+ // localOnly commands (shelve/move/dismiss/override/...) already call
36
+ // maybeCheckpoint, which silently no-ops when the singleton never
37
+ // bootstrapped — so a gist-configured user's CLI mutations were written
38
+ // local-only with no warning and never reached the Gist. Best-effort
39
+ // bootstrap; the warning semantics live (and are unit-tested) in
40
+ // bootstrapGistBestEffort.
41
+ const { bootstrapGistBestEffort } = await import('./core/index.js');
42
+ const localOnlyWarning = await bootstrapGistBestEffort(getGitHubTokenAsync);
43
+ if (localOnlyWarning) {
44
+ console.error(`Warning: ${localOnlyWarning}`);
45
+ // Also thread it into the JSON envelope: shelve/move/dismiss --json
46
+ // consumers (the agent harness) must see the mutation will not sync —
47
+ // stderr alone is invisible to them (#1433).
48
+ const { setEnvelopeGistWarning } = await import('./formatters/json.js');
49
+ setEnvelopeGistWarning(localOnlyWarning);
50
+ }
51
+ }
52
+ else {
34
53
  const token = await getGitHubTokenAsync();
35
54
  if (!token) {
36
55
  // Honor --json at the CLI boundary so machine consumers (plugins, MCP
@@ -72,24 +91,5 @@ export function installPreAction(program, localOnlySet) {
72
91
  setEnvelopeGistWarning(renderGistWarning(status === 'degraded' ? 'init-fallback' : 'state-unreadable'));
73
92
  }
74
93
  }
75
- else {
76
- // #1431: localOnly skips the AUTH GATE, not gist persistence. Mutating
77
- // localOnly commands (shelve/move/dismiss/override/...) already call
78
- // maybeCheckpoint, which silently no-ops when the singleton never
79
- // bootstrapped — so a gist-configured user's CLI mutations were written
80
- // local-only with no warning and never reached the Gist. Best-effort
81
- // bootstrap; the warning semantics live (and are unit-tested) in
82
- // bootstrapGistBestEffort.
83
- const { bootstrapGistBestEffort } = await import('./core/index.js');
84
- const localOnlyWarning = await bootstrapGistBestEffort(getGitHubTokenAsync);
85
- if (localOnlyWarning) {
86
- console.error(`Warning: ${localOnlyWarning}`);
87
- // Also thread it into the JSON envelope: shelve/move/dismiss --json
88
- // consumers (the agent harness) must see the mutation will not sync —
89
- // stderr alone is invisible to them (#1433).
90
- const { setEnvelopeGistWarning } = await import('./formatters/json.js');
91
- setEnvelopeGistWarning(localOnlyWarning);
92
- }
93
- }
94
94
  });
95
95
  }
@@ -54,7 +54,7 @@ export function handleCommandError(err, json) {
54
54
  * interface and its `*.contract.test.ts` golden snapshot is the only
55
55
  * shape gate. Nothing fires at runtime if the producer drifts after
56
56
  * the goldens were last updated.
57
- * Commands: state (show/sync/unlink), vet, vet-list, track, comments,
57
+ * Commands: state (show/sync/unlink), vet, vet-list, ledger-backfill, eval, track, comments,
58
58
  * startup, dismiss, undismiss, stats, and the five
59
59
  * guidelines subcommands (list/view/store/reset/fetch-corpus/mark-extracted).
60
60
  *
@@ -188,7 +188,7 @@ export const commands = [
188
188
  const { runStatus } = await import('./commands/status.js');
189
189
  return runStatus({ offline: options.offline });
190
190
  }, (data) => {
191
- console.log('\n\ud83d\udcca OSS Status\n');
191
+ console.log('\n\u{1F4CA} OSS Status\n');
192
192
  console.log(`Merged PRs: ${data.stats.mergedPRs}`);
193
193
  console.log(`Closed PRs: ${data.stats.closedPRs}`);
194
194
  console.log(`Merge Rate: ${data.stats.mergeRate}`);
@@ -556,10 +556,10 @@ export const commands = [
556
556
  console.log('');
557
557
  for (const result of data.results) {
558
558
  const status = result.listStatus === 'still_available'
559
- ? '\u2705'
559
+ ? '\u{2705}'
560
560
  : result.listStatus === 'error'
561
- ? '\u274c'
562
- : '\u26a0\ufe0f';
561
+ ? '\u{274C}'
562
+ : '\u{26A0}\u{FE0F}';
563
563
  const annotation = result.listStatus === 'has_stalled_pr'
564
564
  ? ' (stalled PR, revive opportunity)'
565
565
  : result.listStatus === 'at_risk'
@@ -578,6 +578,43 @@ export const commands = [
578
578
  }));
579
579
  },
580
580
  },
581
+ // ── Ledger Backfill ────────────────────────────────────────────────────
582
+ {
583
+ name: 'ledger-backfill',
584
+ register(program) {
585
+ program
586
+ .command('ledger-backfill')
587
+ .description('Fill missing outcome-ledger fields: opened date, closing issue, close reason, list vet score (#1824)')
588
+ .option('--path <file>', 'Path to issue list file (auto-detected if not specified)')
589
+ .option('--json', 'Output as JSON')
590
+ .action((options) => executeAction(options, async () => {
591
+ const { runLedgerBackfill } = await import('./commands/ledger-backfill.js');
592
+ return runLedgerBackfill({ issueListPath: options.path });
593
+ }, (data) => {
594
+ console.log(`\nQueried ${data.queried} ledger PRs (${data.unresolved} unresolved).`);
595
+ const f = data.filled;
596
+ console.log(` Filled: openedAt ${f.openedAt}, issueUrl ${f.issueUrl}, closeReason ${f.closeReason}, pick ${f.pick}`);
597
+ console.log(` List files scanned: ${data.listFiles.length}`);
598
+ if (data.gistSyncWarning)
599
+ console.log(` Warning: ${data.gistSyncWarning}`);
600
+ }));
601
+ },
602
+ },
603
+ // ── Eval ───────────────────────────────────────────────────────────────
604
+ {
605
+ name: 'eval',
606
+ localOnly: true,
607
+ register(program) {
608
+ program
609
+ .command('eval')
610
+ .description('Calibration and outcome report from the outcome ledger (#1825)')
611
+ .option('--json', 'Output as JSON')
612
+ .action((options) => executeAction(options, async () => {
613
+ const { runEval } = await import('./commands/eval.js');
614
+ return runEval();
615
+ }, (data) => console.log(data.markdown)));
616
+ },
617
+ },
581
618
  // ── Skip Add ───────────────────────────────────────────────────────────
582
619
  {
583
620
  name: 'skip-add',
@@ -656,16 +693,15 @@ export const commands = [
656
693
  .action(async (issueUrl, options) => {
657
694
  const { ListMarkDoneOutputSchema } = await import('./formatters/json.js');
658
695
  await executeAction(options, async () => {
659
- const result = await (await import('./commands/list-mark-done.js')).runMarkIssueListItemDone({
696
+ // Not-found now throws ValidationError inside the command (#1406),
697
+ // so library and CLI consumers see the same failure — no CLI-layer
698
+ // re-throw needed (mirrors list-move-tier after #1355).
699
+ return await (await import('./commands/list-mark-done.js')).runMarkIssueListItemDone({
660
700
  issueUrl,
661
701
  prUrl: options.prUrl,
662
702
  prStatus: options.prStatus,
663
703
  listPath: options.listPath,
664
704
  });
665
- // Not-found now throws ValidationError inside the command (#1406),
666
- // so library and CLI consumers see the same failure — no CLI-layer
667
- // re-throw needed (mirrors list-move-tier after #1355).
668
- return result;
669
705
  }, (data) => {
670
706
  if (data.marked) {
671
707
  const headingNote = data.repoHeadingStruck ? ' (repo heading also struck)' : '';
@@ -713,7 +749,7 @@ export const commands = [
713
749
  const { ComplianceScoreOutputSchema } = await import('./formatters/json.js');
714
750
  await executeAction(options, async () => (await import('./commands/compliance-score.js')).runComplianceScore({ prUrl }), (data) => {
715
751
  console.log(`\n${data.emoji} PR ${data.pr.repo}#${data.pr.number}: ${data.pr.title}`);
716
- console.log(`Score: ${data.score}/100 — ${data.rating.replace(/_/g, ' ')}\n`);
752
+ console.log(`Score: ${data.score}/100 — ${data.rating.replaceAll('_', ' ')}\n`);
717
753
  console.log('Checks:');
718
754
  for (const [name, check] of Object.entries(data.checks)) {
719
755
  const icon = check.status === 'pass' ? 'OK ' : check.status === 'warn' ? 'WARN' : 'FAIL';
@@ -753,7 +789,7 @@ export const commands = [
753
789
  const time = review.submittedAt ? formatRelativeTime(review.submittedAt) : '';
754
790
  console.log(`${state} **@${review.user}** (${review.state}) - ${time}`);
755
791
  if (review.body) {
756
- console.log(`> ${safeExtractFromFence(review.body).split('\n').join('\n> ')}\n`);
792
+ console.log(`> ${safeExtractFromFence(review.body).replaceAll('\n', '\n> ')}\n`);
757
793
  }
758
794
  }
759
795
  }
@@ -762,7 +798,7 @@ export const commands = [
762
798
  for (const comment of data.reviewComments) {
763
799
  const time = formatRelativeTime(comment.createdAt);
764
800
  console.log(`**@${comment.user}** on \`${comment.path}\` - ${time}`);
765
- console.log(`> ${safeExtractFromFence(comment.body).split('\n').join('\n> ')}`);
801
+ console.log(`> ${safeExtractFromFence(comment.body).replaceAll('\n', '\n> ')}`);
766
802
  console.log('');
767
803
  }
768
804
  }
@@ -771,7 +807,7 @@ export const commands = [
771
807
  for (const comment of data.issueComments) {
772
808
  const time = formatRelativeTime(comment.createdAt);
773
809
  console.log(`**@${comment.user}** - ${time}`);
774
- console.log(`> ${comment.body == null ? '' : safeExtractFromFence(comment.body).split('\n').join('\n> ')}\n`);
810
+ console.log(`> ${comment.body == null ? '' : safeExtractFromFence(comment.body).replaceAll('\n', '\n> ')}\n`);
775
811
  }
776
812
  }
777
813
  if (data.reviewComments.length === 0 && data.issueComments.length === 0 && data.reviews.length === 0) {
@@ -860,7 +896,7 @@ export const commands = [
860
896
  console.log('');
861
897
  }
862
898
  else if ('config' in data) {
863
- console.log('\n\u2699\ufe0f Current Configuration:\n');
899
+ console.log('\n\u{2699}\u{FE0F} Current Configuration:\n');
864
900
  console.log(JSON.stringify(data.config, null, 2));
865
901
  }
866
902
  else {
@@ -904,7 +940,7 @@ export const commands = [
904
940
  if ('success' in data) {
905
941
  // --set mode
906
942
  for (const [key, value] of Object.entries(data.settings)) {
907
- console.log(`\u2713 ${key}: ${value}`);
943
+ console.log(`\u{2713} ${key}: ${value}`);
908
944
  }
909
945
  if (data.warnings) {
910
946
  for (const w of data.warnings) {
@@ -914,8 +950,8 @@ export const commands = [
914
950
  }
915
951
  else if ('setupComplete' in data && data.setupComplete) {
916
952
  // Already complete
917
- console.log('\n\u2699\ufe0f OSS Autopilot Setup\n');
918
- console.log('\u2713 Setup already complete!\n');
953
+ console.log('\n\u{2699}\u{FE0F} OSS Autopilot Setup\n');
954
+ console.log('\u{2713} Setup already complete!\n');
919
955
  console.log('Current settings:');
920
956
  console.log(` GitHub username: ${data.config.githubUsername || '(not set)'}`);
921
957
  console.log(` Max active PRs: ${data.config.maxActivePRs}`);
@@ -927,7 +963,7 @@ export const commands = [
927
963
  }
928
964
  else if ('setupRequired' in data) {
929
965
  // Needs setup
930
- console.log('\n\u2699\ufe0f OSS Autopilot Setup\n');
966
+ console.log('\n\u{2699}\u{FE0F} OSS Autopilot Setup\n');
931
967
  console.log('SETUP_REQUIRED');
932
968
  console.log('---');
933
969
  console.log('Please configure the following settings:\n');
@@ -1017,7 +1053,7 @@ export const commands = [
1017
1053
  await executeAction(options, async () => (await import('./commands/parse-list.js')).runParseList({ filePath }), async (data) => {
1018
1054
  const path = await import('node:path');
1019
1055
  const resolvedPath = path.resolve(filePath);
1020
- console.log(`\n\ud83d\udccb Issue List: ${resolvedPath}\n`);
1056
+ console.log(`\n\u{1F4CB} Issue List: ${resolvedPath}\n`);
1021
1057
  console.log(`Available: ${data.availableCount} | Completed: ${data.completedCount} | Blocked: ${data.blockedCount}\n`);
1022
1058
  if (data.available.length > 0) {
1023
1059
  console.log('--- Available ---');
@@ -1059,10 +1095,10 @@ export const commands = [
1059
1095
  console.log('\nNo new code files to check.');
1060
1096
  return;
1061
1097
  }
1062
- console.log(`\n\ud83d\udd0d Integration Check (base: ${options.base})\n`);
1098
+ console.log(`\n\u{1F50D} Integration Check (base: ${options.base})\n`);
1063
1099
  console.log(`New files: ${data.newFiles.length} | Unreferenced: ${data.unreferencedCount}\n`);
1064
1100
  for (const file of data.newFiles) {
1065
- const status = file.isIntegrated ? '\u2705' : '\u26a0\ufe0f';
1101
+ const status = file.isIntegrated ? '\u{2705}' : '\u{26A0}\u{FE0F}';
1066
1102
  console.log(`${status} ${file.path}`);
1067
1103
  if (file.isIntegrated) {
1068
1104
  console.log(` Referenced by: ${file.referencedBy.join(', ')}`);
@@ -1121,7 +1157,7 @@ export const commands = [
1121
1157
  paths: options.paths,
1122
1158
  }), (data) => {
1123
1159
  if (data.fromCache) {
1124
- console.log(`\n\ud83d\udcc1 Local Repos (cached ${data.cachedAt})\n`);
1160
+ console.log(`\n\u{1F4C1} Local Repos (cached ${data.cachedAt})\n`);
1125
1161
  printRepos(data.repos);
1126
1162
  }
1127
1163
  else {