@oss-autopilot/core 3.14.5 → 3.15.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.
@@ -25,9 +25,11 @@ export declare const SEARCH_DIVERSITY_RATIO = 0.2;
25
25
  */
26
26
  export interface ScoutBridgeDiagnostics {
27
27
  /**
28
- * Set when a configured skipped-issues file exists but could not be read.
29
- * The scout state was built with an EMPTY skip list, so explicitly-skipped
30
- * issues may resurface in results.
28
+ * Set when a configured skipped-issues file could not be loaded — either it
29
+ * exists but is unreadable (#1448), or a path is configured but no file
30
+ * exists at the resolved location (#1528, the relative-path-vs-CWD case). The
31
+ * scout state was built with an EMPTY skip list, so explicitly-skipped issues
32
+ * may resurface in results.
31
33
  */
32
34
  skipListUnavailable?: boolean;
33
35
  }
@@ -56,9 +58,9 @@ export declare function buildCandidateLinkedPR(scoutLinkedPR: ScoutLinkedPR | nu
56
58
  * Build a ScoutState from the current AgentState.
57
59
  * Maps oss-autopilot's config and state fields to oss-scout's state format.
58
60
  *
59
- * @param diagnostics - Optional collector for degradation signals (#1448);
60
- * `skipListUnavailable` is set when the skipped-issues file exists but
61
- * could not be read.
61
+ * @param diagnostics - Optional collector for degradation signals (#1448,
62
+ * #1528); `skipListUnavailable` is set when the configured skipped-issues
63
+ * file is unreadable or missing at its resolved path.
62
64
  */
63
65
  export declare function buildScoutState(diagnostics?: ScoutBridgeDiagnostics): ScoutState;
64
66
  /**
@@ -70,18 +70,21 @@ export function buildCandidateLinkedPR(scoutLinkedPR) {
70
70
  * Build a ScoutState from the current AgentState.
71
71
  * Maps oss-autopilot's config and state fields to oss-scout's state format.
72
72
  *
73
- * @param diagnostics - Optional collector for degradation signals (#1448);
74
- * `skipListUnavailable` is set when the skipped-issues file exists but
75
- * could not be read.
73
+ * @param diagnostics - Optional collector for degradation signals (#1448,
74
+ * #1528); `skipListUnavailable` is set when the configured skipped-issues
75
+ * file is unreadable or missing at its resolved path.
76
76
  */
77
77
  export function buildScoutState(diagnostics) {
78
78
  const state = getStateManager().getState();
79
79
  const { config } = state;
80
- // Read failure (not absence) of the skip file means scout will see an empty
81
- // skip list and may resurface explicitly-skipped issues — flag it so the
82
- // search envelope can carry the signal instead of only stderr (#1448).
80
+ // A configured skip file that is unreadable (#1448) OR missing (#1528) leaves
81
+ // scout with an empty skip list and may resurface explicitly-skipped issues
82
+ // — flag both so the search envelope carries the signal instead of failing
83
+ // silently. The missing case is the common one: a relative skippedIssuesPath
84
+ // resolves against the CWD, so running /oss outside the directory that holds
85
+ // it found nothing and the skip list loaded empty without any warning.
83
86
  const skippedIssuesLoad = loadSkippedIssuesDetailed(config.skippedIssuesPath);
84
- if (skippedIssuesLoad.readError !== undefined && diagnostics) {
87
+ if ((skippedIssuesLoad.readError !== undefined || skippedIssuesLoad.notFound) && diagnostics) {
85
88
  diagnostics.skipListUnavailable = true;
86
89
  }
87
90
  // Strategy-derived personalization (#1464). `computeStrategy` returns null
@@ -172,7 +175,26 @@ export function buildScoutState(diagnostics) {
172
175
  title: pr.title,
173
176
  openedAt: pr.createdAt,
174
177
  })),
175
- savedResults: [],
178
+ // Seen-set for result rotation (#1528). Scout's search() excludes issues
179
+ // whose lastSeenAt is within its rotation TTL, so consecutive searches
180
+ // surface fresh candidates instead of the same set. Autopilot runs scout
181
+ // in persistence:'provided', so this durable AgentState-backed list is what
182
+ // makes the rotation survive between separate /oss invocations. Only
183
+ // issueUrl + lastSeenAt drive the exclusion; the remaining SavedCandidate
184
+ // fields are unused by rotation and filled with neutral placeholders.
185
+ savedResults: (state.searchSeen ?? []).map((s) => ({
186
+ issueUrl: s.url,
187
+ repo: '',
188
+ number: 0,
189
+ title: '',
190
+ labels: [],
191
+ recommendation: 'skip',
192
+ viabilityScore: 0,
193
+ searchPriority: 'normal',
194
+ firstSeenAt: s.lastSeenAt,
195
+ lastSeenAt: s.lastSeenAt,
196
+ lastScore: 0,
197
+ })),
176
198
  skippedIssues: skippedIssuesLoad.issues,
177
199
  lastRunAt: state.lastRunAt,
178
200
  };
@@ -2,6 +2,7 @@
2
2
  * Search command
3
3
  * Searches for new issues to work on via @oss-scout/core
4
4
  */
5
+ import { getStateManager } from '../core/index.js';
5
6
  import { type SearchOutput } from '../formatters/json.js';
6
7
  export { type SearchOutput } from '../formatters/json.js';
7
8
  /**
@@ -19,4 +20,17 @@ export { SEARCH_DIVERSITY_RATIO } from './scout-bridge.js';
19
20
  interface SearchOptions {
20
21
  maxResults: number;
21
22
  }
23
+ /**
24
+ * Retention window for the search seen-set (#1528). Entries older than this are
25
+ * culled so the list stays bounded. Set well beyond oss-scout's rotation TTL
26
+ * (default 7 days) so an entry scout would still exclude is never dropped early.
27
+ */
28
+ export declare const SEARCH_SEEN_RETENTION_DAYS = 30;
29
+ /**
30
+ * Record the issues surfaced by a search into the durable seen-set (#1528) so
31
+ * the next search rotates past them, and cull entries older than
32
+ * {@link SEARCH_SEEN_RETENTION_DAYS}. Re-surfacing an issue refreshes its
33
+ * timestamp. No-op-safe: an empty `surfacedUrls` still culls stale entries.
34
+ */
35
+ export declare function recordSearchSeen(stateManager: ReturnType<typeof getStateManager>, surfacedUrls: string[]): void;
22
36
  export declare function runSearch(options: SearchOptions): Promise<SearchOutput>;
@@ -79,6 +79,32 @@ function readScoutDelayOverride(envVar) {
79
79
  }
80
80
  return parsed;
81
81
  }
82
+ /**
83
+ * Retention window for the search seen-set (#1528). Entries older than this are
84
+ * culled so the list stays bounded. Set well beyond oss-scout's rotation TTL
85
+ * (default 7 days) so an entry scout would still exclude is never dropped early.
86
+ */
87
+ export const SEARCH_SEEN_RETENTION_DAYS = 30;
88
+ /**
89
+ * Record the issues surfaced by a search into the durable seen-set (#1528) so
90
+ * the next search rotates past them, and cull entries older than
91
+ * {@link SEARCH_SEEN_RETENTION_DAYS}. Re-surfacing an issue refreshes its
92
+ * timestamp. No-op-safe: an empty `surfacedUrls` still culls stale entries.
93
+ */
94
+ export function recordSearchSeen(stateManager, surfacedUrls) {
95
+ const now = Date.now();
96
+ const nowIso = new Date(now).toISOString();
97
+ const cutoff = now - SEARCH_SEEN_RETENTION_DAYS * 24 * 60 * 60 * 1000;
98
+ const byUrl = new Map(stateManager.getSearchSeen().map((e) => [e.url, e]));
99
+ for (const url of surfacedUrls) {
100
+ byUrl.set(url, { url, lastSeenAt: nowIso });
101
+ }
102
+ const next = [...byUrl.values()].filter((e) => {
103
+ const seen = Date.parse(e.lastSeenAt);
104
+ return Number.isNaN(seen) ? false : seen >= cutoff;
105
+ });
106
+ stateManager.setSearchSeen(next);
107
+ }
82
108
  export async function runSearch(options) {
83
109
  // Collect bridge-level degradation signals (#1448): an unreadable skip file
84
110
  // means scout searched with an empty skip list, so explicitly-skipped
@@ -120,6 +146,10 @@ export async function runSearch(options) {
120
146
  ...(interPhaseDelayMs !== undefined ? { interPhaseDelayMs } : {}),
121
147
  ...(broadPhaseDelayMs !== undefined ? { broadPhaseDelayMs } : {}),
122
148
  });
149
+ // Record everything scout surfaced this round into the durable seen-set so
150
+ // the next search rotates past it (#1528). Done before the own-PR filter so
151
+ // hidden-but-surfaced issues also rotate out. Persists to AgentState.
152
+ recordSearchSeen(stateManager, result.candidates.map((c) => c.issue.url));
123
153
  // #1354: never surface issues the user already has an open PR for. Uses
124
154
  // scout's structured linked-PR metadata when present; candidates without it
125
155
  // pass through (the issue-scout agent re-checks via verify-issue anyway).
@@ -30,6 +30,22 @@ export interface SkippedIssuesLoadResult {
30
30
  * exist, or the read succeeded.
31
31
  */
32
32
  readError?: string;
33
+ /**
34
+ * Set when a path WAS configured but no file exists at the resolved location
35
+ * (#1528). `issues` is `[]`. This is the silent-failure mode that resurfaced
36
+ * already-skipped issues: a relative `skippedIssuesPath` resolves against the
37
+ * process CWD, so running from the wrong directory found nothing and the skip
38
+ * list loaded empty without any signal. Callers raise the same
39
+ * `skipListUnavailable` diagnostic for this as for `readError`. Absent when
40
+ * the path is unset or the file was found.
41
+ */
42
+ notFound?: boolean;
43
+ /**
44
+ * The absolute path the loader actually checked (relative paths resolved
45
+ * against CWD). Present whenever a path was configured, so diagnostics can
46
+ * show exactly where the lookup looked. Absent when no path was configured.
47
+ */
48
+ resolvedPath?: string;
33
49
  }
34
50
  /**
35
51
  * Read the skipped-issues file from disk and parse it, surfacing read
@@ -13,6 +13,7 @@
13
13
  * so the search engine filters already-skipped URLs out of results.
14
14
  */
15
15
  import * as fs from 'node:fs';
16
+ import * as nodePath from 'node:path';
16
17
  import { warn } from '../core/logger.js';
17
18
  import { errorMessage } from '../core/errors.js';
18
19
  const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
@@ -84,17 +85,28 @@ export function parseSkippedIssuesContent(content) {
84
85
  export function loadSkippedIssuesDetailed(path) {
85
86
  if (!path)
86
87
  return { issues: [] };
87
- if (!fs.existsSync(path))
88
- return { issues: [] };
88
+ // Resolve to absolute so a relative `skippedIssuesPath` is interpreted
89
+ // against the CWD explicitly (#1528) and the diagnostics can report the
90
+ // exact location that was checked.
91
+ const resolvedPath = nodePath.resolve(path);
92
+ if (!fs.existsSync(resolvedPath)) {
93
+ // A configured-but-missing skip file used to be silent, which resurfaced
94
+ // already-skipped issues whenever `/oss` ran from a directory other than
95
+ // the one holding a relative skip path. Make it loud.
96
+ warn('skip-file-parser', `Configured skipped-issues file not found at ${resolvedPath} (cwd ${process.cwd()}); ` +
97
+ `proceeding with an EMPTY skip list — previously skipped issues may resurface. ` +
98
+ `Use an absolute skippedIssuesPath, or run from the directory that contains "${path}".`);
99
+ return { issues: [], notFound: true, resolvedPath };
100
+ }
89
101
  let content;
90
102
  try {
91
- content = fs.readFileSync(path, 'utf8');
103
+ content = fs.readFileSync(resolvedPath, 'utf8');
92
104
  }
93
105
  catch (err) {
94
- warn('skip-file-parser', `Failed to read skipped-issues file at ${path}: ${errorMessage(err)}`);
95
- return { issues: [], readError: errorMessage(err) };
106
+ warn('skip-file-parser', `Failed to read skipped-issues file at ${resolvedPath}: ${errorMessage(err)}`);
107
+ return { issues: [], readError: errorMessage(err), resolvedPath };
96
108
  }
97
- return { issues: parseSkippedIssuesContent(content) };
109
+ return { issues: parseSkippedIssuesContent(content), resolvedPath };
98
110
  }
99
111
  /**
100
112
  * Read the skipped-issues file from disk and parse it.
@@ -1,17 +1,16 @@
1
1
  /**
2
- * Issue success-likelihood grade (#858).
2
+ * Issue success-likelihood score (#858, rescaled to 1-10 per #249 follow-up).
3
3
  *
4
4
  * Predicts the probability that a contribution to a given repo will be
5
5
  * accepted and merged, using signals already collected during vetting.
6
6
  *
7
- * The grade is letter-based (A/B/C/F — no D). Each signal is graded
8
- * independently; the overall grade is the worst of the three, and is
9
- * further degraded one step if any signal is unknown (missing data is
10
- * treated as a risk, not ignored). This matches the policy previously
11
- * described as prose in agents/issue-scout.md.
7
+ * The score is on a 1-10 scale. Each signal lands in one of four bands —
8
+ * 10 / 7 / 4 / 1 (best→worst) — graded independently; the overall score is
9
+ * the worst of the three, and drops one band if any signal is unknown
10
+ * (missing data is treated as a risk, not ignored). This matches the policy
11
+ * previously described as prose in agents/issue-scout.md.
12
12
  */
13
13
  import type { ProjectHealth } from '@oss-scout/core';
14
- export type GradeLetter = 'A' | 'B' | 'C' | 'F';
15
14
  export interface GradeSignals {
16
15
  /** Average maintainer response time in days; null if unknown. */
17
16
  avgResponseDays: number | null;
@@ -21,8 +20,9 @@ export interface GradeSignals {
21
20
  daysSinceLastCommit: number | null;
22
21
  }
23
22
  export interface GradeResult {
24
- letter: GradeLetter;
25
- /** Short human-readable explanation of what drove the grade. */
23
+ /** Success-likelihood score on a 1-10 scale (higher is better). */
24
+ score: number;
25
+ /** Short human-readable explanation of what drove the score. */
26
26
  reason: string;
27
27
  }
28
28
  /**
@@ -66,7 +66,7 @@ export declare function deriveGradeSignals(params: {
66
66
  * rubric. The fresh side only enters through `projectHealth`, and only when
67
67
  * scout actually fetched it: the `search` surface passes a `checkFailed`
68
68
  * sentinel (health not fetched per candidate), so search grades purely from
69
- * history-side signals, while `vet` re-grades with fresh health. Same letter
69
+ * history-side signals, while `vet` re-grades with fresh health. Same 1-10
70
70
  * scale, different inputs — the two surfaces can legitimately disagree.
71
71
  */
72
72
  export declare function gradeFromCandidate(params: {
@@ -1,22 +1,27 @@
1
1
  /**
2
- * Issue success-likelihood grade (#858).
2
+ * Issue success-likelihood score (#858, rescaled to 1-10 per #249 follow-up).
3
3
  *
4
4
  * Predicts the probability that a contribution to a given repo will be
5
5
  * accepted and merged, using signals already collected during vetting.
6
6
  *
7
- * The grade is letter-based (A/B/C/F — no D). Each signal is graded
8
- * independently; the overall grade is the worst of the three, and is
9
- * further degraded one step if any signal is unknown (missing data is
10
- * treated as a risk, not ignored). This matches the policy previously
11
- * described as prose in agents/issue-scout.md.
7
+ * The score is on a 1-10 scale. Each signal lands in one of four bands —
8
+ * 10 / 7 / 4 / 1 (best→worst) — graded independently; the overall score is
9
+ * the worst of the three, and drops one band if any signal is unknown
10
+ * (missing data is treated as a risk, not ignored). This matches the policy
11
+ * previously described as prose in agents/issue-scout.md.
12
12
  */
13
- const SEVERITY = { A: 0, B: 1, C: 2, F: 3 };
14
- const LETTERS = ['A', 'B', 'C', 'F'];
15
- function worst(grades) {
16
- return grades.reduce((acc, g) => (SEVERITY[g.letter] > SEVERITY[acc.letter] ? g : acc));
13
+ // Band values, best→worst. A signal always resolves to one of these, so
14
+ // degradeOneStep can step down the ladder by index.
15
+ const BANDS = [10, 7, 4, 1];
16
+ function worst(scores) {
17
+ return scores.reduce((acc, s) => (s.score < acc.score ? s : acc));
17
18
  }
18
- function degradeOneStep(letter) {
19
- return LETTERS[Math.min(SEVERITY[letter] + 1, LETTERS.length - 1)];
19
+ function degradeOneStep(score) {
20
+ const i = BANDS.indexOf(score);
21
+ // Unrecognized score (shouldn't happen) is treated as already-worst.
22
+ if (i === -1)
23
+ return BANDS[BANDS.length - 1];
24
+ return BANDS[Math.min(i + 1, BANDS.length - 1)];
20
25
  }
21
26
  /**
22
27
  * Coerce a candidate numeric signal to `number` if it's finite and in
@@ -33,31 +38,31 @@ function sanitize(value, min, max) {
33
38
  }
34
39
  function gradeResponsiveness(avgResponseDays) {
35
40
  if (avgResponseDays < 3)
36
- return { letter: 'A', detail: `~${Math.round(avgResponseDays)}-day avg response` };
41
+ return { score: 10, detail: `~${Math.round(avgResponseDays)}-day avg response` };
37
42
  if (avgResponseDays < 14)
38
- return { letter: 'B', detail: `${Math.round(avgResponseDays)}-day avg response` };
43
+ return { score: 7, detail: `${Math.round(avgResponseDays)}-day avg response` };
39
44
  if (avgResponseDays <= 60)
40
- return { letter: 'C', detail: `${Math.round(avgResponseDays)}-day avg response` };
41
- return { letter: 'F', detail: 'unresponsive maintainers' };
45
+ return { score: 4, detail: `${Math.round(avgResponseDays)}-day avg response` };
46
+ return { score: 1, detail: 'unresponsive maintainers' };
42
47
  }
43
48
  function gradeMergeRate(mergeRate) {
44
49
  const pct = Math.round(mergeRate * 100);
45
50
  if (mergeRate > 0.7)
46
- return { letter: 'A', detail: `merges ${pct}% of PRs` };
51
+ return { score: 10, detail: `merges ${pct}% of PRs` };
47
52
  if (mergeRate >= 0.4)
48
- return { letter: 'B', detail: `merges ${pct}% of PRs` };
53
+ return { score: 7, detail: `merges ${pct}% of PRs` };
49
54
  if (mergeRate >= 0.1)
50
- return { letter: 'C', detail: `merges ${pct}% of PRs` };
51
- return { letter: 'F', detail: `merges ${pct}% of PRs` };
55
+ return { score: 4, detail: `merges ${pct}% of PRs` };
56
+ return { score: 1, detail: `merges ${pct}% of PRs` };
52
57
  }
53
58
  function gradeActivity(daysSinceLastCommit) {
54
59
  if (daysSinceLastCommit < 7)
55
- return { letter: 'A', detail: 'commits in last week' };
60
+ return { score: 10, detail: 'commits in last week' };
56
61
  if (daysSinceLastCommit < 30)
57
- return { letter: 'B', detail: 'commits in last month' };
62
+ return { score: 7, detail: 'commits in last month' };
58
63
  if (daysSinceLastCommit < 90)
59
- return { letter: 'C', detail: 'commits in last 90 days' };
60
- return { letter: 'F', detail: `no commits in ${daysSinceLastCommit}+ days` };
64
+ return { score: 4, detail: 'commits in last 90 days' };
65
+ return { score: 1, detail: `no commits in ${daysSinceLastCommit}+ days` };
61
66
  }
62
67
  /**
63
68
  * Build `GradeSignals` from a vet candidate's project health plus the
@@ -107,7 +112,7 @@ export function deriveGradeSignals(params) {
107
112
  * rubric. The fresh side only enters through `projectHealth`, and only when
108
113
  * scout actually fetched it: the `search` surface passes a `checkFailed`
109
114
  * sentinel (health not fetched per candidate), so search grades purely from
110
- * history-side signals, while `vet` re-grades with fresh health. Same letter
115
+ * history-side signals, while `vet` re-grades with fresh health. Same 1-10
111
116
  * scale, different inputs — the two surfaces can legitimately disagree.
112
117
  */
113
118
  export function gradeFromCandidate(params) {
@@ -152,15 +157,15 @@ export function computeSuccessGrade(signals) {
152
157
  unknowns.push('activity');
153
158
  else
154
159
  graded.push(gradeActivity(act));
155
- // No signal available at all — give F so callers see missing data as a
156
- // strong negative rather than a neutral grade.
160
+ // No signal available at all — score the lowest band so callers see missing
161
+ // data as a strong negative rather than a neutral score.
157
162
  if (graded.length === 0) {
158
- return { letter: 'F', reason: `unknown ${unknowns.join(', ')}` };
163
+ return { score: BANDS[BANDS.length - 1], reason: `unknown ${unknowns.join(', ')}` };
159
164
  }
160
165
  const worstKnown = worst(graded);
161
- const finalLetter = unknowns.length > 0 ? degradeOneStep(worstKnown.letter) : worstKnown.letter;
166
+ const finalScore = unknowns.length > 0 ? degradeOneStep(worstKnown.score) : worstKnown.score;
162
167
  const reasonParts = [worstKnown.detail];
163
168
  if (unknowns.length > 0)
164
169
  reasonParts.push(`unknown ${unknowns.join(', ')}`);
165
- return { letter: finalLetter, reason: reasonParts.join(', ') };
170
+ return { score: finalScore, reason: reasonParts.join(', ') };
166
171
  }
@@ -403,6 +403,20 @@ export declare const DailyDigestSchema: z.ZodObject<{
403
403
  mergeRate: z.ZodNumber;
404
404
  }, z.core.$strip>;
405
405
  }, z.core.$strip>;
406
+ /**
407
+ * One entry in the search seen-set (#1528). Records that an issue URL was
408
+ * surfaced by a recent `search` so the next search can rotate past it instead
409
+ * of returning the same candidates every time. oss-scout's `search()` excludes
410
+ * URLs whose `lastSeenAt` is within its rotation TTL (default 7 days); this is
411
+ * the durable backing store that lets that exclusion survive between separate
412
+ * `/oss` invocations (autopilot runs scout in `persistence: 'provided'` mode,
413
+ * so scout persists nothing itself). Deliberately lean — only the two fields
414
+ * scout's rotation reads — so the state file stays small.
415
+ */
416
+ export declare const SearchSeenEntrySchema: z.ZodObject<{
417
+ url: z.ZodString;
418
+ lastSeenAt: z.ZodString;
419
+ }, z.core.$strip>;
406
420
  export declare const AgentStateSchema: z.ZodObject<{
407
421
  version: z.ZodLiteral<4>;
408
422
  gistId: z.ZodOptional<z.ZodString>;
@@ -646,12 +660,17 @@ export declare const AgentStateSchema: z.ZodObject<{
646
660
  stepData: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
647
661
  lastUpdatedAt: z.ZodString;
648
662
  }, z.core.$strip>>;
663
+ searchSeen: z.ZodDefault<z.ZodArray<z.ZodObject<{
664
+ url: z.ZodString;
665
+ lastSeenAt: z.ZodString;
666
+ }, z.core.$strip>>>;
649
667
  }, z.core.$strip>;
650
668
  export type IssueStatus = z.infer<typeof IssueStatusSchema>;
651
669
  export type FetchedPRStatus = z.infer<typeof FetchedPRStatusSchema>;
652
670
  export type ProjectCategory = z.infer<typeof ProjectCategorySchema>;
653
671
  export type IssueScope = z.infer<typeof IssueScopeSchema>;
654
672
  export type DiffTool = z.infer<typeof DiffToolSchema>;
673
+ export type SearchSeenEntry = z.infer<typeof SearchSeenEntrySchema>;
655
674
  export type RepoSignals = z.infer<typeof RepoSignalsSchema>;
656
675
  export type RepoScore = z.infer<typeof RepoScoreSchema>;
657
676
  export type StoredMergedPR = z.infer<typeof StoredMergedPRSchema>;
@@ -355,6 +355,20 @@ export const DailyDigestSchema = z.object({
355
355
  summary: DailyDigestSummarySchema,
356
356
  });
357
357
  // ── 8. Root schema ───────────────────────────────────────────────────
358
+ /**
359
+ * One entry in the search seen-set (#1528). Records that an issue URL was
360
+ * surfaced by a recent `search` so the next search can rotate past it instead
361
+ * of returning the same candidates every time. oss-scout's `search()` excludes
362
+ * URLs whose `lastSeenAt` is within its rotation TTL (default 7 days); this is
363
+ * the durable backing store that lets that exclusion survive between separate
364
+ * `/oss` invocations (autopilot runs scout in `persistence: 'provided'` mode,
365
+ * so scout persists nothing itself). Deliberately lean — only the two fields
366
+ * scout's rotation reads — so the state file stays small.
367
+ */
368
+ export const SearchSeenEntrySchema = z.object({
369
+ url: z.string(),
370
+ lastSeenAt: z.string(),
371
+ });
358
372
  export const AgentStateSchema = z.object({
359
373
  version: z.literal(4),
360
374
  gistId: z.string().optional(),
@@ -397,4 +411,12 @@ export const AgentStateSchema = z.object({
397
411
  * Restart / Discard when present.
398
412
  */
399
413
  workflowState: WorkflowStateSchema.optional(),
414
+ /**
415
+ * Durable search seen-set for result rotation (#1528). Issue URLs surfaced
416
+ * by recent searches, with the timestamp they were last surfaced. Fed into
417
+ * oss-scout as `savedResults` so its rotation excludes recently-surfaced
418
+ * issues, and updated after each search. Culled past the rotation window so
419
+ * it cannot grow without bound.
420
+ */
421
+ searchSeen: z.array(SearchSeenEntrySchema).default([]),
400
422
  });
@@ -3,7 +3,7 @@
3
3
  * Thin coordinator that delegates persistence to state-persistence.ts
4
4
  * and scoring logic to repo-score-manager.ts.
5
5
  */
6
- import { AgentState, TrackedIssue, RepoScore, RepoScoreUpdate, DailyDigest, LocalRepoCache, StatusOverride, FetchedPRStatus, StoredMergedPR, StoredClosedPR } from './types.js';
6
+ import { AgentState, TrackedIssue, RepoScore, RepoScoreUpdate, DailyDigest, LocalRepoCache, StatusOverride, FetchedPRStatus, StoredMergedPR, StoredClosedPR, SearchSeenEntry } from './types.js';
7
7
  import { type LoadRecoveryInfo } from './state-persistence.js';
8
8
  import type { Stats } from './repo-score-manager.js';
9
9
  import { GistStateStore } from './gist-state-store.js';
@@ -360,6 +360,17 @@ export declare class StateManager {
360
360
  * @param status - The overridden status
361
361
  * @param lastActivityAt - ISO timestamp of PR's last activity when override was set
362
362
  */
363
+ /**
364
+ * The durable search seen-set (#1528) — issue URLs surfaced by recent
365
+ * searches, fed into oss-scout for result rotation. Returns `[]` when none
366
+ * recorded yet.
367
+ */
368
+ getSearchSeen(): SearchSeenEntry[];
369
+ /**
370
+ * Replace the search seen-set (#1528). Callers merge the just-surfaced URLs
371
+ * and cull stale entries before calling this; the manager only persists.
372
+ */
373
+ setSearchSeen(seen: SearchSeenEntry[]): void;
363
374
  setStatusOverride(url: string, status: FetchedPRStatus, lastActivityAt: string): void;
364
375
  /**
365
376
  * Remove a manual status override for a PR.
@@ -863,6 +863,22 @@ export class StateManager {
863
863
  * @param status - The overridden status
864
864
  * @param lastActivityAt - ISO timestamp of PR's last activity when override was set
865
865
  */
866
+ /**
867
+ * The durable search seen-set (#1528) — issue URLs surfaced by recent
868
+ * searches, fed into oss-scout for result rotation. Returns `[]` when none
869
+ * recorded yet.
870
+ */
871
+ getSearchSeen() {
872
+ return this.state.searchSeen ?? [];
873
+ }
874
+ /**
875
+ * Replace the search seen-set (#1528). Callers merge the just-surfaced URLs
876
+ * and cull stale entries before calling this; the manager only persists.
877
+ */
878
+ setSearchSeen(seen) {
879
+ this.state.searchSeen = seen;
880
+ this.autoSave();
881
+ }
866
882
  setStatusOverride(url, status, lastActivityAt) {
867
883
  if (!this.state.config.statusOverrides) {
868
884
  this.state.config.statusOverrides = {};
@@ -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, } 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, } 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
  /**
@@ -677,12 +677,7 @@ export declare const SearchOutputSchema: z.ZodObject<{
677
677
  }>;
678
678
  viabilityScore: z.ZodNumber;
679
679
  grade: z.ZodObject<{
680
- letter: z.ZodEnum<{
681
- A: "A";
682
- B: "B";
683
- C: "C";
684
- F: "F";
685
- }>;
680
+ score: z.ZodNumber;
686
681
  reason: z.ZodString;
687
682
  }, z.core.$strip>;
688
683
  repoScore: z.ZodOptional<z.ZodObject<{
@@ -738,12 +733,7 @@ export declare const FeaturesOutputSchema: z.ZodObject<{
738
733
  }>;
739
734
  viabilityScore: z.ZodNumber;
740
735
  grade: z.ZodObject<{
741
- letter: z.ZodEnum<{
742
- A: "A";
743
- B: "B";
744
- C: "C";
745
- F: "F";
746
- }>;
736
+ score: z.ZodNumber;
747
737
  reason: z.ZodString;
748
738
  }, z.core.$strip>;
749
739
  repoScore: z.ZodOptional<z.ZodObject<{
@@ -796,12 +786,7 @@ export declare const FeaturesOutputSchema: z.ZodObject<{
796
786
  }>;
797
787
  viabilityScore: z.ZodNumber;
798
788
  grade: z.ZodObject<{
799
- letter: z.ZodEnum<{
800
- A: "A";
801
- B: "B";
802
- C: "C";
803
- F: "F";
804
- }>;
789
+ score: z.ZodNumber;
805
790
  reason: z.ZodString;
806
791
  }, z.core.$strip>;
807
792
  repoScore: z.ZodOptional<z.ZodObject<{
@@ -1260,12 +1245,13 @@ export interface SearchCandidate {
1260
1245
  /** 0-100 scale composite viability score. Sanitized on the boundary (#1043): out-of-contract values are coerced to 0 and logged. */
1261
1246
  viabilityScore: number;
1262
1247
  /**
1263
- * Letter grade (A/B/C/F) computed from the autopilot-tracked repoScore.
1264
- * Scout's `search` does not emit per-candidate projectHealth, so scout-side
1265
- * signals are treated as unknown; unscored repos grade 'F'. See #1043.
1248
+ * Success-likelihood score (1-10) computed from the autopilot-tracked
1249
+ * repoScore. Scout's `search` does not emit per-candidate projectHealth, so
1250
+ * scout-side signals are treated as unknown; unscored repos score 1. See
1251
+ * #1043.
1266
1252
  */
1267
1253
  grade: {
1268
- letter: 'A' | 'B' | 'C' | 'F';
1254
+ score: number;
1269
1255
  reason: string;
1270
1256
  };
1271
1257
  repoScore?: {
@@ -1550,9 +1536,9 @@ export interface VetOutput {
1550
1536
  reasons: string[];
1551
1537
  modelVersion: string;
1552
1538
  } | null;
1553
- /** Success-likelihood grade (#858): predicts whether a PR will merge. */
1539
+ /** Success-likelihood score (#858, 1-10): predicts whether a PR will merge. */
1554
1540
  grade: {
1555
- letter: 'A' | 'B' | 'C' | 'F';
1541
+ score: number;
1556
1542
  reason: string;
1557
1543
  };
1558
1544
  }
@@ -356,7 +356,7 @@ const SearchCandidateSchema = z.object({
356
356
  searchPriority: SearchPrioritySchema,
357
357
  viabilityScore: z.number(),
358
358
  grade: z.object({
359
- letter: z.enum(['A', 'B', 'C', 'F']),
359
+ score: z.number().min(1).max(10),
360
360
  reason: z.string(),
361
361
  }),
362
362
  repoScore: z
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "3.14.5",
3
+ "version": "3.15.0",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -54,7 +54,7 @@
54
54
  "dependencies": {
55
55
  "@octokit/plugin-throttling": "^11.0.3",
56
56
  "@octokit/rest": "^22.0.1",
57
- "@oss-scout/core": "^1.2.1",
57
+ "@oss-scout/core": "^1.2.2",
58
58
  "commander": "^15.0.0",
59
59
  "zod": "^4.4.3"
60
60
  },