E5: archivio delle copie automatiche, segnale e domande 48–55

La tappa E5 copia da sola i file nuovi nelle cartelle con «Automatica».
Questo pacchetto (WP2) dà al motore che verrà ciò che gli serve dal
database, senza migrazioni:

- ExportSelection.Automatic: i file dovuti, non copiati («Tolto» e
  «Superato» mai), nuovi dal «Solo i nuovi», di elementi assestati (niente
  file da scaricare, riga del giornale scritta); i «Non riuscito» solo al
  giro di recupero, tutti e ogni giro (risposta 50 di Alberto), così un
  file che non riesce mai non fa un lavoro ogni due minuti.
- HasAutomaticCandidatesAsync, CountAutomaticBacklogAsync (la domanda
  «Copia anche gli N», i file in più, una cartella nuova), i candidati di
  «Riconosci le copie già presenti» (un «Tolto» resta «Tolto», risposta
  51) e i byte del primo file in attesa di un lavoro in pausa.
- La pausa di una destinazione si scrive solo con metodi suoi, così un
  salvataggio dall'interfaccia non la annulla; l'evento resta uno per
  passaggio.
- AutoExportSignal, un'istanza per le prove, Default per l'applicazione.

Prove nuove su un database vero, confrontate con il piano di «Copia in…»,
e misure su 200.000 elementi entro 2 s senza indici nuovi.

Documenti: in §16 le righe 48–55 con le risposte del 4 dicembre 2026 e in
decisioni.md la riga con le risposte e le tre letture del progetto.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-04 13:21:56 +01:00
1 parent df50c32e22
commit f2568b5d88
12 files changed
+1212 -63

No files matched your search

+18
View File
@@ -21,6 +21,24 @@ public abstract record ExportSelection
/// <summary>Every file of an account (the account card).</summary>
public sealed record Account(long AccountId) : ExportSelection;
/// <summary>
/// The automatic export (tappa E5, D4 and D5): per automatic destination, the files it is the effective destination
/// of, not copied («Tolto» and «Superato» never), new since its «Solo i nuovi» instant, and settled (no file of the
/// entry still to download, the entry not in <paramref name="HeldEntryIds"/>).
/// </summary>
/// <param name="Destinations">The automatic destinations of the pass; one not in use (retired, unknown) gives nothing.</param>
/// <param name="HeldEntryIds">Entries whose line of <c>_febe.jsonl</c> is still to be written (<c>libreria.giornale-da-scrivere</c>).</param>
/// <param name="Round">
/// A recovery round (start-up and every hour): files whose last copy in the destination is «Non riuscito» are
/// candidates too, every round, whatever the error (answer 50 of 4 December 2026). Outside a round they wait for it,
/// so a file that keeps failing does not make a job at every signal.
/// </param>
public sealed record Automatic(IReadOnlyList<AutomaticScope> Destinations, IReadOnlyList<long> HeldEntryIds, bool Round) : ExportSelection;
/// <summary>One automatic destination and its «Solo i nuovi» instant (null: everything due, saved before or after).</summary>
/// <param name="Since">Files saved in the library at or after it (<c>media.downloaded_at</c>); a file without that time is not new.</param>
public sealed record AutomaticScope(long DestinationId, DateTimeOffset? Since);
}
/// <summary>How the instants of «Fotogrammi» are chosen (spec §4.10 «Fotogrammi»).</summary>