@oss-autopilot/core 0.42.1 → 0.42.3

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.
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Shared test factories for oss-autopilot.
3
+ *
4
+ * Centralises mock object construction so that when types gain new required
5
+ * fields we only update one place. Every factory accepts a `Partial<T>`
6
+ * override bag — callers only specify the fields relevant to their test.
7
+ */
8
+ // ---------------------------------------------------------------------------
9
+ // FetchedPR
10
+ // ---------------------------------------------------------------------------
11
+ export function makeFetchedPR(overrides = {}) {
12
+ const repo = overrides.repo ?? 'owner/repo';
13
+ const number = overrides.number ?? 1;
14
+ return {
15
+ id: 1,
16
+ url: `https://github.com/${repo}/pull/${number}`,
17
+ repo,
18
+ number,
19
+ title: 'Test PR',
20
+ status: 'healthy',
21
+ displayLabel: '[Healthy]',
22
+ displayDescription: 'Everything looks good',
23
+ createdAt: '2025-06-01T00:00:00Z',
24
+ updatedAt: '2025-06-15T00:00:00Z',
25
+ daysSinceActivity: 2,
26
+ ciStatus: 'passing',
27
+ failingCheckNames: [],
28
+ classifiedChecks: [],
29
+ hasMergeConflict: false,
30
+ reviewDecision: 'approved',
31
+ hasUnrespondedComment: false,
32
+ hasIncompleteChecklist: false,
33
+ maintainerActionHints: [],
34
+ ...overrides,
35
+ };
36
+ }
37
+ // ---------------------------------------------------------------------------
38
+ // DailyDigest
39
+ // ---------------------------------------------------------------------------
40
+ export function makeDailyDigest(overrides = {}) {
41
+ return {
42
+ generatedAt: '2025-06-20T00:00:00Z',
43
+ openPRs: [],
44
+ prsNeedingResponse: [],
45
+ ciFailingPRs: [],
46
+ ciBlockedPRs: [],
47
+ ciNotRunningPRs: [],
48
+ mergeConflictPRs: [],
49
+ needsRebasePRs: [],
50
+ missingRequiredFilesPRs: [],
51
+ incompleteChecklistPRs: [],
52
+ needsChangesPRs: [],
53
+ changesAddressedPRs: [],
54
+ waitingOnMaintainerPRs: [],
55
+ approachingDormant: [],
56
+ dormantPRs: [],
57
+ healthyPRs: [],
58
+ recentlyClosedPRs: [],
59
+ recentlyMergedPRs: [],
60
+ shelvedPRs: [],
61
+ autoUnshelvedPRs: [],
62
+ summary: {
63
+ totalActivePRs: 0,
64
+ totalNeedingAttention: 0,
65
+ totalMergedAllTime: 0,
66
+ mergeRate: 0,
67
+ },
68
+ ...overrides,
69
+ };
70
+ }
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
+ // CapacityAssessment
87
+ // ---------------------------------------------------------------------------
88
+ export function makeCapacityAssessment(overrides = {}) {
89
+ return {
90
+ hasCapacity: true,
91
+ activePRCount: 3,
92
+ maxActivePRs: 10,
93
+ shelvedPRCount: 0,
94
+ criticalIssueCount: 0,
95
+ reason: 'You have capacity',
96
+ ...overrides,
97
+ };
98
+ }
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
+ }
@@ -451,7 +451,7 @@ export interface AgentConfig {
451
451
  aiPolicyBlocklist?: string[];
452
452
  /** PR URLs manually shelved by the user. Shelved PRs are excluded from capacity and actionable issues. Auto-unshelved when maintainers engage. */
453
453
  shelvedPRUrls?: string[];
454
- /** Issue URLs dismissed by the user, mapped to ISO timestamp of when dismissed. Issues with new responses after the dismiss timestamp resurface automatically. */
454
+ /** Issue/PR URLs dismissed by the user, mapped to ISO timestamp of when dismissed. Issues with new responses after the dismiss timestamp resurface automatically. Named dismissedIssues for state backward compatibility (#416). */
455
455
  dismissedIssues?: Record<string, string>;
456
456
  /** PR URLs with snoozed CI failures, mapped to snooze metadata. Snoozed PRs are excluded from actionable CI failure list until expiry. */
457
457
  snoozedPRs?: Record<string, SnoozeInfo>;
@@ -108,7 +108,6 @@ export interface CompactRepoGroup {
108
108
  }
109
109
  export interface DailyOutput {
110
110
  digest: DailyDigestCompact;
111
- updates: unknown[];
112
111
  capacity: CapacityAssessment;
113
112
  summary: string;
114
113
  briefSummary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "0.42.1",
3
+ "version": "0.42.3",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {