feat(copies): matches between this PC and the server, Integrate and merge (owner review 6, v1.2.0) (#74)
CI / Build and test (push) Successful in 13m44s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 16s
Release / Build, test and publish (push) Successful in 26m34s
CI / PostgreSQL 16 integration (push) Failing after 17m36s
CI / PostgreSQL 17 integration (push) Failing after 15m36s
CI / Docker image (push) Successful in 1m12s
Release / Server image (push) Failing after 15s
CI / Build and test (push) Successful in 13m44s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 16s
Release / Build, test and publish (push) Successful in 26m34s
CI / PostgreSQL 16 integration (push) Failing after 17m36s
CI / PostgreSQL 17 integration (push) Failing after 15m36s
CI / Docker image (push) Successful in 1m12s
Release / Server image (push) Failing after 15s
The same time-lapse on a server and on this PC under different ids, or twice on this PC, is recognised, compared and settled as the owner asked in owner review 6. Matches are found after each sync refresh, through the server's new photo lookup, and after the jobs that change photos. The default is to ask every time. Server › Matches offers: - Keep apart, which is remembered; - Link only and Unlink; - the Compare dialog: photos, details line by line, projects and the plan. Integrate completes both sides. Photos default to Union, projects are copied across, and a losing version goes to the trash only after a hash check. Afterwards new photos move by themselves, and deletions wait for the user. A merge of two local sequences verifies every photo before the other sequence goes to its archive's trash. Upload all local skips suspected matches and flags them. Migration 0012 adds the found_copies and copy_probes tables. Jobs 25 (Integrate) and 26 (MergeSequences) are new, and so are the server capabilities photo-lookup and upload-into. Refs #73 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #74.
This commit is contained in:
1 parent
43719bb5c5
commit
f33bcac32e
586 files changed
+41546
-280
No files matched your search
@@ -0,0 +1,76 @@
|
||||
# Owner review 6 (2026-11-16)
|
||||
|
||||
## Owner's text (verbatim, Italian)
|
||||
|
||||
> Potrei avere la stessa sequenza prima caricata sul server e poi ancora presente sul computer se indico una cartella di
|
||||
> lavoro o una cartella per delle sequenze locali. In questo caso il software deve riconoscere i doppioni ed eventuali
|
||||
> differenze e farti scegliere cosa fare. Deve essere una gestione avanzata che riconosce differenze, chiede se mantenere
|
||||
> le due cartelle o integrarle e poi sincronizzarle, ecc ecc.
|
||||
|
||||
## Interpretation
|
||||
|
||||
One time-lapse can live on a Chronos Server (uploaded earlier, by this desktop or by the Uploader) and on this PC at the
|
||||
same time: in this PC's archive, in a server's originals archive (`<archive> - <server>`), in an adopted folder, or in
|
||||
the workspace. Their ids differ, so Chronos 1.1 sees two sequences. The desktop must find these copies, show how they
|
||||
differ, and let the user keep them apart or integrate them and then keep them in sync.
|
||||
|
||||
| Id | Request | Working interpretation |
|
||||
|---|---|---|
|
||||
| R1 | Recognise the same sequence (matches) | Chronos finds a *match*: two sequences that hold the same time-lapse, one on this PC and one on a server, or two in this PC's archives (this PC's archive, adopted folders, servers' originals archives). Evidence: shared photos by SHA-256 (conversions followed), by size and capture time while a side is unhashed, session keys, and an existing link. Server detection runs after each sync refresh through the server's new photo lookup (`POST /api/v1/photos/lookup`), with 1.1's rule and hints on an older server; local detection runs after the index opens and after jobs that change photos. Matches are listed under Server › *Matches*. The *Link matches* setting (default *Ask always*) decides whether Chronos links a match by itself. |
|
||||
| R2 | Show the differences | The Compare dialog shows two sequences side by side in four parts: *Photos* (each photo classed as same, same unverified, only here, only there, different, converted, deleted here, deleted there or two versions), *Details* (title, tags, rating, notes and each setting, line by line), *Projects* (each side's projects and where they go) and *Plan* (the dry run of what an Integrate or a merge will do, with its blocks). |
|
||||
| R3 | Let the user choose: keep apart, or integrate and sync | *Keep apart* is remembered (asked again only when the match grows a lot or becomes identical); *Link only* links without moving anything; *Unlink* undoes a link. *Integrate* of a local and a server sequence completes both: each side receives the photos it lacks, details are settled once, projects follow the projects choice, then the two stay linked. Two sequences on this PC are *merged* into the kept one; the other goes to its archive's trash only after every one of its photos is hash-verified in the kept one. |
|
||||
| R4 | Photos only on one side or different | The *Integrate photos* setting (default *Union*) and the dialog's photo choice: *Union* sends every photo to both sides and keeps a differing photo in both versions, listed so the user can drop one to the trash; *Choose each* preselects nothing; *This PC wins* / *Server wins* decide the differing photos for the whole sequence. Photos deleted on one side stay deleted. |
|
||||
| R5 | Projects other than Main | The *Integrate projects* setting (default *Copy across*) and the dialog's choice: each side's projects are copied to the other home with their histories, named `<name> (<PC>)` (or the server's name) on a clash. *Leave them* keeps them where they are and marks the two workspace copies as twins in Edit. A merge always copies across. Amends BRIEF §14.5. |
|
||||
| R6 | Keep them in sync afterwards | After an Integrate that left nothing out, new photos move by themselves both ways (paused on metered connections, never interrupting the user's jobs). Settings sync as today. A photo deleted on one side shows as *deleted there* and goes to the trash here only on confirmation. A server sequence that answers 404 twice reads *deleted on server*, with *Keep here*, *Upload again* and *To trash…*. |
|
||||
| R7 | A folder of local sequences; Upload all local | Such a folder is added with *Adopt folder…* (as an archive) and compared with the server and the other archives; no watched folders. *Upload all local* skips suspected matches, kept-apart sequences, sequences of a server's originals archive, sequences whose server copy was deleted and busy sequences, marks them *skipped* with the reason and leaves the matches under Matches. |
|
||||
| R8 | Track the work | Issue #73 in milestone `v1.2.0`, a board card, every commit ending with `Refs #73`. |
|
||||
|
||||
## Questions and answers
|
||||
|
||||
The questions were asked in two rounds on 2026-11-16 (the first with options and a recommendation, the second for the
|
||||
local folders and *Upload all local*). The owner answered in Italian; quoted words are his.
|
||||
|
||||
| Id | Question | Owner's answer |
|
||||
|---|---|---|
|
||||
| Q1 (R1) | When Chronos finds two copies of one sequence, does it link them by itself or ask? | "Mettere la scelta come parametro, default chiedere sempre". A setting, default *Ask always*; options *Ask always*, *When identical* (exactly the same photos) and *Half shared* (1.1's rule, its gates kept). *Keep apart* is remembered. |
|
||||
| Q2 (R3) | What does "integrate" do with the two folders? | "Completa entrambe". Two folders stay, one here and one on the server: each gets the photos it lacks, the differences are settled once, then they stay linked and in sync. Two copies on this PC are merged into one sequence; the other folder goes to the archive trash after every photo is hash-verified in the kept one. |
|
||||
| Q3 (R4) | Photos only on one side, or that differ: what is the default? | "Anche qui mettere un parametro, default unione". A setting, default *Union*; options *Union* (a differing photo kept in both versions and listed so one can go to the trash; deleted photos stay deleted), *Choose each* (nothing preselected), *One side wins* (this PC or the server, for the whole sequence). |
|
||||
| Q4 (R2) | Title, tags, rating, notes and settings that differ | "Riga per riga". In the comparison the user picks this PC's or the server's value for each difference; it is applied as one change on both sides. |
|
||||
| Q5 (R5) | Projects other than Main | "Scelta, default copiali dall'altra parte". A choice in the dialog and a default in Settings, default *Copy across*, renamed `<name> (<PC>)` on a clash; alternative *Leave them*, with the two workspace copies marked as twins in Edit. |
|
||||
| Q6 (R6) | After integrating, what stays in sync by itself? | "Foto nuove in auto". New photos move automatically both ways, paused on metered connections. Settings sync as today. A photo deleted on one side shows as "deleted there" and goes to the trash here only on confirmation. |
|
||||
| Q7 (R7) | What is "a folder of local sequences"? | "Come archivio". It is added with *Adopt folder…*, which exists, and compared with the server and the other archives. No watched folders. |
|
||||
| Q8 (R7) | *Upload all local* and suspected duplicates | "Saltale e segnalale". Skip suspected duplicates and sequences in other servers' originals archives, and leave them among the matches. |
|
||||
|
||||
## Design summary
|
||||
|
||||
- Data: migration 0012 adds `found_copies` (a pair: local↔server or local↔local, its evidence, scores, the user's
|
||||
answer, the photo policy and the 404 record) and `copy_probes` (what detection last compared, so nothing is compared
|
||||
twice while neither side moves). Every existing link with a local sequence becomes a linked pair. Code lives in
|
||||
`Chronos.Data.Copies`.
|
||||
- Server: `POST /api/v1/photos/lookup` (Read; at most 200 probes and 20,000 items) and `intoTarget` on
|
||||
`POST /api/v1/uploads`, which files a photo into the target even when another sequence of the served archive holds
|
||||
it, copied on the server (`copied` in the answer). `server/info` announces `photo-lookup` and `upload-into`. An older
|
||||
server gets detection by 1.1's rule and hints, and no Integrate.
|
||||
- Jobs: `Integrate` (stored as 25) and `MergeSequences` (26), high in the priority queue, desktop only, each with an
|
||||
atomic journal (`.chronos/journal/integrate-<job>.json`, `merge-<job>.json`) that resumes at every stage, and a plan
|
||||
fingerprint the job checks before it moves anything. A background job (an automatic transfer) never interrupts a
|
||||
running one.
|
||||
- UI: Server › *Matches* (chip, list, *Find matches*), the in-window Compare dialog (Photos, Details, Projects, Plan),
|
||||
the Replace and Merge confirmations (the merge typed by photo count), sync rows that read *match found*, *deleted on
|
||||
server*, *kept here*, *skipped*, *not sent* or *deleted there · n*, Library cards *Also elsewhere* / *Deleted there*
|
||||
with *Compare…*, the Edit picker's *Twin* chip, and three rows in Settings › Server: *Link matches*, *Integrate
|
||||
photos*, *Integrate projects*.
|
||||
- Words: the UI noun is *match* / *corrispondenza*, never *copy* / *copia*, which the photo-duplicates report owns
|
||||
(`i18n/GLOSSARY.md`: Match, Integrate, Merge sequences, Keep apart, Twin).
|
||||
|
||||
## Delivery plan
|
||||
|
||||
| Phase | Content | State | Commit |
|
||||
|---|---|---|---|
|
||||
| 1 | `v1.2.0`: R1–R7 (#73); R8 tracking. Parcels: P0 foundation (contracts, migration 0012, store, wire, trash and job hooks, keys), P1a pure comparison and rules, P1b detection and sync integration, P2 server photo lookup and uploads into a target, P3 Integrate, P4 merge of two local sequences, P5 engine composition and automatic photos, P6 the desktop surfaces; then one review round (correctness, safety, conformance) with every verified finding fixed, a gap round and twelve verification rounds (the last seven on the data engines only, each finding confirmed by two of three independent checks, the last three on the latest fixes only, until one found nothing). BRIEF §5, §6.2, §12.2, §12.3, §12.5, §12.7, §12.8, §14.3, §14.4, §14.5, §14.6, §24 and Appendix C amended; DESIGN §4 *Matches*; DECISIONS rows dated 2026-11-16 to 2026-11-18 citing #73 | done: released as `v1.2.0` on 2026-11-18; strings in all 38 languages and their glossaries; the Windows captures committed as baselines; CI green with PostgreSQL 16 and 17 | `283d04d9` … `65b7cdf9` on `or6-duplicates`, squash-merged into `main` |
|
||||
|
||||
Follow-ups kept out of 1.2.0: a field-level three-way merge of an integrated pair's settings (settings sync as today,
|
||||
owner Q6; to be asked of the owner), the Import › Folder… warning for photos already on a server, merging two
|
||||
sequences of one server, the list of second versions with *Drop…* in Edit (the Library has it: *Two versions…*).
|
||||
|
||||
Tracking: issue #73, milestone `v1.2.0`, board card; status **done**.
|
||||
Reference in new issue
Block a user