Fix provenance-backfill multipart offsets, incomplete-fingerprint fallback, and add name-size audit trail

Multipart ZIP fingerprint reads now use per-part sizes instead of the
whole-archive total, so the tail download offset stays within the last
part's bounds on both the scanned side and the destination-copy side
(scannedFileId replaced with an ordered scannedParts list). A fingerprint
comparison is now only treated as a real mismatch when both sides have
complete CRCs and differ; incomplete comparisons (e.g. empty files) fall
back to name+size confidence instead of silently refusing to backfill.
Name+size-confidence backfills now also create an INFO
INTEGRITY_AUDIT systemNotification for later review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-23 14:46:45 +02:00
co-authored by Claude Opus 4.8
parent 7595543386
commit ceae4f384b
2 changed files with 105 additions and 33 deletions
+1 -1
View File
@@ -1673,7 +1673,7 @@ async function processOneArchiveSet(
sourceCaption: archiveSet.parts[0].caption ?? null,
remoteUniqueId: archiveSet.parts[0].remoteUniqueId ?? null,
creator: derivedCreator,
scannedFileId: archiveSet.parts[archiveSet.parts.length - 1].fileId,
scannedParts: archiveSet.parts.map((p) => ({ fileId: p.fileId, fileSize: p.fileSize })),
previewData: null,
previewMsgId: preview?.id ?? null,
});