From a2e8560d41329490553f4c44f5194b200d4bf136 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Sun, 6 Dec 2026 18:15:18 +0100 Subject: [PATCH] fix(release): stop the release notes from failing on a low engine count The VirusTotal gate and the candidate selector stopped gating on how many engines answered in August: the count is VirusTotal fleet availability on the day, not a verdict, and a 50-engine floor had failed a whole release on a binary with zero detections. append-vt-notes.sh kept that floor (`completed < 50`), so a release whose gate passed could still fail later, in `verify`, after the draft exists, in a job the retry controller never retries. The v0.12.2-rc.1 run had exactly such a candidate: clean, judged by 49 engines ("verdict still applies" in the gate log). The notes now keep only the incoherence check the selector keeps (`total < completed`) and report the count in the engine range. The notes contract gains the case: a shipped, clean binary judged by 49 engines publishes its notes and the range shows 49. It fails without this change with "incomplete VirusTotal result". Signed-off-by: Martin Vogel --- scripts/ci/append-vt-notes.sh | 7 +++++-- tests/test_vt_release_notes_contract.sh | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/scripts/ci/append-vt-notes.sh b/scripts/ci/append-vt-notes.sh index db4b50c0d0..a231606a70 100755 --- a/scripts/ci/append-vt-notes.sh +++ b/scripts/ci/append-vt-notes.sh @@ -152,8 +152,11 @@ for result in results: fail(f"VirusTotal result is not bound to candidate bytes: {result['scan_path']}") completed = int(result["completed_engines"]) total = int(result["total_engines"]) - if completed < 50 or total < completed: - fail(f"incomplete VirusTotal result: {result['scan_path']}") + # As in the gate and the selector: `total < completed` is an incoherent + # response, but how many engines answered is VirusTotal fleet availability, + # not a verdict, so a low count is reported and never fails the release. + if total < completed: + fail(f"VirusTotal result has incoherent engine coverage: {result['scan_path']}") classification = result["policy_classification"] clean = ( classification == "clean" diff --git a/tests/test_vt_release_notes_contract.sh b/tests/test_vt_release_notes_contract.sh index 6360a2c28e..0a37fbcc6a 100644 --- a/tests/test_vt_release_notes_contract.sh +++ b/tests/test_vt_release_notes_contract.sh @@ -231,6 +231,30 @@ if run_notes "$FIX/current.md" "$FIX/tampered.md"; then fi mv "$FIX/evidence/release-selection.clean.tsv" "$FIX/evidence/release-selection.tsv" +# How many engines answered is VirusTotal fleet availability, not a verdict: +# the gate and the selector record the count and never gate on it. A shipped, +# clean binary judged by 49 engines (as on the v0.12.2-rc.1 run) must publish +# its notes, and the count must appear in the reported range. +cp "$FIX/evidence/virustotal-candidate-results.tsv" "$FIX/evidence/vt-results.clean.tsv" +python3 - "$FIX/evidence/virustotal-candidate-results.tsv" <<'PY' +import hashlib, pathlib, sys +p = pathlib.Path(sys.argv[1]) +sha = hashlib.sha256(b"linux-arm64:stripped").hexdigest() +lines = p.read_text().splitlines(keepends=True) +hits = [i for i, line in enumerate(lines) if line.startswith(f"objects/{sha}\t")] +assert len(hits) == 1, "fixture row for the shipped linux-arm64 binary not found" +cells = lines[hits[0]].split("\t") +assert cells[4] == "61" and cells[11] == "clean", cells +cells[4] = "49" +lines[hits[0]] = "\t".join(cells) +p.write_text("".join(lines)) +PY +run_notes "$FIX/current.md" "$FIX/low-engines.md" || \ + fail "a clean shipped binary judged by 49 engines must not fail the release notes" +grep -q 'decisive engines: 49' "$FIX/low-engines.md" || \ + fail "the 49-engine count must be reported, not hidden" +mv "$FIX/evidence/vt-results.clean.tsv" "$FIX/evidence/virustotal-candidate-results.tsv" + cat > "$FIX/reversed.md" <<'EOF' stale reversed data