@oss-autopilot/core 0.44.15 → 0.44.17

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.
@@ -198,7 +198,7 @@ async function updateRepoScores(prMonitor, prs, mergedCounts, closedCounts) {
198
198
  }
199
199
  catch (error) {
200
200
  warn(MODULE, `Failed to fetch repo star counts: ${errorMessage(error)}`);
201
- warn(MODULE, 'Dashboard minStars filter will use cached star counts (or be skipped for repos without cached data).');
201
+ warn(MODULE, 'Repos without cached star data will be excluded from stats until star counts are fetched on the next successful run.');
202
202
  starCounts = new Map();
203
203
  }
204
204
  let starUpdateFailures = 0;
@@ -7,9 +7,9 @@ import { getStateManager, PRMonitor, IssueConversationMonitor } from '../core/in
7
7
  import { errorMessage, isRateLimitOrAuthError } from '../core/errors.js';
8
8
  import { warn } from '../core/logger.js';
9
9
  import { emptyPRCountsResult } from '../core/github-stats.js';
10
+ import { isBelowMinStars, } from '../core/types.js';
10
11
  import { toShelvedPRRef, buildStarFilter } from './daily.js';
11
12
  const MODULE = 'dashboard-data';
12
- import { isBelowMinStars, } from '../core/types.js';
13
13
  export function buildDashboardStats(digest, state) {
14
14
  const summary = digest.summary || {
15
15
  totalActivePRs: 0,
@@ -17,11 +17,12 @@ export function buildDashboardStats(digest, state) {
17
17
  mergeRate: 0,
18
18
  totalNeedingAttention: 0,
19
19
  };
20
+ const minStars = state.config.minStars ?? 50;
20
21
  return {
21
22
  activePRs: summary.totalActivePRs,
22
23
  shelvedPRs: (digest.shelvedPRs || []).length,
23
24
  mergedPRs: summary.totalMergedAllTime,
24
- closedPRs: Object.values(state.repoScores || {}).reduce((sum, s) => sum + (s.closedWithoutMergeCount || 0), 0),
25
+ closedPRs: Object.values(state.repoScores || {}).reduce((sum, s) => sum + (isBelowMinStars(s.stargazersCount, minStars) ? 0 : s.closedWithoutMergeCount || 0), 0),
25
26
  mergeRate: `${(summary.mergeRate ?? 0).toFixed(1)}%`,
26
27
  };
27
28
  }
@@ -142,9 +142,8 @@ export function generateDashboardScripts(stats, monthlyMerged, monthlyClosed, mo
142
142
  if (exOrgs?.some((o) => o.toLowerCase() === repoLower.split('/')[0]))
143
143
  return true;
144
144
  const score = (state.repoScores || {})[repo];
145
- // Fail-open: repos without cached star data are shown (not excluded).
146
- // Unlike issue-discovery (fail-closed), the dashboard shows the user's own
147
- // contribution history — hiding repos just because a star fetch failed would be confusing.
145
+ // Fail-closed: repos without cached star data are excluded from charts.
146
+ // Star data is populated by the daily check; repos appear once stars are fetched.
148
147
  if (isBelowMinStars(score?.stargazersCount, starThreshold))
149
148
  return true;
150
149
  return false;
@@ -89,8 +89,7 @@ async function fetchUserPRCounts(octokit, githubUsername, query, label, accumula
89
89
  // Note: excludeRepos/excludeOrgs are intentionally NOT filtered here.
90
90
  // Those filters control issue discovery/search, not historical statistics.
91
91
  // Skip repos below the minimum star threshold (#576).
92
- // Repos with unknown star counts (not yet fetched) are included they'll be
93
- // filtered on the next run once star data is cached in repoScores.
92
+ // Repos with unknown star counts (not yet fetched) are also excluded (fail-closed).
94
93
  if (starFilter && isBelowMinStars(starFilter.knownStarCounts.get(repo), starFilter.minStars)) {
95
94
  continue;
96
95
  }
@@ -411,8 +411,7 @@ export interface StarFilter {
411
411
  }
412
412
  /**
413
413
  * Check if a repo should be excluded based on its star count.
414
- * Returns true if the repo is known to be below the threshold.
415
- * Repos with unknown star counts pass through (fail-open).
414
+ * Returns true if the repo is below the threshold or has unknown star count.
416
415
  */
417
416
  export declare function isBelowMinStars(stargazersCount: number | undefined, minStars: number): boolean;
418
417
  /** Manual status override for a PR, set via dashboard or CLI. Auto-clears when new activity is detected. */
@@ -3,11 +3,10 @@
3
3
  */
4
4
  /**
5
5
  * Check if a repo should be excluded based on its star count.
6
- * Returns true if the repo is known to be below the threshold.
7
- * Repos with unknown star counts pass through (fail-open).
6
+ * Returns true if the repo is below the threshold or has unknown star count.
8
7
  */
9
8
  export function isBelowMinStars(stargazersCount, minStars) {
10
- return stargazersCount !== undefined && stargazersCount < minStars;
9
+ return stargazersCount === undefined || stargazersCount < minStars;
11
10
  }
12
11
  /** Default configuration applied to new state files. All fields can be overridden via `/setup-oss`. */
13
12
  export const DEFAULT_CONFIG = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "0.44.15",
3
+ "version": "0.44.17",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {