feat(app): workspace projects whose home is a server, pushed and pulled like this PC's archive

Owner review 2, R8, phase 5b (client part), ported onto the final phase 5a.
A Chronos Server with the "projects" capability is now the home of
workspace projects. A server sequence is edited in the workspace like a
local one, not inside the library, and its versions sync with the server
"like git".

- Data: ServerProjectHome is an IProjectHome over ChronosClient.
  - These are HomeUnavailableException, so the workspace shows Offline: a
    server out of reach, an expired sign-in, a 503 (lease, offline archive,
    projects_unreadable), a 409 folder_in_use, and a server without projects.
  - 404 sequence/project/version and refused names are ProjectException;
    other refusals keep their meaning.
  - A deleted project's head is 404 project, so final 5a's HeadAsync NotFound
    rule reads it as Gone. The original 5b's IsLiveAsync and
    WorkspaceStatus.Gone are dropped. IProjectHome gains rename and delete.
- Data: WorkspaceJobs.CopyFromServer downloads into the workspace, through
  the desktop's session, the proxies of one frames version (or the
  thumbnails standing in for them), with the aliases of the server's
  conversions. It is rebuilt on final 5a's copy handler:
  - the copy:frame:fv:folder checkpoint, EnsureSpace (from the server's proxy
    sizes), WritingMedia, and the cancelled-copy clean-up;
  - the editor's current file is never overwritten;
  - each file is hashed as it arrives and checked on disk, four at a time.
  It never writes this PC's archive. Originals are still refused until 5c.
- Data: SyncAgent passes on the server's projectChanged events, and after a
  lost event stream it reports that changes may have been missed.
- App: SyncHost gives the server home over one session client. The Server
  screen offers Open in workspace, disabled with its reason on older
  servers, whose sequences keep opening with proxies.
- App: Edit opens or checks out server projects with final 5a's refusals:
  unreadable copies, a disabled damaged or newer Main, a refused folder. The
  "sequence left the index" refusal now applies only to projects of this
  PC's archive.
- App: the picker and the chip follow projectChanged (Server newer, Not on
  server). Every state, conflict, delete, remove and failure text uses its
  ".Server" form when one exists (WorkspaceText.ForHome). That includes 5a's
  newer-format conflict, the save conflict, the taken-values toast, Gone and
  version-too-large.
- App: a render of a server project first offers to send what is not on the
  server, then renders the version the server holds. Offline, Gone, Damaged
  and missing media hold the render. Analyses and renders run as server jobs
  (ServerJobs, shared with RemoteSequenceSource).
- Pruning keeps final 5a's rule: a version is pruned only after HoldsAsync
  reads it back.
- Strings in en and it; ARCHITECTURE, DECISIONS and CHANGELOG.

Tests:
- ServerProjectHome error mapping, using a fake handler.
- Against the in-process server:
  - two workspaces on one project: fast-forward, replay and merge, keep mine,
    take server, save both, restore;
  - the copy job verifying, resuming and following new frames;
  - a project deleted on the server (Gone from its head; a push sends
    nothing);
  - an offline server.
- SyncAgent project events.
- App tests for the host, the project menu and renders of a server home.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-04 11:45:06 +01:00
1 parent e2ecc409a3
commit 26bab759fe
48 files changed
+3243 -409

No files matched your search

+10
View File
@@ -626,3 +626,13 @@ One line per decision: date · decision · alternative · reason.
| 2026-11-04 | `ChronosAddress` refuses a link-local IPv6 address with a zone index (`fe80::1%12`): *Invalid address*. | Keep the zone as `%25` | `Uri` and the connection would drop the zone, failing later with a less clear error; the LAN address or name works. |
| 2026-11-04 | Screenshot baselines are captured on the development PC (Europe/Rome time zone) from a Release build and committed to `tests/visual/baselines` (156 screens, owner review 3, R2); CI no longer pushes its screenshots to a `ci-screenshots` branch, the branch is deleted, and the `windows` job's token is read-only. Until a Windows runner is registered (on that PC, or a new set accepted from the runner's PC), `screenshots diff` runs locally before a pull request that changes a screen. | Keep accepting from `ci-screenshots`; merge that branch | The owner chose it: no Windows runner exists, so CI never produced a set taken at `SampleData.Now`, and the old `ci-screenshots` commit predates the fixed clock; a branch that only CI writes and that never merges is noise once baselines live in `main`. |
| 2026-11-04 | While `--capture` freezes `AppClock`, what the screens measure on the machine is shown as fixed sample values: free space 1.2 TB (`ArchiveLocations.FreeSpace` and the import plan's totals), a server latency of 12 ms, and the last sync comparison at the frozen moment taking 0.4 s. | Raise the diff tolerance; leave them measured | Measured, they moved the Server screens by 0.13–0.15 % (the latency's width shifts the rest of the status line) and the Import screens to the 0.05 % limit (the PC's free space), so baselines failed at random; a larger tolerance would hide real changes. |
| 2026-11-04 | Server home (owner review 2, R8, phase 5b): a server sequence's projects live under `/api/v1/sequences/{id}/projects` (list, create, rename, delete, head, versions, push, frames) on the same `ProjectService` as a PC's archive, gated by the `projects` capability; the desktop reaches them through `ServerProjectHome` over the signed-in session's `ChronosClient`. A server out of reach, an expired sign-in, a 503 (busy lease, offline archive, `projects_unreadable`), a 409 `folder_in_use` and a server without the projects are `HomeUnavailableException` (the workspace shows Offline and its work waits); a 404 `sequence`/`project`/`version` and a refused name are `ProjectException`s; other refusals keep their `ChronosApiException`. | A separate server-side project store | One implementation of the rules 5a hardened (leases, sidecars, journals, merges); the workspace treats both homes alike. |
| 2026-11-04 | A deleted project's head answers 404 `project` on the server, as `IProjectHome.HeadAsync` answers NotFound on a PC's archive (5a): the workspace reads Gone from the head alone. The original 5b's `IProjectHome.IsLiveAsync` and `WorkspaceStatus.Gone` are dropped in the port. | Keep the head readable and ask `IsLiveAsync` (the original 5b) | Final 5a already decides Gone from the head; one rule for both homes, and one request fewer per status. A deleted project's versions stay readable (`/versions`). |
| 2026-11-04 | Push outcomes gain `too_large` (422, `PushOutcome.TooLarge`, final 5a's 64 MiB limit), a version over the limit read by the server is 413 `too_large`, and `ProjectsUnreadableException` is 503 `projects_unreadable`; both are caught before the `IOException` → 409 `folder_in_use` mapping. The workspace words them for the home (`Errors.Workspace.VersionTooLarge.Server`). | Let them fall through as `folder_in_use` | They are not a folder in use: too large is final, unreadable is worth retrying. |
| 2026-11-04 | `ProjectService` tells what each call changed (`ProjectChangeSet` to `ArchiveServiceOptions.ProjectsChanged`) after the lease is let go, compared from the projects read before the reconcile and after the call; the server turns it into `projectChanged` events and its background `ProjectCatchUp` runs `CatchUpAsync`. The catch-up of a read-only archive (`ReadOnlyCatchUpAsync`) tells nothing. | Tell inside the lease; diff the index | Subscribers never run under a sequence's lease; the before/after read is the only one that sees records the reconcile healed. |
| 2026-11-04 | Kept versions on a server home are pruned as on a PC's archive: each version file goes only after `HoldsAsync` read that version back from the home with the same hash (one request per version). | One listing of the server's versions (the original 5b) | Final 5a's rule: a listing does not prove the stored bytes; pruning is rare and small. |
| 2026-11-04 | The workspace copy of a server's sequence (`WorkspaceJobs.CopyFromServer`) downloads through the desktop's session (`ISyncConnector`), never this PC's archive: one frames version with its aliases, each proxy (else the thumbnail standing in, `FileKind` thumb) hashed as it arrives and checked on disk, four at a time, resumable from final 5a's `copy:frame:fv:folder` checkpoint, the editor's current file never overwritten (other bytes under `ProxyName(id, sha)`), the space checked against the server's proxy sizes (the manifest has no file sizes), a cancelled first copy cleared like 5a's. | Copy through the proxy cache | The cache is the proxy editor's; the workspace owns its media. |
| 2026-11-04 | Texts of a server's project are their key's `.Server` form when one exists (`WorkspaceText.ForHome`), else the key itself; the chip says *Server newer* and *Not on server*. | Format "the library" / "the server" into one text | Word order and articles differ by language; a missing form falls back to the library's text, never to a key. |
| 2026-11-04 | A server's project renders what the server holds: before a render (`ProjectMenuViewModel.ReadyToRenderAsync`) unsaved or unsent work is offered to be saved and sent; Offline, Gone, Damaged or media removed hold the render. In step, the jobs name the version alone; out of step, the portable settings travel and only the project is recorded. An analysis's Auto values reaching Main at the server are taken by the next `projectChanged` (pushed) within 2 minutes, with Sync automatically. | Render the workspace's settings always | The server renders with its originals; only a version it holds can be named. |
| 2026-11-04 | Edit opens a server's sequence as a workspace project when the server has the `projects` capability (`OpenServerWorkspaceAsync`), with final 5a's refusals (a copy this Chronos cannot read, a damaged or newer Main listed disabled, a workspace folder refused). The *sequence left the index* refusal applies only to projects of this PC's archive. An older server's sequences open with proxies as before. | Refuse every project whose sequence is not in the index | A server's sequence is never in this PC's index. |
| 2026-11-04 | `ServerProjectHome` gives no frames stamp: a status reads the server's frames each time. | Add a stamp to the API | Kept for later; the frames endpoint is small and the 5a rule (stamp unchanged → frames not read) falls back safely. |