@oss-autopilot/core 3.42.5 → 3.44.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 (192) hide show
  1. package/dist/cli-pre-action.js +8 -3
  2. package/dist/cli-registry.js +428 -27
  3. package/dist/cli.bundle.cjs +212 -156
  4. package/dist/commands/check-integration.js +5 -1
  5. package/dist/commands/cleanup.d.ts +80 -0
  6. package/dist/commands/cleanup.js +334 -0
  7. package/dist/commands/comments.d.ts +14 -1
  8. package/dist/commands/comments.js +17 -5
  9. package/dist/commands/config.d.ts +2 -0
  10. package/dist/commands/config.js +63 -6
  11. package/dist/commands/daily-dismiss-filter.d.ts +7 -0
  12. package/dist/commands/daily-dismiss-filter.js +17 -1
  13. package/dist/commands/daily-ledger.d.ts +150 -0
  14. package/dist/commands/daily-ledger.js +248 -0
  15. package/dist/commands/daily-recent-prs.d.ts +26 -0
  16. package/dist/commands/daily-recent-prs.js +55 -0
  17. package/dist/commands/daily-render.d.ts +2 -1
  18. package/dist/commands/daily-render.js +4 -1
  19. package/dist/commands/daily.d.ts +5 -1
  20. package/dist/commands/daily.js +83 -93
  21. package/dist/commands/dashboard-cache.d.ts +2 -0
  22. package/dist/commands/dashboard-cache.js +33 -8
  23. package/dist/commands/dashboard-data.js +113 -69
  24. package/dist/commands/dashboard-gist-sync.js +3 -1
  25. package/dist/commands/dashboard-lifecycle.d.ts +36 -8
  26. package/dist/commands/dashboard-lifecycle.js +132 -39
  27. package/dist/commands/dashboard-process.d.ts +49 -1
  28. package/dist/commands/dashboard-process.js +111 -12
  29. package/dist/commands/dashboard-server.js +89 -23
  30. package/dist/commands/detect-formatters.js +1 -0
  31. package/dist/commands/dismiss.js +11 -7
  32. package/dist/commands/doctor.d.ts +15 -1
  33. package/dist/commands/doctor.js +66 -5
  34. package/dist/commands/draft.d.ts +77 -0
  35. package/dist/commands/draft.js +218 -0
  36. package/dist/commands/eval.js +1 -0
  37. package/dist/commands/fork-prune.d.ts +58 -0
  38. package/dist/commands/fork-prune.js +247 -0
  39. package/dist/commands/guidelines.d.ts +69 -2
  40. package/dist/commands/guidelines.js +158 -14
  41. package/dist/commands/index.d.ts +29 -4
  42. package/dist/commands/index.js +20 -3
  43. package/dist/commands/issue-thread.d.ts +46 -0
  44. package/dist/commands/issue-thread.js +123 -0
  45. package/dist/commands/ledger-backfill.d.ts +9 -0
  46. package/dist/commands/ledger-backfill.js +44 -1
  47. package/dist/commands/list-mark-done.d.ts +2 -1
  48. package/dist/commands/list-mark-done.js +3 -1
  49. package/dist/commands/list-move-tier.d.ts +2 -1
  50. package/dist/commands/list-move-tier.js +3 -1
  51. package/dist/commands/local-repos.js +10 -5
  52. package/dist/commands/locate-issue-list.d.ts +40 -17
  53. package/dist/commands/locate-issue-list.js +148 -88
  54. package/dist/commands/move.js +7 -1
  55. package/dist/commands/overnight-handoff.d.ts +17 -7
  56. package/dist/commands/overnight-handoff.js +36 -14
  57. package/dist/commands/overnight-push-prep.d.ts +14 -8
  58. package/dist/commands/overnight-push-prep.js +107 -35
  59. package/dist/commands/overnight-tool-rules.d.ts +54 -0
  60. package/dist/commands/overnight-tool-rules.js +217 -0
  61. package/dist/commands/overnight.d.ts +5 -6
  62. package/dist/commands/overnight.js +61 -140
  63. package/dist/commands/parse-list.js +7 -1
  64. package/dist/commands/policy.d.ts +90 -0
  65. package/dist/commands/policy.js +276 -0
  66. package/dist/commands/pr-create.d.ts +48 -0
  67. package/dist/commands/pr-create.js +200 -0
  68. package/dist/commands/pr-preflight.d.ts +69 -0
  69. package/dist/commands/pr-preflight.js +348 -0
  70. package/dist/commands/repo-vet.d.ts +9 -0
  71. package/dist/commands/repo-vet.js +36 -11
  72. package/dist/commands/scout-bridge.js +18 -8
  73. package/dist/commands/search.js +7 -0
  74. package/dist/commands/setup.d.ts +3 -3
  75. package/dist/commands/setup.js +160 -48
  76. package/dist/commands/skip-add.js +10 -1
  77. package/dist/commands/startup.d.ts +12 -3
  78. package/dist/commands/startup.js +82 -49
  79. package/dist/commands/state-cmd.d.ts +2 -0
  80. package/dist/commands/state-cmd.js +5 -1
  81. package/dist/commands/stats.js +1 -0
  82. package/dist/commands/status.js +6 -0
  83. package/dist/commands/strategy.js +1 -0
  84. package/dist/commands/validation.d.ts +5 -0
  85. package/dist/commands/validation.js +5 -0
  86. package/dist/commands/vet-list.d.ts +6 -0
  87. package/dist/commands/vet-list.js +26 -1
  88. package/dist/commands/vet.d.ts +20 -0
  89. package/dist/commands/vet.js +133 -2
  90. package/dist/commands/work.d.ts +4 -0
  91. package/dist/commands/work.js +34 -11
  92. package/dist/core/__fixtures__/prompt-injection-payloads.js +31 -0
  93. package/dist/core/anti-llm-policy.d.ts +3 -0
  94. package/dist/core/anti-llm-policy.js +3 -0
  95. package/dist/core/auth.js +2 -0
  96. package/dist/core/ci-analysis.d.ts +7 -2
  97. package/dist/core/ci-analysis.js +76 -21
  98. package/dist/core/commit-date.d.ts +45 -0
  99. package/dist/core/commit-date.js +45 -0
  100. package/dist/core/compliance-score.d.ts +3 -0
  101. package/dist/core/compliance-score.js +13 -9
  102. package/dist/core/config-registry.d.ts +27 -2
  103. package/dist/core/config-registry.js +94 -7
  104. package/dist/core/contributing.d.ts +2 -3
  105. package/dist/core/contributing.js +2 -3
  106. package/dist/core/daily-logic.d.ts +30 -5
  107. package/dist/core/daily-logic.js +68 -19
  108. package/dist/core/errors.d.ts +37 -3
  109. package/dist/core/errors.js +54 -5
  110. package/dist/core/fork-prune.d.ts +149 -0
  111. package/dist/core/fork-prune.js +333 -0
  112. package/dist/core/gist-health.d.ts +15 -3
  113. package/dist/core/gist-health.js +8 -0
  114. package/dist/core/gist-state-store.d.ts +24 -4
  115. package/dist/core/gist-state-store.js +98 -51
  116. package/dist/core/github-stats.d.ts +110 -16
  117. package/dist/core/github-stats.js +295 -110
  118. package/dist/core/http-cache.d.ts +0 -10
  119. package/dist/core/http-cache.js +0 -19
  120. package/dist/core/index.d.ts +13 -6
  121. package/dist/core/index.js +16 -6
  122. package/dist/core/issue-conversation.d.ts +8 -2
  123. package/dist/core/issue-conversation.js +31 -12
  124. package/dist/core/local-config.d.ts +95 -0
  125. package/dist/core/local-config.js +270 -0
  126. package/dist/core/merged-pr-notes.d.ts +2 -2
  127. package/dist/core/pacing.d.ts +41 -0
  128. package/dist/core/pacing.js +115 -0
  129. package/dist/core/pagination.d.ts +55 -0
  130. package/dist/core/pagination.js +59 -0
  131. package/dist/core/paths.d.ts +7 -0
  132. package/dist/core/paths.js +9 -0
  133. package/dist/core/pr-assembly.d.ts +2 -0
  134. package/dist/core/pr-assembly.js +6 -2
  135. package/dist/core/pr-graphql.d.ts +53 -4
  136. package/dist/core/pr-graphql.js +87 -14
  137. package/dist/core/pr-monitor.d.ts +35 -12
  138. package/dist/core/pr-monitor.js +110 -26
  139. package/dist/core/pr-preflight.d.ts +154 -0
  140. package/dist/core/pr-preflight.js +753 -0
  141. package/dist/core/pr-quality-rubric.d.ts +0 -6
  142. package/dist/core/pr-quality-rubric.js +0 -8
  143. package/dist/core/pr-template.d.ts +2 -0
  144. package/dist/core/pr-template.js +5 -1
  145. package/dist/core/prose-script.d.ts +72 -0
  146. package/dist/core/prose-script.js +223 -0
  147. package/dist/core/repo-policy.d.ts +111 -0
  148. package/dist/core/repo-policy.js +428 -0
  149. package/dist/core/repo-score-manager.d.ts +66 -0
  150. package/dist/core/repo-score-manager.js +140 -1
  151. package/dist/core/review-analysis.d.ts +49 -21
  152. package/dist/core/review-analysis.js +89 -15
  153. package/dist/core/reviewed-prs-fetch.js +11 -29
  154. package/dist/core/reviewed-prs.js +8 -15
  155. package/dist/core/stale-data.d.ts +78 -0
  156. package/dist/core/stale-data.js +153 -0
  157. package/dist/core/state-persistence.d.ts +62 -27
  158. package/dist/core/state-persistence.js +338 -119
  159. package/dist/core/state-schema.d.ts +152 -210
  160. package/dist/core/state-schema.js +232 -80
  161. package/dist/core/state.d.ts +81 -8
  162. package/dist/core/state.js +239 -46
  163. package/dist/core/status-determination.js +32 -12
  164. package/dist/core/strategy.js +3 -1
  165. package/dist/core/types.d.ts +22 -1
  166. package/dist/core/types.js +1 -0
  167. package/dist/core/untrusted-content.d.ts +30 -11
  168. package/dist/core/untrusted-content.js +95 -42
  169. package/dist/core/urls.d.ts +33 -0
  170. package/dist/core/urls.js +94 -0
  171. package/dist/dashboard/assets/chart-panel-B-nLVgzQ.js +3 -0
  172. package/dist/dashboard/assets/index-5IvMGokL.js +55 -0
  173. package/dist/dashboard/index.html +1 -1
  174. package/dist/formatters/json.d.ts +432 -10
  175. package/dist/formatters/json.js +156 -1
  176. package/package.json +6 -6
  177. package/dist/core/ci-enforced-tools.d.ts +0 -35
  178. package/dist/core/ci-enforced-tools.js +0 -109
  179. package/dist/core/comment-decision.d.ts +0 -79
  180. package/dist/core/comment-decision.js +0 -82
  181. package/dist/core/extraction-categories.d.ts +0 -55
  182. package/dist/core/extraction-categories.js +0 -108
  183. package/dist/core/follow-up-history.d.ts +0 -40
  184. package/dist/core/follow-up-history.js +0 -71
  185. package/dist/core/issue-effort.d.ts +0 -29
  186. package/dist/core/issue-effort.js +0 -47
  187. package/dist/core/maintainer-hints.d.ts +0 -23
  188. package/dist/core/maintainer-hints.js +0 -36
  189. package/dist/core/workflow-state.d.ts +0 -56
  190. package/dist/core/workflow-state.js +0 -101
  191. package/dist/dashboard/assets/chart-panel-DPKNBUts.js +0 -3
  192. package/dist/dashboard/assets/index-B25bZOYX.js +0 -55
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * Keys fall into two CLI surfaces:
5
5
  * - `oss-autopilot setup --set key=value` — direct scalar / list-replace sets
6
- * - `oss-autopilot config <key> <value>` — list mutators (add-/remove-) and aliases
6
+ * - `oss-autopilot config <key> <value>` — list mutators (add-/remove-) and aliases;
7
+ * it also applies `setup` keys by delegating to setup (#1913)
7
8
  *
8
9
  * A key may be settable via one, the other, or both. `auto` means the field is
9
10
  * populated by internal code (e.g. starredRepos is fetched from GitHub), never
@@ -11,7 +12,7 @@
11
12
  *
12
13
  * When adding a new user-configurable state.json field:
13
14
  * 1. Add the field to `AgentConfigSchema` (state-schema.ts).
14
- * 2. Add an entry here.
15
+ * 2. Add an entry here, with its `trust` tier (see {@link ConfigTrust}).
15
16
  * 3. Wire the handler in `commands/setup.ts` and/or `commands/config.ts`.
16
17
  * 4. The registry test (`config-registry.test.ts`) asserts both commands
17
18
  * handle every non-`auto` key.
@@ -23,6 +24,7 @@ export const CONFIG_KEY_REGISTRY = [
23
24
  description: 'Your GitHub username.',
24
25
  settableVia: 'both',
25
26
  valueHint: 'string',
27
+ trust: 'preference',
26
28
  },
27
29
  // ── Capacity / dormancy ──────────────────────────────────────────────
28
30
  {
@@ -30,36 +32,56 @@ export const CONFIG_KEY_REGISTRY = [
30
32
  description: 'Soft cap on how many active PRs you want to juggle at once. 0 disables the cap.',
31
33
  settableVia: 'setup',
32
34
  valueHint: 'non-negative integer (0 = no limit)',
35
+ trust: 'preference',
33
36
  },
34
37
  {
35
38
  key: 'maxOpenPRsPerRepo',
36
39
  description: 'Discovery leaves out a repo once you have this many open PRs there, and the pre-push check warns. Default 0 (off).',
37
40
  settableVia: 'setup',
38
41
  valueHint: 'non-negative integer (0 = no limit)',
42
+ trust: 'preference',
39
43
  },
40
44
  {
41
45
  key: 'maxOpenPRsColdRepo',
42
46
  description: 'Per-repo open-PR cap while none of your PRs in that repo have merged (default 1). Discovery leaves the repo out and the pre-push check warns. 0 disables.',
43
47
  settableVia: 'setup',
44
48
  valueHint: 'non-negative integer (0 = no limit)',
49
+ trust: 'preference',
45
50
  },
46
51
  {
47
52
  key: 'maxConcurrentImplementations',
48
53
  description: 'How many implementations may run at once across sessions and machines (work claim --kind implementation refuses past it). Default 2; 0 disables the cap.',
49
54
  settableVia: 'setup',
50
55
  valueHint: 'non-negative integer (0 = no limit)',
56
+ trust: 'preference',
57
+ },
58
+ {
59
+ key: 'maxNewPrsPerDay',
60
+ description: 'Optional cap on new PRs to repos you do not own per rolling 24 hours; pr-preflight defers a new PR for an issue past it (one without an issue URL is counted, not deferred). Unset or 0 = no cap. Counted from local state: PRs recorded when the tool opened them plus those the last daily run saw.',
61
+ settableVia: 'setup',
62
+ valueHint: 'non-negative integer (0 or empty = no cap)',
63
+ trust: 'safeguard',
64
+ },
65
+ {
66
+ key: 'maxNewForksPerDay',
67
+ description: 'Optional soft cap on new forks per rolling 24 hours: the first known PR into a repo counts as one new fork, and pr-preflight defers only a PR from a clone with no fork remote of yours. Unset or 0 = no cap.',
68
+ settableVia: 'setup',
69
+ valueHint: 'non-negative integer (0 or empty = no cap)',
70
+ trust: 'safeguard',
51
71
  },
52
72
  {
53
73
  key: 'dormantDays',
54
74
  description: 'Alias for dormantThresholdDays: days of inactivity before a PR is considered dormant.',
55
75
  settableVia: 'setup',
56
76
  valueHint: 'positive integer',
77
+ trust: 'preference',
57
78
  },
58
79
  {
59
80
  key: 'approachingDays',
60
81
  description: 'Alias for approachingDormantDays: days before dormancy threshold at which to warn.',
61
82
  settableVia: 'setup',
62
83
  valueHint: 'positive integer',
84
+ trust: 'preference',
63
85
  },
64
86
  // ── Issue discovery ──────────────────────────────────────────────────
65
87
  {
@@ -67,90 +89,112 @@ export const CONFIG_KEY_REGISTRY = [
67
89
  description: 'Programming languages to filter issue discovery by (whole-list replace).',
68
90
  settableVia: 'setup',
69
91
  valueHint: 'comma-separated list',
92
+ trust: 'preference',
70
93
  },
71
94
  {
72
95
  key: 'labels',
73
96
  description: 'Issue labels to search for (whole-list replace).',
74
97
  settableVia: 'setup',
75
98
  valueHint: 'comma-separated list',
99
+ trust: 'preference',
76
100
  },
77
101
  {
78
102
  key: 'scope',
79
103
  description: 'Issue complexity scope(s) — beginner, intermediate, advanced.',
80
104
  settableVia: 'setup',
81
105
  valueHint: 'comma-separated list of: beginner,intermediate,advanced',
106
+ trust: 'preference',
82
107
  },
83
108
  {
84
109
  key: 'minStars',
85
110
  description: 'Minimum stargazers required for a repo to surface during discovery.',
86
111
  settableVia: 'setup',
87
112
  valueHint: 'non-negative integer',
113
+ trust: 'preference',
88
114
  },
89
115
  {
90
116
  key: 'includeDocIssues',
91
117
  description: 'Whether documentation-only issues should appear in discovery.',
92
118
  settableVia: 'setup',
93
119
  valueHint: 'true|false',
120
+ trust: 'preference',
94
121
  },
95
122
  {
96
123
  key: 'maxIssueAgeDays',
97
124
  description: 'Maximum age (in days) for an issue to be considered in discovery.',
98
125
  settableVia: 'setup',
99
126
  valueHint: 'positive integer',
127
+ trust: 'preference',
100
128
  },
101
129
  {
102
130
  key: 'skipBroadWhenSufficientResults',
103
131
  description: 'Skip the broad discovery phase once this many candidates from new repos are found (0 = always run the broad phase). Affinity/starred-repo candidates do not count toward it.',
104
132
  settableVia: 'setup',
105
133
  valueHint: 'non-negative integer (0 disables)',
134
+ trust: 'preference',
106
135
  },
107
136
  {
108
137
  key: 'complexIssues',
109
138
  description: 'Surface larger issues in repos where you already have a merged PR: only a PR that closes the issue counts as an existing PR, and maintainer-filed issues pass without code in the body.',
110
139
  settableVia: 'setup',
111
140
  valueHint: 'off|warm',
141
+ trust: 'preference',
112
142
  },
113
143
  {
114
144
  key: 'minRepoScoreThreshold',
115
145
  description: 'Minimum repo maintainer-health score required for discovery (0–10).',
116
146
  settableVia: 'setup',
117
147
  valueHint: 'non-negative integer',
148
+ trust: 'preference',
118
149
  },
119
150
  {
120
151
  key: 'projectCategories',
121
152
  description: 'Project categories to prioritize (whole-list replace).',
122
153
  settableVia: 'setup',
123
154
  valueHint: 'comma-separated list of: nonprofit,devtools,infrastructure,web-frameworks,data-ml,education',
155
+ trust: 'preference',
124
156
  },
125
157
  {
126
158
  key: 'preferredOrgs',
127
159
  description: 'GitHub orgs to prioritize during discovery (whole-list replace).',
128
160
  settableVia: 'setup',
129
161
  valueHint: 'comma-separated list',
162
+ trust: 'preference',
130
163
  },
131
164
  {
132
165
  key: 'untrackedOrgs',
133
166
  description: 'GitHub orgs whose PRs are not tracked (e.g. work repos). Discovery is unaffected (whole-list replace).',
134
167
  settableVia: 'setup',
135
168
  valueHint: 'comma-separated list',
169
+ trust: 'preference',
136
170
  },
137
171
  {
138
172
  key: 'aiPolicyBlocklist',
139
173
  description: 'Repos (owner/repo) with anti-AI contribution policies to block from discovery.',
140
174
  settableVia: 'setup',
141
175
  valueHint: 'comma-separated list of owner/repo',
176
+ trust: 'safeguard',
177
+ },
178
+ {
179
+ key: 'keepForks',
180
+ description: 'Forks (owner/repo, or their parent) that fork-prune never deletes (whole-list replace).',
181
+ settableVia: 'setup',
182
+ valueHint: 'comma-separated list of owner/repo',
183
+ trust: 'safeguard',
142
184
  },
143
185
  {
144
186
  key: 'avoidRepos',
145
187
  description: 'Repos (owner/repo) to softly downrank in discovery results — milder than excludeRepos (whole-list replace).',
146
188
  settableVia: 'setup',
147
189
  valueHint: 'comma-separated list of owner/repo',
190
+ trust: 'preference',
148
191
  },
149
192
  {
150
193
  key: 'boostIssueTypes',
151
194
  description: 'Issue label types to softly boost in discovery ranking (whole-list replace).',
152
195
  settableVia: 'setup',
153
196
  valueHint: 'comma-separated list (e.g. bug,good first issue)',
197
+ trust: 'preference',
154
198
  },
155
199
  // ── Exclusion list mutators (config-only) ────────────────────────────
156
200
  {
@@ -158,91 +202,114 @@ export const CONFIG_KEY_REGISTRY = [
158
202
  description: 'Append a language to the discovery languages list.',
159
203
  settableVia: 'config',
160
204
  valueHint: 'string',
205
+ trust: 'preference',
161
206
  },
162
207
  {
163
208
  key: 'add-label',
164
209
  description: 'Append a label to the discovery labels list.',
165
210
  settableVia: 'config',
166
211
  valueHint: 'string',
212
+ trust: 'preference',
167
213
  },
168
214
  {
169
215
  key: 'remove-label',
170
216
  description: 'Remove a label from the discovery labels list.',
171
217
  settableVia: 'config',
172
218
  valueHint: 'string (must already be present)',
219
+ trust: 'preference',
173
220
  },
174
221
  {
175
222
  key: 'add-scope',
176
223
  description: 'Append a scope to the discovery scope list.',
177
224
  settableVia: 'config',
178
225
  valueHint: 'one of: beginner,intermediate,advanced',
226
+ trust: 'preference',
179
227
  },
180
228
  {
181
229
  key: 'remove-scope',
182
230
  description: 'Remove a scope from the discovery scope list.',
183
231
  settableVia: 'config',
184
232
  valueHint: 'one of: beginner,intermediate,advanced',
233
+ trust: 'preference',
185
234
  },
186
235
  {
187
236
  key: 'exclude-repo',
188
237
  description: 'Exclude a specific repo (owner/repo) from discovery.',
189
238
  settableVia: 'config',
190
239
  valueHint: 'owner/repo',
240
+ trust: 'preference',
191
241
  },
192
242
  {
193
243
  key: 'exclude-org',
194
244
  description: 'Exclude an entire org from discovery.',
195
245
  settableVia: 'config',
196
246
  valueHint: 'org name (no slash)',
247
+ trust: 'preference',
197
248
  },
198
249
  {
199
250
  key: 'add-avoid-repo',
200
251
  description: 'Append a repo (owner/repo) to the soft-downrank avoid list.',
201
252
  settableVia: 'config',
202
253
  valueHint: 'owner/repo',
254
+ trust: 'preference',
203
255
  },
204
256
  {
205
257
  key: 'remove-avoid-repo',
206
258
  description: 'Remove a repo from the soft-downrank avoid list.',
207
259
  settableVia: 'config',
208
260
  valueHint: 'owner/repo (must already be present)',
261
+ trust: 'preference',
209
262
  },
210
263
  {
211
264
  key: 'add-boost-issue-type',
212
265
  description: 'Append an issue label type to the discovery ranking boost list.',
213
266
  settableVia: 'config',
214
267
  valueHint: 'issue label (e.g. bug)',
268
+ trust: 'preference',
215
269
  },
216
270
  {
217
271
  key: 'remove-boost-issue-type',
218
272
  description: 'Remove an issue label type from the discovery ranking boost list.',
219
273
  settableVia: 'config',
220
274
  valueHint: 'issue label (must already be present)',
275
+ trust: 'preference',
221
276
  },
222
277
  // ── Tooling ──────────────────────────────────────────────────────────
223
278
  {
224
279
  key: 'issueListPath',
225
- description: 'Path to a text file of extra issue URLs to surface.',
280
+ description: 'Path to a text file of extra issue URLs to surface (per machine, not synced).',
226
281
  settableVia: 'both',
227
282
  valueHint: 'filesystem path',
283
+ trust: 'path',
228
284
  },
229
285
  {
230
286
  key: 'skippedIssuesPath',
231
- description: 'Path to the skipped-issues file (entries are permanent).',
287
+ description: 'Path to the skipped-issues file (entries are permanent; per machine, not synced).',
232
288
  settableVia: 'setup',
233
289
  valueHint: 'filesystem path',
290
+ trust: 'path',
291
+ },
292
+ {
293
+ key: 'localRepoScanPaths',
294
+ description: 'Directories local-repos scans for clones (per machine, not synced). Empty clears it and the defaults apply.',
295
+ settableVia: 'setup',
296
+ valueHint: 'comma-separated list of directory paths',
297
+ trust: 'path',
234
298
  },
235
299
  {
236
300
  key: 'diffTool',
237
301
  description: 'Default diff renderer for reviews.',
238
302
  settableVia: 'both',
239
303
  valueHint: 'one of: inline,sourcetree,vscode,custom',
304
+ trust: 'preference',
305
+ commandValues: ['custom'],
240
306
  },
241
307
  {
242
308
  key: 'diffToolCustomCommand',
243
309
  description: 'Shell command template used when diffTool=custom.',
244
310
  settableVia: 'both',
245
311
  valueHint: 'shell command with {old}/{new} placeholders',
312
+ trust: 'command',
246
313
  },
247
314
  // ── Behavior ─────────────────────────────────────────────────────────
248
315
  {
@@ -250,42 +317,49 @@ export const CONFIG_KEY_REGISTRY = [
250
317
  description: 'Default merge strategy — squash-merge, prompt, or standard merge.',
251
318
  settableVia: 'setup',
252
319
  valueHint: 'true|false|ask',
320
+ trust: 'preference',
253
321
  },
254
322
  {
255
323
  key: 'persistence',
256
324
  description: 'Where to store state.json — local file or GitHub Gist.',
257
325
  settableVia: 'setup',
258
326
  valueHint: 'one of: local,gist',
327
+ trust: 'preference',
259
328
  },
260
329
  {
261
330
  key: 'autoExtractLearnings',
262
331
  description: 'Extract per-repo learnings from freshly merged PRs automatically at /oss startup and overnight (#1696). false restores the extract_learnings action-menu item.',
263
332
  settableVia: 'setup',
264
333
  valueHint: 'true|false',
334
+ trust: 'preference',
265
335
  },
266
336
  {
267
337
  key: 'autoFormatBeforePush',
268
- description: 'No effect. The hook that used this setting was removed in #1642; the key is kept in the schema for state-file compatibility.',
338
+ description: 'Retired: not read by oss-autopilot since #1642. Accepted and stored for compatibility; will be removed in the next major version.',
269
339
  settableVia: 'setup',
270
340
  valueHint: 'true|false',
341
+ trust: 'preference',
271
342
  },
272
343
  {
273
344
  key: 'trustOwnRepoWrites',
274
- description: 'No effect. The hook that used this setting was removed in #1642; the key is kept in the schema for state-file compatibility.',
345
+ description: 'Retired: not read by oss-autopilot since #1642. Accepted and stored for compatibility; will be removed in the next major version.',
275
346
  settableVia: 'setup',
276
347
  valueHint: 'true|false',
348
+ trust: 'preference',
277
349
  },
278
350
  {
279
351
  key: 'healthCheckFreshnessMinutes',
280
- description: 'No effect. The hook that used this setting was removed in #1642; the key is kept in the schema for state-file compatibility.',
352
+ description: 'Retired: not read by oss-autopilot since #1642. Accepted and stored for compatibility; will be removed in the next major version.',
281
353
  settableVia: 'setup',
282
354
  valueHint: 'positive integer',
355
+ trust: 'preference',
283
356
  },
284
357
  {
285
358
  key: 'reviewMaxPasses',
286
359
  description: 'Convergence cap for the multi-agent review loop in workflows/dispatch-review.md. Optional; falls back to per-mode defaults (5 for diff, 3 for plan) when unset (#1275).',
287
360
  settableVia: 'setup',
288
361
  valueHint: 'positive integer',
362
+ trust: 'preference',
289
363
  },
290
364
  // ── Setup-only completion flag ──────────────────────────────────────
291
365
  {
@@ -293,6 +367,7 @@ export const CONFIG_KEY_REGISTRY = [
293
367
  description: 'Internal marker that initial setup has finished. Normally set by the wizard — `setup --set complete=true` is a manual override.',
294
368
  settableVia: 'setup',
295
369
  valueHint: 'true',
370
+ trust: 'preference',
296
371
  },
297
372
  // ── Auto-managed (listed for auditability; not user-settable) ────────
298
373
  {
@@ -300,12 +375,14 @@ export const CONFIG_KEY_REGISTRY = [
300
375
  description: 'Cache of the user’s starred repos. Refreshed automatically during discovery.',
301
376
  settableVia: 'auto',
302
377
  valueHint: '(managed internally)',
378
+ trust: 'preference',
303
379
  },
304
380
  {
305
381
  key: 'starredReposLastFetched',
306
382
  description: 'Timestamp of the last starredRepos refresh.',
307
383
  settableVia: 'auto',
308
384
  valueHint: '(managed internally)',
385
+ trust: 'preference',
309
386
  },
310
387
  ];
311
388
  const KEY_INDEX = new Map(CONFIG_KEY_REGISTRY.map((def) => [def.key, def]));
@@ -315,6 +392,16 @@ export function isKnownKey(key) {
315
392
  export function getKeyDef(key) {
316
393
  return KEY_INDEX.get(key);
317
394
  }
395
+ /**
396
+ * The trust tier of writing `value` to `key` (see {@link ConfigTrust}).
397
+ * Unknown keys read as `preference`; the commands reject them anyway.
398
+ */
399
+ export function getKeyTrust(key, value) {
400
+ const def = KEY_INDEX.get(key);
401
+ if (value !== undefined && def?.commandValues?.includes(value))
402
+ return 'command';
403
+ return def?.trust ?? 'preference';
404
+ }
318
405
  /** Keys accepted by the `setup --set` command (includes `both`). */
319
406
  export function getSetupKeys() {
320
407
  return CONFIG_KEY_REGISTRY.filter((d) => d.settableVia === 'setup' || d.settableVia === 'both').map((d) => d.key);
@@ -8,9 +8,8 @@
8
8
  * (#1242), strategy (#1243), and the recent #1252 / #1264 / #1286
9
9
  * extractions.
10
10
  *
11
- * Pure typed helper — no I/O. Callers (the workflow runner, the
12
- * `pr-compliance-checker` agent) read the file themselves and pass
13
- * the contents in. The extraction step is heuristic regex matching
11
+ * Pure typed helper — no I/O. The caller (`derivePolicy` in
12
+ * repo-policy.ts, #1953) reads the file and passes the contents in. The extraction step is heuristic regex matching
14
13
  * over headings + bullet phrases; it intentionally over-recalls
15
14
  * (some false positives) rather than under-recalling.
16
15
  *
@@ -8,9 +8,8 @@
8
8
  * (#1242), strategy (#1243), and the recent #1252 / #1264 / #1286
9
9
  * extractions.
10
10
  *
11
- * Pure typed helper — no I/O. Callers (the workflow runner, the
12
- * `pr-compliance-checker` agent) read the file themselves and pass
13
- * the contents in. The extraction step is heuristic regex matching
11
+ * Pure typed helper — no I/O. The caller (`derivePolicy` in
12
+ * repo-policy.ts, #1953) reads the file and passes the contents in. The extraction step is heuristic regex matching
14
13
  * over headings + bullet phrases; it intentionally over-recalls
15
14
  * (some false positives) rather than under-recalling.
16
15
  *
@@ -10,17 +10,43 @@
10
10
  * - toShelvedPRRef — lightweight projection for digest display
11
11
  *
12
12
  * Rendering functions (formatActionHint, formatBriefSummary, formatSummary,
13
- * printDigest) live in src/commands/daily-render.ts (#1117). This file
14
- * re-exports them at the bottom so existing imports keep working without
15
- * a sweep.
13
+ * printDigest) live in src/commands/daily-render.ts (#1117).
16
14
  */
17
15
  import type { AttentionSummary } from './pr-attention.js';
18
- import type { FetchedPR, FetchedPRStatus, StalenessTier, ActionReason, AgentState, ShelvedPRRef, ComputedRepoSignals, RepoGroup, CommentedIssue, CapacityAssessment, ActionableIssue, ActionMenu, StarFilter } from './types.js';
16
+ import type { FetchedPR, FetchedPRStatus, StalenessTier, ActionReason, AgentState, DailyDigest, ShelvedPRRef, ComputedRepoSignals, RepoGroup, CommentedIssue, CapacityAssessment, ActionableIssue, ActionMenu, StarFilter } from './types.js';
19
17
  /**
20
18
  * Statuses indicating action needed from the contributor.
21
19
  * Used for auto-unshelving shelved PRs.
22
20
  */
23
21
  export declare const CRITICAL_STATUSES: ReadonlySet<FetchedPRStatus>;
22
+ /**
23
+ * The action reasons a shelve record stores and compares (#1922): every
24
+ * reason the PR has while it needs addressing, none when it does not. A PR
25
+ * that carries only a primary reason yields that one.
26
+ */
27
+ export declare function shelveReasonsOf(pr: Pick<FetchedPR, 'status' | 'actionReason' | 'actionReasons'>): string[];
28
+ /**
29
+ * Whether an explicitly shelved PR goes back to active (#1922). It must need
30
+ * addressing, and something must be new since it was shelved: maintainer
31
+ * activity after the shelve, or an action reason not among the recorded ones.
32
+ * A PR shelved while it already needed addressing stays shelved until then,
33
+ * also when one of its recorded reasons clears or comes back. A
34
+ * maintainer-driven reason (needs_response, needs_changes) missing from the
35
+ * record counts only through maintainer activity after the shelve, since the
36
+ * digest the record came from may be older than that activity (#2043).
37
+ * A record without reasons (the PR was not in the digest at shelve time)
38
+ * only unshelves on maintainer activity; the daily run then fills the reasons
39
+ * in. Without a shelve record (shelved before `config.shelvedPRInfo` existed)
40
+ * or a known maintainer-activity time, needing addressing alone unshelves it.
41
+ *
42
+ * @param shelvedPRInfo - `config.shelvedPRInfo`, keyed by `issueRefKey`
43
+ */
44
+ export declare function shouldAutoUnshelve(pr: Pick<FetchedPR, 'url' | 'status' | 'actionReason' | 'actionReasons' | 'lastMaintainerActivityAt'>, shelvedPRInfo: AgentState['config']['shelvedPRInfo'] | undefined): boolean;
45
+ /**
46
+ * A PR shelved while it needs addressing stays shelved (#1922): keep it out
47
+ * of the Needs Addressing list the brief and --json output render.
48
+ */
49
+ export declare function withoutShelvedNeedsAddressing(digest: DailyDigest, shelvedPRs: ShelvedPRRef[]): DailyDigest;
24
50
  /**
25
51
  * ActionReason values that indicate high-priority issues blocking capacity.
26
52
  * `incomplete_checklist` is excluded — it's actionable but not blocking.
@@ -208,4 +234,3 @@ export declare function computeActionMenu(actionableIssues: ActionableIssue[], c
208
234
  * dismiss filter.
209
235
  */
210
236
  export declare function isCoveredByDismiss(dismissedAt: string, lastResponseAt: string): boolean;
211
- export { formatActionHint, formatBriefSummary, formatSummary, printDigest } from '../commands/daily-render.js';
@@ -10,15 +10,14 @@
10
10
  * - toShelvedPRRef — lightweight projection for digest display
11
11
  *
12
12
  * Rendering functions (formatActionHint, formatBriefSummary, formatSummary,
13
- * printDigest) live in src/commands/daily-render.ts (#1117). This file
14
- * re-exports them at the bottom so existing imports keep working without
15
- * a sweep.
13
+ * printDigest) live in src/commands/daily-render.ts (#1117).
16
14
  */
17
15
  import { warn } from './logger.js';
18
16
  import { errorMessage } from './errors.js';
19
17
  import { getStateManager } from './state.js';
20
- import { parseGitHubUrl } from './urls.js';
18
+ import { parseGitHubUrl, issueRefKey } from './urls.js';
21
19
  import { MAINTAINER_RESPONSE_RULE } from './review-analysis.js';
20
+ import { FetchedPRStatusSchema, isKnownValue } from './state-schema.js';
22
21
  // ---------------------------------------------------------------------------
23
22
  // Constants
24
23
  // ---------------------------------------------------------------------------
@@ -27,6 +26,64 @@ import { MAINTAINER_RESPONSE_RULE } from './review-analysis.js';
27
26
  * Used for auto-unshelving shelved PRs.
28
27
  */
29
28
  export const CRITICAL_STATUSES = new Set(['needs_addressing']);
29
+ /**
30
+ * The action reasons a shelve record stores and compares (#1922): every
31
+ * reason the PR has while it needs addressing, none when it does not. A PR
32
+ * that carries only a primary reason yields that one.
33
+ */
34
+ export function shelveReasonsOf(pr) {
35
+ if (!CRITICAL_STATUSES.has(pr.status))
36
+ return [];
37
+ if (pr.actionReasons?.length)
38
+ return pr.actionReasons;
39
+ return [pr.actionReason ?? 'needs_addressing'];
40
+ }
41
+ /**
42
+ * Action reasons only a maintainer's comment or review creates. The recorded
43
+ * reasons come from the last digest, which can predate the shelve, so one of
44
+ * these missing from the record proves nothing; it is new only when the
45
+ * maintainer activity behind it came after the shelve (#2043).
46
+ */
47
+ const MAINTAINER_ACTION_REASONS = new Set(['needs_response', 'needs_changes']);
48
+ /**
49
+ * Whether an explicitly shelved PR goes back to active (#1922). It must need
50
+ * addressing, and something must be new since it was shelved: maintainer
51
+ * activity after the shelve, or an action reason not among the recorded ones.
52
+ * A PR shelved while it already needed addressing stays shelved until then,
53
+ * also when one of its recorded reasons clears or comes back. A
54
+ * maintainer-driven reason (needs_response, needs_changes) missing from the
55
+ * record counts only through maintainer activity after the shelve, since the
56
+ * digest the record came from may be older than that activity (#2043).
57
+ * A record without reasons (the PR was not in the digest at shelve time)
58
+ * only unshelves on maintainer activity; the daily run then fills the reasons
59
+ * in. Without a shelve record (shelved before `config.shelvedPRInfo` existed)
60
+ * or a known maintainer-activity time, needing addressing alone unshelves it.
61
+ *
62
+ * @param shelvedPRInfo - `config.shelvedPRInfo`, keyed by `issueRefKey`
63
+ */
64
+ export function shouldAutoUnshelve(pr, shelvedPRInfo) {
65
+ if (!CRITICAL_STATUSES.has(pr.status))
66
+ return false;
67
+ const info = shelvedPRInfo?.[issueRefKey(pr.url) ?? pr.url];
68
+ if (!info || !pr.lastMaintainerActivityAt)
69
+ return true;
70
+ const known = info.reasons;
71
+ const isNew = (reason) => !MAINTAINER_ACTION_REASONS.has(reason) && !known?.includes(reason);
72
+ if (known && shelveReasonsOf(pr).some((reason) => isNew(reason)))
73
+ return true;
74
+ const activityMs = Date.parse(pr.lastMaintainerActivityAt);
75
+ const shelvedMs = Date.parse(info.at);
76
+ // An unparseable date resurfaces the PR instead of hiding it.
77
+ return Number.isNaN(activityMs) || Number.isNaN(shelvedMs) || activityMs > shelvedMs;
78
+ }
79
+ /**
80
+ * A PR shelved while it needs addressing stays shelved (#1922): keep it out
81
+ * of the Needs Addressing list the brief and --json output render.
82
+ */
83
+ export function withoutShelvedNeedsAddressing(digest, shelvedPRs) {
84
+ const shelvedUrls = new Set(shelvedPRs.map((ref) => ref.url));
85
+ return { ...digest, needsAddressingPRs: digest.needsAddressingPRs.filter((pr) => !shelvedUrls.has(pr.url)) };
86
+ }
30
87
  /**
31
88
  * ActionReason values that indicate high-priority issues blocking capacity.
32
89
  * `incomplete_checklist` is excluded — it's actionable but not blocking.
@@ -43,7 +100,6 @@ export const STALE_STATUSES = new Set(['dormant', 'approaching_dormant']);
43
100
  // ---------------------------------------------------------------------------
44
101
  // Status overrides
45
102
  // ---------------------------------------------------------------------------
46
- const VALID_OVERRIDE_STATUSES = new Set(['needs_addressing', 'waiting_on_maintainer']);
47
103
  /**
48
104
  * Apply status overrides from state to the PR list.
49
105
  * Overrides are auto-cleared if the PR has new activity since the override was set.
@@ -88,7 +144,8 @@ export function applyStatusOverrides(prs, state, failures) {
88
144
  if (!override) {
89
145
  return pr;
90
146
  }
91
- if (!VALID_OVERRIDE_STATUSES.has(override.status)) {
147
+ // A newer release may write a status this one does not know (#2005).
148
+ if (!isKnownValue(FetchedPRStatusSchema.options, override.status)) {
92
149
  warn('daily-logic', `Invalid override status "${override.status}" for ${pr.url} — ignoring`);
93
150
  return pr;
94
151
  }
@@ -559,8 +616,8 @@ export function computeActionMenu(actionableIssues, capacity, commentedIssues =
559
616
  }
560
617
  // Closed-PR status nudge (#1863) — the user's PR closed without merge and
561
618
  // the linked issue has heard nothing from them since. Routes to
562
- // workflows/closed-pr-status-update.md, which drafts the comment through
563
- // draft-review-post; nothing posts automatically. Self-clears once the
619
+ // workflows/closed-pr-status-update.md, which drafts the comment as a draft
620
+ // file and posts only after approval. Self-clears once the
564
621
  // user comments on the issue or the PR leaves the recently-closed window.
565
622
  if (closedPRStatusCount > 0) {
566
623
  items.push({
@@ -572,7 +629,7 @@ export function computeActionMenu(actionableIssues, capacity, commentedIssues =
572
629
  // Merged-PR notes (#1861) — a maintainer thanked the user or explained a
573
630
  // change at merge time and nobody answered. Routes to
574
631
  // workflows/merged-pr-notes.md, which classifies each note and drafts the
575
- // reply through draft-review-post; nothing posts automatically. Self-clears
632
+ // reply as a draft file, posted only after approval. Self-clears
576
633
  // once the user comments on the PR, dismisses its URL, or the PR leaves
577
634
  // the recently-merged window.
578
635
  if (mergedPRNotesCount > 0) {
@@ -586,8 +643,8 @@ export function computeActionMenu(actionableIssues, capacity, commentedIssues =
586
643
  // the author pushed commits or replied since the user's last review or
587
644
  // comment. Routes to workflows/review-follow-ups.md, which re-reviews the
588
645
  // compare range (or the commit list after a rebase) through review-panel
589
- // and drafts answers through draft-review-post; nothing posts
590
- // automatically. Self-clears once the user reviews or comments again,
646
+ // and drafts answers as draft files; nothing posts without the user's
647
+ // approval. Self-clears once the user reviews or comments again,
591
648
  // dismisses the PR URL, or the PR closes. Never counted in capacity.
592
649
  if (reviewedPRCount > 0) {
593
650
  items.push({
@@ -657,11 +714,3 @@ export function isCoveredByDismiss(dismissedAt, lastResponseAt) {
657
714
  return false;
658
715
  return dismissedMs >= responseMs;
659
716
  }
660
- // ---------------------------------------------------------------------------
661
- // Rendering re-exports (back-compat)
662
- // ---------------------------------------------------------------------------
663
- //
664
- // The actual implementations live in src/commands/daily-render.ts. Existing
665
- // callers that import these from `core/daily-logic` continue to work; new
666
- // callers should import from `commands/daily-render` directly.
667
- export { formatActionHint, formatBriefSummary, formatSummary, printDigest } from '../commands/daily-render.js';