fix: projects and the workspace copy follow phase 4's folder and conversion rules

Phase 5a was written on an early phase 4a state. On top of phase 4b it now
keeps the rules every writer of a sequence's folder follows, and keeps
project versions intact through Reorganize and conversions:

- ProjectService writes project sidecars, project.json and the settings
  only under the sequence's lease and only in a folder that holds the
  sequence (SequenceFolders.Holds). A folder another index moved away, or
  one another sequence was moved into, is refused with
  SequenceFolderMovedException: reads answer from the index, so no
  project is taken for gone, nothing is written into the other sequence's
  folder and the old folder is never created again. The home reports it
  as out of reach. Full scans and rebuilds reconcile projects the same
  way, and a failure there is logged instead of failing the scan.
- Stored versions park positions by photo and now follow the encodings a
  Replace conversion (or its undo) joined through the sequence's Replaced
  tombstones (PhotoAlias, HomePhotos): Main's mirror, renders of a
  version and workspace media place them on the converted frames.
  ProjectContent.Rebind/SameChoices name parked photos as the frames hold
  them now, so a conversion or a hash since is no "external" Main version
  and no spurious "Modified" in a workspace, and merges see one photo.
- The workspace copy job only reads the archive: it no longer runs the
  archive's proxy pass, makes missing proxies in the workspace, reads
  only a folder that holds the sequence, starts again when the folder
  moved or files were renamed during the copy, resumes from a checkpoint
  of its frames version, and refuses a workspace folder inside any
  library before it writes anything (Errors.Workspace.InsideLibrary).
  The working state keeps its positions by frame where frames stay.
- ArchiveProjectHome looks for a project or version the index does not
  know yet in the sequence's sidecars first (an index taken back from a
  backup, a sequence back from the trash), instead of calling it gone.

Tests cover the moved and taken folder, conversions in the archive and in
the workspace, the copy refusing a workspace in a library, resuming on
other frames, the alias lookup and the rebinding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-02 10:14:39 +01:00
1 parent b9d1c396a1
commit 50e28fd63d
18 files changed
+596 -91

No files matched your search

+3 -3
View File
@@ -36,7 +36,7 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S
| `Advice` | `Advisor`: recommendations with localisable reasons, apply/optimise, sequence presets |
| `Motion` | FFT, phase correlation, pyramids, optical flow, motion blur, stabiliser, virtual camera, interpolation, stacking |
| `Math` (namespace `Chronos.Core.Mathematics`) | Splines, LOWESS, statistics, solar position, 3×3 colour matrices |
| `Project` | `ProjectSettings` (Auto/manual values; members a newer Chronos wrote kept in `Extra` and written back; one of a newer settings format read with `FromJson(json, allowNewer: true)`, `IsNewerFormat`: read-only), export presets, `ProjectBundle` (the `.chronos` project file: sequence reference and settings; format 2 adds the `workspace` section of a workspace's working state: project, name, Main, home, base version, media; a file without it is still written as format 1), `ProjectContent` (the portable form of project versions: every frame position parked by photo with `TranslateFramePositions`, placed back on any copy's frames; canonical text, content hash = SHA-256 of its UTF-8 bytes) |
| `Project` | `ProjectSettings` (Auto/manual values; members a newer Chronos wrote kept in `Extra` and written back; one of a newer settings format read with `FromJson(json, allowNewer: true)`, `IsNewerFormat`: read-only), export presets, `ProjectBundle` (the `.chronos` project file: sequence reference and settings; format 2 adds the `workspace` section of a workspace's working state: project, name, Main, home, base version, media; a file without it is still written as format 1), `ProjectContent` (the portable form of project versions: every frame position parked by photo with `TranslateFramePositions`, placed back on any copy's frames; canonical text, content hash = SHA-256 of its UTF-8 bytes; `Rebind`/`SameChoices` name each parked photo as the frames hold it now, so a photo hashed or converted since is no change of the choices), `FramePhotos` (the photos of one copy's frames; a photo named by an encoding a conversion replaced, or its undo, is found through `PhotoAlias` links) |
| `Render` | Render plan (timing modes), preparation pass, geometry, `RenderPipeline`, self-test suite |
| `Export` | Preset resolution, encoder selection with fallbacks, output naming |
| `Video` (+ `Mp4`, `Avi`, `Bitstream`, `Yuv`, `Managed`) | `IVideoEncoderProvider`, MP4 muxer and inspector, AVI-MJPEG, NV12/P010, managed encoders (MJPEG-AVI, GIF, APNG, image sequences) |
@@ -61,8 +61,8 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S
| `Housekeeping` | `BackupJobHandler`, `CleanupJobHandler`, `ICleanupStep` with the shared steps (`CleanupSteps`: job history, audit log, trash report that never deletes); hosts add their own steps through `ArchiveServiceOptions.CleanupSteps` |
| `Archiving` | `ArchiveService` (create/adopt/open, archive settings written to `archive.json` then the index, `ArchiveSettings.CheckTemplates` and `TemplateRuleException` holding a template given anew to the template rules; `UnderLeaseAsync`: a write under a sequence's lease with its row read under it), `ArchiveIndexer` (scan, rebuild; a sequence found in another folder takes its exports' paths along; a full scan or a rebuild takes the projects' sidecars back too), `ArchiveIngest` (uploads and imports, named through `FrameNaming`), `ImportService`, `ArchiveVerifier`, `ArchiveImages` (thumbnail and proxy passes, several photos at once through `OrderedWork`, which hands results back in frame order), `FrameTiers` (decode tier, `PreviewOnly`/`Undecodable` flags and preview size of frames, written to sidecar and index by the light analysis, deep analysis, renders and image passes), `GprCompanions` (the JPEG of each GoPro GPR, found in the index when an import kept it in another sequence), `ArchiveMaintenance`, `MassRenamer` (mass rename and Reorganize: the dry run reads each sidecar for a file template; each step checked under its leases before anything of it moves (where its sequences are, what is inside and at its new folder, a sidecar of a newer format, the title it was planned from when it changes it or names the folder or files after it), then the folder, with the sequences of the plan an earlier step left as they were inside it (taken along, their title and file names kept), every index row (the frame paths and render paths of the exports inside it, a file or an image-sequence folder, its own unless the export is still at the old place and another sequence's when it moved with it, follow it in one transaction; a sidecar that cannot be read or written then still has its row follow, and fails the step), then the files under the plan's journal in `journal/` (a sequence whose photos changed since, such as one still receiving them, or whose files are found changed or in use or have their new names taken keeps its file names, the renames being pinned by digest, and the step and the plan go on); the journal keeps the tally of the whole plan, and a plan its job held (paused, cancelled or failed) is left to that job, only its half-done file renames completed at an archive open, which completes any other plan an interruption left and tells each sequence changed; the file renames of a step: sidecar, a sequence whose sidecar cannot be read staying as it is with every folder around it, index (`FrameRepository.RenameFilesAsync`) and the sequence's journal), `SequenceFolders` (`Holds`: the folder the index has for a sequence is there and its sidecar names no other sequence; every writer into a sequence's folder asks it), `SequenceTrash` (delete into the archive's hidden trash with a dry run, restore; the folder moves back when the index step fails; lists sequence and photo entries; `SequenceTrash.Empty`: the emptying's dry run, fingerprint and erase, each entry checked against its fingerprint again under its lease), `FrameTrash` (photos of a sequence into `trash/photos` with a dry run, a journal that undoes an interrupted deletion whose entry stays unlisted until its sidecar is written, tombstones (a photo never hashed is hashed as it goes; one whose original is missing goes without a file or tombstone; a frame that stays and may be a twin is hashed, its hash kept), positions parked and placed back, proxies and thumbnails moved to follow their frames; `FrameTrash.Restore`: restore re-hashes each file and says why each kept photo stayed (`KeptReason`), under a journal of its own into the sequence that another writer settles only under the entry's lease, into a new sequence through the ingest when theirs is gone, each original staged inside its own entry and the record rewritten after each photo filed; a replaced entry swaps back while its converted frames are unchanged; `FrameTrash.Replace`: the files of frames swapped in place, same ids and indices, the old files into one `Replaced` entry with their replacements' hashes and a copy of `analysis.json`, tombstones aliasing old content to new, under `.chronos/replace.pending.json`, which the next writer undoes or completes), `MassConverter` (conversion's dry run with busy, offline and unreadable sequences and the space against `ArchiveServiceOptions.FreeSpace`; the job's stage A converts into `staging/convert-<job>/` with `OrderedWork`, each staged file appended to `journal/convert-<job>.staged`; stage B per sequence, all or nothing: replace through `FrameTrash.ReplaceAsync` (the sequence's folder read again under its lease, as every writer does), or a new sequence through the ingest with the source's tags, rating, notes and project; each sequence replaced or made told as it completes), job handlers |
| `Processing` | `ProcessingService`, `SequenceAnalyser`, `DeepReports` (a saved deep report while it still describes the frames), `SequenceRender`, `ProjectStore`, `ProjectBundles` (a `.chronos` file for a sequence, and the sequence a file names), `RenderNodeClient`, job handlers |
| `Projects` | `ProjectService` (`ArchiveService.Projects`: the projects of this PC's sequences as a home, under the sequence's lease: list, create, rename, delete into `projects/.trash`, history, push with fast-forward / idempotent repeat / divergence / hash and portability checks; each call first catches up: the sidecars into the index (`ProjectIndexer`, also run by full scans and rebuilds; a version file a push left past its record adopted, a stray one moved to `versions/.stray`), Main made from the sequence's settings, settings another path wrote appended to Main as an `external` version, a mirror a crash cut short completed or merged; a push to Main mirrored into `project.json` and the settings with the settings version check), `ProjectSidecars` (record and immutable version files, the settings as a JSON string checked against their hash), `ProjectMerge` (three-way merge member by member, pending frames merged photo by photo, conflicts, `Replay` of local commits on a moved head), `IProjectHome` and `ArchiveProjectHome` (the home a workspace pushes to and pulls from; the server's comes in phase 5b) |
| `Workspaces` | `WorkspaceStore` (a folder outside the library: `workspace.json`, one folder per project, no index), `WorkspaceProject` (`project.chronos` working state, `media/` with `media.json`, `proxies/<frame id>.jpg` and `analysis.json`, `versions/`, `sync.json` for a restore or a conflict, `exports/`, the lease `.lock.lease`), `WorkspaceSync` (checkout, open, save, commit, push, pull with replay and merge, conflicts settled by keep mine, take server or save both, restore, status), `WorkspaceCopyJobHandler` (`WorkspaceJobs.Copy`, registered by the desktop only: proxies copied hash-verified and resumable, the working state's positions moved by photo onto the new frames) |
| `Projects` | `ProjectService` (`ArchiveService.Projects`: the projects of this PC's sequences as a home, under the sequence's lease and only in a folder that holds the sequence (`SequenceFolders.Holds`; otherwise `SequenceFolderMovedException`: reads answer from the index, writes are refused): list, create, rename, delete into `projects/.trash`, history, push with fast-forward / idempotent repeat / divergence / hash and portability checks; each call first catches up: the sidecars into the index (`ProjectIndexer`, also run by full scans and rebuilds; a version file a push left past its record adopted, a stray one moved to `versions/.stray`), Main made from the sequence's settings, settings another path wrote appended to Main as an `external` version, a mirror a crash cut short completed or merged; a push to Main mirrored into `project.json` and the settings with the settings version check), `ProjectSidecars` (record and immutable version files, the settings as a JSON string checked against their hash), `ProjectMerge` (three-way merge member by member, pending frames merged photo by photo, conflicts, `Replay` of local commits on a moved head), `IProjectHome` and `ArchiveProjectHome` (the home a workspace pushes to and pulls from, a project or version the index lacks looked for in the sidecars first; the server's comes in phase 5b), `HomePhotos` (a sequence's photos as positions name them, with the encodings its Replaced tombstones join) |
| `Workspaces` | `WorkspaceStore` (a folder outside the library: `workspace.json`, one folder per project, no index), `WorkspaceProject` (`project.chronos` working state, `media/` with `media.json`, `proxies/<frame id>.jpg` and `analysis.json`, `versions/`, `sync.json` for a restore or a conflict, `exports/`, the lease `.lock.lease`), `WorkspaceSync` (checkout, open, save, commit, push, pull with replay and merge, conflicts settled by keep mine, take server or save both, restore, status), `WorkspaceCopyJobHandler` (`WorkspaceJobs.Copy`, registered by the desktop only: the archive only read, from a folder that holds the sequence; a workspace inside a library refused; the archive's current proxies copied, the others made in the workspace, each hash-verified, resumable from a checkpoint of its frames version; the encodings conversions joined kept in `media.json`; the working state's positions moved by frame where frames stay, by photo where they came or went) |
| `Sync` | `SyncService` (sync table of one server: compare, link by content, settle conflicts, enqueue transfers), `SyncRules` (status, settings merge and differences, no I/O), `SyncTombstones` (photos either side removed are not offered back, a replaced photo counts as its replacement), `SyncPositions` (the settings' frame positions translated by photo to the frames of the copy they go to), `SyncLinkStore` (`sync_links`, `sync_state`), `SyncTransfers` and `SyncJobHandler` (resumable, hash-verified uploads and downloads as jobs; downloads commit through the archive ingest), `SyncAgent` (background comparison, server events, backoff, offline proxies), `ProxyCache` and `RemoteSequence` (server sequences opened with proxies), `ISyncRemote` (the server calls; `ChronosSyncRemote` over `ChronosClient`) |
### 2.3 Chronos.App areas