Documenti allineati alla catena 0.3.0 costruita: i componenti esterni sono già usciti
verifica / controlli (push) Canceled after 0s
verifica / prove (push) Canceled after 0s
verifica / installatore (push) Canceled after 0s
verifica / immagine (push) Canceled after 0s

Su funzione/senza-terzi le tappe C1–C6 e S4b sono costruite, ma i documenti le
davano ancora per future e le prove dei documenti chiedevano «esce con».

- Regola 12 di CLAUDE.md e appendice A (identiche), regola 13 e §3: SkiaSharp,
  ffprobe, ffmpeg, NSIS, Node, Archivo e Lucide «sono già usciti» con la loro
  tappa; via «finché la tappa non è unita il codice di prima li usa».
- §6.0 «Quando si copia»: tolto «Finché questo non è costruito…»; il testo dice
  cancel con pageLeft e LeavePageAsync, la vista chiusa dal browser fermo che non
  conta, il permesso che finisce senza copia oltre i 30 secondi, e il ripiego su
  «Annulla» dove non c'è una sessione da copiare.
- Formati (§3, §4.6, §8.4, §9.2, §9.3, §14.1): HEIC/HEIF decodificato in casa e mai
  detto «File danneggiato o incompleto»; JPEG e PNG senza EOI/IEND troncati, con
  le misure lette lo stesso; MPEG-PS con codec e dimensioni dall'SPS (HEVC con il
  tipo 0x24) e nessun fotogramma; danneggiati segnati in revisione, resoconto e
  CSV; il lettore JPEG con codifica aritmetica, 12 bit e senza perdita.
- §11: l'immagine com'è (Febe processo 1 senza tini, fonts-dejavu-core e
  fonts-noto-color-emoji, i pacchetti del runtime .NET, setpriv dall'immagine di
  base); §12 e §13.2 senza ffmpeg e NSIS «fino ad allora».
- Appendici B e C senza Archivo e Lucide, con il token --carattere; la pila dei
  caratteri senza Liberation anche in docs/schermate/differenze.md e in
  src/Febe.Web/LEGGIMI.md; LEGGIMI delle immagini di riferimento al passato.
- SpecificationConsistencyTests: la frase che nomina ogni componente deve dire che
  è uscito e non «esce/escono con»; una prova nuova cerca nei documenti le frasi
  che davano un componente ancora in uso; Directory.Packages.props ammette solo i
  pacchetti della regola; punti nuovi per HEIC, EOI/IEND, MPEG-PS, §6.0 e §11.
  InstallerTests ammette NSIS nella regola 12 solo se la riga dice che è uscito.
- docs/decisioni.md: una riga del 25 novembre 2026.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-25 17:59:12 +01:00
1 parent 2068dd28f3
commit 5b7b37ad4f
8 files changed
+149 -92

No files matched your search

+3 -3
View File
@@ -594,9 +594,9 @@ public sealed partial class InstallerTests
var text = File.ReadAllText(file);
if (string.Equals(Path.GetFileName(file), "CLAUDE.md", StringComparison.Ordinal))
{
// Rule 12 is the copy of spec appendix A, the stage description that says which stage NSIS left with
// (SpecificationConsistencyTests wants it there): only that line may name it.
text = string.Join('\n', text.Split('\n').Where(line => !line.StartsWith("12. Niente componenti esterni", StringComparison.Ordinal)));
// Rule 12 is the copy of spec appendix A, which says with which stage NSIS left
// (SpecificationConsistencyTests wants it there): only that line may name it, and only to say it is gone.
text = string.Join('\n', text.Split('\n').Where(line => !(line.StartsWith("12. Niente componenti esterni", StringComparison.Ordinal) && line.Contains("Sono già usciti", StringComparison.Ordinal))));
}
if (NsisWord().IsMatch(text))
@@ -5,31 +5,70 @@ namespace Febe.Tests.Docs;
/// <summary>
/// The documents agree with each other where a review of the 18 November 2026 changes found them apart: the rule on
/// external components allows only gitleaks, Trivy, Xvfb and the Debian packages Chromium needs, and every other
/// component the project still uses says in which stage of 0.3.0 it leaves; no hypothesis of spec §6.6 is called
/// verified without an outcome in docs/sonda/esito.md; the questions Alberto answered are not open any more; and the
/// paragraphs of §2, §3, §4.10, §6.0, §6.1, §6.6, §13.2, §14.1 and §15 that were contradictory or unbounded say what
/// settles them. Since 25 November 2026 also Alberto's answers of that day (the session copied when the browser page is
/// left in Docker, the fonts of the Docker image, damaged images refused without a perceptual hash, HEVC RExt kept)
/// and the features of issue #59 (download order, Dashboard, grouped or per-file mosaic, stage D1).
/// component the project used says with which stage of 0.3.0 it left (all of them are built: since 25 November 2026 the
/// rule says so in the past tense, and no document may say that one of them is still in use); no hypothesis of spec
/// §6.6 is called verified without an outcome in docs/sonda/esito.md; the questions Alberto answered are not open any
/// more; and the paragraphs of §2, §3, §4.10, §6.0, §6.1, §6.6, §13.2, §14.1 and §15 that were contradictory or
/// unbounded say what settles them. Since 25 November 2026 also Alberto's answers of that day (the session copied when
/// the browser page is left in Docker, the fonts of the Docker image, damaged images refused without a perceptual hash,
/// HEVC RExt kept) and the features of issue #59 (download order, Dashboard, grouped or per-file mosaic, stage D1).
/// </summary>
[TestClass]
public sealed partial class SpecificationConsistencyTests
{
/// <summary>Packages that rule 13 allows for good; any other one must say in which stage it leaves.</summary>
/// <summary>Packages that rule 13 allows; since stage C1 no other package may be in Directory.Packages.props.</summary>
private static readonly string[] AllowedPackages = ["Microsoft.Data.Sqlite", "Microsoft.Web.WebView2", "MSTest"];
/// <summary>The only exceptions the rule allows besides .NET, Microsoft.Data.Sqlite, the browser and MSTest.</summary>
private static readonly string[] Exceptions = ["gitleaks e Trivy", "Xvfb", "pacchetti Debian che gli servono"];
/// <summary>
/// Components still in use that the rule must name, each with the stage of 0.3.0 it leaves with: the first stage
/// named after the last mention of the component.
/// Components the project used that the rule must name, each with the stage of 0.3.0 it left with: the first stage
/// named after the last mention of the component, in a sentence that says they left («uscito», «usciti»).
/// </summary>
private static readonly (string Component, string Stage)[] Leaving =
[
("SkiaSharp", "C1"), ("ffmpeg", "C3"), ("NSIS", "C6"), ("Node", "C6"), ("Archivo", "C6"), ("Lucide", "C6"),
];
/// <summary>Words that put the leaving of a component in the future: none may be in the sentence that names it.</summary>
private static readonly string[] FutureLeaving = ["esce con", "escono con", "uscirà", "usciranno", "finché la tappa", "finché una tappa", "il codice di prima li usa"];
/// <summary>
/// Phrases that said a component that left with 0.3.0, or a part of it not built yet, is still in use (the stages
/// C1–C6 and S4b are built); none may be left in the documents (normalized like <see cref="GuideTests.Normalize"/>).
/// </summary>
private static readonly string[] StillInUse =
[
"escono con la loro tappa",
"il codice di prima li usa",
"non ancora unito",
"fino alla tappa c3 del traguardo 0.3.0 il fotogramma lo estrae ffmpeg",
"fra c3 e c4 un video hevc",
"fino alla tappa c2 del traguardo 0.3.0 si usa ancora ffprobe",
"fra c2 e c5 un file asf",
"un ffmpeg nel path serve ancora",
"`ffmpeg` solo fino alla tappa c3",
"finché ci sono, ffmpeg e ffprobe",
"fino ad allora archivo",
"fino ad allora lo costruisce nsis",
"fino alla tappa c6 della 0.3.0 restano il carattere archivo",
"font-family:\"archivo\"",
"quello usato oggi con skiasharp",
"quando skiasharp sarà tolto",
"finché questo non è costruito",
"in docker si copia solo a «ho finito» e alla fine del permesso",
"liberation sans",
"`fonts-liberation` esce",
];
/// <summary>The documents <see cref="StillInUse"/> looks at, besides docs/guida.</summary>
private static readonly string[] CurrentDocuments =
[
"CLAUDE.md", "docs/SPECIFICA.md", "docs/docker.md", "docs/processo.md", "docs/windows.md", "docs/schermate/differenze.md",
"src/Febe.Web/LEGGIMI.md", "tests/Febe.Tests/Imaging/Riferimenti/LEGGIMI.md",
];
/// <summary>
/// Since stage C6 the guide must not name these any more (InstallerTests and InHouseAssetsTests look for them in
/// docs/guida): there the rule may leave them unnamed, and if it names one, it still says the stage it left with.
@@ -84,15 +123,18 @@ public sealed partial class SpecificationConsistencyTests
["l'adozione non si fida della sola dimensione", "- **Adozione per percorso**", new[] { "rifà la conversione", "la sola dimensione non basta mai", "nome libero" }],
["le immagini animate si copiano come originali", "| Foto |", new[] { "immagini animate", "`acTL`", "`anim`/`anmf`" }],
["il file di prova delle cartelle rifiutate è un .part nella sola candidata", "- Cartelle rifiutate", new[] { "`.febe-prova-*.part`", "solo nella cartella candidata", "mai in dati, libreria, cartelle degli account o `/importa`" }],
["i decodificatori dicono il loro sottoinsieme", "- decodificatori di immagini:", new[] { "rfc 6386", "codifica aritmetica", "precisione a 12 bit" }],
["i decodificatori dicono il loro sottoinsieme", "- decodificatori di immagini:", new[] { "rfc 6386", "codifica aritmetica", "precisione a 12 bit", "resta fuori il gerarchico" }],
["HEIC si decodifica in casa e non si dice mai danneggiato", "- decodificatori di immagini:", new[] { "heic/heif (iso/iec 23008-12)", "a griglia di riquadri", "dimensioni, miniatura e impronta visiva", "non si dice mai «file danneggiato o incompleto»", "non distingue un file rovinato da uno che non gestisce" }],
["JPEG e PNG senza marcatore di fine sono troncati, le misure restano", "- decodificatori di immagini:", new[] { "`iend` o `eoi`", "anche quando dati e scansioni sembrano completi", "la sola lettura delle dimensioni dalle intestazioni resta tollerante" }],
["il decodificatore H.264 copre tutto lo standard", "- decodificatore H.264", new[] { "tutto lo standard", "extended", "high 10", "high 4:4:4", "piani di colore separati", "senza perdita", "monocromatico", "paff", "mbaff", "svc", "mvc", "cabac" }],
["il decodificatore H.265 è dentro la 0.3.0 e tiene RExt", "- decodificatore H.265/HEVC", new[] { "tappa c4", "main 10", "domanda 18", "risposta di alberto del 25 novembre 2026", "estensioni di formato (rext)", "che restano", "fino a 12 bit", "fotogramma non disponibile per questo video" }],
["VP9 e AV1 hanno la tessera neutra", "- VP9, AV1", new[] { "tessera neutra", "fotogramma non disponibile per questo video" }],
["i lettori dei contenitori comprendono ASF, FLV e MPEG-PS", "- lettori dei contenitori ASF", new[] { "flv", "mpeg-ps", "13818-1", "durata, dimensioni, codec e data", "tappa c5" }],
["MPEG-PS ha codec e dimensioni dall'SPS, HEVC con il tipo 0x24, ma nessun fotogramma", "- lettori dei contenitori ASF", new[] { "dall'sps di una traccia h.264 o h.265", "tipo di flusso 0x24", "non si elencano", "la miniatura è la tessera neutra" }],
["l'installatore si scrive in casa", "- l'installatore di Windows", new[] { "al posto di nsis", "tappa c6" }],
["la CI non vuole Node", "- i passi della CI", new[] { "node", "git", "curl verso l'api di gitea", "tappa c6" }],
["le serie di conformità stanno nel repository con la loro fonte", "- Le serie di conformità ITU-T", new[] { "h.264.1", "h.265.1", "solo i flussi e l'md5 dell'uscita di riferimento", "`leggimi.md` che dice la fonte" }],
["SkiaSharp esce anche dal disegno", "- ridimensionamento", new[] { "brandicon", "demoimages", "importpreview", "mediafactory", "librarytestsupport", "importtestfiles" }],
["SkiaSharp è uscito anche dal disegno", "- ridimensionamento", new[] { "brandicon", "demoimages", "importpreview", "mediafactory", "librarytestsupport", "importtestfiles" }],
["le prove dei codec con perdita hanno una tolleranza", "- **Codec e video**", new[] { "psnr", "esattamente per png" }],
["C1 comprende disegno e tolleranze", "| **C1 Codec delle immagini** |", new[] { "disegnatore 2d", "tolleranze di §14.1" }],
["C3 copre tutto H.264 e tutti i flussi", "| **C3 Decodificatore H.264** |", new[] { "tutto lo standard", "tutti i flussi di itu-t h.264.1", "nessuno saltato", "permesso di alberto", "`leggimi.md`" }],
@@ -101,8 +143,10 @@ public sealed partial class SpecificationConsistencyTests
["C6 toglie Node, NSIS, Archivo e Lucide", "| **C6 Niente terzi nella CI e nell'interfaccia** |", new[] { "senza node", "al posto di nsis", "al posto di archivo", "al posto di lucide", "gitleaks e trivy" }],
["le tappe C4–C6 e D1 hanno le loro dipendenze", "Dipendenze: C1", new[] { "c3 → c4", "c5 dopo c2", "c6 indipendente", "d1 indipendente" }],
["in Docker lasciare la pagina del browser copia la sessione", "**Quando si copia**", new[] { "lasciare la pagina del browser", "risposta di alberto del 25 novembre 2026", "pagina «browser»", "vista remota della pagina collegamento", "chiudere la scheda", "per 5 secondi", "ricaricare la pagina non è lasciarla", "lasciando la pagina in docker e alla fine del permesso la copia ha le stesse garanzie" }],
["lasciare la pagina passa da LeavePageAsync e vale «Annulla» solo dove non si copia", "**Quando si copia**", new[] { "`cancel` e `pageleft` (`iconnectionservice.leavepageasync`)", "una vista chiusa perché il browser si è fermato non conta", "dove la sessione si copia, solo il pulsante «annulla» restituisce il browser senza copiare", "senza la raccolta `richieste` non c'è una sessione salvata", "lasciare la pagina vale «annulla»", "il permesso finisce senza copia" }],
["il comando CDP della copia comprende la pagina lasciata in Docker", "| Copiare la sessione", new[] { "25 novembre 2026", "in docker lasciando la pagina del browser o chiudendone la scheda" }],
["l'immagine Docker tiene le emoji e non Liberation", "- **Immagine.**", new[] { "`fonts-noto-color-emoji`, che resta", "`fonts-liberation` esce", "25 novembre 2026" }],
["l'immagine Docker tiene le emoji e non Liberation", "- **Immagine.**", new[] { "`fonts-noto-color-emoji`, che resta", "`fonts-liberation` è uscito", "25 novembre 2026", "`fonts-dejavu-core`", "`libicu76`", "`libssl3t64`", "`ca-certificates`", "ffmpeg è uscito con la tappa c3", "`util-linux` è essenziale in debian" }],
["in Docker Febe è il processo 1, senza tini", "- **Processi.**", new[] { "processo 1", "niente `tini`", "`exec` di `setpriv`", "raccoglie anche i processi rimasti orfani" }],
["un'immagine troncata non ha impronta e resta", "- **Immagini troncate o rovinate**", new[] { "«file danneggiato o incompleto»", "nessuna impronta visiva", "mai doppione probabile per impronta", "resta in libreria", "25 novembre 2026" }],
["il visualizzatore dice «File danneggiato o incompleto»", "- **File danneggiato o incompleto**", new[] { "tessera neutra", "visualizzatore", "resta in libreria", "non lo riscarica" }],
["l'importazione non fa doppioni per impronta di un'immagine troncata", "I doppioni si cercano anche dentro la sorgente stessa", new[] { "mai «doppione probabile» per impronta", "«file danneggiato o incompleto»" }],
@@ -140,7 +184,7 @@ public sealed partial class SpecificationConsistencyTests
}
[TestMethod]
public void TheRuleOnExternalComponentsIsTheSameEverywhereAndSaysWhenEachComponentLeaves()
public void TheRuleOnExternalComponentsIsTheSameEverywhereAndSaysWithWhichStageEachComponentLeft()
{
var claude = RuleLine(Read("CLAUDE.md"), "12. Niente componenti esterni");
var appendix = RuleLine(Read("docs", "SPECIFICA.md")[Read("docs", "SPECIFICA.md").IndexOf("## Appendice A", StringComparison.Ordinal)..], "12. Niente componenti esterni");
@@ -181,8 +225,19 @@ public sealed partial class SpecificationConsistencyTests
var next = Stage().Match(text, last);
if (!next.Success || !string.Equals(next.Value, stage.ToLowerInvariant(), StringComparison.Ordinal))
{
problems.Add($"{name}: {component} esce con la tappa {stage}, il testo dice «{(next.Success ? next.Value : "nessuna tappa")}»");
problems.Add($"{name}: {component} è uscito con la tappa {stage}, il testo dice «{(next.Success ? next.Value : "nessuna tappa")}»");
continue;
}
// The sentence that names the component and its stage says that it left, never that it will.
var start = text.LastIndexOf(". ", last, StringComparison.Ordinal) + 1;
var sentence = text[start..(next.Index + next.Length)];
if (!sentence.Contains("uscit", StringComparison.Ordinal))
{
problems.Add($"{name}: la frase che nomina {component} non dice che è uscito («{sentence.Trim()}»)");
}
problems.AddRange(FutureLeaving.Where(f => sentence.Contains(f, StringComparison.Ordinal)).Select(f => $"{name}: {component} è già uscito, la frase dice ancora «{f}»"));
}
}
@@ -219,7 +274,7 @@ public sealed partial class SpecificationConsistencyTests
}
[TestMethod]
public void EveryMentionOfFfmpegSaysThatItLeavesWithStageC3()
public void EveryMentionOfFfmpegSaysThatItLeftWithStageC3()
{
var problems = new List<string>();
foreach (var file in new[] { "CLAUDE.md", "docs/docker.md", "docs/processo.md", "docs/guida/Sviluppo.md" })
@@ -235,13 +290,21 @@ public sealed partial class SpecificationConsistencyTests
if (!line.Contains("C3", StringComparison.Ordinal))
{
problems.Add($"{file}:{i + 1}: ffmpeg senza la tappa C3 in cui esce");
problems.Add($"{file}:{i + 1}: ffmpeg senza la tappa C3 con cui è uscito");
}
if (line.Contains("C2–C3", StringComparison.Ordinal) || line.Contains("C2-C3", StringComparison.Ordinal))
{
problems.Add($"{file}:{i + 1}: ffmpeg esce con la tappa C3, non con C2–C3");
problems.Add($"{file}:{i + 1}: ffmpeg è uscito con la tappa C3, non con C2–C3");
}
var text = GuideTests.Normalize(line);
if (!text.Contains("uscit", StringComparison.Ordinal))
{
problems.Add($"{file}:{i + 1}: ffmpeg senza dire che è uscito");
}
problems.AddRange(FutureLeaving.Append("fino alla tappa").Where(f => text.Contains(f, StringComparison.Ordinal)).Select(f => $"{file}:{i + 1}: ffmpeg è già uscito, la riga dice ancora «{f}»"));
}
}
@@ -249,32 +312,35 @@ public sealed partial class SpecificationConsistencyTests
}
[TestMethod]
public void EveryPackageIsAllowedOrSaysInWhichStageItLeaves()
public void NoDocumentSaysThatAComponentThatLeftIsStillInUse()
{
var root = Root();
var files = CurrentDocuments.Select(f => Path.Combine([root, .. f.Split('/')]))
.Concat(Directory.EnumerateFiles(GuideTests.GuideFolder(), "*.md"))
.ToList();
var problems = new List<string>();
foreach (var file in files)
{
Assert.IsTrue(File.Exists(file), $"manca {Path.GetRelativePath(root, file)}");
var text = GuideTests.Normalize(File.ReadAllText(file));
problems.AddRange(StillInUse.Where(p => text.Contains(p, StringComparison.Ordinal)).Select(p => $"{Path.GetRelativePath(root, file)} dice ancora «{p}»"));
}
Assert.IsEmpty(problems, string.Join("\n", problems));
}
[TestMethod]
public void EveryPackageIsAllowedByTheRule()
{
var lines = Read("Directory.Packages.props").Split('\n');
Assert.IsTrue(lines.Any(l => l.Contains("<!-- Niente componenti esterni", StringComparison.Ordinal)), "Directory.Packages.props non nomina la regola «Niente componenti esterni»");
var lastComment = string.Empty;
var problems = new List<string>();
foreach (var line in lines)
{
if (line.Contains("<!--", StringComparison.Ordinal))
{
lastComment = line;
}
var match = PackageVersion().Match(line);
if (!match.Success)
{
continue;
}
var name = match.Groups["name"].Value;
if (!AllowedPackages.Contains(name, StringComparer.Ordinal) && !StageComment().IsMatch(lastComment))
{
problems.Add($"{name}: non è ammesso dalla regola 13 e nessun commento dice in quale tappa esce");
}
}
// Every component that was in use until 0.3.0 has left with its stage: no package waits for a stage any more,
// so only the ones the rule allows may be named (adding another one is asked first, rule 13).
var packages = lines.Select(line => PackageVersion().Match(line)).Where(m => m.Success).Select(m => m.Groups["name"].Value).ToList();
Assert.IsNotEmpty(packages, "Directory.Packages.props non ha pacchetti: la prova non legge il file giusto");
var problems = packages.Where(name => !AllowedPackages.Contains(name, StringComparer.Ordinal))
.Select(name => $"{name}: non è ammesso dalla regola 13 (gli altri componenti sono usciti con la 0.3.0)")
.ToList();
Assert.IsEmpty(problems, string.Join("\n", problems));
}
@@ -319,9 +385,6 @@ public sealed partial class SpecificationConsistencyTests
[GeneratedRegex("<PackageVersion Include=\"(?<name>[^\"]+)\"")]
private static partial Regex PackageVersion();
[GeneratedRegex(@"tappa C\d")]
private static partial Regex StageComment();
/// <summary>A stage of 0.3.0 in normalized (lower-case) text.</summary>
[GeneratedRegex(@"\bc\d\b")]
private static partial Regex Stage();
@@ -1,7 +1,7 @@
# Immagini di riferimento dei codec di casa
Insieme fisso di immagini con cui si provano i lettori di immagini scritti in casa (tappa C1: SkiaSharp esce da
Febe). Ogni caso è una coppia:
Insieme fisso di immagini con cui si provano i lettori di immagini scritti in casa (tappa C1, con cui SkiaSharp è
uscito da Febe). Ogni caso è una coppia:
- il **file d'ingresso** (`nome.png`, `.jpg`, `.webp`, `.gif`, `.bmp`);
- `nome.atteso.png`, **l'immagine attesa**: ciò che SkiaSharp ha letto da quel file, in RGBA a 8 bit per canale con
@@ -13,7 +13,7 @@ Febe). Ogni caso è una coppia:
Una volta sola, il 18 novembre 2026, con il permesso di Alberto, da un programma usa e getta con SkiaSharp 4.153.1
(lo stesso di `Directory.Packages.props` in quel momento) che **non è nel repository**: nel repository c'è solo ciò che
ha prodotto. Non si rigenerano: quando SkiaSharp sarà tolto non si potrà, ed è voluto. Un caso nuovo si costruisce con
ha prodotto. Non si rigenerano: SkiaSharp è uscito con la tappa C1 e non si può più, ed è voluto. Un caso nuovo si costruisce con
il nostro codice, non si aggiunge qui.
- **Contenuto solo sintetico.** Le scene sono calcolate: sfumature, un disco, righe a colori invertiti, una zona di