feat: add stage 3 round 1 enrich script and wire into orchestrator

This commit is contained in:
lila 2026-05-05 19:28:38 +02:00
parent 76af2ab093
commit 9642daf6dd
2 changed files with 493 additions and 4 deletions

View file

@ -7,6 +7,7 @@ import { openDb } from "./db/index.js";
import { reverseLink } from "./stage-2-reverse-link/scripts/reverse-link.js";
import { ALL_PROVIDERS, validateProviderKey } from "./stage-3-enrich/config.js";
import type { ProviderConfig } from "./stage-3-enrich/config.js";
import { enrich } from "./stage-3-enrich/scripts/enrich.js";
// ── Types ─────────────────────────────────────────────────────────────────────
@ -248,10 +249,15 @@ function runReverseLinkStage(): void {
markReverseLinkComplete();
}
function runRound1(provider: ProviderConfig, stats: RunStats): void {
async function runRound1(
provider: ProviderConfig,
stats: RunStats,
): Promise<void> {
console.log(`\n [round 1] Running ${provider.name}...`);
// TODO: implement round 1 enrich script
console.log(` [round 1] ${provider.name} — not yet implemented`);
const counts = await enrich(provider);
stats.recordsProcessed += counts.processed;
stats.recordsSkipped += counts.skipped;
stats.needsReview += counts.needsReview;
stats.modelsRun.push(provider.name);
}
@ -492,7 +498,7 @@ async function main(): Promise<void> {
console.log(` [round 1] ${provider.name} — resuming...`);
}
runRound1(provider, stats);
await runRound1(provider, stats);
}
if (shutdownRequested) {