Skip to content

Commit c0bd4bb

Browse files
authored
Merge pull request #1603 from DeusData/fix/vt-evidence-marker
fix(ci): publish VT evidence under the marker the gate actually writes
2 parents d150ebe + 07240cf commit c0bd4bb

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)