| 276 | } |
| 277 | |
| 278 | async function loadResumeIds(output: string): Promise<Set<number>> { |
| 279 | if (!existsSync(output)) return new Set(); |
| 280 | const ids = new Set<number>(); |
| 281 | const text = await readFile(output, "utf8"); |
| 282 | for (const line of text.split("\n")) { |
| 283 | if (!line.trim()) continue; |
| 284 | try { |
| 285 | const row = JSON.parse(line); |
| 286 | if (typeof row.github_repo_id === "number") { |
| 287 | ids.add(row.github_repo_id); |
| 288 | } |
| 289 | } catch { |
| 290 | // ignore |
| 291 | } |
| 292 | } |
| 293 | return ids; |
| 294 | } |
| 295 | |
| 296 | async function discoverCandidates(args: Args): Promise<Map<string, Candidate>> { |
| 297 | const candidates = new Map<string, Candidate>(); |