@oss-autopilot/core 0.44.1 → 0.44.2
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.
- package/dist/cli-registry.d.ts +2 -1
- package/dist/cli.bundle.cjs.map +3 -3
- package/dist/core/ci-analysis.d.ts +3 -17
- package/dist/core/ci-analysis.js +3 -3
- package/dist/core/github-stats.d.ts +0 -20
- package/dist/core/github-stats.js +1 -1
- package/dist/core/github.js +2 -2
- package/dist/core/http-cache.d.ts +0 -2
- package/dist/core/http-cache.js +0 -4
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/test-utils.d.ts +1 -3
- package/dist/core/test-utils.js +0 -41
- package/package.json +1 -1
|
@@ -3,21 +3,6 @@
|
|
|
3
3
|
* Extracted from PRMonitor to isolate CI-related logic (#263).
|
|
4
4
|
*/
|
|
5
5
|
import { CIFailureCategory, ClassifiedCheck, CIStatusResult } from './types.js';
|
|
6
|
-
/**
|
|
7
|
-
* Known CI check name patterns that indicate fork limitations rather than real failures (#81).
|
|
8
|
-
* These are deployment/preview services that require repo-level secrets unavailable in forks.
|
|
9
|
-
*/
|
|
10
|
-
export declare const FORK_LIMITATION_PATTERNS: RegExp[];
|
|
11
|
-
/**
|
|
12
|
-
* Known CI check name patterns that indicate authorization gates (#81).
|
|
13
|
-
* These require maintainer approval and are not real failures.
|
|
14
|
-
*/
|
|
15
|
-
export declare const AUTH_GATE_PATTERNS: RegExp[];
|
|
16
|
-
/**
|
|
17
|
-
* Known CI check name patterns that indicate infrastructure/transient failures (#145).
|
|
18
|
-
* These are runner issues, dependency install problems, or service outages — not code failures.
|
|
19
|
-
*/
|
|
20
|
-
export declare const INFRASTRUCTURE_PATTERNS: RegExp[];
|
|
21
6
|
/**
|
|
22
7
|
* Classify a failing CI check as actionable, fork_limitation, auth_gate, or infrastructure (#81, #145).
|
|
23
8
|
* Default is 'actionable' — only known patterns get reclassified.
|
|
@@ -45,7 +30,7 @@ export declare function analyzeCheckRuns(checkRuns: Array<{
|
|
|
45
30
|
failingCheckConclusions: Map<string, string>;
|
|
46
31
|
};
|
|
47
32
|
/** Result shape from analyzeCheckRuns, used by mergeStatuses. */
|
|
48
|
-
|
|
33
|
+
interface CheckRunAnalysis {
|
|
49
34
|
hasFailingChecks: boolean;
|
|
50
35
|
hasPendingChecks: boolean;
|
|
51
36
|
hasSuccessfulChecks: boolean;
|
|
@@ -53,7 +38,7 @@ export interface CheckRunAnalysis {
|
|
|
53
38
|
failingCheckConclusions: Map<string, string>;
|
|
54
39
|
}
|
|
55
40
|
/** Result shape from analyzeCombinedStatus, used by mergeStatuses. */
|
|
56
|
-
|
|
41
|
+
interface CombinedStatusAnalysis {
|
|
57
42
|
effectiveCombinedState: string;
|
|
58
43
|
hasStatuses: boolean;
|
|
59
44
|
failingStatusNames: string[];
|
|
@@ -76,3 +61,4 @@ export declare function analyzeCombinedStatus(combinedStatus: {
|
|
|
76
61
|
* Priority: failing > pending > passing > unknown.
|
|
77
62
|
*/
|
|
78
63
|
export declare function mergeStatuses(checkRunAnalysis: CheckRunAnalysis, combinedAnalysis: CombinedStatusAnalysis, checkRunCount: number): CIStatusResult;
|
|
64
|
+
export {};
|
package/dist/core/ci-analysis.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Known CI check name patterns that indicate fork limitations rather than real failures (#81).
|
|
7
7
|
* These are deployment/preview services that require repo-level secrets unavailable in forks.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
const FORK_LIMITATION_PATTERNS = [
|
|
10
10
|
/vercel/i,
|
|
11
11
|
/netlify/i,
|
|
12
12
|
/\bpreview\s*deploy/i,
|
|
@@ -20,12 +20,12 @@ export const FORK_LIMITATION_PATTERNS = [
|
|
|
20
20
|
* Known CI check name patterns that indicate authorization gates (#81).
|
|
21
21
|
* These require maintainer approval and are not real failures.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
const AUTH_GATE_PATTERNS = [/authoriz/i, /approval/i, /\bcla\b/i, /license\/cla/i];
|
|
24
24
|
/**
|
|
25
25
|
* Known CI check name patterns that indicate infrastructure/transient failures (#145).
|
|
26
26
|
* These are runner issues, dependency install problems, or service outages — not code failures.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
const INFRASTRUCTURE_PATTERNS = [
|
|
29
29
|
/\binstall\s*(os\s*)?dep(endenc|s\b)/i,
|
|
30
30
|
/\bsetup\s+fail(ed|ure)?\b/i,
|
|
31
31
|
/\bservice\s*unavailable/i,
|
|
@@ -28,26 +28,6 @@ export declare function fetchUserMergedPRCounts(octokit: Octokit, githubUsername
|
|
|
28
28
|
* Used to populate closedWithoutMergeCount in repo scores for accurate merge rate.
|
|
29
29
|
*/
|
|
30
30
|
export declare function fetchUserClosedPRCounts(octokit: Octokit, githubUsername: string): Promise<PRCountsResult<number>>;
|
|
31
|
-
/**
|
|
32
|
-
* Shared helper: search for recent PRs and filter out own repos, excluded repos/orgs.
|
|
33
|
-
* Returns parsed search results that pass all filters.
|
|
34
|
-
*/
|
|
35
|
-
export declare function fetchRecentPRs<T>(octokit: Octokit, config: {
|
|
36
|
-
githubUsername: string;
|
|
37
|
-
excludeRepos: string[];
|
|
38
|
-
excludeOrgs?: string[];
|
|
39
|
-
}, query: string, label: string, days: number, mapItem: (item: {
|
|
40
|
-
html_url: string;
|
|
41
|
-
title: string;
|
|
42
|
-
closed_at: string | null;
|
|
43
|
-
pull_request?: {
|
|
44
|
-
merged_at?: string | null;
|
|
45
|
-
};
|
|
46
|
-
}, parsed: {
|
|
47
|
-
owner: string;
|
|
48
|
-
repo: string;
|
|
49
|
-
number: number;
|
|
50
|
-
}) => T): Promise<T[]>;
|
|
51
31
|
/**
|
|
52
32
|
* Fetch PRs closed without merge in the last N days.
|
|
53
33
|
* Returns lightweight ClosedPR objects for surfacing in the daily digest.
|
|
@@ -168,7 +168,7 @@ export function fetchUserClosedPRCounts(octokit, githubUsername) {
|
|
|
168
168
|
* Shared helper: search for recent PRs and filter out own repos, excluded repos/orgs.
|
|
169
169
|
* Returns parsed search results that pass all filters.
|
|
170
170
|
*/
|
|
171
|
-
|
|
171
|
+
async function fetchRecentPRs(octokit, config, query, label, days, mapItem) {
|
|
172
172
|
if (!config.githubUsername) {
|
|
173
173
|
warn(MODULE, `Skipping recently ${label} PRs fetch: no githubUsername configured. Run /setup-oss to configure.`);
|
|
174
174
|
return [];
|
package/dist/core/github.js
CHANGED
|
@@ -19,7 +19,7 @@ export function getOctokit(token) {
|
|
|
19
19
|
_octokit = new ThrottledOctokit({
|
|
20
20
|
auth: token,
|
|
21
21
|
throttle: {
|
|
22
|
-
onRateLimit: (retryAfter, options,
|
|
22
|
+
onRateLimit: (retryAfter, options, _octokit, retryCount) => {
|
|
23
23
|
const opts = options;
|
|
24
24
|
const resetAt = new Date(Date.now() + retryAfter * 1000);
|
|
25
25
|
if (retryCount < 2) {
|
|
@@ -29,7 +29,7 @@ export function getOctokit(token) {
|
|
|
29
29
|
warn(MODULE, `Rate limit exceeded, not retrying — ${opts.method} ${opts.url} (resets at ${formatResetTime(resetAt)})`);
|
|
30
30
|
return false;
|
|
31
31
|
},
|
|
32
|
-
onSecondaryRateLimit: (retryAfter, options,
|
|
32
|
+
onSecondaryRateLimit: (retryAfter, options, _octokit, retryCount) => {
|
|
33
33
|
const opts = options;
|
|
34
34
|
const resetAt = new Date(Date.now() + retryAfter * 1000);
|
|
35
35
|
if (retryCount < 1) {
|
|
@@ -78,8 +78,6 @@ export declare class HttpCache {
|
|
|
78
78
|
* The singleton is lazily initialized on first access.
|
|
79
79
|
*/
|
|
80
80
|
export declare function getHttpCache(): HttpCache;
|
|
81
|
-
/** Reset the singleton (for tests). */
|
|
82
|
-
export declare function resetHttpCache(): void;
|
|
83
81
|
/**
|
|
84
82
|
* Wraps an Octokit `repos.get`-style call with ETag caching and request
|
|
85
83
|
* deduplication.
|
package/dist/core/http-cache.js
CHANGED
|
@@ -204,10 +204,6 @@ export function getHttpCache() {
|
|
|
204
204
|
}
|
|
205
205
|
return _httpCache;
|
|
206
206
|
}
|
|
207
|
-
/** Reset the singleton (for tests). */
|
|
208
|
-
export function resetHttpCache() {
|
|
209
|
-
_httpCache = null;
|
|
210
|
-
}
|
|
211
207
|
// ---------------------------------------------------------------------------
|
|
212
208
|
// Octokit integration helpers
|
|
213
209
|
// ---------------------------------------------------------------------------
|
package/dist/core/index.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export { getOctokit, checkRateLimit, type RateLimitInfo } from './github.js';
|
|
|
11
11
|
export { parseGitHubUrl, daysBetween, splitRepo, isOwnRepo, getCLIVersion, getDataDir, getStatePath, getBackupDir, getCacheDir, getDashboardPath, formatRelativeTime, byDateDescending, getGitHubToken, getGitHubTokenAsync, requireGitHubToken, resetGitHubTokenCache, } from './utils.js';
|
|
12
12
|
export { OssAutopilotError, ConfigurationError, ValidationError, errorMessage, getHttpStatusCode } from './errors.js';
|
|
13
13
|
export { enableDebug, isDebugEnabled, debug, info, warn, timed } from './logger.js';
|
|
14
|
-
export { HttpCache, getHttpCache,
|
|
14
|
+
export { HttpCache, getHttpCache, cachedRequest, type CacheEntry } from './http-cache.js';
|
|
15
15
|
export { CRITICAL_STATUSES, computeRepoSignals, groupPRsByRepo, assessCapacity, collectActionableIssues, computeActionMenu, toShelvedPRRef, formatActionHint, formatBriefSummary, formatSummary, printDigest, } from './daily-logic.js';
|
|
16
16
|
export * from './types.js';
|
package/dist/core/index.js
CHANGED
|
@@ -11,6 +11,6 @@ export { getOctokit, checkRateLimit } from './github.js';
|
|
|
11
11
|
export { parseGitHubUrl, daysBetween, splitRepo, isOwnRepo, getCLIVersion, getDataDir, getStatePath, getBackupDir, getCacheDir, getDashboardPath, formatRelativeTime, byDateDescending, getGitHubToken, getGitHubTokenAsync, requireGitHubToken, resetGitHubTokenCache, } from './utils.js';
|
|
12
12
|
export { OssAutopilotError, ConfigurationError, ValidationError, errorMessage, getHttpStatusCode } from './errors.js';
|
|
13
13
|
export { enableDebug, isDebugEnabled, debug, info, warn, timed } from './logger.js';
|
|
14
|
-
export { HttpCache, getHttpCache,
|
|
14
|
+
export { HttpCache, getHttpCache, cachedRequest } from './http-cache.js';
|
|
15
15
|
export { CRITICAL_STATUSES, computeRepoSignals, groupPRsByRepo, assessCapacity, collectActionableIssues, computeActionMenu, toShelvedPRRef, formatActionHint, formatBriefSummary, formatSummary, printDigest, } from './daily-logic.js';
|
|
16
16
|
export * from './types.js';
|
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
* fields we only update one place. Every factory accepts a `Partial<T>`
|
|
6
6
|
* override bag — callers only specify the fields relevant to their test.
|
|
7
7
|
*/
|
|
8
|
-
import type { FetchedPR, DailyDigest
|
|
8
|
+
import type { FetchedPR, DailyDigest } from './types.js';
|
|
9
9
|
import type { CapacityAssessment } from '../formatters/json.js';
|
|
10
10
|
export declare function makeFetchedPR(overrides?: Partial<FetchedPR>): FetchedPR;
|
|
11
11
|
export declare function makeDailyDigest(overrides?: Partial<DailyDigest>): DailyDigest;
|
|
12
|
-
export declare function makeShelvedPRRef(overrides?: Partial<ShelvedPRRef>): ShelvedPRRef;
|
|
13
12
|
export declare function makeCapacityAssessment(overrides?: Partial<CapacityAssessment>): CapacityAssessment;
|
|
14
|
-
export declare function makeAgentState(overrides?: Partial<AgentState>): AgentState;
|
package/dist/core/test-utils.js
CHANGED
|
@@ -69,20 +69,6 @@ export function makeDailyDigest(overrides = {}) {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
// ---------------------------------------------------------------------------
|
|
72
|
-
// ShelvedPRRef
|
|
73
|
-
// ---------------------------------------------------------------------------
|
|
74
|
-
export function makeShelvedPRRef(overrides = {}) {
|
|
75
|
-
return {
|
|
76
|
-
number: 1,
|
|
77
|
-
url: 'https://github.com/owner/repo/pull/1',
|
|
78
|
-
title: 'Shelved PR',
|
|
79
|
-
repo: 'owner/repo',
|
|
80
|
-
daysSinceActivity: 45,
|
|
81
|
-
status: 'healthy',
|
|
82
|
-
...overrides,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
// ---------------------------------------------------------------------------
|
|
86
72
|
// CapacityAssessment
|
|
87
73
|
// ---------------------------------------------------------------------------
|
|
88
74
|
export function makeCapacityAssessment(overrides = {}) {
|
|
@@ -96,30 +82,3 @@ export function makeCapacityAssessment(overrides = {}) {
|
|
|
96
82
|
...overrides,
|
|
97
83
|
};
|
|
98
84
|
}
|
|
99
|
-
// ---------------------------------------------------------------------------
|
|
100
|
-
// AgentState (partial — for tests that need a state object)
|
|
101
|
-
// ---------------------------------------------------------------------------
|
|
102
|
-
export function makeAgentState(overrides = {}) {
|
|
103
|
-
return {
|
|
104
|
-
version: 2,
|
|
105
|
-
repoScores: {},
|
|
106
|
-
config: {
|
|
107
|
-
setupComplete: false,
|
|
108
|
-
githubUsername: 'testuser',
|
|
109
|
-
excludeRepos: [],
|
|
110
|
-
maxActivePRs: 10,
|
|
111
|
-
dormantThresholdDays: 30,
|
|
112
|
-
approachingDormantDays: 25,
|
|
113
|
-
maxIssueAgeDays: 90,
|
|
114
|
-
languages: [],
|
|
115
|
-
labels: [],
|
|
116
|
-
trustedProjects: [],
|
|
117
|
-
minRepoScoreThreshold: 4,
|
|
118
|
-
starredRepos: [],
|
|
119
|
-
},
|
|
120
|
-
events: [],
|
|
121
|
-
lastRunAt: '2025-06-20T00:00:00Z',
|
|
122
|
-
activeIssues: [],
|
|
123
|
-
...overrides,
|
|
124
|
-
};
|
|
125
|
-
}
|