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>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-03 10:19:56 +01:00
1 parent 50e28fd63d
commit 833d7cf8e9
18 files changed
+950 -92

No files matched your search

@@ -1,3 +1,4 @@
using Chronos.Core.Localization;
using Chronos.Core.Project;
using Chronos.Testing;
@@ -107,6 +108,23 @@ public sealed class ProjectBundleTests(TestContext context)
Assert.Throws<InvalidDataException>(() => ProjectBundle.Load(path));
}
[Test]
public void AFileNoReadCouldTakeBackIsRefusedBeforeItIsWritten()
{
var folder = context.CreateTempDirectory("bundle");
var path = Path.Combine(folder, "huge.chronos");
var sample = Sample();
var huge = sample with { Sequence = sample.Sequence with { Title = new string('x', ProjectBundle.MaxBytes) } };
var refused = Assert.Throws<ProjectTooLargeException>(() => huge.Save(path));
Assert.Equal(Loc.L("Errors.Project.TooLarge", ProjectBundle.MaxBytes >> 20), refused.Message);
Assert.False(File.Exists(path));
Assert.Empty(Directory.GetFiles(folder));
// Within the limit, the file is written and read back.
sample.Save(path);
Assert.Equal(sample.Sequence.Title, ProjectBundle.Load(path).Sequence.Title);
}
[Test]
public void FramePositionsApplyOnlyToTheFramesTheyWereSavedFor()
{