Commit Graph
11 Commits
Author SHA1 Message Date
Alby96 775deda0f4 Merge branch 'review2-p5a-fix2-workspace' into review2-p5a-int2
# Conflicts:
#	src/Chronos.Data/Workspaces/WorkspaceSync.cs
2026-11-03 12:12:19 +01:00
Alby96andClaude Opus 5.5 e23cba3ee1 fix(workspace): phase 5a fix round 2, workspace sync and copy
A Save both, a recorded conflict and a damaged version file could each leave
a local version out of the chain or a copy half-made at the home. This round
makes every one of these end with nothing lost and nothing half done.

- Save both retry: a journaled copy somebody else sent a version to (or one
  deleted since) is left as it is, and a new copy takes every local version.
  A divergence met at the copy while sending also makes a new copy, once.
- Keep mine, Take server, or a pull that settles a conflict after a Save both
  was cut short first send the rest of the journaled versions to that copy,
  if it is still this workspace's. The journal is cleared at the commit point.
- A conflict of format met past local versions the home already stored
  (their answer lost) now moves the base onto them, like any other conflict.
  The conflict, the base and the chain then name one version. A save-both
  journal follows the base when it moves.
- A conflict recorded before stays while the home holds no version after
  the base. A base that has reached the conflict's head clears it.
- Take server no longer replays or sends the version it saves first when,
  replayed, that version holds only the server's values. It stays in
  versions/.replaced for the undo. The test checks the exact history again.
- Version files after the base that cannot be read, or that do not follow
  from it, are listed (WorkspaceProject.UnreadableVersions). The new state
  WorkspaceState.Damaged shows them. Commit, push, pull and resolve refuse to
  go past them. A damaged file whose version the home holds takes the home's
  copy at the next sync, and the damaged file is kept aside. Remove local
  copy counts these files as unsent.
- PushOutcome.TooLarge raises its own WorkspaceSyncException message. The
  desktop says Errors.Workspace.VersionTooLarge for it and for
  ProjectVersionTooLargeException when a local commit is too large.
- The editor maps LeaseUnavailableException from opening a busy project to
  Errors.Workspace.Busy.
- The copy job no longer deletes, during the pass, a proxy that the editor's
  current media name. RemoveStale removes it after the commit. A resumed run
  does not keep such a file as a frame whose photo changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:31:18 +01:00
Alby96andClaude Opus 5.5 43b092bd5d fix(workspace): newer-format editor stays usable; media learn the home's photo names
A pull onto a newer Chronos's settings made the editor throw: ProjectHistory.Replace
rebased every undo and redo snapshot through ProjectMerge, which refuses to merge a
newer format when both sides changed, so any non-empty undo stack broke the reload
after a sync that had succeeded. Replace now drops the steps instead when either side
(or a step) is of a newer format: the project is shown read-only and undo never brings
back values from before the newer settings.

The media learnt the home's hashes and conversion aliases only inside a replay, so a
status or Save version before that compared a SHA-named base with photo-named media
and read a false Modified or saved a version that only re-keyed photos. Now:
- ProjectContent.SameChoices also compares the texts as placed on the frames, hashed
  or not (Bound), so status and commit without a home agree with the base;
- a status asked of the home teaches the media its names (written under the lease, or
  when the lease is free), and so does a checkout of a project already here;
- WorkspaceStatus.MediaOutdated reports frames moved at the home, or names the media
  could not learn yet, and the project menu offers Update media for it (tooltip text
  updated in en and it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:19:21 +01:00
Alby96andClaude Opus 5.5 8256b72913 fix: integrate phase 5a fix round 1
Taking the server's values now saves unsaved changes as a version first
(desktop fix), while a conflict of format refuses that choice (merge fix):
the save is skipped for a conflict of format, so a refused choice leaves
the local versions as they were. A project that moves onto a newer
Chronos's head with nothing of its own now adopts the home's copies of
the local versions the home already held, as a replay does, since the
replay no longer writes over unsent files before the base moves
(workspace fix). The recovery test of a conflict met past a held version
checks the versions before the one Take the server's saves first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:49:53 +01:00
Alby96 1a35fcdb27 merge: review2-p5a-fix-desktop into phase 5a fix round 1 integration
# Conflicts:
#	src/Chronos.Data/Workspaces/WorkspaceSync.cs
2026-11-03 10:40:02 +01:00
Alby96 9772c2f934 merge: review2-p5a-fix-workspace into phase 5a fix round 1 integration
# Conflicts:
#	src/Chronos.Data/Workspaces/WorkspaceSync.cs
2026-11-03 10:39:19 +01:00
Alby96andClaude Opus 5.5 8027d84f7e fix(workspace): settle only the conflict shown, keep what a choice replaces, desktop gaps of phase 5a
Review 2, phase 5a, fix round 1 (desktop and the engine side of Resolve and Restore).

- Resolve applies Keep mine / Take the library's only to the conflict the dialog listed:
  when the head or what differs moved since, the new conflict is recorded and asked again;
  Sync re-works a pending conflict instead of re-showing a stale list. Take the library's
  first saves uncommitted changes as a version, and the editor takes it as one undo step
  (toast Undo, Ctrl+Z) that brings back only the settings both changed.
- Restore saves unsaved changes as a version also while a conflict waits; a restore that
  changed nothing, or was undone, no longer marks the next version as a Restore.
- The editor's saves and merges of a workspace project merge positions photo by photo
  (portable form) and ask where both sides changed a setting, never deciding for ours.
- Read-only after a pull is signalled, and no save that can never be stored is left behind.
- The chip is read again after edits; a background conflict waits for the open dialog;
  Send first and Delete show the conflict they met; Discard changes needs the typed name.
- Open project... reaches the library's other projects (Save both's sibling, also from
  its toast); copies whose project or sequence is gone read Not in library and can be
  removed from the picker's Workspace rows; a delete whose local copy stays says so.
- A workspace folder inside a library is refused before anything is written.
- Conflict and Compare lines name heroes, exclusions and keyframes; History shows the PC
  name alone, never the program's prefixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:22:17 +01:00
Alby96andClaude Opus 5.5 833d7cf8e9 fix(workspace): every cut of a sync is recoverable, renders name only versions the home holds
A push now moves the base before its local file reads as sent; a replay
journals itself in sync.json, writes the replayed versions, then the base
(the commit point), and only then sets the old ones aside and adopts the
local commits the home already held; a conflict met past such commits moves
the base onto them first. A save-both journals its copy and the ids it sends
under, so a retry completes the same copy instead of making another. The
next push, pull or resolve finishes or undoes whatever a cut left, so no
version is orphaned and no false conflict appears.

The editor reads the working state and the media index under the project
lease; workspace.json is written whole and moved into place (an empty one is
made again); project files may hold 64 MiB and one that would be larger is
refused before it is written, so large projects check out. The workspace copy
checks the drive's free space before and during the copy, keeps the folder in
its checkpoint and stores a reset when a pass starts again, and runs at High
level in the priority queue. Renders record a version only when the index
holds it with the settings rendered; an unsent version renders as the project.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:19:56 +01:00
Alby96andClaude Opus 5.5 eac4a36a7b fix(projects): one photo merges as one, newer settings are never merged
A workspace copied before the home hashed or converted a photo named it
differently from the versions the home made since, so a pull merged the
same photo as two: frame edits were silently undone and Keep mine placed
the library's value. Before replaying, the workspace media now learn the
home's hashes (same frame id, size and capture time) and conversion
aliases, so every side names each photo alike. Rebind also gives a
renamed entry the occurrence a placement looks for, so positions on
burst photos keep applying once hashed, and folds entries of one photo
(in Rebind and in the merge's keyed form) instead of keeping one.

Settings of a newer Chronos are no longer merged member by member with
this one's: ProjectMerge refuses when both sides changed. A workspace
pull keeps its local versions and working state untouched and records a
conflict of format that only Save both settles (into a new project of
this format); with nothing local it takes the newer head read-only.
Main's catch-up leaves a newer head and settings written meanwhile as
they are.

When Main's catch-up merge overrides values another writer stored, that
writer's settings are kept as an External version before the Merge one,
so nothing is lost from the history.

Unknown members inside Auto values, camera keyframes and curve points,
and on pending entries once placed, are kept like ProjectSettings' Extra.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:05:27 +01:00
Alby96andClaude Opus 5.5 50e28fd63d 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>
2026-11-02 10:14:39 +01:00
Alby96 03d32f18d3 feat(projects): workspace projects with linear versions, the local archive as their home
Owner review 2, phase 5a (R8): editing moves out of the library into a workspace on a fast disk, and a
sequence gets several projects, each with a linear version history pushed and pulled like git.

- Core: ProjectSettings keeps members a newer Chronos wrote (Extra) and reads a newer settings format
  read-only; ProjectContent is the portable form of a version (every frame position parked by photo,
  canonical text, SHA-256 content hash); ProjectBundle format 2 adds the workspace section, and a file
  without it is still written as format 1. JobKind.WorkspaceCopy = 20 (19 kept for Convert).
- Data: migration 0009 (projects, project_versions, the render's project columns); ProjectService on
  ArchiveService.Projects keeps projects as sidecars first (.chronos/projects/<id>/), then the index,
  under the sequence lease: create, rename, delete into the projects' trash, history, push with
  fast-forward, idempotent repeat, divergence and hash checks. Main is made from the sequence's settings
  and mirrored both ways, so every older code path keeps working; outside writes become "external"
  versions, a mirror a crash cut short is completed or merged. Full scans and rebuilds take the projects
  back from their sidecars.
- ProjectMerge moves from the App to Data/Projects, merges pending frames photo by photo and replays
  unpushed commits on a moved head.
- Workspaces: WorkspaceStore, WorkspaceSync (checkout, save, commit, push, pull with replay and merge,
  conflicts settled by keep mine / take server / save both, restore, status) and the WorkspaceCopy job
  (proxies copied hash-verified and resumable; originals refused until phase 5c).
- Renders of a project version place its positions on the frames and record the project and version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit c4c1802884e403db8759ed0501f770a67a047f20)
2026-10-27 22:51:32 +01:00