Files
Chronos/tests/Chronos.Core.Tests
Alby96 8127373fd5 fix(reorganize): never name a folder or title after a photo no longer first, and retry a kept job honestly
A Reorganize step whose photos changed after the plan kept its file names but still moved its folder and wrote
the title the plan had computed from the old first photo, so a trashed first photo or an earlier photo filed
since left the sequence named after a photo that is no longer first. The plan now journals its folder and
title templates, and under the step's leases each folder move or retitle is expanded again from the settled
sidecar: it is applied only when it gives what the plan gives (the folder itself or its " (n)"); otherwise the
sequence stays as it was (Dropped, "changed after the plan"), or keeps its title and file names when an
interrupted run moved its folder already (TitlesKept). Plans journaled before this change are applied as made.

A Move job that ended failed with sequences kept, or whose held plan was given up, kept its plan:<id>
checkpoint after the plan's journal was gone, so a retry logged "completed when the archive was opened" and
ended done. Such a job now saves the checkpoint "applied": a retry plans again and applies only a plan that is
still the one confirmed. A job that succeeds keeps plan:<id>, so a crash before it is marked done still finds
the plan completed.

Sequences a folder was to carry when that folder stayed (dropped, its title edited, its names no longer given,
or a newer sidecar) were reported as "changed after the plan", and a newer-format carrier failed the job with
ReorganizeKept. They are now a separate outcome, CarriedKept (journaled), logged with the new
Archive.Log.ReorganizeCarriedKept (en+it) and not counted in the job's error, which follows the carrier's own
reason.

When a step's sidecar cannot be read or written after its folder moved, every sequence of the step is told
(sequenceChanged "reorganized") before the failure is thrown, since the retry that would tell them may never
come.

Tests: Core APlanKeepsItsTemplatesSoTheNamesOfAFirstPhotoNoLongerFirstAreTold; Data
AFolderOrTitleNamedAfterAPhotoNoLongerFirstIsNeverGiven, ARetryOfAJobThatKeptSequencesPlansAgain,
ASequenceAFolderWasToCarryIsToldItStayedWithIt, AnArchiveOpensWhenAnInterruptedRenameMeetsASidecarOfANewerFormat,
AResumedStepWhoseFolderMovedKeepsATitleEditedSinceAndTheNamesFromIt, and
AMovedFolderWhoseSidecarCannotBeReadThereHasItsIndexRowFollowAndIsTold, which breaks the sidecar with a
relative symbolic link instead of a read-only file, so it also runs on the Linux runner as root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 130701afab224d47ea066eb7cc8debb16d1fb432)
2026-10-27 19:16:27 +01:00
..