@oss-scout/core 1.2.0 → 1.2.1

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.
@@ -42,6 +42,15 @@ const PHASE0_PER_PAGE = 30;
42
42
  * screens staleness, existing PRs, and claims downstream.
43
43
  */
44
44
  const CONTRIBUTED_REPO_MAX_AGE_DAYS = 365;
45
+ /**
46
+ * Cap on Phase 0's share of `maxResults`. Phase 0 (contributed repos) fetches
47
+ * deeply (`PHASE0_PER_PAGE`) and can otherwise fill the entire result budget,
48
+ * which makes the `allCandidates.length < maxResults` gate false for every
49
+ * later phase so starred (Phase 1) and broad (Phases 2/3) never run. Reserving
50
+ * half the budget for the other strategies keeps each search round varied
51
+ * instead of returning only contributed-repo results.
52
+ */
53
+ const PHASE0_MAX_SHARE = 0.5;
45
54
  /** Build a reusable filter function from config. */
46
55
  function buildIssueFilter(config) {
47
56
  return (items) => {
@@ -421,8 +430,19 @@ export class IssueDiscovery {
421
430
  break;
422
431
  }
423
432
  const phase0RepoSet = new Set(phase0Repos);
433
+ // Only cap Phase 0 when a later phase can actually consume the reserved
434
+ // budget — otherwise (no starred repos, broad/maintained disabled) the
435
+ // reservation would just shrink the result set with nothing to fill it.
436
+ const otherStrategiesCanRun = (starredRepos.length > 0 && enabledStrategies.has("starred")) ||
437
+ enabledStrategies.has("broad") ||
438
+ enabledStrategies.has("maintained");
424
439
  if (phase0Repos.length > 0 && enabledStrategies.has("merged")) {
425
- const remaining = maxResults - allCandidates.length;
440
+ // Cap Phase 0's share so it can't consume the whole budget and starve
441
+ // the starred/broad phases (which gate on allCandidates < maxResults).
442
+ const phase0Cap = otherStrategiesCanRun
443
+ ? Math.max(1, Math.ceil(maxResults * PHASE0_MAX_SHARE))
444
+ : maxResults;
445
+ const remaining = Math.min(maxResults - allCandidates.length, phase0Cap);
426
446
  if (remaining > 0) {
427
447
  const result = await runPhase0(this.octokit, this.vetter, phase0Repos, remaining, filterIssuesPhase0);
428
448
  recordPhaseResult("0", result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-scout/core",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Personalized GitHub issue finder with multi-strategy search, deep vetting, and viability scoring — CLI, library, MCP server, and Claude Code plugin",
5
5
  "type": "module",
6
6
  "bin": {