@oss-autopilot/core 3.25.0 → 3.26.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.
- package/dist/cli-registry.js +16 -0
- package/dist/cli.bundle.cjs +93 -93
- package/dist/commands/overnight.d.ts +63 -3
- package/dist/commands/overnight.js +121 -7
- package/dist/core/daily-logic.d.ts +8 -0
- package/dist/core/daily-logic.js +14 -1
- package/dist/core/state-schema.d.ts +35 -0
- package/dist/core/state-schema.js +14 -0
- package/dist/core/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { getStateManager } from '../core/index.js';
|
|
22
22
|
import type { PRCheckFailure } from '../core/pr-monitor.js';
|
|
23
|
-
import type { ActionableIssueType, OvernightPrepared } from '../core/types.js';
|
|
23
|
+
import type { ActionableIssueType, OvernightImplementAttempt, OvernightPrepared } from '../core/types.js';
|
|
24
24
|
import type { DailyOutput, DailyWarning, PendingLearnings } from '../formatters/json.js';
|
|
25
25
|
import type { AttentionSummary } from '../core/pr-attention.js';
|
|
26
26
|
/** One item in either bucket; which bucket is the array it lives in. */
|
|
@@ -43,12 +43,18 @@ export interface OvernightOutput {
|
|
|
43
43
|
warnings: DailyWarning[];
|
|
44
44
|
/** Branches carried over from an earlier run on the same date (a re-run never drops recorded work). */
|
|
45
45
|
carriedPrepared: number;
|
|
46
|
+
/**
|
|
47
|
+
* The one curated-list issue to implement tonight (#1715): first item of
|
|
48
|
+
* the list's Pursue tier whose repo has no open PR of yours and that no
|
|
49
|
+
* earlier run has attempted. Null when the list is absent or exhausted.
|
|
50
|
+
*/
|
|
51
|
+
implement: OvernightImplementItem | null;
|
|
46
52
|
/** Set when the run could not be pushed to the Gist; the local cache has it. */
|
|
47
53
|
gistSyncWarning?: string;
|
|
48
54
|
/** Repos whose merged-PR learnings the overnight run should extract (#1696); absent when none. */
|
|
49
55
|
pendingLearnings?: PendingLearnings;
|
|
50
56
|
}
|
|
51
|
-
type ReportBody = Pick<OvernightOutput, 'runAt' | 'prepare' | 'judgment' | 'attention' | 'failures' | 'warnings'>;
|
|
57
|
+
type ReportBody = Pick<OvernightOutput, 'runAt' | 'prepare' | 'judgment' | 'attention' | 'failures' | 'warnings' | 'implement'>;
|
|
52
58
|
/** Freshness block `startup` surfaces (#1574). */
|
|
53
59
|
export interface OvernightFreshness {
|
|
54
60
|
runAt: string;
|
|
@@ -63,8 +69,46 @@ export interface OvernightFreshness {
|
|
|
63
69
|
/** `local`: the file at `reportPath` is here. `gist`: only the published copy, read it with `overnight report`. */
|
|
64
70
|
reportAvailable: ReportAvailability;
|
|
65
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Languages whose test suites the headless allowlist can actually run: it
|
|
74
|
+
* grants node, pnpm and npm and nothing else (OVERNIGHT_ALLOWED_TOOLS). A
|
|
75
|
+
* preparer on a Rust or Python repo can diagnose but never reach "Verify", so
|
|
76
|
+
* two nights of that ended blocked (#1697). Repos with a known primary
|
|
77
|
+
* language outside this set go to judgment instead of burning a preparer;
|
|
78
|
+
* a repo whose language is unknown (never scored) is given the benefit of
|
|
79
|
+
* the doubt. GitHub's `language` names, case-insensitive.
|
|
80
|
+
*/
|
|
81
|
+
export declare const VERIFIABLE_LANGUAGES: string[];
|
|
82
|
+
/** Pure: null when the repo's suite can be run, else why not. */
|
|
83
|
+
export declare function toolchainSkipReason(language: string | null | undefined): string | null;
|
|
84
|
+
/** A curated-list issue picked for implementation (#1715). */
|
|
85
|
+
export interface OvernightImplementItem {
|
|
86
|
+
url: string;
|
|
87
|
+
repo: string;
|
|
88
|
+
number: number;
|
|
89
|
+
title: string;
|
|
90
|
+
/** Why this one: the tier it came from and the list path. */
|
|
91
|
+
reason: string;
|
|
92
|
+
}
|
|
93
|
+
/** The tier name the curated list uses for issues John already vetted and wants done. */
|
|
94
|
+
export declare const IMPLEMENT_TIER = "Pursue";
|
|
95
|
+
/**
|
|
96
|
+
* Pure: the one list issue to implement tonight, or null. First Pursue item
|
|
97
|
+
* (list order is the user's priority order) whose repo has no open PR of the
|
|
98
|
+
* user's (one PR per repo at a time keeps maintainers' review load sane and
|
|
99
|
+
* respects repos with a one-open-PR rule) and that no earlier run attempted.
|
|
100
|
+
*/
|
|
101
|
+
export declare function pickImplementCandidate(items: {
|
|
102
|
+
url: string;
|
|
103
|
+
repo: string;
|
|
104
|
+
number: number;
|
|
105
|
+
title: string;
|
|
106
|
+
tier: string;
|
|
107
|
+
}[], openPRs: {
|
|
108
|
+
repo: string;
|
|
109
|
+
}[], attempts: OvernightImplementAttempt[], listPath: string, languageOf?: (repo: string) => string | null | undefined): OvernightImplementItem | null;
|
|
66
110
|
/** Pure: split the daily check into prepare vs judgment items. */
|
|
67
|
-
export declare function bucketize(daily: Pick<DailyOutput, 'actionableIssues' | 'commentedIssues'
|
|
111
|
+
export declare function bucketize(daily: Pick<DailyOutput, 'actionableIssues' | 'commentedIssues'>, languageOf?: (repo: string) => string | null | undefined): {
|
|
68
112
|
prepare: OvernightItem[];
|
|
69
113
|
judgment: OvernightItem[];
|
|
70
114
|
};
|
|
@@ -84,6 +128,22 @@ export declare function renderReport(out: ReportBody, prepared?: OvernightPrepar
|
|
|
84
128
|
/** Local calendar date: the job fires at a local hour, so the report is filed under the local day. */
|
|
85
129
|
export declare function reportDateFor(d: Date): string;
|
|
86
130
|
export declare function runOvernight(): Promise<OvernightOutput>;
|
|
131
|
+
export interface OvernightImplementBlockedOptions {
|
|
132
|
+
url: string;
|
|
133
|
+
note?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface OvernightImplementBlockedOutput {
|
|
136
|
+
url: string;
|
|
137
|
+
attemptCount: number;
|
|
138
|
+
gistSyncWarning?: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* `overnight implement-blocked` (#1715): the preparer could not produce a
|
|
142
|
+
* branch for tonight's list issue. Remember that so the next run picks the
|
|
143
|
+
* next Pursue item instead of retrying this one every night; the note lands
|
|
144
|
+
* in the report's Blocked section like any other blocked item.
|
|
145
|
+
*/
|
|
146
|
+
export declare function runOvernightImplementBlocked(options: OvernightImplementBlockedOptions): Promise<OvernightImplementBlockedOutput>;
|
|
87
147
|
export interface OvernightRecordOptions {
|
|
88
148
|
url: string;
|
|
89
149
|
branch: string;
|
|
@@ -21,9 +21,11 @@
|
|
|
21
21
|
import * as fs from 'node:fs';
|
|
22
22
|
import * as os from 'node:os';
|
|
23
23
|
import * as path from 'node:path';
|
|
24
|
-
import { errorMessage, getStateManager, maybeCheckpoint, requireGitHubToken } from '../core/index.js';
|
|
24
|
+
import { errorMessage, getStateManager, maybeCheckpoint, parseGitHubUrl, requireGitHubToken } from '../core/index.js';
|
|
25
25
|
import { warn } from '../core/logger.js';
|
|
26
26
|
import { getReportsDir } from '../core/paths.js';
|
|
27
|
+
import { detectIssueListPath } from './locate-issue-list.js';
|
|
28
|
+
import { parseIssueList } from './parse-list.js';
|
|
27
29
|
import { executeDailyCheck } from './daily.js';
|
|
28
30
|
const MODULE = 'overnight';
|
|
29
31
|
// ponytail: static table, not a classifier. Every ActionableIssueType is
|
|
@@ -42,17 +44,82 @@ const BUCKET_BY_TYPE = {
|
|
|
42
44
|
},
|
|
43
45
|
needs_response: { bucket: 'judgment', reason: 'a maintainer is waiting on your reply' },
|
|
44
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Languages whose test suites the headless allowlist can actually run: it
|
|
49
|
+
* grants node, pnpm and npm and nothing else (OVERNIGHT_ALLOWED_TOOLS). A
|
|
50
|
+
* preparer on a Rust or Python repo can diagnose but never reach "Verify", so
|
|
51
|
+
* two nights of that ended blocked (#1697). Repos with a known primary
|
|
52
|
+
* language outside this set go to judgment instead of burning a preparer;
|
|
53
|
+
* a repo whose language is unknown (never scored) is given the benefit of
|
|
54
|
+
* the doubt. GitHub's `language` names, case-insensitive.
|
|
55
|
+
*/
|
|
56
|
+
export const VERIFIABLE_LANGUAGES = ['javascript', 'typescript'];
|
|
57
|
+
/** Pure: null when the repo's suite can be run, else why not. */
|
|
58
|
+
export function toolchainSkipReason(language) {
|
|
59
|
+
if (!language)
|
|
60
|
+
return null;
|
|
61
|
+
return VERIFIABLE_LANGUAGES.includes(language.toLowerCase())
|
|
62
|
+
? null
|
|
63
|
+
: `${language} repo: the headless run cannot execute its test suite (node/pnpm/npm only)`;
|
|
64
|
+
}
|
|
65
|
+
/** The tier name the curated list uses for issues John already vetted and wants done. */
|
|
66
|
+
export const IMPLEMENT_TIER = 'Pursue';
|
|
67
|
+
/**
|
|
68
|
+
* Pure: the one list issue to implement tonight, or null. First Pursue item
|
|
69
|
+
* (list order is the user's priority order) whose repo has no open PR of the
|
|
70
|
+
* user's (one PR per repo at a time keeps maintainers' review load sane and
|
|
71
|
+
* respects repos with a one-open-PR rule) and that no earlier run attempted.
|
|
72
|
+
*/
|
|
73
|
+
export function pickImplementCandidate(items, openPRs, attempts, listPath, languageOf = () => undefined) {
|
|
74
|
+
const busyRepos = new Set(openPRs.map((p) => p.repo.toLowerCase()));
|
|
75
|
+
const tried = new Set(attempts.map((a) => a.url));
|
|
76
|
+
for (const it of items) {
|
|
77
|
+
if (it.tier !== IMPLEMENT_TIER)
|
|
78
|
+
continue;
|
|
79
|
+
if (tried.has(it.url))
|
|
80
|
+
continue;
|
|
81
|
+
if (busyRepos.has(it.repo.toLowerCase()))
|
|
82
|
+
continue;
|
|
83
|
+
if (toolchainSkipReason(languageOf(it.repo)))
|
|
84
|
+
continue;
|
|
85
|
+
return {
|
|
86
|
+
url: it.url,
|
|
87
|
+
repo: it.repo,
|
|
88
|
+
number: it.number,
|
|
89
|
+
title: it.title,
|
|
90
|
+
reason: `${IMPLEMENT_TIER} tier of ${listPath}, no open PR of yours on ${it.repo}`,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
/** The curated list's available items, or null when there is no readable list. */
|
|
96
|
+
function loadListItems() {
|
|
97
|
+
const located = detectIssueListPath();
|
|
98
|
+
if (!located)
|
|
99
|
+
return null;
|
|
100
|
+
try {
|
|
101
|
+
return { items: parseIssueList(fs.readFileSync(located.path, 'utf8')).available, path: located.path };
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
warn(MODULE, `Could not read the issue list at ${located.path}: ${errorMessage(err)}`);
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
45
108
|
/** Pure: split the daily check into prepare vs judgment items. */
|
|
46
|
-
export function bucketize(daily) {
|
|
109
|
+
export function bucketize(daily, languageOf = () => undefined) {
|
|
47
110
|
const prepare = [];
|
|
48
111
|
const judgment = [];
|
|
49
112
|
for (const issue of daily.actionableIssues) {
|
|
50
113
|
const rule = BUCKET_BY_TYPE[issue.type];
|
|
51
|
-
|
|
114
|
+
// A CI fix needs the suite to run; a rebase or a requested edit can still
|
|
115
|
+
// be prepared and verified by hand in the morning.
|
|
116
|
+
const parsed = issue.type === 'ci_failing' ? parseGitHubUrl(issue.prUrl) : null;
|
|
117
|
+
const noToolchain = parsed ? toolchainSkipReason(languageOf(`${parsed.owner}/${parsed.repo}`)) : null;
|
|
118
|
+
(rule.bucket === 'prepare' && !noToolchain ? prepare : judgment).push({
|
|
52
119
|
url: issue.prUrl,
|
|
53
120
|
type: issue.type,
|
|
54
121
|
label: issue.label,
|
|
55
|
-
reason: rule.reason,
|
|
122
|
+
reason: noToolchain ? `${noToolchain}; rerun or fix it from a machine that can` : rule.reason,
|
|
56
123
|
});
|
|
57
124
|
}
|
|
58
125
|
for (const c of daily.commentedIssues) {
|
|
@@ -105,6 +172,12 @@ export function renderReport(out, prepared = []) {
|
|
|
105
172
|
lines.push(`Run at ${out.runAt}. Nothing was pushed, posted, or merged.`, '');
|
|
106
173
|
lines.push(`Attention: ${out.attention.needsAttention} need attention, ${out.attention.stuckCI} stuck CI, ${out.attention.dormantFollowup} dormant, ${out.attention.waiting} waiting.`, '');
|
|
107
174
|
lines.push(renderPreparedSection(prepared));
|
|
175
|
+
lines.push(`## Implement tonight (${out.implement ? 1 : 0})`, '');
|
|
176
|
+
if (out.implement)
|
|
177
|
+
lines.push(`- ${out.implement.repo}#${out.implement.number} ${out.implement.url} — ${out.implement.reason}`);
|
|
178
|
+
else
|
|
179
|
+
lines.push('_No list issue queued: the Pursue tier is empty, exhausted, or every repo has an open PR of yours._');
|
|
180
|
+
lines.push('');
|
|
108
181
|
lines.push(`## Queued for preparation (${out.prepare.length})`, '');
|
|
109
182
|
if (out.prepare.length === 0)
|
|
110
183
|
lines.push('_Nothing to prepare._');
|
|
@@ -140,11 +213,21 @@ export async function runOvernight() {
|
|
|
140
213
|
const daily = await executeDailyCheck(requireGitHubToken());
|
|
141
214
|
const now = new Date();
|
|
142
215
|
const runAt = now.toISOString();
|
|
143
|
-
const
|
|
216
|
+
const languageOf = (repo) => sm.getRepoScore(repo)?.language;
|
|
217
|
+
const { prepare, judgment } = bucketize(daily, languageOf);
|
|
218
|
+
const previous = sm.getLastOvernight();
|
|
219
|
+
const list = loadListItems();
|
|
220
|
+
// Attempts survive across runs; the ones whose issue left the list are
|
|
221
|
+
// dropped so a re-added issue can be tried again.
|
|
222
|
+
const attempts = (previous?.implementAttempts ?? []).filter((a) => !list || list.items.some((i) => i.url === a.url));
|
|
223
|
+
const implement = list
|
|
224
|
+
? pickImplementCandidate(list.items, daily.digest.openPRs, attempts, list.path, languageOf)
|
|
225
|
+
: null;
|
|
144
226
|
const body = {
|
|
145
227
|
runAt,
|
|
146
228
|
prepare,
|
|
147
229
|
judgment,
|
|
230
|
+
implement,
|
|
148
231
|
attention: daily.attention,
|
|
149
232
|
failures: daily.failures,
|
|
150
233
|
warnings: daily.warnings,
|
|
@@ -152,7 +235,6 @@ export async function runOvernight() {
|
|
|
152
235
|
const reportPath = reportPathFor(now);
|
|
153
236
|
// A re-run on the same date (launchd retry, manual) must not drop branches
|
|
154
237
|
// already recorded: they are still on disk, so keep them in state and report.
|
|
155
|
-
const previous = sm.getLastOvernight();
|
|
156
238
|
const carried = previous?.reportPath === reportPath ? previous.prepared : [];
|
|
157
239
|
fs.writeFileSync(reportPath, renderReport(body, carried), { mode: 0o600 });
|
|
158
240
|
publishReport(sm, reportPath);
|
|
@@ -162,6 +244,8 @@ export async function runOvernight() {
|
|
|
162
244
|
prepareCount: prepare.length,
|
|
163
245
|
judgmentCount: judgment.length,
|
|
164
246
|
prepared: carried,
|
|
247
|
+
...(implement ? { implementUrl: implement.url } : {}),
|
|
248
|
+
implementAttempts: attempts,
|
|
165
249
|
});
|
|
166
250
|
// executeDailyCheck already checkpointed the Gist; this write came after it,
|
|
167
251
|
// and in Gist mode setLastOvernight only reaches the local cache (#1629 class).
|
|
@@ -174,6 +258,28 @@ export async function runOvernight() {
|
|
|
174
258
|
...(daily.pendingLearnings ? { pendingLearnings: daily.pendingLearnings } : {}),
|
|
175
259
|
};
|
|
176
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* `overnight implement-blocked` (#1715): the preparer could not produce a
|
|
263
|
+
* branch for tonight's list issue. Remember that so the next run picks the
|
|
264
|
+
* next Pursue item instead of retrying this one every night; the note lands
|
|
265
|
+
* in the report's Blocked section like any other blocked item.
|
|
266
|
+
*/
|
|
267
|
+
export async function runOvernightImplementBlocked(options) {
|
|
268
|
+
const sm = getStateManager();
|
|
269
|
+
const last = sm.getLastOvernight();
|
|
270
|
+
if (!last)
|
|
271
|
+
throw new Error('No overnight run recorded yet; run `overnight` first.');
|
|
272
|
+
if (options.url !== last.implementUrl) {
|
|
273
|
+
throw new Error(`${options.url} is not tonight's implement item (${last.implementUrl ?? 'none queued'})`);
|
|
274
|
+
}
|
|
275
|
+
const implementAttempts = [
|
|
276
|
+
...(last.implementAttempts ?? []),
|
|
277
|
+
{ url: options.url, attemptedAt: new Date().toISOString(), outcome: 'blocked', note: options.note },
|
|
278
|
+
];
|
|
279
|
+
sm.setLastOvernight({ ...last, implementAttempts });
|
|
280
|
+
const gistSyncWarning = await maybeCheckpoint(sm, MODULE);
|
|
281
|
+
return { url: options.url, attemptCount: implementAttempts.length, ...(gistSyncWarning ? { gistSyncWarning } : {}) };
|
|
282
|
+
}
|
|
177
283
|
/** Append one prepared branch to state and to the report of the latest run. */
|
|
178
284
|
export async function runOvernightRecord(options) {
|
|
179
285
|
const sm = getStateManager();
|
|
@@ -188,7 +294,15 @@ export async function runOvernightRecord(options) {
|
|
|
188
294
|
recordedAt: new Date().toISOString(),
|
|
189
295
|
};
|
|
190
296
|
const prepared = [...last.prepared, entry];
|
|
191
|
-
|
|
297
|
+
// Recording the branch for tonight's list issue is what marks the attempt
|
|
298
|
+
// as prepared, so the next run moves on to the next Pursue item.
|
|
299
|
+
const implementAttempts = options.url === last.implementUrl
|
|
300
|
+
? [
|
|
301
|
+
...(last.implementAttempts ?? []),
|
|
302
|
+
{ url: options.url, attemptedAt: entry.recordedAt, outcome: 'prepared' },
|
|
303
|
+
]
|
|
304
|
+
: last.implementAttempts;
|
|
305
|
+
sm.setLastOvernight({ ...last, prepared, implementAttempts });
|
|
192
306
|
const { reportRecreated } = writePreparedSection(last.reportPath, prepared);
|
|
193
307
|
publishReport(sm, last.reportPath);
|
|
194
308
|
const gistSyncWarning = await maybeCheckpoint(sm, MODULE);
|
|
@@ -45,6 +45,14 @@ export declare const STALE_STATUSES: ReadonlySet<StalenessTier>;
|
|
|
45
45
|
* wrong status is visible in the envelope, not just stderr.
|
|
46
46
|
* @returns New PR array with overrides applied (original array is not mutated)
|
|
47
47
|
*/
|
|
48
|
+
/**
|
|
49
|
+
* When the PR last had activity a person can act on: a commit or a maintainer
|
|
50
|
+
* comment/review. GitHub's `updatedAt` also moves on invisible events (merge
|
|
51
|
+
* state recomputed after the base branch advances, label churn), which on a
|
|
52
|
+
* busy repo cleared a fresh manual override within hours (#1713). Falls back
|
|
53
|
+
* to `updatedAt` only when neither signal is present.
|
|
54
|
+
*/
|
|
55
|
+
export declare function latestActivityAt(pr: Pick<FetchedPR, 'updatedAt' | 'latestCommitDate' | 'lastMaintainerComment'>): string;
|
|
48
56
|
export declare function applyStatusOverrides(prs: FetchedPR[], state: Readonly<AgentState>, failures?: string[]): FetchedPR[];
|
|
49
57
|
/**
|
|
50
58
|
* Project a PR to a lightweight ShelvedPRRef for digest output.
|
package/dist/core/daily-logic.js
CHANGED
|
@@ -58,6 +58,19 @@ const VALID_OVERRIDE_STATUSES = new Set(['needs_addressing', 'waiting_on_maintai
|
|
|
58
58
|
* wrong status is visible in the envelope, not just stderr.
|
|
59
59
|
* @returns New PR array with overrides applied (original array is not mutated)
|
|
60
60
|
*/
|
|
61
|
+
/**
|
|
62
|
+
* When the PR last had activity a person can act on: a commit or a maintainer
|
|
63
|
+
* comment/review. GitHub's `updatedAt` also moves on invisible events (merge
|
|
64
|
+
* state recomputed after the base branch advances, label churn), which on a
|
|
65
|
+
* busy repo cleared a fresh manual override within hours (#1713). Falls back
|
|
66
|
+
* to `updatedAt` only when neither signal is present.
|
|
67
|
+
*/
|
|
68
|
+
export function latestActivityAt(pr) {
|
|
69
|
+
const candidates = [pr.latestCommitDate, pr.lastMaintainerComment?.createdAt].filter((d) => !!d);
|
|
70
|
+
if (candidates.length === 0)
|
|
71
|
+
return pr.updatedAt;
|
|
72
|
+
return candidates.reduce((a, b) => (a > b ? a : b));
|
|
73
|
+
}
|
|
61
74
|
export function applyStatusOverrides(prs, state, failures) {
|
|
62
75
|
const overrides = state.config.statusOverrides;
|
|
63
76
|
if (!overrides || Object.keys(overrides).length === 0)
|
|
@@ -69,7 +82,7 @@ export function applyStatusOverrides(prs, state, failures) {
|
|
|
69
82
|
stateManager.batch(() => {
|
|
70
83
|
result = prs.map((pr) => {
|
|
71
84
|
try {
|
|
72
|
-
const override = stateManager.getStatusOverride(pr.url, pr
|
|
85
|
+
const override = stateManager.getStatusOverride(pr.url, latestActivityAt(pr));
|
|
73
86
|
if (!override) {
|
|
74
87
|
return pr;
|
|
75
88
|
}
|
|
@@ -437,6 +437,20 @@ export declare const OvernightPreparedSchema: z.ZodObject<{
|
|
|
437
437
|
pushProblem: z.ZodOptional<z.ZodString>;
|
|
438
438
|
}, z.core.$strip>;
|
|
439
439
|
/** The latest overnight run (#1574); `startup` surfaces its freshness. */
|
|
440
|
+
/**
|
|
441
|
+
* One list issue the overnight run tried to implement (#1715). Kept across
|
|
442
|
+
* runs so a blocked issue is not retried every night; cleared when the
|
|
443
|
+
* issue leaves the list.
|
|
444
|
+
*/
|
|
445
|
+
export declare const OvernightImplementAttemptSchema: z.ZodObject<{
|
|
446
|
+
url: z.ZodString;
|
|
447
|
+
attemptedAt: z.ZodString;
|
|
448
|
+
outcome: z.ZodEnum<{
|
|
449
|
+
blocked: "blocked";
|
|
450
|
+
prepared: "prepared";
|
|
451
|
+
}>;
|
|
452
|
+
note: z.ZodOptional<z.ZodString>;
|
|
453
|
+
}, z.core.$strip>;
|
|
440
454
|
export declare const OvernightRecordSchema: z.ZodObject<{
|
|
441
455
|
runAt: z.ZodString;
|
|
442
456
|
reportPath: z.ZodString;
|
|
@@ -453,6 +467,16 @@ export declare const OvernightRecordSchema: z.ZodObject<{
|
|
|
453
467
|
compareUrl: z.ZodOptional<z.ZodString>;
|
|
454
468
|
pushProblem: z.ZodOptional<z.ZodString>;
|
|
455
469
|
}, z.core.$strip>>>;
|
|
470
|
+
implementUrl: z.ZodOptional<z.ZodString>;
|
|
471
|
+
implementAttempts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
472
|
+
url: z.ZodString;
|
|
473
|
+
attemptedAt: z.ZodString;
|
|
474
|
+
outcome: z.ZodEnum<{
|
|
475
|
+
blocked: "blocked";
|
|
476
|
+
prepared: "prepared";
|
|
477
|
+
}>;
|
|
478
|
+
note: z.ZodOptional<z.ZodString>;
|
|
479
|
+
}, z.core.$strip>>>;
|
|
456
480
|
}, z.core.$strip>;
|
|
457
481
|
/**
|
|
458
482
|
* Mirrors oss-scout's `searchRotation`: the broad-phase language cursor, the
|
|
@@ -735,6 +759,16 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
735
759
|
compareUrl: z.ZodOptional<z.ZodString>;
|
|
736
760
|
pushProblem: z.ZodOptional<z.ZodString>;
|
|
737
761
|
}, z.core.$strip>>>;
|
|
762
|
+
implementUrl: z.ZodOptional<z.ZodString>;
|
|
763
|
+
implementAttempts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
764
|
+
url: z.ZodString;
|
|
765
|
+
attemptedAt: z.ZodString;
|
|
766
|
+
outcome: z.ZodEnum<{
|
|
767
|
+
blocked: "blocked";
|
|
768
|
+
prepared: "prepared";
|
|
769
|
+
}>;
|
|
770
|
+
note: z.ZodOptional<z.ZodString>;
|
|
771
|
+
}, z.core.$strip>>>;
|
|
738
772
|
}, z.core.$strip>>;
|
|
739
773
|
searchRotation: z.ZodOptional<z.ZodObject<{
|
|
740
774
|
languageOffset: z.ZodDefault<z.ZodNumber>;
|
|
@@ -753,6 +787,7 @@ export type DiffTool = z.infer<typeof DiffToolSchema>;
|
|
|
753
787
|
export type SearchSeenEntry = z.infer<typeof SearchSeenEntrySchema>;
|
|
754
788
|
export type OvernightPrepared = z.infer<typeof OvernightPreparedSchema>;
|
|
755
789
|
export type OvernightRecord = z.infer<typeof OvernightRecordSchema>;
|
|
790
|
+
export type OvernightImplementAttempt = z.infer<typeof OvernightImplementAttemptSchema>;
|
|
756
791
|
export type SearchRotation = z.infer<typeof SearchRotationSchema>;
|
|
757
792
|
export type RepoSignals = z.infer<typeof RepoSignalsSchema>;
|
|
758
793
|
export type RepoScore = z.infer<typeof RepoScoreSchema>;
|
|
@@ -400,12 +400,26 @@ export const OvernightPreparedSchema = z.object({
|
|
|
400
400
|
pushProblem: z.string().optional(),
|
|
401
401
|
});
|
|
402
402
|
/** The latest overnight run (#1574); `startup` surfaces its freshness. */
|
|
403
|
+
/**
|
|
404
|
+
* One list issue the overnight run tried to implement (#1715). Kept across
|
|
405
|
+
* runs so a blocked issue is not retried every night; cleared when the
|
|
406
|
+
* issue leaves the list.
|
|
407
|
+
*/
|
|
408
|
+
export const OvernightImplementAttemptSchema = z.object({
|
|
409
|
+
url: z.string(),
|
|
410
|
+
attemptedAt: z.string(),
|
|
411
|
+
outcome: z.enum(['prepared', 'blocked']),
|
|
412
|
+
note: z.string().optional(),
|
|
413
|
+
});
|
|
403
414
|
export const OvernightRecordSchema = z.object({
|
|
404
415
|
runAt: z.string(),
|
|
405
416
|
reportPath: z.string(),
|
|
406
417
|
prepareCount: z.number().int().nonnegative(),
|
|
407
418
|
judgmentCount: z.number().int().nonnegative(),
|
|
408
419
|
prepared: z.array(OvernightPreparedSchema).default([]),
|
|
420
|
+
/** The one curated-list issue picked for implementation this run, if any (#1715). */
|
|
421
|
+
implementUrl: z.string().optional(),
|
|
422
|
+
implementAttempts: z.array(OvernightImplementAttemptSchema).optional(),
|
|
409
423
|
});
|
|
410
424
|
/**
|
|
411
425
|
* Mirrors oss-scout's `searchRotation`: the broad-phase language cursor, the
|
package/dist/core/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Core types for the Open Source Contribution Agent
|
|
3
3
|
*/
|
|
4
4
|
import type { FetchedPRStatus, RepoSignals, TrackedIssue, IssueVettingResult, IssueScope, DiffTool, AgentConfig, AgentState } from './state-schema.js';
|
|
5
|
-
export type { IssueStatus, FetchedPRStatus, ProjectCategory, IssueScope, DiffTool, RepoSignals, RepoScore, StoredMergedPR, StoredClosedPR, AnalyzedIssueConversation, ContributionGuidelines, IssueVettingResult, TrackedIssue, ShelvedPRRef, StatusOverride, AgentConfig, LocalRepoCache, ClosedPR, MergedPR, DailyDigest, AgentState, SearchSeenEntry, OvernightPrepared, OvernightRecord, SearchRotation, } from './state-schema.js';
|
|
5
|
+
export type { IssueStatus, FetchedPRStatus, ProjectCategory, IssueScope, DiffTool, RepoSignals, RepoScore, StoredMergedPR, StoredClosedPR, AnalyzedIssueConversation, ContributionGuidelines, IssueVettingResult, TrackedIssue, ShelvedPRRef, StatusOverride, AgentConfig, LocalRepoCache, ClosedPR, MergedPR, DailyDigest, AgentState, SearchSeenEntry, OvernightPrepared, OvernightRecord, OvernightImplementAttempt, SearchRotation, } from './state-schema.js';
|
|
6
6
|
/** CI pipeline status for a PR's latest commit. */
|
|
7
7
|
export type CIStatus = 'passing' | 'failing' | 'pending' | 'unknown';
|
|
8
8
|
/**
|