@oss-autopilot/core 3.9.0 → 3.10.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.
@@ -5,7 +5,8 @@
5
5
  import { buildCandidateLinkedPR, createAutopilotScout } from './scout-bridge.js';
6
6
  import { getStateManager } from '../core/index.js';
7
7
  import { gradeFromCandidate } from '../core/issue-grading.js';
8
- import { warn } from '../core/logger.js';
8
+ import { computeStrategy } from '../core/strategy.js';
9
+ import { debug, warn } from '../core/logger.js';
9
10
  const MODULE = 'search';
10
11
  /**
11
12
  * Hard cap on issue-search result count. Shared between CLI (`cli-registry.ts`),
@@ -46,8 +47,23 @@ function sanitizeViabilityScore(raw) {
46
47
  }
47
48
  export async function runSearch(options) {
48
49
  const scout = await createAutopilotScout();
49
- const result = await scout.search({ maxResults: options.maxResults });
50
50
  const stateManager = getStateManager();
51
+ // Derive personalization from local history (#1244). `computeStrategy`
52
+ // returns null below the merged-PR floor — in that case we pass nothing
53
+ // and scout's sort behaves exactly as before. Once strategy data is
54
+ // available, scout boosts language/repo matches into a separate sort
55
+ // tier (still no filtering).
56
+ const strategy = computeStrategy(stateManager.getState());
57
+ const preferLanguages = strategy?.recommendations.languages ?? undefined;
58
+ const preferRepos = strategy?.recommendations.repos ?? undefined;
59
+ if (preferLanguages?.length || preferRepos?.length) {
60
+ debug(MODULE, `Applying strategy bias to search: preferLanguages=${JSON.stringify(preferLanguages ?? [])}, preferRepos=${JSON.stringify(preferRepos ?? [])}`);
61
+ }
62
+ const result = await scout.search({
63
+ maxResults: options.maxResults,
64
+ preferLanguages,
65
+ preferRepos,
66
+ });
51
67
  const searchOutput = {
52
68
  candidates: result.candidates.map((c) => {
53
69
  const repoScoreRecord = stateManager.getRepoScore(c.issue.repo);
@@ -97,6 +113,8 @@ export async function runSearch(options) {
97
113
  }
98
114
  : undefined,
99
115
  ...(linkedPR ? { linkedPR } : {}),
116
+ ...(typeof c.boostScore === 'number' ? { boostScore: c.boostScore } : {}),
117
+ ...(c.boostReasons && c.boostReasons.length > 0 ? { boostReasons: c.boostReasons } : {}),
100
118
  };
101
119
  }),
102
120
  excludedRepos: result.excludedRepos,
@@ -620,6 +620,8 @@ export declare const SearchOutputSchema: z.ZodObject<{
620
620
  updatedAt: z.ZodOptional<z.ZodString>;
621
621
  isStalled: z.ZodBoolean;
622
622
  }, z.core.$strip>>;
623
+ boostScore: z.ZodOptional<z.ZodNumber>;
624
+ boostReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
623
625
  }, z.core.$strip>>;
624
626
  excludedRepos: z.ZodArray<z.ZodString>;
625
627
  aiPolicyBlocklist: z.ZodArray<z.ZodString>;
@@ -676,6 +678,8 @@ export declare const FeaturesOutputSchema: z.ZodObject<{
676
678
  updatedAt: z.ZodOptional<z.ZodString>;
677
679
  isStalled: z.ZodBoolean;
678
680
  }, z.core.$strip>>;
681
+ boostScore: z.ZodOptional<z.ZodNumber>;
682
+ boostReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
679
683
  horizon: z.ZodEnum<{
680
684
  "quick-win": "quick-win";
681
685
  "bigger-bet": "bigger-bet";
@@ -731,6 +735,8 @@ export declare const FeaturesOutputSchema: z.ZodObject<{
731
735
  updatedAt: z.ZodOptional<z.ZodString>;
732
736
  isStalled: z.ZodBoolean;
733
737
  }, z.core.$strip>>;
738
+ boostScore: z.ZodOptional<z.ZodNumber>;
739
+ boostReasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
734
740
  horizon: z.ZodEnum<{
735
741
  "quick-win": "quick-win";
736
742
  "bigger-bet": "bigger-bet";
@@ -335,6 +335,14 @@ const SearchCandidateSchema = z.object({
335
335
  })
336
336
  .optional(),
337
337
  linkedPR: CandidateLinkedPRSchema.optional(),
338
+ /**
339
+ * Personalization sort-tier signal threaded up from oss-scout (#1244).
340
+ * Present only when local strategy data biased the search and this
341
+ * candidate matched. `boostReasons` is the human-readable explanation
342
+ * (e.g. `"repo affinity: vercel/next.js"`, `"language match: TypeScript"`).
343
+ */
344
+ boostScore: z.number().optional(),
345
+ boostReasons: z.array(z.string()).optional(),
338
346
  });
339
347
  export const SearchOutputSchema = z.object({
340
348
  candidates: z.array(SearchCandidateSchema),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "3.9.0",
3
+ "version": "3.10.0",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -54,7 +54,7 @@
54
54
  "dependencies": {
55
55
  "@octokit/plugin-throttling": "^11.0.3",
56
56
  "@octokit/rest": "^22.0.1",
57
- "@oss-scout/core": "^0.9.0",
57
+ "@oss-scout/core": "^0.10.0",
58
58
  "commander": "^14.0.3",
59
59
  "zod": "^4.4.3"
60
60
  },