Commit Graph
11 Commits
Author SHA1 Message Date
Alby96andClaude Opus 5.5 e3cbe30b29 fix: conversions on the released phase 4a keep out of folders a sequence left
Phase 4b and its first fix round were written on phase 4a before its rounds 4-6. Moved onto the
released 4a, the conversion now follows 4a's rule for writers into a sequence's folder
(SequenceFolders.Holds), and the parallel fixes meet:

- The job leaves a sequence another index moved away (its folder missing, or holding another
  sequence's sidecar) as Blocked with Errors.Archive.FolderMoved, nothing settled, staged or
  replaced there; the retry after this index's scan converts it where it is. It read the
  sidecar there and reported the reader's technical text.
- New sequence reads the source's project under the source's lease, where its sidecar was just
  read as its own, and writes the new sequence's project under that sequence's lease only into
  a folder that holds it. It read the project from the folder the row named afterwards, without
  a lease, and wrote through the store without the check.
- Download originals (resolved in the cherry-pick of the trash and sync fix, tested here) swaps
  a copy fetched in another encoding into its missing frame after the transfers, as round 6
  restores originals, and only once the sequence is found in the folder the index has;
  otherwise the copies stay staged and the job fails with FolderMoved after its other work.
  The swap ran inside the transfer loop and failed the job at the first refusal.
- The New sequence wording of the three skip reasons the codecs fix added (Archive.Convert.
  NotCopied.EightBit, ColorProfile, TooLarge, en and it): the server and the desktop look them
  up by reason.
- The server's free space test sets the staging folder's figures too: the job fix measures the
  tighter of the archive root's and the staging folder's volumes.

Tests: a conversion of a sequence another index moved (its folder taken or empty), and a
download whose missing frame takes the server's conversion where the sequence is now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 22:33:11 +01:00
Alby96 d0bbd77c92 fix(archive): settle conversions by content and keep their aliases through trash, undo, sync and ingest
Owner review 2, phase 4b, fix round 1 (trash, undo, recovery, sync and ingest).

- Replace journal: records a phase (moving, written, undoing) and the name each swapped
  frame is filed under. Recovery decides "sidecar written" by what the sidecar lists, not
  by the frames version any writer moves; a failed rollback stays undoing and its failure
  now stops the writer (as a photo deletion's recovery does). The ingest settles restores
  and replacements first, so an upload can no longer complete a swap that never happened.
- Emptying a Replaced entry re-verifies each replacement where it is now: in the sequence
  through later conversions (a second conversion no longer strands the first originals),
  or, when the conversion was deleted, its copy in the trash. The dry run marks such
  entries "conversion deleted" (fingerprinted, shown on the desktop and the panel), and
  the confirmed emptying may then erase them instead of keeping them forever.
- Undo of a conversion takes exactly the entries its job made (the job id is recorded on
  the entry), never entries found by time window.
- Project positions translated by photo use the sidecar's photo of every frame still
  there, so positions on a converted frame stay put when another frame went meanwhile.
- Sync aliases are equivalence classes: an original converted on both sides is one photo;
  link-by-content, proxy counting and proxy upload follow aliases; a download into a
  frame missing here swaps the other encoding into that frame instead of adding a frame.
- The ingest answers a converted photo's original (a card or folder imported again, a
  download) as a duplicate of its conversion and keeps the alias tombstone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 3341a2f845753fc4c5bcba51a3b645f126c95eaf)
2026-10-27 22:13:36 +01:00
Alby96 f8c445fac3 fix(archive): a third sequence's export follows its file; resumed renders and restored originals stay out of folders a sequence left
Round 5 stopped clearing "behind" for rows of a third sequence (neither the one moving nor the
one now holding the old folder). Such a row, an export one sequence saved in another's exports
through the Export folder picker, then stayed at its old path whenever the sequence that moved
into the folder brought an export of the same name, and named that sequence's file (Send exports
would upload it). A file at the old path is never "behind" while the old folder holds another
sequence: it is that sequence's, so every row other than the holder's follows its file.

A resumed render job deleted the output its crashed attempt was writing at the absolute path in
the checkpoint. After another index moved the sequence away and another sequence into the folder
it left, and this index scanned, that path named the other sequence's export. The checkpoint now
keeps the sequence's folder when the output was chosen; a pending output there is rebased into the
folder the sequence is in now, one in the sequence's current exports or outside the archive (an
export folder chosen on a client) is discarded as before, and one anywhere else in the archive is
left alone (the entry renders under another name). Older checkpoints, without the folder, only
discard in the current exports.

Download originals put an original flagged missing back at the path read before the transfer,
with no lease and no check of the folder: after another index moved the sequence, it recreated
the folder it left or filed the photo among another sequence's originals. The restores now run
after the transfers under the sequence's lease, in the folder the index has then, which must hold
the sequence (SequenceFolders.Holds), at each frame's path read under that lease. Otherwise
nothing is restored, the copies stay staged for the next attempt and the job fails with
Errors.Archive.FolderMoved after its other work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ad46ef68180845de4b9b605a4ce2529a148c6f13)
2026-10-27 21:07:06 +01:00
Alby96 8c2b9f1bfe fix(archive): a rebase moves no row of the sequence that took the old folder; writers refuse a folder another sequence holds
Round 4 let every row under the old folder follow when that folder holds another sequence
now. When the scan took the new holder first, its own row (already rebased into the old
folder) then followed the moving sequence too and named that sequence's file, leaving its
own export without a row; a second scan did not repair it. Only the moving sequence's own
rows now follow because the old folder is taken, and a row of the sequence holding the old
folder never follows: its export is in its own folder whatever the other one took along
under the same name. The rebase callback now gets the owner of each row.

Writers that file into the folder the index has for a sequence checked only that the folder
existed. After another index moved the sequence away and another one into that folder, Take
server wrote the server's settings into the other sequence's project.json, Save both wrote
this PC's copy into its .chronos, and a render sent for the sequence was filed among its
exports. SequenceFolders.Holds treats a folder whose sidecar names another sequence exactly
like a missing one, and every such writer asks it: settings sync and conflict resolution
(Errors.Archive.FolderMoved), Save both's copy and its clean-up, server render filing (503
folder_moved, the upload kept), export downloads, render jobs as they start, proxies sent and
proxy passes, the deep analysis checkpoint and the editor's project save. A thumbnail pass
refuses a sidecar of another sequence before it opens the pack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b406a4f6a9a7a3121e9e40289663fb62ee31948e)
2026-10-27 20:36:20 +01:00
Alby96 964b996af2 fix: keep pre-rule templates through web settings saves; retry render filing after another index moved the folder
The web panel's archive settings save checked both request templates against
every template rule before the engine ran, so an archive.json saved before the
rules made every save fail, even of the name or proxy size. Only a template that
differs from the stored one is now held to the rules, as ArchiveService already
does, and a TemplateRuleException from the engine (archive.json changed since the
form was read) answers invalid_template with its rule instead of archive_policy.

Exports follow a moved folder correctly in two more cases. Image-sequence exports
are folders, so the rebase now tests Path.Exists instead of File.Exists. An
export left at the old path no longer pins a sequence's row when that path now
belongs to another sequence (its sidecar holds the old folder, or its render row
names the path); the row follows to the new path, so it never names another
sequence's file.

RenderStore throws FolderMovedException when the sequence is not in the folder
the index has. That is transient until this index's next scan, so client render
uploads and render-node results now answer 503 folder_moved, keep the part file
and the node's job, instead of failing them for good with a wrong reason.

Save both and Take server refused because the folder moved now say
Errors.Archive.FolderMoved (try again after the next scan) instead of the
"changed again, choose again" sentence, which repeated until a scan.

Doc wording: the ReorganizeDialogViewModel summary covers a sequence kept whole,
and RenamePlanner.Plan's existsExactly says the own folder is found under at most
one of the two names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d898798657197d48f4e19b7f776003eb2fc441b5)
2026-10-27 19:46:16 +01:00
Alby96 c3756d03c9 fix: keep render filing retryable and writers out of a folder another index moved
Third fix round of owner review 2, phase 4a (Reorganize), cross-cutting items.

- Server render filing now runs under the sequence lease, so it can meet a busy
  sequence or an offline archive. Both completions (client render uploads and
  render-node results) used to answer 500 and leave the upload stuck in
  Committing until a restart. They now answer 503 sequence_busy or
  archive_offline, which clients retry. The upload goes back to receiving with
  its part file and the node keeps its job (UploadService.ReceiveAgainAsync).
- Save both: when this PC's copy cannot be written (another index moved the
  folder), the server's version is no longer applied, even if this index's scan
  relocates the row before the apply would run. A copy that has to be dropped is
  deleted from where the folder is now, as a best effort.
- Export rebase on a folder move (scan and Reorganize): the sequence's own
  export follows the folder unless its file is still at the old path and not at
  the new one. A file written into a re-created old folder therefore keeps a row
  that finds it, so the file is never stranded.
- A render job refuses to start when its folder is not where the index has it,
  which also stops it from re-creating the old folder. Renders fetched by sync
  are now filed under the sequence lease into the current folder, or not at all
  (new string Errors.Archive.FolderMoved, en and it).
- The proxy pass holds the thumbnail lease one batch at a time (a quarter of
  the lease wait), then lets it go for longer than a waiter's poll and reads
  the folder and sidecar again. Before, another process's Reorganize, sequence
  deletion or pack compaction could wait out its lease wait and fail. Updated
  the stale comments on that lease and ARCHITECTURE.md to match.

Tests cover each fix, and each new test fails with its fix reverted. Also
covered: proxy store and pass in a moved folder, RenderStore with the folder
gone, Take server with the folder moved, and an editor save with the folder
moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 811509d32a118ed50ad10d47d4b002e534da9d77)
2026-10-27 19:16:28 +01:00
Alby96 6e99a4b269 fix(archive): exports follow a folder any index moved; proxies, exports and copies no longer recreate it
Second review of owner review 2, phase 4a (Reorganize), cross-cutting findings.

- A second index of the archive (a desktop sharing a server's archive, or a folder moved by
  hand) moved the sequence row at its next scan but left renders.output_path at the old
  folder: the export answered 404 there. The scan now rebases the render rows in the same
  transaction when it finds a sequence in another folder.
- The rebase covers every render of the archive under the old folder: the sequence's own
  exports always, and another sequence's export saved inside it (through the Export folder
  picker) when its file moved with the folder. That check keeps the exports of a sequence
  that took the old folder since (a later Reorganize on the other index) where they are. A
  change of case only counts as a move.
- The desktop now tells an open editor after each Reorganize step
  (ArchiveServiceOptions.SequenceChanged -> AppServices.SequenceReorganized), and the editor
  reads its sequence again where it is now, so frames no longer decode blank until the next
  save. LocalSequenceSource.LoadAsync also requires the same folder on both row reads, so a
  move that commits during the frame listing is never taken as current.
- Writers that wrote without the lease, or trusted a row another index had moved, could
  create the old folder again. A proxy sent by a client is now filed under the sequence's
  lease into the folder the index has then, and a gone sequence or folder answers 404
  (sequence_busy 503 after the lease wait). The server files a render a client or render
  node sends under the lease (ArchiveService.UnderLeaseAsync). "Save both" keeps its copy
  under the lease. The proxy pass holds the thumbnail lease, as the thumbnail pass does. The
  deep analysis opens its checkpoint under the sequence lock only while the folder is still
  there, and a pass whose folder another process moved records nothing (the job logs
  Advisor.Log.FramesChangedElsewhere). Editor saves and sync applies refuse when the folder
  is gone.
- ARCHITECTURE.md no longer claims more than this: a render of another process whose folder
  moves while it runs is still not stopped.
- ArchiveVerifier.FlushAsync: corrected the comment. A move keeps each file's stamp, so only a
  check that found the file missing no longer applies.

Tests cover the scan path with a later swap into the vacated folder, another sequence's
export inside a moving folder, a photo deletion refused when the folder moved while it
waited for the lease, proxies sent and made after a move, Save both during a move, a deep
analysis whose folder another index moved, a render filed after a move on the server, and
an open editor reloaded by a Move job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit c857b98f795b22956c060f1c5acf4d94b6d1c994)
2026-10-27 18:09:02 +01:00
Alby96 9ce201cd70 fix(archive): exports follow a Reorganize folder move; writers resolve the folder under the lease
A Reorganize step that moves a sequence folder carries its exports/ with it, but only
the sequences and frames rows followed: renders.output_path kept naming the old folder,
so the server answered 404 for the export, Get/Send exports and Reveal lost it, and no
scan or trash restore could repair it. RenderRepository.RebaseFolderAsync now rewrites
the archive-relative output paths of the step's sequence in the same transaction as the
frames (idempotent on resume; absolute outputs and the archive root are untouched).

Writers that read a sequence row before taking its lease wrote into the folder a
Reorganize had moved meanwhile, creating it again (project.json from the editor or a
sync, a thumbnail pack) or failing on its missing sidecar. They now take the folder from
the index row read under the lease (SequenceWriter.FolderAsync): the editor's save
refuses with FramesChangedException and reloads at the new folder, FramesCurrentAsync
reports a moved folder, and the sync apply, project store, thumbnail pass and its
status, decode tiers, analyses, verify, info edits, ingest, duplicate flags, pack
compaction and photo restores write where the sequence is now; a photo deletion planned
before the move is refused as stale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit be28d8acf0d96012c94a266f8af61e9bbafaa28d)
2026-10-27 16:29:59 +01:00
Alby96 316c182b19 fix(sync,upload): keep tombstones honest and let an explicit upload bring a photo back
Sync:
- A server frame that has not been hashed is known by content only once it is
  downloaded: one this PC deleted (or holds as its replacement) is now deleted
  from staging instead of filed again, which also dropped its tombstone.
- An unhashed local original that turns out to be a photo the server deleted
  is not uploaded, and the archive verify then writes the hashes into the
  index, so the row settles instead of offering Upload for good.
- A tombstone leaves a photo out of the comparison only when its side no longer
  holds that content, so a tombstone left beside a held copy does not keep the
  other side's copy missing forever.

Uploads:
- StartUploadRequest.Restore (optional, never sent by sync or older clients)
  lets an explicit user upload file a photo deleted from the sequence again,
  also after the trash was emptied; the completion repeats it with
  ?restore=true and the ingest drops the tombstone.
- The completion checks the tombstone again: a photo deleted while its bytes
  were on the way is not filed (409 photo_removed, upload cancelled); the
  protocol client reports that as not sent.
- A tombstone of content a frame of the target still holds refuses no repair.
- Hidden dot names (AppleDouble "._" files) are refused, as the archive
  scanner leaves them out.

Web upload dialog:
- Upload again on rows marked Deleted before; the tooltip no longer promises
  a trash restore that may be impossible.
- Sends a capture time: the Exif DateTimeOriginal of a JPEG or TIFF-based file
  (minimal in-house reader, capture-time.js), else the file's time, so photos
  without Exif keep their order.
- Esc is stopped at keydown during a run (Chromium allows one prevented cancel
  per activation); hidden dot files are left out; a completion refused while
  another one files the upload waits for it; the same photo picked under two
  names waits for its first copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d051bcfc351f5a08500ca864a6508576a95492a4)
2026-10-27 12:45:33 +01:00
Alby96 51782a3ada feat(archive): photo delete, tombstones, trash kinds and emptying, library API
Owner review 2, R6: the web panel manages the library without editing it, so
the engine and the server must delete single photos safely, keep them out of
sync afterwards, and let an administrator restore or finally erase the trash.

- Migration 0008: frame_removals (tombstones by sequence and SHA-256, reason,
  replacement); the sidecar gains "removed" (omitted when empty) and frames a
  reserved "source"; the indexer writes the tombstones on every sync, so a
  rebuild keeps them, and drops a hero frame that is gone.
- FrameTrash: dry run (busy, frames changed, offline, would empty), delete under
  the sequence lease with a write-ahead journal that the next writer undoes
  after a crash, files to trash/photos/<seq>-<time>/originals with a record,
  sidecar without the frames plus tombstones, index sync clearing analyses,
  thumbnails and proxies, proxies renamed to follow their frames, follow-up
  jobs. Restore re-hashes every file, keeps mismatches in the trash, puts the
  same frame records back and drops their tombstones, or files the photos into
  a new sequence through the ingest when theirs is gone.
- Project positions on vanished photos are translated by photo and wait as
  pending frames, so they come back with a restore.
- Trash entries have a kind (sequence, photos, replaced); emptying is a dry run
  with a fingerprint and a new EmptyTrash job (18) that erases exactly the
  planned entries, refuses a stale plan and erases replaced originals only
  while their replacements still hash right.
- Sync honours tombstones: nothing one side deleted is offered back, local
  files are never deleted, replaced photos count as their replacement; the
  server answers an upload of a tombstoned SHA-256 as already there.
- Server: sequence thumbnail, photo delete, bulk delete/retag/jobs, trash
  list/restore/empty endpoints with their error messages; a verify of
  sequences now targets their archive (POST /jobs failed before).
- Desktop trash dialog lists photo entries and empties the trash after a
  typed confirmation through the same job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 35bb56690a1d69eae57153d036e1409201cd73f7)
2026-10-27 10:49:34 +01:00
Alby96andClaude Opus 5.5 f2b58522b9 refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted
Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control,
and asked for Actions and a first automatic release with the server package
and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md).

- Chronos everywhere: a byte-exact rename of contents and paths, then a
  per-language review of the forms the old name's ending had dictated.
- Gitea instead of GitHub: the update check, licence, issue and support
  links read ChronosReleasesUrl; the update check takes the highest stable
  version, offers a pre-release build its final release and reports a
  repository it cannot see as a failed check. EULA, security policy and
  Gitea issue forms live at the repository root.
- Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release,
  nightly image and performance gates in the .NET SDK container with git
  checkout and the system SQLite. The release cross-compiles the Windows
  programs, checks their icon, version and DPI manifest, packs installers
  and zips, publishes the Gitea release and pushes the server image
  (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows
  runner (WINDOWS_RUNNER).
- New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the
  docker-exec script, which Gitea's service containers do not allow; the
  throw-away server runs without durability) and pe-check.
- Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR,
  3 on the shared runner; the weekly performance gates keep theirs).

BREAKING CHANGE: programs, settings, data folders, file types, environment
variables and the Docker image use the new name; nothing is migrated from
Titano, which never had a release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
2026-10-23 12:45:18 +02:00