@oss-autopilot/core 3.42.4 → 3.43.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 (172) hide show
  1. package/dist/cli-pre-action.js +8 -3
  2. package/dist/cli-registry.js +272 -25
  3. package/dist/cli.bundle.cjs +183 -154
  4. package/dist/commands/check-integration.js +1 -0
  5. package/dist/commands/cleanup.d.ts +76 -0
  6. package/dist/commands/cleanup.js +269 -0
  7. package/dist/commands/comments.d.ts +6 -0
  8. package/dist/commands/comments.js +6 -2
  9. package/dist/commands/config.js +37 -5
  10. package/dist/commands/daily-dismiss-filter.d.ts +7 -0
  11. package/dist/commands/daily-dismiss-filter.js +17 -1
  12. package/dist/commands/daily-ledger.d.ts +122 -0
  13. package/dist/commands/daily-ledger.js +225 -0
  14. package/dist/commands/daily-recent-prs.d.ts +26 -0
  15. package/dist/commands/daily-recent-prs.js +55 -0
  16. package/dist/commands/daily.d.ts +2 -1
  17. package/dist/commands/daily.js +59 -89
  18. package/dist/commands/dashboard-cache.d.ts +2 -0
  19. package/dist/commands/dashboard-cache.js +33 -8
  20. package/dist/commands/dashboard-data.js +71 -36
  21. package/dist/commands/dashboard-gist-sync.js +3 -1
  22. package/dist/commands/dashboard-lifecycle.js +1 -1
  23. package/dist/commands/dashboard-process.d.ts +14 -1
  24. package/dist/commands/dashboard-process.js +46 -7
  25. package/dist/commands/dashboard-server.js +89 -23
  26. package/dist/commands/detect-formatters.js +1 -0
  27. package/dist/commands/dismiss.js +5 -2
  28. package/dist/commands/doctor.d.ts +15 -1
  29. package/dist/commands/doctor.js +73 -5
  30. package/dist/commands/draft.d.ts +77 -0
  31. package/dist/commands/draft.js +218 -0
  32. package/dist/commands/eval.js +1 -0
  33. package/dist/commands/guidelines.d.ts +23 -1
  34. package/dist/commands/guidelines.js +49 -4
  35. package/dist/commands/index.d.ts +24 -4
  36. package/dist/commands/index.js +15 -3
  37. package/dist/commands/issue-thread.d.ts +46 -0
  38. package/dist/commands/issue-thread.js +123 -0
  39. package/dist/commands/ledger-backfill.d.ts +9 -0
  40. package/dist/commands/ledger-backfill.js +44 -1
  41. package/dist/commands/list-mark-done.d.ts +2 -1
  42. package/dist/commands/list-mark-done.js +3 -1
  43. package/dist/commands/list-move-tier.d.ts +2 -1
  44. package/dist/commands/list-move-tier.js +3 -1
  45. package/dist/commands/local-repos.js +10 -5
  46. package/dist/commands/locate-issue-list.d.ts +40 -17
  47. package/dist/commands/locate-issue-list.js +148 -88
  48. package/dist/commands/move.js +7 -1
  49. package/dist/commands/overnight-handoff.d.ts +17 -7
  50. package/dist/commands/overnight-handoff.js +36 -14
  51. package/dist/commands/overnight-push-prep.d.ts +13 -8
  52. package/dist/commands/overnight-push-prep.js +106 -34
  53. package/dist/commands/overnight-tool-rules.d.ts +54 -0
  54. package/dist/commands/overnight-tool-rules.js +217 -0
  55. package/dist/commands/overnight.d.ts +5 -6
  56. package/dist/commands/overnight.js +61 -140
  57. package/dist/commands/parse-list.js +7 -1
  58. package/dist/commands/policy.d.ts +86 -0
  59. package/dist/commands/policy.js +263 -0
  60. package/dist/commands/pr-preflight.d.ts +43 -0
  61. package/dist/commands/pr-preflight.js +294 -0
  62. package/dist/commands/repo-vet.d.ts +9 -0
  63. package/dist/commands/repo-vet.js +36 -11
  64. package/dist/commands/scout-bridge.js +18 -8
  65. package/dist/commands/search.js +7 -0
  66. package/dist/commands/setup.d.ts +3 -3
  67. package/dist/commands/setup.js +46 -18
  68. package/dist/commands/skip-add.js +10 -1
  69. package/dist/commands/startup.d.ts +5 -3
  70. package/dist/commands/startup.js +65 -49
  71. package/dist/commands/state-cmd.d.ts +2 -0
  72. package/dist/commands/state-cmd.js +5 -1
  73. package/dist/commands/stats.js +1 -0
  74. package/dist/commands/status.js +1 -0
  75. package/dist/commands/strategy.js +1 -0
  76. package/dist/commands/vet-list.d.ts +6 -0
  77. package/dist/commands/vet-list.js +25 -0
  78. package/dist/commands/vet.d.ts +12 -0
  79. package/dist/commands/vet.js +118 -1
  80. package/dist/core/__fixtures__/prompt-injection-payloads.js +31 -0
  81. package/dist/core/anti-llm-policy.d.ts +3 -0
  82. package/dist/core/anti-llm-policy.js +3 -0
  83. package/dist/core/auth.js +2 -0
  84. package/dist/core/checklist-analysis.js +50 -12
  85. package/dist/core/ci-analysis.d.ts +7 -2
  86. package/dist/core/ci-analysis.js +76 -21
  87. package/dist/core/comment-utils.d.ts +1 -1
  88. package/dist/core/comment-utils.js +7 -1
  89. package/dist/core/commit-date.d.ts +19 -0
  90. package/dist/core/commit-date.js +17 -0
  91. package/dist/core/compliance-score.js +11 -7
  92. package/dist/core/config-registry.js +11 -5
  93. package/dist/core/contributing.d.ts +2 -3
  94. package/dist/core/contributing.js +2 -3
  95. package/dist/core/daily-logic.d.ts +27 -5
  96. package/dist/core/daily-logic.js +57 -19
  97. package/dist/core/errors.d.ts +37 -3
  98. package/dist/core/errors.js +54 -5
  99. package/dist/core/gist-health.d.ts +15 -3
  100. package/dist/core/gist-health.js +8 -0
  101. package/dist/core/gist-state-store.d.ts +24 -4
  102. package/dist/core/gist-state-store.js +97 -46
  103. package/dist/core/github-stats.d.ts +104 -16
  104. package/dist/core/github-stats.js +282 -97
  105. package/dist/core/http-cache.d.ts +0 -10
  106. package/dist/core/http-cache.js +0 -19
  107. package/dist/core/index.d.ts +12 -5
  108. package/dist/core/index.js +15 -5
  109. package/dist/core/issue-conversation.d.ts +8 -2
  110. package/dist/core/issue-conversation.js +31 -12
  111. package/dist/core/local-config.d.ts +95 -0
  112. package/dist/core/local-config.js +271 -0
  113. package/dist/core/merged-pr-notes.d.ts +2 -2
  114. package/dist/core/pagination.d.ts +55 -0
  115. package/dist/core/pagination.js +59 -0
  116. package/dist/core/paths.d.ts +7 -0
  117. package/dist/core/paths.js +9 -0
  118. package/dist/core/pr-assembly.js +6 -2
  119. package/dist/core/pr-graphql.d.ts +37 -3
  120. package/dist/core/pr-graphql.js +73 -12
  121. package/dist/core/pr-monitor.d.ts +29 -12
  122. package/dist/core/pr-monitor.js +71 -23
  123. package/dist/core/pr-preflight.d.ts +113 -0
  124. package/dist/core/pr-preflight.js +364 -0
  125. package/dist/core/pr-quality-rubric.d.ts +0 -6
  126. package/dist/core/pr-quality-rubric.js +0 -8
  127. package/dist/core/pr-template.d.ts +2 -0
  128. package/dist/core/pr-template.js +5 -1
  129. package/dist/core/repo-policy.d.ts +105 -0
  130. package/dist/core/repo-policy.js +400 -0
  131. package/dist/core/repo-score-manager.d.ts +48 -0
  132. package/dist/core/repo-score-manager.js +111 -1
  133. package/dist/core/review-analysis.d.ts +34 -19
  134. package/dist/core/review-analysis.js +74 -19
  135. package/dist/core/reviewed-prs-fetch.js +11 -29
  136. package/dist/core/reviewed-prs.js +8 -15
  137. package/dist/core/stale-data.d.ts +41 -0
  138. package/dist/core/stale-data.js +115 -0
  139. package/dist/core/state-persistence.d.ts +62 -27
  140. package/dist/core/state-persistence.js +338 -117
  141. package/dist/core/state-schema.d.ts +113 -210
  142. package/dist/core/state-schema.js +165 -80
  143. package/dist/core/state.d.ts +60 -8
  144. package/dist/core/state.js +192 -46
  145. package/dist/core/status-determination.js +26 -8
  146. package/dist/core/strategy.js +3 -1
  147. package/dist/core/types.d.ts +22 -1
  148. package/dist/core/types.js +1 -0
  149. package/dist/core/untrusted-content.d.ts +30 -11
  150. package/dist/core/untrusted-content.js +77 -42
  151. package/dist/core/urls.d.ts +9 -0
  152. package/dist/core/urls.js +18 -0
  153. package/dist/dashboard/assets/{chart-panel-DPKNBUts.js → chart-panel-C_C1lFTI.js} +1 -1
  154. package/dist/dashboard/assets/{index-B25bZOYX.js → index-B--H66Jk.js} +1 -1
  155. package/dist/dashboard/index.html +1 -1
  156. package/dist/formatters/json.d.ts +262 -6
  157. package/dist/formatters/json.js +77 -1
  158. package/package.json +1 -1
  159. package/dist/core/ci-enforced-tools.d.ts +0 -35
  160. package/dist/core/ci-enforced-tools.js +0 -109
  161. package/dist/core/comment-decision.d.ts +0 -79
  162. package/dist/core/comment-decision.js +0 -82
  163. package/dist/core/extraction-categories.d.ts +0 -55
  164. package/dist/core/extraction-categories.js +0 -108
  165. package/dist/core/follow-up-history.d.ts +0 -40
  166. package/dist/core/follow-up-history.js +0 -71
  167. package/dist/core/issue-effort.d.ts +0 -29
  168. package/dist/core/issue-effort.js +0 -47
  169. package/dist/core/maintainer-hints.d.ts +0 -23
  170. package/dist/core/maintainer-hints.js +0 -36
  171. package/dist/core/workflow-state.d.ts +0 -56
  172. package/dist/core/workflow-state.js +0 -101
@@ -5,6 +5,7 @@
5
5
  import { z, type ZodType } from 'zod';
6
6
  import type { AttentionSummary } from '../core/pr-attention.js';
7
7
  import type { FetchedPR, DailyDigest, AgentState, RepoGroup, CommentedIssue, ShelvedPRRef, SearchPriority, CapacityAssessment, ActionableIssue, CompactActionableIssue, ActionMenu, WorkClaim } from '../core/types.js';
8
+ import type { RepoPolicySummary } from '../core/repo-policy.js';
8
9
  import type { ContributionStats } from '../core/stats.js';
9
10
  import type { RepoCapStatus } from '../core/repo-cap.js';
10
11
  import type { PRCheckFailure } from '../core/pr-monitor.js';
@@ -70,7 +71,7 @@ export interface CompactRepoGroup {
70
71
  * See `DailyWarning` and issue #1042 for the rationale — keeping this a
71
72
  * fixed union so downstream consumers can switch on it without drift.
72
73
  */
73
- export type DailyWarningPhase = 'fetch' | 'repo-scores' | 'analytics' | 'merge-loop' | 'partition' | 'dismiss-filter' | 'gist-init' | 'gist-checkpoint' | 'gist-staleness' | 'state-load' | 'closed-pr-status' | 'merged-pr-notes' | 'reviewed-prs';
74
+ export type DailyWarningPhase = 'fetch' | 'repo-scores' | 'analytics' | 'merge-loop' | 'partition' | 'dismiss-filter' | 'gist-init' | 'gist-checkpoint' | 'gist-staleness' | 'state-load' | 'closed-pr-status' | 'merged-pr-notes' | 'reviewed-prs' | 'issue-list';
74
75
  /**
75
76
  * A single non-fatal failure surfaced from the `daily` pipeline. Unlike
76
77
  * `PRCheckFailure` (which is scoped to per-PR fetch errors), this covers
@@ -159,7 +160,7 @@ export interface DailyOutput {
159
160
  /**
160
161
  * Closed-unmerged PRs whose linked issue has not heard from the user since
161
162
  * the close (#1863). Drives the `closed_pr_status` action-menu item; the
162
- * workflow drafts a status comment per entry through draft-review-post.
163
+ * workflow drafts a status comment per entry as a draft file.
163
164
  * Present only when at least one entry exists, so merge-free runs and
164
165
  * goldens are unchanged. See {@link ClosedPRStatusUpdate}.
165
166
  */
@@ -168,7 +169,7 @@ export interface DailyOutput {
168
169
  * Recently merged PRs carrying maintainer notes (thanks, a follow-up, a
169
170
  * commit pushed on top) the user has not answered (#1861). Drives the
170
171
  * `merged_pr_notes` action-menu item; the workflow classifies each note
171
- * and drafts a reply through draft-review-post. Note excerpts are fenced
172
+ * and drafts a reply as a draft file. Note excerpts are fenced
172
173
  * as untrusted GitHub content. Present only when at least one entry
173
174
  * exists, so merge-free runs and goldens are unchanged. See
174
175
  * {@link MergedPRNotes}.
@@ -179,7 +180,7 @@ export interface DailyOutput {
179
180
  * replied since the user's last review or comment (#1857). Drives the
180
181
  * `review_follow_ups` action-menu item; the workflow re-reviews the range
181
182
  * (or the commit list when `rebased`) through review-panel and answers the
182
- * questions through draft-review-post. Excerpts and commit subjects are
183
+ * questions in draft files. Excerpts and commit subjects are
183
184
  * fenced as untrusted GitHub content. Never counted in capacity or
184
185
  * `needsAddressingPRs`. Present only when at least one entry exists, so
185
186
  * goldens are unchanged. See {@link ReviewedPRFollowUp}.
@@ -292,6 +293,7 @@ export declare const StatusOutputSchema: z.ZodObject<{
292
293
  "gist-checkpoint": "gist-checkpoint";
293
294
  "gist-staleness": "gist-staleness";
294
295
  "state-load": "state-load";
296
+ "issue-list": "issue-list";
295
297
  }>;
296
298
  operation: z.ZodString;
297
299
  message: z.ZodString;
@@ -512,6 +514,7 @@ export declare const DailyOutputSchema: z.ZodObject<{
512
514
  "gist-checkpoint": "gist-checkpoint";
513
515
  "gist-staleness": "gist-staleness";
514
516
  "state-load": "state-load";
517
+ "issue-list": "issue-list";
515
518
  }>;
516
519
  operation: z.ZodString;
517
520
  message: z.ZodString;
@@ -756,6 +759,7 @@ export declare const CompactDailyOutputSchema: z.ZodObject<{
756
759
  "gist-checkpoint": "gist-checkpoint";
757
760
  "gist-staleness": "gist-staleness";
758
761
  "state-load": "state-load";
762
+ "issue-list": "issue-list";
759
763
  }>;
760
764
  operation: z.ZodString;
761
765
  message: z.ZodString;
@@ -899,13 +903,73 @@ export declare const CompactDailyOutputSchema: z.ZodObject<{
899
903
  finishedAt: z.ZodOptional<z.ZodString>;
900
904
  }, z.core.$loose>>>;
901
905
  }, z.core.$strip>;
906
+ /** Enumerated fields of a repo's contribution policy (#1953); no quoted text, so no fence. */
907
+ export declare const RepoPolicySummarySchema: z.ZodObject<{
908
+ aiPolicy: z.ZodEnum<{
909
+ unknown: "unknown";
910
+ allowed: "allowed";
911
+ "disclosure-required": "disclosure-required";
912
+ banned: "banned";
913
+ }>;
914
+ cla: z.ZodEnum<{
915
+ required: "required";
916
+ none: "none";
917
+ unknown: "unknown";
918
+ }>;
919
+ commitRules: z.ZodArray<z.ZodString>;
920
+ prGate: z.ZodEnum<{
921
+ none: "none";
922
+ unknown: "unknown";
923
+ "claim-first": "claim-first";
924
+ "maintainer-label": "maintainer-label";
925
+ "collaborators-only": "collaborators-only";
926
+ }>;
927
+ maxOpenAiPRs: z.ZodOptional<z.ZodNumber>;
928
+ reviewedByUser: z.ZodBoolean;
929
+ }, z.core.$strip>;
930
+ /** `policy get` / `policy set` (#1953). Quoted repo text arrives in `<github-content>` fences. */
931
+ export declare const PolicyGetOutputSchema: z.ZodObject<{
932
+ repo: z.ZodString;
933
+ policy: z.ZodNullable<z.ZodObject<{
934
+ aiPolicy: z.ZodEnum<{
935
+ unknown: "unknown";
936
+ allowed: "allowed";
937
+ "disclosure-required": "disclosure-required";
938
+ banned: "banned";
939
+ }>;
940
+ cla: z.ZodEnum<{
941
+ required: "required";
942
+ none: "none";
943
+ unknown: "unknown";
944
+ }>;
945
+ commitRules: z.ZodArray<z.ZodString>;
946
+ prGate: z.ZodEnum<{
947
+ none: "none";
948
+ unknown: "unknown";
949
+ "claim-first": "claim-first";
950
+ "maintainer-label": "maintainer-label";
951
+ "collaborators-only": "collaborators-only";
952
+ }>;
953
+ maxOpenAiPRs: z.ZodOptional<z.ZodNumber>;
954
+ reviewedByUser: z.ZodBoolean;
955
+ updatedAt: z.ZodString;
956
+ blocklisted: z.ZodBoolean;
957
+ disclosureText: z.ZodOptional<z.ZodString>;
958
+ sources: z.ZodOptional<z.ZodString>;
959
+ }, z.core.$strip>>;
960
+ blocklistChange: z.ZodOptional<z.ZodEnum<{
961
+ removed: "removed";
962
+ added: "added";
963
+ }>>;
964
+ gistSyncWarning: z.ZodOptional<z.ZodString>;
965
+ }, z.core.$strip>;
902
966
  /** Per-repo open-PR cap status (core/repo-cap.ts). */
903
967
  export declare const RepoCapStatusSchema: z.ZodObject<{
904
968
  repo: z.ZodString;
905
969
  openPRCount: z.ZodNumber;
906
970
  countSource: z.ZodEnum<{
907
- digest: "digest";
908
971
  github: "github";
972
+ digest: "digest";
909
973
  }>;
910
974
  mergedPRCount: z.ZodNumber;
911
975
  cold: z.ZodBoolean;
@@ -914,6 +978,34 @@ export declare const RepoCapStatusSchema: z.ZodObject<{
914
978
  excluded: z.ZodBoolean;
915
979
  reason: z.ZodOptional<z.ZodString>;
916
980
  }, z.core.$strip>;
981
+ /** `pr-preflight` (#1952). A later check is one more `checks` entry, so the shape does not change. */
982
+ export declare const PrPreflightOutputSchema: z.ZodObject<{
983
+ verdict: z.ZodEnum<{
984
+ fail: "fail";
985
+ pass: "pass";
986
+ warn: "warn";
987
+ }>;
988
+ dir: z.ZodString;
989
+ repo: z.ZodNullable<z.ZodString>;
990
+ issueUrl: z.ZodNullable<z.ZodString>;
991
+ branch: z.ZodNullable<z.ZodString>;
992
+ remote: z.ZodNullable<z.ZodString>;
993
+ base: z.ZodNullable<z.ZodString>;
994
+ mergeBase: z.ZodNullable<z.ZodString>;
995
+ ahead: z.ZodNullable<z.ZodNumber>;
996
+ behind: z.ZodNullable<z.ZodNumber>;
997
+ checks: z.ZodArray<z.ZodObject<{
998
+ id: z.ZodString;
999
+ status: z.ZodEnum<{
1000
+ skipped: "skipped";
1001
+ fail: "fail";
1002
+ pass: "pass";
1003
+ warn: "warn";
1004
+ }>;
1005
+ summary: z.ZodString;
1006
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1007
+ }, z.core.$strip>>;
1008
+ }, z.core.$strip>;
917
1009
  export declare const SearchOutputSchema: z.ZodObject<{
918
1010
  candidates: z.ZodArray<z.ZodObject<{
919
1011
  issue: z.ZodObject<{
@@ -964,11 +1056,38 @@ export declare const SearchOutputSchema: z.ZodObject<{
964
1056
  boostScore: z.ZodOptional<z.ZodNumber>;
965
1057
  boostReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
966
1058
  diversitySlot: z.ZodOptional<z.ZodBoolean>;
1059
+ policy: z.ZodOptional<z.ZodObject<{
1060
+ aiPolicy: z.ZodEnum<{
1061
+ unknown: "unknown";
1062
+ allowed: "allowed";
1063
+ "disclosure-required": "disclosure-required";
1064
+ banned: "banned";
1065
+ }>;
1066
+ cla: z.ZodEnum<{
1067
+ required: "required";
1068
+ none: "none";
1069
+ unknown: "unknown";
1070
+ }>;
1071
+ commitRules: z.ZodArray<z.ZodString>;
1072
+ prGate: z.ZodEnum<{
1073
+ none: "none";
1074
+ unknown: "unknown";
1075
+ "claim-first": "claim-first";
1076
+ "maintainer-label": "maintainer-label";
1077
+ "collaborators-only": "collaborators-only";
1078
+ }>;
1079
+ maxOpenAiPRs: z.ZodOptional<z.ZodNumber>;
1080
+ reviewedByUser: z.ZodBoolean;
1081
+ }, z.core.$strip>>;
967
1082
  }, z.core.$strip>>;
968
1083
  excludedRepos: z.ZodArray<z.ZodString>;
969
1084
  aiPolicyBlocklist: z.ZodArray<z.ZodString>;
970
1085
  hiddenOwnPRCount: z.ZodNumber;
971
1086
  reposAtCap: z.ZodArray<z.ZodString>;
1087
+ policyBannedRepos: z.ZodOptional<z.ZodArray<z.ZodObject<{
1088
+ repo: z.ZodString;
1089
+ reviewedByUser: z.ZodBoolean;
1090
+ }, z.core.$strip>>>;
972
1091
  rateLimitWarning: z.ZodOptional<z.ZodString>;
973
1092
  skipListUnavailable: z.ZodOptional<z.ZodBoolean>;
974
1093
  }, z.core.$strip>;
@@ -1022,6 +1141,29 @@ export declare const FeaturesOutputSchema: z.ZodObject<{
1022
1141
  boostScore: z.ZodOptional<z.ZodNumber>;
1023
1142
  boostReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
1024
1143
  diversitySlot: z.ZodOptional<z.ZodBoolean>;
1144
+ policy: z.ZodOptional<z.ZodObject<{
1145
+ aiPolicy: z.ZodEnum<{
1146
+ unknown: "unknown";
1147
+ allowed: "allowed";
1148
+ "disclosure-required": "disclosure-required";
1149
+ banned: "banned";
1150
+ }>;
1151
+ cla: z.ZodEnum<{
1152
+ required: "required";
1153
+ none: "none";
1154
+ unknown: "unknown";
1155
+ }>;
1156
+ commitRules: z.ZodArray<z.ZodString>;
1157
+ prGate: z.ZodEnum<{
1158
+ none: "none";
1159
+ unknown: "unknown";
1160
+ "claim-first": "claim-first";
1161
+ "maintainer-label": "maintainer-label";
1162
+ "collaborators-only": "collaborators-only";
1163
+ }>;
1164
+ maxOpenAiPRs: z.ZodOptional<z.ZodNumber>;
1165
+ reviewedByUser: z.ZodBoolean;
1166
+ }, z.core.$strip>>;
1025
1167
  horizon: z.ZodEnum<{
1026
1168
  "quick-win": "quick-win";
1027
1169
  "bigger-bet": "bigger-bet";
@@ -1076,6 +1218,29 @@ export declare const FeaturesOutputSchema: z.ZodObject<{
1076
1218
  boostScore: z.ZodOptional<z.ZodNumber>;
1077
1219
  boostReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
1078
1220
  diversitySlot: z.ZodOptional<z.ZodBoolean>;
1221
+ policy: z.ZodOptional<z.ZodObject<{
1222
+ aiPolicy: z.ZodEnum<{
1223
+ unknown: "unknown";
1224
+ allowed: "allowed";
1225
+ "disclosure-required": "disclosure-required";
1226
+ banned: "banned";
1227
+ }>;
1228
+ cla: z.ZodEnum<{
1229
+ required: "required";
1230
+ none: "none";
1231
+ unknown: "unknown";
1232
+ }>;
1233
+ commitRules: z.ZodArray<z.ZodString>;
1234
+ prGate: z.ZodEnum<{
1235
+ none: "none";
1236
+ unknown: "unknown";
1237
+ "claim-first": "claim-first";
1238
+ "maintainer-label": "maintainer-label";
1239
+ "collaborators-only": "collaborators-only";
1240
+ }>;
1241
+ maxOpenAiPRs: z.ZodOptional<z.ZodNumber>;
1242
+ reviewedByUser: z.ZodBoolean;
1243
+ }, z.core.$strip>>;
1079
1244
  horizon: z.ZodEnum<{
1080
1245
  "quick-win": "quick-win";
1081
1246
  "bigger-bet": "bigger-bet";
@@ -1180,6 +1345,47 @@ export declare const VerifyIssueOutputSchema: z.ZodObject<{
1180
1345
  verdictReason: z.ZodString;
1181
1346
  userLogin: z.ZodString;
1182
1347
  }, z.core.$strip>;
1348
+ export declare const IssueThreadOutputSchema: z.ZodObject<{
1349
+ url: z.ZodString;
1350
+ owner: z.ZodString;
1351
+ repo: z.ZodString;
1352
+ number: z.ZodNumber;
1353
+ state: z.ZodString;
1354
+ title: z.ZodString;
1355
+ author: z.ZodNullable<z.ZodString>;
1356
+ authorAssociation: z.ZodNullable<z.ZodString>;
1357
+ createdAt: z.ZodString;
1358
+ body: z.ZodString;
1359
+ comments: z.ZodArray<z.ZodObject<{
1360
+ author: z.ZodNullable<z.ZodString>;
1361
+ authorAssociation: z.ZodNullable<z.ZodString>;
1362
+ createdAt: z.ZodString;
1363
+ body: z.ZodString;
1364
+ }, z.core.$strip>>;
1365
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
1366
+ phase: z.ZodEnum<{
1367
+ fetch: "fetch";
1368
+ "merged-pr-notes": "merged-pr-notes";
1369
+ "reviewed-prs": "reviewed-prs";
1370
+ "closed-pr-status": "closed-pr-status";
1371
+ "merge-loop": "merge-loop";
1372
+ "repo-scores": "repo-scores";
1373
+ analytics: "analytics";
1374
+ partition: "partition";
1375
+ "dismiss-filter": "dismiss-filter";
1376
+ "gist-init": "gist-init";
1377
+ "gist-checkpoint": "gist-checkpoint";
1378
+ "gist-staleness": "gist-staleness";
1379
+ "state-load": "state-load";
1380
+ "issue-list": "issue-list";
1381
+ }>;
1382
+ operation: z.ZodString;
1383
+ message: z.ZodString;
1384
+ timestamp: z.ZodOptional<z.ZodString>;
1385
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1386
+ }, z.core.$strip>>>;
1387
+ }, z.core.$strip>;
1388
+ export type IssueThreadOutput = z.infer<typeof IssueThreadOutputSchema>;
1183
1389
  export declare const PostOutputSchema: z.ZodObject<{
1184
1390
  commentUrl: z.ZodString;
1185
1391
  url: z.ZodString;
@@ -1272,6 +1478,7 @@ export declare const WorkListOutputSchema: z.ZodObject<{
1272
1478
  "gist-checkpoint": "gist-checkpoint";
1273
1479
  "gist-staleness": "gist-staleness";
1274
1480
  "state-load": "state-load";
1481
+ "issue-list": "issue-list";
1275
1482
  }>;
1276
1483
  operation: z.ZodString;
1277
1484
  message: z.ZodString;
@@ -1326,6 +1533,7 @@ export declare const SetupOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
1326
1533
  }, z.core.$strip>]>;
1327
1534
  export declare const ConfigCommandOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
1328
1535
  config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1536
+ machinePathSources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1329
1537
  }, z.core.$strip>, z.ZodObject<{
1330
1538
  success: z.ZodLiteral<true>;
1331
1539
  key: z.ZodString;
@@ -1394,6 +1602,29 @@ export declare const RepoVetOutputSchema: z.ZodObject<{
1394
1602
  avoid: "avoid";
1395
1603
  }>;
1396
1604
  historyScore: z.ZodOptional<z.ZodNumber>;
1605
+ policy: z.ZodOptional<z.ZodObject<{
1606
+ aiPolicy: z.ZodEnum<{
1607
+ unknown: "unknown";
1608
+ allowed: "allowed";
1609
+ "disclosure-required": "disclosure-required";
1610
+ banned: "banned";
1611
+ }>;
1612
+ cla: z.ZodEnum<{
1613
+ required: "required";
1614
+ none: "none";
1615
+ unknown: "unknown";
1616
+ }>;
1617
+ commitRules: z.ZodArray<z.ZodString>;
1618
+ prGate: z.ZodEnum<{
1619
+ none: "none";
1620
+ unknown: "unknown";
1621
+ "claim-first": "claim-first";
1622
+ "maintainer-label": "maintainer-label";
1623
+ "collaborators-only": "collaborators-only";
1624
+ }>;
1625
+ maxOpenAiPRs: z.ZodOptional<z.ZodNumber>;
1626
+ reviewedByUser: z.ZodBoolean;
1627
+ }, z.core.$strip>>;
1397
1628
  }, z.core.$strip>;
1398
1629
  /**
1399
1630
  * The CLI wrapper renames the core function's `repo` metadata object to
@@ -1680,11 +1911,13 @@ export interface SearchCandidate {
1680
1911
  boostReasons?: string[];
1681
1912
  /** True when this candidate filled a diversity slot (#1244). */
1682
1913
  diversitySlot?: boolean;
1914
+ /** The repo's stored contribution policy (#1953), when one is recorded. */
1915
+ policy?: RepoPolicySummary;
1683
1916
  }
1684
1917
  export interface SearchOutput {
1685
1918
  candidates: SearchCandidate[];
1686
1919
  excludedRepos: string[];
1687
- /** Repos with known anti-AI contribution policies, filtered from search results (#108). */
1920
+ /** Repos filtered from search results for banning AI-assisted contributions: `config.aiPolicyBlocklist` plus bans the user confirmed with `policy set` (#108, #1953). */
1688
1921
  aiPolicyBlocklist: string[];
1689
1922
  /** Candidates dropped because the authenticated user already has an open PR
1690
1923
  * linked to the issue (#1354). Surfaced as a count so the filter is visible. */
@@ -1692,6 +1925,15 @@ export interface SearchOutput {
1692
1925
  /** Repos left out of discovery because they are at the per-repo open-PR
1693
1926
  * cap (`maxOpenPRsColdRepo` / `maxOpenPRsPerRepo`); empty when none. */
1694
1927
  reposAtCap: string[];
1928
+ /**
1929
+ * Stored `banned` contribution policies (#1953). Reviewed ones are in
1930
+ * `aiPolicyBlocklist` and filtered; unreviewed ones (vet read them from the
1931
+ * docs) stay searchable, and their candidates carry `policy`. Absent when none.
1932
+ */
1933
+ policyBannedRepos?: Array<{
1934
+ repo: string;
1935
+ reviewedByUser: boolean;
1936
+ }>;
1695
1937
  /** Set when the seen-set write could not be pushed to the Gist (#1629);
1696
1938
  * the local cache has it but the next startup's Gist refetch will drop it. */
1697
1939
  gistSyncWarning?: string;
@@ -1731,7 +1973,14 @@ export interface TrackOutput {
1731
1973
  };
1732
1974
  }
1733
1975
  export interface ConfigOutput {
1976
+ /** `issueListPath` and `skippedIssuesPath` are this machine's values in effect (#1950). */
1734
1977
  config: AgentState['config'];
1978
+ /**
1979
+ * Where each shown path comes from: `set`, `adopted` or `probe` for a value
1980
+ * in this machine's `local-config.json`, `synced` for the shared config
1981
+ * fallback. Omitted when neither path is configured.
1982
+ */
1983
+ machinePathSources?: Partial<Record<'issueListPath' | 'skippedIssuesPath' | 'localRepoScanPaths', 'set' | 'adopted' | 'probe' | 'synced'>>;
1735
1984
  }
1736
1985
  /** Info about a detected issue list file */
1737
1986
  export interface IssueListInfo {
@@ -1983,6 +2232,13 @@ export interface VetOutput {
1983
2232
  * in `excludeRepos`; `reason` says which.
1984
2233
  */
1985
2234
  repoCap?: RepoCapStatus;
2235
+ /**
2236
+ * The repo's contribution policy (#1953): what this vet read from its docs,
2237
+ * or the user's record when one is set, with `config.aiPolicyBlocklist`
2238
+ * read as a ban. `banned` makes the recommendation `skip`. Absent when
2239
+ * nothing is known. Quoted lines: `policy get`.
2240
+ */
2241
+ policy?: RepoPolicySummary;
1986
2242
  /** Set when the vet-time prediction (#1824) could not be saved locally. */
1987
2243
  pickRecordError?: string;
1988
2244
  /** Set when the saved prediction could not be pushed to the Gist. */
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { z } from 'zod';
6
6
  import { fenceFetchedPR } from '../core/untrusted-content.js';
7
- import { WorkClaimSchema } from '../core/state-schema.js';
7
+ import { RepoPolicySchema, WorkClaimSchema } from '../core/state-schema.js';
8
8
  // Process-level gist degradation warning threaded into every JSON envelope
9
9
  // (#1433). The CLI preAction bootstrap sets it; one-shot processes never
10
10
  // clear it (the whole invocation runs degraded or it doesn't).
@@ -113,6 +113,7 @@ const DailyWarningPhaseSchema = z.enum([
113
113
  'closed-pr-status',
114
114
  'merged-pr-notes',
115
115
  'reviewed-prs',
116
+ 'issue-list',
116
117
  ]);
117
118
  const DailyWarningSchema = z.object({
118
119
  phase: DailyWarningPhaseSchema,
@@ -430,6 +431,27 @@ const CandidateLinkedPRSchema = z.object({
430
431
  updatedAt: z.string().optional(),
431
432
  isStalled: z.boolean(),
432
433
  });
434
+ /** Enumerated fields of a repo's contribution policy (#1953); no quoted text, so no fence. */
435
+ export const RepoPolicySummarySchema = RepoPolicySchema.pick({
436
+ aiPolicy: true,
437
+ cla: true,
438
+ prGate: true,
439
+ commitRules: true,
440
+ maxOpenAiPRs: true,
441
+ reviewedByUser: true,
442
+ });
443
+ /** `policy get` / `policy set` (#1953). Quoted repo text arrives in `<github-content>` fences. */
444
+ export const PolicyGetOutputSchema = z.object({
445
+ repo: z.string(),
446
+ policy: RepoPolicySummarySchema.extend({
447
+ updatedAt: z.string(),
448
+ blocklisted: z.boolean(),
449
+ disclosureText: z.string().optional(),
450
+ sources: z.string().optional(),
451
+ }).nullable(),
452
+ blocklistChange: z.enum(['added', 'removed']).optional(),
453
+ gistSyncWarning: z.string().optional(),
454
+ });
433
455
  const SearchCandidateSchema = z.object({
434
456
  issue: z.object({
435
457
  repo: z.string(),
@@ -470,6 +492,8 @@ const SearchCandidateSchema = z.object({
470
492
  /** True when this candidate filled a diversity slot (#1244) — surfaced so
471
493
  * the user can see the counterweight working, not just its absence. */
472
494
  diversitySlot: z.boolean().optional(),
495
+ /** The repo's stored contribution policy (#1953), when one is recorded. */
496
+ policy: RepoPolicySummarySchema.optional(),
473
497
  });
474
498
  /** Per-repo open-PR cap status (core/repo-cap.ts). */
475
499
  export const RepoCapStatusSchema = z.object({
@@ -483,12 +507,34 @@ export const RepoCapStatusSchema = z.object({
483
507
  excluded: z.boolean(),
484
508
  reason: z.string().optional(),
485
509
  });
510
+ const PrPreflightCheckSchema = z.object({
511
+ id: z.string(),
512
+ status: z.enum(['pass', 'warn', 'fail', 'skipped']),
513
+ summary: z.string(),
514
+ details: z.record(z.string(), z.unknown()).optional(),
515
+ });
516
+ /** `pr-preflight` (#1952). A later check is one more `checks` entry, so the shape does not change. */
517
+ export const PrPreflightOutputSchema = z.object({
518
+ verdict: z.enum(['pass', 'warn', 'fail']),
519
+ dir: z.string(),
520
+ repo: z.string().nullable(),
521
+ issueUrl: z.string().nullable(),
522
+ branch: z.string().nullable(),
523
+ remote: z.string().nullable(),
524
+ base: z.string().nullable(),
525
+ mergeBase: z.string().nullable(),
526
+ ahead: z.number().int().nonnegative().nullable(),
527
+ behind: z.number().int().nonnegative().nullable(),
528
+ checks: z.array(PrPreflightCheckSchema),
529
+ });
530
+ const PolicyBanSchema = z.object({ repo: z.string(), reviewedByUser: z.boolean() });
486
531
  export const SearchOutputSchema = z.object({
487
532
  candidates: z.array(SearchCandidateSchema),
488
533
  excludedRepos: z.array(z.string()),
489
534
  aiPolicyBlocklist: z.array(z.string()),
490
535
  hiddenOwnPRCount: z.number().int().nonnegative(),
491
536
  reposAtCap: z.array(z.string()),
537
+ policyBannedRepos: z.array(PolicyBanSchema).optional(),
492
538
  rateLimitWarning: z.string().optional(),
493
539
  // Skip file unreadable — search ran with an empty skip list (#1448).
494
540
  // Optional: absent on clean runs.
@@ -592,6 +638,28 @@ export const VerifyIssueOutputSchema = z.object({
592
638
  verdictReason: z.string(),
593
639
  userLogin: z.string(),
594
640
  });
641
+ // issue-thread (#1932): one issue's title, body and comments. `title`,
642
+ // `body` and every `comments[].body` are `<github-content>`-fenced strings.
643
+ const IssueThreadCommentSchema = z.object({
644
+ author: z.string().nullable(),
645
+ authorAssociation: z.string().nullable(),
646
+ createdAt: z.string(),
647
+ body: z.string(),
648
+ });
649
+ export const IssueThreadOutputSchema = z.object({
650
+ url: z.string(),
651
+ owner: z.string(),
652
+ repo: z.string(),
653
+ number: z.number().int().positive(),
654
+ state: z.string(),
655
+ title: z.string(),
656
+ author: z.string().nullable(),
657
+ authorAssociation: z.string().nullable(),
658
+ createdAt: z.string(),
659
+ body: z.string(),
660
+ comments: z.array(IssueThreadCommentSchema),
661
+ warnings: z.array(DailyWarningSchema).optional(),
662
+ });
595
663
  // ── #1155: Zod coverage for remaining CLI commands ───────────────────
596
664
  export const PostOutputSchema = z.object({
597
665
  commentUrl: z.string(),
@@ -688,6 +756,8 @@ export const SetupOutputSchema = z.union([SetupSetOutputSchema, SetupCompleteOut
688
756
  const ConfigKeyDefSchema = z.object({}).passthrough();
689
757
  const ConfigGetOutputSchema = z.object({
690
758
  config: z.record(z.string(), z.unknown()),
759
+ // Where each machine-local path shown comes from (#1950, #2010).
760
+ machinePathSources: z.record(z.string(), z.string()).optional(),
691
761
  });
692
762
  const ConfigSetOutputSchema = z.object({
693
763
  success: z.literal(true),
@@ -792,6 +862,12 @@ export const RepoVetOutputSchema = z.object({
792
862
  * stored score into a hard --json contract throw (#1465 review).
793
863
  */
794
864
  historyScore: z.number().optional(),
865
+ /**
866
+ * The repo's contribution policy (#1953): the user's record, else what this
867
+ * run read from CONTRIBUTING and the PR template; the blocklist reads as a
868
+ * ban. Not stored (`vet` stores it). Absent when nothing is known.
869
+ */
870
+ policy: RepoPolicySummarySchema.optional(),
795
871
  });
796
872
  const ComplianceCheckSchema = z.object({
797
873
  status: z.enum(['pass', 'warn', 'fail']),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "3.42.4",
3
+ "version": "3.43.0",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,35 +0,0 @@
1
- /**
2
- * CI-enforced tool detection (#1286).
3
- *
4
- * Extracted from `workflows/pre-commit-review.md` Steps 2b and 6a so
5
- * the same logic isn't reimplemented twice in markdown. Callers
6
- * supply pre-fetched config snippets (the workflow runs `cat` /
7
- * `head` against the well-known files); this function does the
8
- * structured parse.
9
- *
10
- * Pure typed helper — no I/O.
11
- */
12
- export type CIToolName = 'lint' | 'format' | 'typecheck' | 'test' | 'build' | 'commit-format' | 'security-scan';
13
- export interface CIEnforcedToolsInput {
14
- /** `.pre-commit-config.yaml` contents, or null when the file is missing. */
15
- preCommitConfigYaml: string | null;
16
- /** Concatenated contents of `.github/workflows/*.yml` (or null when none). */
17
- workflowYamls: string | null;
18
- /** `Makefile` contents, or null when missing. */
19
- makefile: string | null;
20
- /** `package.json` contents — used to detect script names. */
21
- packageJson: string | null;
22
- }
23
- export interface CIEnforcedTool {
24
- tool: CIToolName;
25
- source: 'pre-commit' | 'github-workflow' | 'makefile' | 'package-json';
26
- /** Short snippet that surfaced this tool — useful for explainability. */
27
- evidence: string;
28
- }
29
- /**
30
- * Detect which class of tool each input source enforces. The output
31
- * may contain duplicates (e.g., `test` enforced by both pre-commit
32
- * and a GitHub workflow); callers can dedupe on `tool` or display
33
- * each evidence pair separately.
34
- */
35
- export declare function getCIEnforcedTools(input: CIEnforcedToolsInput): CIEnforcedTool[];