Просмотр исходного кода

codex_harness: preserve original _copy_bound_receipt authoritative rewriting for package receipts.

Codex Resource Selftest 4 месяцев назад
Родитель
Сommit
ee3a0a3580
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      tools/codex_harness.py

+ 3 - 3
tools/codex_harness.py

@@ -117,9 +117,6 @@ def _copy_bound_receipt(
         # Do not overwrite or invent the bitstream hash either.
     elif value.get("status") == "pass" and not SHA256_RE.fullmatch(str(value.get("bitstream_sha256", ""))):
         raise ValueError(f"confirmation receipt requires its own bitstream SHA256: {source}")
-    if receipt_role is not None:
-        value["receipt_role"] = receipt_role
-
     required_authoritative_fields = [
         "verification_run_id",
         "commit",
@@ -137,6 +134,9 @@ def _copy_bound_receipt(
         required_authoritative_fields.append("bitstream_sha256")
     missing = [field for field in required_authoritative_fields if not value.get(field)]
 
+    if receipt_role is not None:
+        value["receipt_role"] = receipt_role
+
     was_pass = value.get("status") == "pass"
     if was_pass and not missing:
         value["authoritative"] = True