@oss-autopilot/core 3.40.2 → 3.42.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.
@@ -76,6 +76,7 @@ function toFeaturesCandidate(scoutCandidate, getState) {
76
76
  reasonsToApprove: scoutCandidate.reasonsToApprove,
77
77
  reasonsToSkip: scoutCandidate.reasonsToSkip,
78
78
  searchPriority: scoutCandidate.searchPriority,
79
+ ...(scoutCandidate.complexityUnlocked && { complexityUnlocked: true }),
79
80
  viabilityScore: sanitizeViabilityScore(scoutCandidate.viabilityScore),
80
81
  grade,
81
82
  repoScore: repoScoreRecord
@@ -61,13 +61,16 @@ export declare function buildCandidateLinkedPR(scoutLinkedPR: ScoutLinkedPR | nu
61
61
  * @param diagnostics - Optional collector for degradation signals (#1448,
62
62
  * #1528); `skipListUnavailable` is set when the configured skipped-issues
63
63
  * file is unreadable or missing at its resolved path.
64
+ * @param excludeUrls - Issue URLs the caller wants left out of this search
65
+ * (`search --exclude-file`). Non-issue URLs are ignored.
64
66
  */
65
- export declare function buildScoutState(diagnostics?: ScoutBridgeDiagnostics): ScoutState;
67
+ export declare function buildScoutState(diagnostics?: ScoutBridgeDiagnostics, excludeUrls?: readonly string[]): ScoutState;
66
68
  /**
67
69
  * Create an OssScout instance backed by the current AgentState.
68
70
  * Uses 'provided' persistence so scout reads from oss-autopilot's state.
69
71
  *
70
72
  * @param diagnostics - Optional collector for degradation signals (#1448),
71
73
  * forwarded to {@link buildScoutState}.
74
+ * @param excludeUrls - Issue URLs to leave out, forwarded to {@link buildScoutState}.
72
75
  */
73
- export declare function createAutopilotScout(diagnostics?: ScoutBridgeDiagnostics): Promise<OssScout>;
76
+ export declare function createAutopilotScout(diagnostics?: ScoutBridgeDiagnostics, excludeUrls?: readonly string[]): Promise<OssScout>;
@@ -76,8 +76,10 @@ export function buildCandidateLinkedPR(scoutLinkedPR) {
76
76
  * @param diagnostics - Optional collector for degradation signals (#1448,
77
77
  * #1528); `skipListUnavailable` is set when the configured skipped-issues
78
78
  * file is unreadable or missing at its resolved path.
79
+ * @param excludeUrls - Issue URLs the caller wants left out of this search
80
+ * (`search --exclude-file`). Non-issue URLs are ignored.
79
81
  */
80
- export function buildScoutState(diagnostics) {
82
+ export function buildScoutState(diagnostics, excludeUrls = []) {
81
83
  const state = getStateManager().getState();
82
84
  const { config } = state;
83
85
  // A configured skip file that is unreadable (#1448) OR missing (#1528) leaves
@@ -137,6 +139,26 @@ export function buildScoutState(diagnostics) {
137
139
  permanent: true,
138
140
  });
139
141
  }
142
+ // Caller-supplied exclusions (`search --exclude-file`). A scheduled search
143
+ // run with --no-record keeps its own seen list; passing it here makes scout
144
+ // skip those issues before vetting, where discarding them from the results
145
+ // afterwards would hand back the same top-ranked issues every run.
146
+ const excludedAt = new Date().toISOString();
147
+ for (const url of excludeUrls) {
148
+ if (skippedUrls.has(url) || !ISSUE_URL_PATTERN.test(url))
149
+ continue;
150
+ const parsed = parseGitHubUrl(url);
151
+ skippedUrls.add(url);
152
+ skippedIssues.push({
153
+ url,
154
+ repo: parsed ? `${parsed.owner}/${parsed.repo}` : '',
155
+ number: parsed?.number ?? 0,
156
+ title: '',
157
+ skippedAt: excludedAt,
158
+ reason: 'excluded by caller',
159
+ permanent: true,
160
+ });
161
+ }
140
162
  // Strategy-derived personalization (#1464). `computeStrategy` returns null
141
163
  // below the merged-PR floor — empty lists then read as "no bias" on scout's
142
164
  // side. Baking the bias into the preferences (rather than only per-call
@@ -181,6 +203,7 @@ export function buildScoutState(diagnostics) {
181
203
  interPhaseDelayMs: 0,
182
204
  broadPhaseDelayMs: 0,
183
205
  skipBroadWhenSufficientResults: config.skipBroadWhenSufficientResults,
206
+ complexIssues: config.complexIssues === 'warm' ? 'warm' : 'off',
184
207
  persistence: config.persistence,
185
208
  slmTriageModel: config.slmTriageModel,
186
209
  slmTriageHost: config.slmTriageHost,
@@ -279,12 +302,13 @@ export function buildScoutState(diagnostics) {
279
302
  *
280
303
  * @param diagnostics - Optional collector for degradation signals (#1448),
281
304
  * forwarded to {@link buildScoutState}.
305
+ * @param excludeUrls - Issue URLs to leave out, forwarded to {@link buildScoutState}.
282
306
  */
283
- export async function createAutopilotScout(diagnostics) {
307
+ export async function createAutopilotScout(diagnostics, excludeUrls) {
284
308
  const token = requireGitHubToken();
285
309
  return createScout({
286
310
  githubToken: token,
287
311
  persistence: 'provided',
288
- initialState: buildScoutState(diagnostics),
312
+ initialState: buildScoutState(diagnostics, excludeUrls),
289
313
  });
290
314
  }
@@ -48,7 +48,22 @@ interface SearchOptions {
48
48
  * cursor does not advance either; pair it with `full`.
49
49
  */
50
50
  record?: boolean;
51
+ /**
52
+ * Issue URLs to leave out of this search (`--exclude-file`). Scout skips
53
+ * them before vetting, so they use no vetting or result slots. Matching is
54
+ * exact, against the URL as search prints it.
55
+ */
56
+ excludeUrls?: string[];
51
57
  }
58
+ /**
59
+ * Read the issue URLs out of an `--exclude-file`. The file can be any text
60
+ * (one URL per line, or lines like `2026-11-01 <url>`); every GitHub issue URL
61
+ * in it is used, each once.
62
+ *
63
+ * @throws {Error} If the file cannot be read. A silent miss would resurface
64
+ * everything the caller meant to exclude.
65
+ */
66
+ export declare function readExcludeFile(path: string): string[];
52
67
  /**
53
68
  * Parse and validate a comma-separated `--strategy` value into scout strategies.
54
69
  *
@@ -2,6 +2,7 @@
2
2
  * Search command
3
3
  * Searches for new issues to work on via @oss-scout/core
4
4
  */
5
+ import * as fs from 'node:fs';
5
6
  import { adaptScoutLinkedPR, buildCandidateLinkedPR, createAutopilotScout, SEARCH_DIVERSITY_RATIO, } from './scout-bridge.js';
6
7
  import { SearchStrategySchema } from '@oss-scout/core';
7
8
  import { classifyLinkedPR, getStateManager, maybeCheckpoint } from '../core/index.js';
@@ -32,6 +33,33 @@ export const DEFAULT_SEARCH_RESULTS = 15;
32
33
  * here so existing importers keep working.
33
34
  */
34
35
  export { SEARCH_DIVERSITY_RATIO } from './scout-bridge.js';
36
+ /**
37
+ * Read the issue URLs out of an `--exclude-file`. The file can be any text
38
+ * (one URL per line, or lines like `2026-11-01 <url>`); every GitHub issue URL
39
+ * in it is used, each once.
40
+ *
41
+ * @throws {Error} If the file cannot be read. A silent miss would resurface
42
+ * everything the caller meant to exclude.
43
+ */
44
+ export function readExcludeFile(path) {
45
+ let text;
46
+ try {
47
+ text = fs.readFileSync(path, 'utf8');
48
+ }
49
+ catch (err) {
50
+ throw new Error(`Cannot read --exclude-file "${path}": ${err instanceof Error ? err.message : String(err)}`, {
51
+ cause: err,
52
+ });
53
+ }
54
+ const urls = [...new Set(text.match(/https:\/\/github\.com\/[^/\s]+\/[^/\s]+\/issues\/\d+/g) ?? [])];
55
+ // An empty file is a fresh seen list. Text with no URL in it is more likely
56
+ // the wrong file or the wrong format, and would otherwise exclude nothing
57
+ // without a word.
58
+ if (urls.length === 0 && text.trim() !== '') {
59
+ warn(MODULE, `--exclude-file "${path}" has content but no GitHub issue URLs; nothing is excluded`);
60
+ }
61
+ return urls;
62
+ }
35
63
  /**
36
64
  * Parse and validate a comma-separated `--strategy` value into scout strategies.
37
65
  *
@@ -152,7 +180,7 @@ export async function runSearch(options) {
152
180
  // silent no-op and discovery recycles the merged-PR repos every run. Fails
153
181
  // soft, so a GitHub hiccup never blocks the search.
154
182
  await refreshStarredReposIfStale(stateManager);
155
- const scout = await createAutopilotScout(bridgeDiagnostics);
183
+ const scout = await createAutopilotScout(bridgeDiagnostics, options.excludeUrls);
156
184
  // Derive personalization from local history (#1244). `computeStrategy`
157
185
  // returns null below the merged-PR floor — in that case we pass nothing
158
186
  // and scout falls back to the bridge-built preferences, which derive the
@@ -260,6 +288,7 @@ export async function runSearch(options) {
260
288
  reasonsToApprove: c.reasonsToApprove,
261
289
  reasonsToSkip: c.reasonsToSkip,
262
290
  searchPriority: c.searchPriority,
291
+ ...(c.complexityUnlocked && { complexityUnlocked: true }),
263
292
  viabilityScore: sanitizeViabilityScore(c.viabilityScore),
264
293
  grade,
265
294
  repoScore: repoScoreRecord
@@ -22,6 +22,12 @@ function parseNonNegativeInt(value, settingName) {
22
22
  }
23
23
  return parsed;
24
24
  }
25
+ function parseComplexIssues(value) {
26
+ if (value !== 'off' && value !== 'warm') {
27
+ throw new ValidationError(`Invalid value for complexIssues: "${value}". Must be "off" or "warm".`);
28
+ }
29
+ return value;
30
+ }
25
31
  /**
26
32
  * Interactive setup wizard or direct setting application.
27
33
  *
@@ -348,6 +354,12 @@ export async function runSetup(options) {
348
354
  results[key] = String(threshold);
349
355
  break;
350
356
  }
357
+ case 'complexIssues': {
358
+ const mode = parseComplexIssues(value);
359
+ stateManager.updateConfig({ complexIssues: mode });
360
+ results[key] = mode;
361
+ break;
362
+ }
351
363
  case 'healthCheckFreshnessMinutes': {
352
364
  const minutes = parsePositiveInt(value, 'healthCheckFreshnessMinutes');
353
365
  stateManager.updateConfig({ healthCheckFreshnessMinutes: minutes });
@@ -227,6 +227,7 @@ export async function runVetList(options = {}) {
227
227
  recommendation: reconcileRecommendation(candidate.recommendation, grade),
228
228
  reasonsToApprove: candidate.reasonsToApprove,
229
229
  reasonsToSkip: candidate.reasonsToSkip,
230
+ ...(candidate.complexityUnlocked && { complexityUnlocked: true }),
230
231
  projectHealth: candidate.projectHealth,
231
232
  vettingResult: candidate.vettingResult,
232
233
  antiLLMPolicy: candidate.antiLLMPolicy,
@@ -42,6 +42,7 @@ export async function runVet(options) {
42
42
  recommendation: reconcileRecommendation(candidate.recommendation, grade),
43
43
  reasonsToApprove: candidate.reasonsToApprove,
44
44
  reasonsToSkip: candidate.reasonsToSkip,
45
+ ...(candidate.complexityUnlocked && { complexityUnlocked: true }),
45
46
  projectHealth: candidate.projectHealth,
46
47
  vettingResult: candidate.vettingResult,
47
48
  antiLLMPolicy: candidate.antiLLMPolicy,
@@ -104,6 +104,12 @@ export const CONFIG_KEY_REGISTRY = [
104
104
  settableVia: 'setup',
105
105
  valueHint: 'non-negative integer (0 disables)',
106
106
  },
107
+ {
108
+ key: 'complexIssues',
109
+ 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
+ settableVia: 'setup',
111
+ valueHint: 'off|warm',
112
+ },
107
113
  {
108
114
  key: 'minRepoScoreThreshold',
109
115
  description: 'Minimum repo maintainer-health score required for discovery (0–10).',
@@ -319,6 +319,7 @@ export declare const AgentConfigSchema: z.ZodPipe<z.ZodObject<{
319
319
  approachingDormantDays: z.ZodDefault<z.ZodNumber>;
320
320
  maxIssueAgeDays: z.ZodDefault<z.ZodNumber>;
321
321
  skipBroadWhenSufficientResults: z.ZodDefault<z.ZodNumber>;
322
+ complexIssues: z.ZodDefault<z.ZodCustom<"off" | (string & {}) | "warm", "off" | (string & {}) | "warm">>;
322
323
  languages: z.ZodDefault<z.ZodArray<z.ZodString>>;
323
324
  labels: z.ZodDefault<z.ZodArray<z.ZodString>>;
324
325
  scope: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -389,6 +390,7 @@ export declare const AgentConfigSchema: z.ZodPipe<z.ZodObject<{
389
390
  approachingDormantDays: number;
390
391
  maxIssueAgeDays: number;
391
392
  skipBroadWhenSufficientResults: number;
393
+ complexIssues: "off" | (string & {}) | "warm";
392
394
  languages: string[];
393
395
  labels: string[];
394
396
  excludeRepos: string[];
@@ -441,6 +443,7 @@ export declare const AgentConfigSchema: z.ZodPipe<z.ZodObject<{
441
443
  approachingDormantDays: number;
442
444
  maxIssueAgeDays: number;
443
445
  skipBroadWhenSufficientResults: number;
446
+ complexIssues: "off" | (string & {}) | "warm";
444
447
  languages: string[];
445
448
  labels: string[];
446
449
  excludeRepos: string[];
@@ -747,6 +750,7 @@ export declare const AgentStateSchema: z.ZodObject<{
747
750
  approachingDormantDays: z.ZodDefault<z.ZodNumber>;
748
751
  maxIssueAgeDays: z.ZodDefault<z.ZodNumber>;
749
752
  skipBroadWhenSufficientResults: z.ZodDefault<z.ZodNumber>;
753
+ complexIssues: z.ZodDefault<z.ZodCustom<"off" | (string & {}) | "warm", "off" | (string & {}) | "warm">>;
750
754
  languages: z.ZodDefault<z.ZodArray<z.ZodString>>;
751
755
  labels: z.ZodDefault<z.ZodArray<z.ZodString>>;
752
756
  scope: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -817,6 +821,7 @@ export declare const AgentStateSchema: z.ZodObject<{
817
821
  approachingDormantDays: number;
818
822
  maxIssueAgeDays: number;
819
823
  skipBroadWhenSufficientResults: number;
824
+ complexIssues: "off" | (string & {}) | "warm";
820
825
  languages: string[];
821
826
  labels: string[];
822
827
  excludeRepos: string[];
@@ -869,6 +874,7 @@ export declare const AgentStateSchema: z.ZodObject<{
869
874
  approachingDormantDays: number;
870
875
  maxIssueAgeDays: number;
871
876
  skipBroadWhenSufficientResults: number;
877
+ complexIssues: "off" | (string & {}) | "warm";
872
878
  languages: string[];
873
879
  labels: string[];
874
880
  excludeRepos: string[];
@@ -298,6 +298,12 @@ export const AgentConfigSchema = z
298
298
  // found (0 disables — broad always runs). Affinity/starred-repo candidates do
299
299
  // not count, so the broad phase still surfaces repos you haven't touched.
300
300
  skipBroadWhenSufficientResults: z.number().min(0).default(8),
301
+ // Passed to scout as its `complexIssues` preference. "warm" relaxes vetting
302
+ // in repos the user already has a merged PR in, so larger and
303
+ // maintainer-filed issues surface there. "off" keeps one rule set everywhere.
304
+ // Open enum: a later release may add a mode, and this one must still load
305
+ // the shared state. Anything but "warm" reads as off (scout-bridge.ts).
306
+ complexIssues: openEnum(['off', 'warm']).default('off'),
301
307
  languages: z.array(z.string()).default(['typescript', 'javascript']),
302
308
  labels: z.array(z.string()).default(['good first issue', 'help wanted']),
303
309
  scope: z.array(IssueScopeSchema).optional(),
@@ -937,6 +937,7 @@ export declare const SearchOutputSchema: z.ZodObject<{
937
937
  preferred_org: "preferred_org";
938
938
  starred: "starred";
939
939
  }>;
940
+ complexityUnlocked: z.ZodOptional<z.ZodLiteral<true>>;
940
941
  viabilityScore: z.ZodNumber;
941
942
  grade: z.ZodObject<{
942
943
  score: z.ZodNumber;
@@ -994,6 +995,7 @@ export declare const FeaturesOutputSchema: z.ZodObject<{
994
995
  preferred_org: "preferred_org";
995
996
  starred: "starred";
996
997
  }>;
998
+ complexityUnlocked: z.ZodOptional<z.ZodLiteral<true>>;
997
999
  viabilityScore: z.ZodNumber;
998
1000
  grade: z.ZodObject<{
999
1001
  score: z.ZodNumber;
@@ -1047,6 +1049,7 @@ export declare const FeaturesOutputSchema: z.ZodObject<{
1047
1049
  preferred_org: "preferred_org";
1048
1050
  starred: "starred";
1049
1051
  }>;
1052
+ complexityUnlocked: z.ZodOptional<z.ZodLiteral<true>>;
1050
1053
  viabilityScore: z.ZodNumber;
1051
1054
  grade: z.ZodObject<{
1052
1055
  score: z.ZodNumber;
@@ -1643,6 +1646,8 @@ export interface SearchCandidate {
1643
1646
  reasonsToApprove: string[];
1644
1647
  reasonsToSkip: string[];
1645
1648
  searchPriority: SearchPriority;
1649
+ /** Set when the `complexIssues` setting unlocked this repo: size is not a reason to pass on the issue. */
1650
+ complexityUnlocked?: true;
1646
1651
  /** 0-100 scale composite viability score. Sanitized on the boundary (#1043): out-of-contract values are coerced to 0 and logged. */
1647
1652
  viabilityScore: number;
1648
1653
  /**
@@ -1924,6 +1929,8 @@ export interface VetOutput {
1924
1929
  recommendation: 'approve' | 'skip' | 'needs_review';
1925
1930
  reasonsToApprove: string[];
1926
1931
  reasonsToSkip: string[];
1932
+ /** Set when the `complexIssues` setting unlocked this repo: size is not a reason to pass on the issue. */
1933
+ complexityUnlocked?: true;
1927
1934
  projectHealth: unknown;
1928
1935
  vettingResult: unknown;
1929
1936
  /**
@@ -443,6 +443,7 @@ const SearchCandidateSchema = z.object({
443
443
  reasonsToApprove: z.array(z.string()),
444
444
  reasonsToSkip: z.array(z.string()),
445
445
  searchPriority: SearchPrioritySchema,
446
+ complexityUnlocked: z.literal(true).optional(),
446
447
  viabilityScore: z.number(),
447
448
  grade: z.object({
448
449
  score: z.number().min(1).max(10),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "3.40.2",
3
+ "version": "3.42.0",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -55,7 +55,7 @@
55
55
  "@octokit/plugin-retry": "^8.1.1",
56
56
  "@octokit/plugin-throttling": "^11.0.5",
57
57
  "@octokit/rest": "^22.0.1",
58
- "@oss-scout/core": "^1.12.0",
58
+ "@oss-scout/core": "^1.14.0",
59
59
  "commander": "^15.0.0",
60
60
  "zod": "^4.6.7"
61
61
  },