feat(worker): opportunistic provenance backfill during scan

Wire tryProvenanceBackfill into processOneArchiveSet: before downloading
a scanned ZIP/RAR/7Z, check whether it's the true origin of a
placeholder-provenance package in the destination channel and backfill
in place, skipping the download. Add the zipsBackfilled counter through
PipelineContext, updateRunActivity, and completeIngestionRun.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-23 14:23:53 +02:00
co-authored by Claude Opus 4.8
parent 4a7b9e2a09
commit 7ddf13053f
2 changed files with 56 additions and 0 deletions
+3
View File
@@ -376,6 +376,7 @@ export interface ActivityUpdate {
zipsFound?: number;
zipsDuplicate?: number;
zipsIngested?: number;
zipsBackfilled?: number;
}
export async function updateRunActivity(
@@ -399,6 +400,7 @@ export async function updateRunActivity(
...(activity.zipsFound !== undefined && { zipsFound: activity.zipsFound }),
...(activity.zipsDuplicate !== undefined && { zipsDuplicate: activity.zipsDuplicate }),
...(activity.zipsIngested !== undefined && { zipsIngested: activity.zipsIngested }),
...(activity.zipsBackfilled !== undefined && { zipsBackfilled: activity.zipsBackfilled }),
...(activity.currentTopicId !== undefined && { currentTopicId: activity.currentTopicId }),
...(activity.currentAccountChannelMapId !== undefined && {
currentAccountChannelMapId: activity.currentAccountChannelMapId,
@@ -429,6 +431,7 @@ export async function completeIngestionRun(
zipsFound: number;
zipsDuplicate: number;
zipsIngested: number;
zipsBackfilled: number;
}
) {
return db.ingestionRun.update({