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