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

@@ -228,7 +228,7 @@ public sealed class WorkspaceSequenceSource : ISequenceSource, IProjectRenders
/// The render at the home (owner review 2, R8: edit with proxies, render where the originals are): one job of this PC's
/// engine per preset, with the project's portable settings (positions parked by photo, placed on the home's frames by
/// the render) and the project recorded on the render; the version too when the settings are those of the last
/// version saved (an unsaved working state renders as it is, without a version).
/// version the home holds (an unsaved working state, or one saved here and not sent yet, renders as it is, without a version).
/// </summary>
public IReadOnlyList<ArchiveJobRequest> RenderRequests(Sequence sequence, ProjectSettings project, ExportSettings export, int sourceWidth, int sourceHeight)
{
@@ -293,12 +293,16 @@ public sealed class WorkspaceSequenceSource : ISequenceSource, IProjectRenders
}
}
/// <summary>The last version saved: the newest one not sent yet, else the base; with its content hash.</summary>
/// <summary>
/// The version a render may name, with its content hash: the base, which the home holds, while no version waits to be
/// sent; none otherwise. A version not sent yet may never reach the home under its id (a replay or a save-both sends it
/// under another), so a render of it names the project alone.
/// </summary>
private (Guid? Id, string? Hash) Tip()
{
try
{
if (_sync.Unpushed(ProjectId) is { Count: > 0 } unsent) return (unsent[^1].Id, unsent[^1].ContentHash);
if (_sync.Unpushed(ProjectId).Count > 0) return (null, null);
return Project.ReadBundle().Workspace?.Base is { } basis ? (basis.VersionId, basis.ContentHash) : (null, null);
}
catch (Exception ex) when (ex is IOException or InvalidDataException or InvalidOperationException)