Skip to content

Commit 07240cf

Browse files
committed
fix(ci): publish VT evidence under the marker the gate actually writes
The v0.10.4 release (run 31755436916) failed at the very last step of `verify`, after all 69 other jobs had passed — full test matrix, all eight builds, smoke and soak: publish-vt-evidence: wrong evidence marker in binaries/vt-results.tsv The results format was bumped to `cbm-virustotal-results-v2` in DeusData#1596, but publish-vt-evidence.sh still demanded `-v1`. It was the only straggler: the gate, the selector, the notes renderer and all three contract fixtures were already on v2. It survived because that PR had removed the script's only caller, leaving it dead code that nothing exercised. Restoring the full-surface scan restored the caller too, and the stale expectation surfaced in the worst possible place — at the end of a real release rather than in a dry-run, since `verify` does not run in dry-runs. Also adds the guard that would have caught it: every marker publish-vt-evidence.sh validates must be one the gate actually writes. Revert-checked — reintroducing v1 fails with "publisher expects marker never written by the gate: cbm-virustotal-results-v1". The scan itself passed. This is purely the evidence-publishing step. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent d150ebe commit 07240cf

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

‎scripts/ci/publish-vt-evidence.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ publish_copy() {
4040

4141
publish_copy "$VT_ASSOCIATIONS" cbm-release-scan-associations-v3 virustotal-associations.tsv
4242
publish_copy "$VT_EXPECTED_SCAN_SET" cbm-release-scan-set-v2 virustotal-scan-set.tsv
43-
publish_copy "$VT_RESULTS_PATH" cbm-virustotal-results-v1 virustotal-results.tsv
43+
publish_copy "$VT_RESULTS_PATH" cbm-virustotal-results-v2 virustotal-results.tsv
4444

4545
for name in virustotal-associations.tsv virustotal-results.tsv virustotal-scan-set.tsv; do
4646
if command -v sha256sum >/dev/null 2>&1; then

‎tests/test_vt_gate_policy_contract.sh‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,31 @@ grep -Fq 'Microsoft `!ml` tolerance' "$ROOT/README.md" || \
3232
grep -Fq 'Policy identifier: `cbm-vt-candidate-selection-v1`' "$ROOT/SECURITY.md" || \
3333
fail "SECURITY.md must name the versioned candidate-selection policy"
3434

35+
# Every marker publish-vt-evidence.sh validates must be one the gate actually
36+
# writes. These drifted silently: the results format went to v2 while the
37+
# publisher still demanded v1, and nothing caught it because the publisher had
38+
# no caller for a while. Restoring the caller failed a real release at the very
39+
# last step, after the full test matrix, both builds, smoke and soak had passed.
40+
python3 - "$ROOT" <<'MARKERS' || fail "evidence markers disagree between writer and publisher"
41+
import pathlib, re, sys
42+
root = pathlib.Path(sys.argv[1])
43+
publisher = (root / "scripts/ci/publish-vt-evidence.sh").read_text(encoding="utf-8")
44+
writers = "\n".join(
45+
(root / name).read_text(encoding="utf-8")
46+
for name in ("scripts/ci/check-virustotal.sh", "scripts/ci/append-vt-notes.sh")
47+
)
48+
expected = re.findall(r"^publish_copy\s+\S+\s+(\S+)", publisher, re.M)
49+
if not expected:
50+
print("no publish_copy markers found - has the publisher been restructured?", file=sys.stderr)
51+
raise SystemExit(1)
52+
missing = [m for m in expected if m not in writers]
53+
if missing:
54+
for m in missing:
55+
print(f"publisher expects marker never written by the gate: {m}", file=sys.stderr)
56+
raise SystemExit(1)
57+
print(f"OK: all {len(expected)} published evidence markers match what the gate writes")
58+
MARKERS
59+
3560
# Tripwire for the REVERTED endpoint-verification mechanism specifically. The
3661
# current `!ml` tolerance is a policy branch inside this gate, not a callout to
3762
# an external verification service, and must never become one.

0 commit comments

Comments
 (0)