feat(server/m7-381): RunScan orchestrator chains library+backfill+enrich

Adds internal/library/scanrun.go with RunScan, which creates a scan_runs
row and sequences file-walk → MBID backfill → cover enrich, persisting
per-stage tallies as jsonb. Extends coverart.EnrichBatch to return
(processed, succeeded, failed, err) so the orchestrator can classify
outcomes. Replaces main.go's two separate boot goroutines with a single
RunScan call; passes nil scanner in the no-startup-scan branch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-04 20:08:48 -04:00
parent 1ed6ca0309
commit 65a3c4892c
4 changed files with 203 additions and 33 deletions
+1 -1
View File
@@ -219,7 +219,7 @@ func TestEnrichBatch_DrainsNullSourceOnly(t *testing.T) {
}
e := NewEnricher(pool, discardLogger(), nil, false)
processed, err := e.EnrichBatch(context.Background(), 100)
processed, _, _, err := e.EnrichBatch(context.Background(), 100)
if err != nil {
t.Fatalf("batch: %v", err)
}