fix(archive,analysis): an unreadable photo changes nothing; a report stale by proxies never replaces a current one

The orphans fix and scans treated a folder whose only new photo could not be
read yet (held open, no permission, an offline placeholder) as changed: the
sidecar was rewritten, the covering flags cleared and analyses queued again at
every click. SequenceAdopter.Reconcile now returns null when it indexed nothing
and changed no flag, as its contract says.

A deep pass counted as current by frames version alone, so a pass whose verdict
a proxy made stale overwrote the report a later pass made from the proxies,
then dropped the deep status. It now counts as current only when its report
describes the frames as they are, and otherwise replaces only a saved report
that does not describe them either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-13 00:31:30 +00:00
1 parent 00823b0328
commit 0085765a12
4 files changed
+84 -12

No files matched your search

@@ -62,6 +62,9 @@ public static class SequenceAdopter
if (flagChanges.Count == 0 && orphans.UnindexedFiles.Count == 0) return null;
var updated = flagChanges.Count == 0 ? manifest : SequenceFrames.Update(manifest, flagChanges);
var (added, first) = ReadFrames(sequence, orphans.UnindexedFiles, cancellationToken);
// Photos that cannot be read yet (held open by another program, no read permission, a placeholder not downloaded)
// stay unindexed: with nothing else changed, nothing changed.
if (added.Count == 0 && flagChanges.Count == 0) return null;
if (updated.Camera is null && first is not null)
updated = updated with { Camera = new SidecarCamera { Make = first.Make, Model = first.Model, Serial = first.BodySerial }, Lens = updated.Lens ?? first.LensModel };
return SequenceFrames.Insert(updated, added);