|
|
@@ -65,13 +65,50 @@ OFFLINE_FIDELITY_FORBIDDEN_ACTION_MARKERS = [
|
|
|
"PROGRAM_DEVICE",
|
|
|
"READ_DEVICE_ID",
|
|
|
]
|
|
|
-UART_SCHEMAS = {
|
|
|
- "uart-preflight-receipt-v1": "uart-preflight-validation-v1",
|
|
|
- "bmc-uart-protocol-receipt-v1": "bmc-uart-protocol-validation-v1",
|
|
|
- "uart-loopback-receipt-v1": "uart-loopback-validation-v1",
|
|
|
- "uart-board-sram-receipt-v1": "uart-board-sram-validation-v1",
|
|
|
- "uart-soak-receipt-v1": "uart-soak-validation-v1",
|
|
|
-}
|
|
|
+UART_SCHEMAS = {
|
|
|
+ "uart-preflight-receipt-v1": "uart-preflight-validation-v1",
|
|
|
+ "bmc-uart-protocol-receipt-v1": "bmc-uart-protocol-validation-v1",
|
|
|
+ "changxin-temp-uart-publisher-receipt-v1": "changxin-temp-uart-publisher-validation-v1",
|
|
|
+ "changxin-temp-uart-tty0tty-receipt-v1": "changxin-temp-uart-tty0tty-validation-v1",
|
|
|
+ "uart-loopback-receipt-v1": "uart-loopback-validation-v1",
|
|
|
+ "uart-board-sram-receipt-v1": "uart-board-sram-validation-v1",
|
|
|
+ "uart-soak-receipt-v1": "uart-soak-validation-v1",
|
|
|
+ "j6-binary921-evidence-manifest-v1": "j6-binary921-evidence-validation-v1",
|
|
|
+}
|
|
|
+BINARY921_ALLOWED_PROFILES = {
|
|
|
+ "debug-photo-bmc-replay-binary921",
|
|
|
+ "formal-uart1-bmc-replay-binary921",
|
|
|
+}
|
|
|
+BINARY921_REQUIRED_SAFETY_FALSE_FIELDS = [
|
|
|
+ "flash_attempted",
|
|
|
+ "driver_install_attempted",
|
|
|
+ "programs_nonvolatile",
|
|
|
+ "enumerates_com_ports",
|
|
|
+ "debug_port_writes_to_serial",
|
|
|
+]
|
|
|
+BINARY921_FORBIDDEN_ACTION_MARKERS = [
|
|
|
+ "PROGRAM_FLASH",
|
|
|
+ "ERASE_FLASH",
|
|
|
+ "PROGRAM_SPIBIN",
|
|
|
+ "DIRECT_FLASH_WRITE",
|
|
|
+ "DRIVER_INSTALL",
|
|
|
+ "DRIVER_REINSTALL",
|
|
|
+]
|
|
|
+CHANGXIN_TEMP_UART_REQUIRED_SAFETY_FALSE_FIELDS = [
|
|
|
+ "flash_attempted",
|
|
|
+ "programs_flash",
|
|
|
+ "programs_nonvolatile",
|
|
|
+ "driver_install_attempted",
|
|
|
+ "real_ptc_fan_action_attempted",
|
|
|
+ "uncontrolled_real_bmc_action_attempted",
|
|
|
+ "thermal_performance_claimed",
|
|
|
+ "cpld_bitstream_generated",
|
|
|
+ "program_sram_attempted",
|
|
|
+ "ipmi_lan_attempted",
|
|
|
+ "network_bmc_attempted",
|
|
|
+ "opens_unknown_serial_ports",
|
|
|
+ "toggles_dtr_rts",
|
|
|
+]
|
|
|
FINAL_GATE_REQUIRED_LAYERS = [
|
|
|
"static",
|
|
|
"model",
|
|
|
@@ -840,19 +877,192 @@ def _validate_offline_layer_evidence(layer: str, item: dict[str, Any]) -> list[s
|
|
|
return failures
|
|
|
|
|
|
|
|
|
-def _validate_safety(receipt: dict[str, Any]) -> list[str]:
|
|
|
- failures: list[str] = []
|
|
|
- safety = receipt.get("safety") or {}
|
|
|
- for field in ["flash_attempted", "real_ptc_fan_bmc_action_attempted", "driver_install_attempted"]:
|
|
|
- if safety.get(field) is not False:
|
|
|
- failures.append(f"safety_flag:{field}")
|
|
|
- if _contains_forbidden_action(receipt):
|
|
|
- failures.append("forbidden_action_marker")
|
|
|
- return failures
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-def _validate_real_bmc_artifact(
|
|
|
+def _validate_safety(receipt: dict[str, Any]) -> list[str]:
|
|
|
+ failures: list[str] = []
|
|
|
+ safety = receipt.get("safety") or {}
|
|
|
+ for field in [
|
|
|
+ "flash_attempted",
|
|
|
+ "real_ptc_fan_bmc_action_attempted",
|
|
|
+ "driver_install_attempted",
|
|
|
+ "programs_flash",
|
|
|
+ "programs_nonvolatile",
|
|
|
+ ]:
|
|
|
+ if field not in safety:
|
|
|
+ continue
|
|
|
+ if safety.get(field) is not False:
|
|
|
+ failures.append(f"safety_flag:{field}")
|
|
|
+ if _contains_forbidden_action(receipt):
|
|
|
+ failures.append("forbidden_action_marker")
|
|
|
+ return failures
|
|
|
+
|
|
|
+
|
|
|
+def _validate_changxin_temp_uart_receipt(receipt: dict[str, Any], *, strict: bool) -> list[str]:
|
|
|
+ failures: list[str] = []
|
|
|
+ if receipt.get("status") != "pass":
|
|
|
+ failures.append(f"changxin_status_not_pass:{receipt.get('status')}")
|
|
|
+ config = receipt.get("config") or {}
|
|
|
+ if strict and not re.fullmatch(r"[0-9a-f]{64}", str(config.get("toml_sha256") or "")):
|
|
|
+ failures.append("changxin_missing_config_hash")
|
|
|
+ bmc = receipt.get("bmc") or {}
|
|
|
+ if bmc.get("method") != "serial_tty":
|
|
|
+ failures.append("changxin_bmc_method_not_serial_tty")
|
|
|
+ if bmc.get("device") != "/dev/ttyUSB1":
|
|
|
+ failures.append("changxin_bmc_device_not_ttyusb1")
|
|
|
+ if int(bmc.get("baudrate") or 0) != 115200:
|
|
|
+ failures.append("changxin_bmc_baudrate_not_115200")
|
|
|
+ for field in ["host", "username", "password", "interface", "lanplus"]:
|
|
|
+ if field in bmc:
|
|
|
+ failures.append(f"changxin_legacy_bmc_network_key:{field}")
|
|
|
+ if str(bmc.get("raw_command") or "") not in set(map(str, bmc.get("readonly_whitelist") or [])):
|
|
|
+ failures.append("changxin_raw_command_not_allowlisted")
|
|
|
+ mapping = receipt.get("mapping") or {}
|
|
|
+ if mapping.get("source_groups") != 24:
|
|
|
+ failures.append("changxin_source_groups_not_24")
|
|
|
+ if mapping.get("destination_groups") != 32:
|
|
|
+ failures.append("changxin_destination_groups_not_32")
|
|
|
+ if mapping.get("invalid_fill_groups") != "25-32":
|
|
|
+ failures.append("changxin_invalid_fill_groups_not_25_32")
|
|
|
+ table = mapping.get("table") or []
|
|
|
+ if strict and len(table) != 32:
|
|
|
+ failures.append("changxin_mapping_table_not_32")
|
|
|
+ frame = receipt.get("frame") or {}
|
|
|
+ if frame.get("logical_length_bytes") != 66:
|
|
|
+ failures.append("changxin_frame_length_not_66")
|
|
|
+ checksum = frame.get("checksum") or {}
|
|
|
+ if checksum.get("algorithm") != "ones_complement_sum_first_49_bytes":
|
|
|
+ failures.append("changxin_checksum_algorithm")
|
|
|
+ if checksum.get("protected_length_bytes") != 49:
|
|
|
+ failures.append("changxin_checksum_protected_length_not_49")
|
|
|
+ if strict and not all(checksum.get("results") or []):
|
|
|
+ failures.append("changxin_checksum_result_not_pass")
|
|
|
+ if strict and not checksum.get("protocol_risk"):
|
|
|
+ failures.append("changxin_missing_protocol_risk")
|
|
|
+ serial = receipt.get("serial") or {}
|
|
|
+ if serial.get("virtual_serial") not in {"pty_socat", "pty_python", "tty0tty"}:
|
|
|
+ failures.append("changxin_virtual_serial_backend")
|
|
|
+ if serial.get("output_format") not in {"ascii_hex_space_lf", "ascii_hex_space_crlf", "binary_66_bytes"}:
|
|
|
+ failures.append("changxin_output_format")
|
|
|
+ required_hash = "wire_transcript_sha256" if serial.get("output_format") == "binary_66_bytes" else "ascii_transcript_sha256"
|
|
|
+ for field in ["pty_path", required_hash, "consumer_transcript_sha256"]:
|
|
|
+ if strict and not serial.get(field):
|
|
|
+ failures.append(f"changxin_missing_serial_{field}")
|
|
|
+ timing = receipt.get("timing") or {}
|
|
|
+ publish_interval = timing.get("publish_interval") or {}
|
|
|
+ for field in ["avg_sec", "p95_sec", "p99_sec", "max_sec"]:
|
|
|
+ if strict and field not in publish_interval:
|
|
|
+ failures.append(f"changxin_missing_timing_{field}")
|
|
|
+ errors = receipt.get("errors") or {}
|
|
|
+ for field in ["timeout", "stale", "parse_error", "missing"]:
|
|
|
+ if field not in errors:
|
|
|
+ failures.append(f"changxin_missing_error_count:{field}")
|
|
|
+ safety = receipt.get("safety") or {}
|
|
|
+ for field in CHANGXIN_TEMP_UART_REQUIRED_SAFETY_FALSE_FIELDS:
|
|
|
+ if safety.get(field) is not False:
|
|
|
+ failures.append(f"safety_flag:{field}")
|
|
|
+ authority = str(receipt.get("authority_boundary") or "").lower()
|
|
|
+ if "thermal performance" not in authority or "does not prove" not in authority:
|
|
|
+ failures.append("changxin_authority_boundary_missing_thermal_exclusion")
|
|
|
+ return failures
|
|
|
+
|
|
|
+
|
|
|
+def _validate_binary921_evidence_manifest(receipt: dict[str, Any], *, strict: bool) -> list[str]:
|
|
|
+ failures: list[str] = []
|
|
|
+ if receipt.get("status") != "pass":
|
|
|
+ failures.append(f"binary921_status_not_pass:{receipt.get('status')}")
|
|
|
+ if receipt.get("protocol") != "binary921":
|
|
|
+ failures.append("binary921_protocol_not_binary921")
|
|
|
+ if receipt.get("profile") not in BINARY921_ALLOWED_PROFILES:
|
|
|
+ failures.append("binary921_profile_not_allowed")
|
|
|
+ if receipt.get("bmc_source") != "pc_replay_from_real_bmc_capture":
|
|
|
+ failures.append("binary921_bmc_source_not_pc_replay")
|
|
|
+ if receipt.get("live_bmc_link_status") != "not_used":
|
|
|
+ failures.append("binary921_live_bmc_link_status_must_be_not_used")
|
|
|
+ if receipt.get("real_fan_ptc_hardware_status") != "not_run":
|
|
|
+ failures.append("binary921_real_fan_ptc_hardware_status_must_be_not_run")
|
|
|
+ if receipt.get("host_command_count") != 12:
|
|
|
+ failures.append("binary921_host_command_count_not_12")
|
|
|
+ if receipt.get("host_ack_count") != 12:
|
|
|
+ failures.append("binary921_host_ack_count_not_12")
|
|
|
+ if receipt.get("host_ack_matched_count") != 12:
|
|
|
+ failures.append("binary921_host_ack_matched_count_not_12")
|
|
|
+ try:
|
|
|
+ debug_frame_count = int(receipt.get("debug_frame_count") or 0)
|
|
|
+ except (TypeError, ValueError):
|
|
|
+ debug_frame_count = 0
|
|
|
+ if debug_frame_count <= 0:
|
|
|
+ failures.append("binary921_debug_frame_count_not_positive")
|
|
|
+ try:
|
|
|
+ bmc_payload_frame_count = int(receipt.get("bmc_payload_frame_count") or 0)
|
|
|
+ except (TypeError, ValueError):
|
|
|
+ bmc_payload_frame_count = 0
|
|
|
+ if bmc_payload_frame_count <= 0:
|
|
|
+ failures.append("binary921_bmc_payload_frame_missing")
|
|
|
+ try:
|
|
|
+ sensor_cache_frame_count = int(receipt.get("sensor_cache_frame_count") or 0)
|
|
|
+ except (TypeError, ValueError):
|
|
|
+ sensor_cache_frame_count = 0
|
|
|
+ if sensor_cache_frame_count <= 0:
|
|
|
+ failures.append("binary921_sensor_cache_frame_missing")
|
|
|
+ bmc_replay = receipt.get("bmc_replay") or {}
|
|
|
+ if not isinstance(bmc_replay, dict) or bmc_replay.get("status") != "pass":
|
|
|
+ failures.append("binary921_bmc_replay_not_pass")
|
|
|
+ else:
|
|
|
+ if bmc_replay.get("bmc_source") != "pc_replay_from_real_bmc_capture":
|
|
|
+ failures.append("binary921_bmc_replay_source_not_pc_replay")
|
|
|
+ if bmc_replay.get("byte_count") != 48:
|
|
|
+ failures.append("binary921_bmc_replay_byte_count_not_48")
|
|
|
+
|
|
|
+ safety = receipt.get("safety") or {}
|
|
|
+ if not isinstance(safety, dict):
|
|
|
+ failures.append("binary921_safety_not_object")
|
|
|
+ safety = {}
|
|
|
+ for field in BINARY921_REQUIRED_SAFETY_FALSE_FIELDS:
|
|
|
+ if safety.get(field) is not False:
|
|
|
+ failures.append(f"binary921_safety_flag:{field}")
|
|
|
+ for marker in _forbidden_action_markers(receipt, BINARY921_FORBIDDEN_ACTION_MARKERS):
|
|
|
+ failures.append(f"binary921_forbidden_action_marker:{marker}")
|
|
|
+
|
|
|
+ startup_ready = receipt.get("startup_ready") or {}
|
|
|
+ decoded = startup_ready.get("decoded") if isinstance(startup_ready, dict) else None
|
|
|
+ frame_type = startup_ready.get("frame_type") if isinstance(startup_ready, dict) else None
|
|
|
+ if strict and not (
|
|
|
+ isinstance(decoded, dict)
|
|
|
+ and decoded.get("kind") == "ready"
|
|
|
+ and int(frame_type if frame_type is not None else -1) == 1
|
|
|
+ ):
|
|
|
+ failures.append("binary921_startup_ready_missing")
|
|
|
+ return failures
|
|
|
+
|
|
|
+
|
|
|
+def _validate_changxin_temp_uart_tty0tty_receipt(receipt: dict[str, Any], *, strict: bool) -> list[str]:
|
|
|
+ failures: list[str] = []
|
|
|
+ if receipt.get("status") != "pass":
|
|
|
+ failures.append(f"tty0tty_status_not_pass:{receipt.get('status')}")
|
|
|
+ if receipt.get("operation") not in {"doctor", "setup", "teardown"}:
|
|
|
+ failures.append("tty0tty_operation")
|
|
|
+ failures.extend(_validate_json_schema_file(receipt, "changxin_temp_uart_tty0tty_receipt.schema.json", required=strict))
|
|
|
+ safety = receipt.get("safety") or {}
|
|
|
+ for field in [
|
|
|
+ "flash_attempted",
|
|
|
+ "program_sram_attempted",
|
|
|
+ "programs_flash",
|
|
|
+ "programs_nonvolatile",
|
|
|
+ "real_ptc_fan_action_attempted",
|
|
|
+ "thermal_performance_claimed",
|
|
|
+ "auto_setup_from_run_attempted",
|
|
|
+ ]:
|
|
|
+ if safety.get(field) is not False:
|
|
|
+ failures.append(f"safety_flag:{field}")
|
|
|
+ if strict and not receipt.get("rollback"):
|
|
|
+ failures.append("tty0tty_missing_rollback")
|
|
|
+ authority = str(receipt.get("authority_boundary") or "").lower()
|
|
|
+ if "thermal performance" not in authority or "does not prove" not in authority:
|
|
|
+ failures.append("tty0tty_authority_boundary_missing_thermal_exclusion")
|
|
|
+ return failures
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+def _validate_real_bmc_artifact(
|
|
|
receipt_path: Path | None,
|
|
|
layer: dict[str, Any],
|
|
|
key: str,
|
|
|
@@ -2002,11 +2212,15 @@ def _validate_host_sensor_debug921_common(
|
|
|
)
|
|
|
|
|
|
programming = payload.get("programming") if isinstance(payload.get("programming"), dict) else {}
|
|
|
- if programming.get("mode") != "PROGRAM_SRAM":
|
|
|
- failures.append("programming_not_sram")
|
|
|
- if programming.get("manual_programming") is not True:
|
|
|
- failures.append("manual_programming_not_true")
|
|
|
- bitstream_result = _hash_validation_with_optional_receipt_path(receipt_path, programming.get("bitstream"), required=True)
|
|
|
+ if programming.get("mode") != "PROGRAM_SRAM":
|
|
|
+ failures.append("programming_not_sram")
|
|
|
+ if programming.get("manual_programming") is not True:
|
|
|
+ failures.append("manual_programming_not_true")
|
|
|
+ if _safe_int(programming.get("jtag_speed_hz"), default=0) != 200000:
|
|
|
+ failures.append("jtag_speed_hz_not_200000")
|
|
|
+ if programming.get("board_power_present_before_program") is not True:
|
|
|
+ failures.append("board_power_present_before_program_not_true")
|
|
|
+ bitstream_result = _hash_validation_with_optional_receipt_path(receipt_path, programming.get("bitstream"), required=True)
|
|
|
if bitstream_result["status"] == "missing":
|
|
|
failures.append("bitstream_missing")
|
|
|
elif bitstream_result["status"] == "hash_mismatch":
|
|
|
@@ -2098,11 +2312,15 @@ def _validate_host_sensor_debug921_common(
|
|
|
elif bitstream_sha256 and td_bitstream_sha256.lower() != bitstream_sha256.lower():
|
|
|
failures.append("td_bitstream_hash_mismatch")
|
|
|
|
|
|
- if manual_layer.get("mode") != "PROGRAM_SRAM":
|
|
|
- failures.append("manual_sram_mode_not_program_sram")
|
|
|
- if manual_layer.get("manual_programming") is not True:
|
|
|
- failures.append("manual_sram_manual_programming_not_true")
|
|
|
- attestation_result, current_failures = _validate_real_bmc_artifact(receipt_path, manual_layer, "attestation", "manual_sram_attestation")
|
|
|
+ if manual_layer.get("mode") != "PROGRAM_SRAM":
|
|
|
+ failures.append("manual_sram_mode_not_program_sram")
|
|
|
+ if manual_layer.get("manual_programming") is not True:
|
|
|
+ failures.append("manual_sram_manual_programming_not_true")
|
|
|
+ if _safe_int(manual_layer.get("jtag_speed_hz"), default=0) != 200000:
|
|
|
+ failures.append("manual_sram_jtag_speed_hz_not_200000")
|
|
|
+ if manual_layer.get("board_power_present_before_program") is not True:
|
|
|
+ failures.append("manual_sram_board_power_present_before_program_not_true")
|
|
|
+ attestation_result, current_failures = _validate_real_bmc_artifact(receipt_path, manual_layer, "attestation", "manual_sram_attestation")
|
|
|
failures.extend(current_failures)
|
|
|
attestation_sha256 = _artifact_hash_from_result(attestation_result)
|
|
|
if isinstance(attestation_result, dict) and attestation_result.get("exists"):
|
|
|
@@ -2114,10 +2332,14 @@ def _validate_host_sensor_debug921_common(
|
|
|
if isinstance(attestation_payload, dict):
|
|
|
if str(attestation_payload.get("status") or "missing") != "pass":
|
|
|
failures.append(f"manual_sram_attestation_not_pass:{attestation_payload.get('status', 'missing')}")
|
|
|
- if attestation_payload.get("mode") != "PROGRAM_SRAM":
|
|
|
- failures.append("manual_sram_attestation_wrong_mode")
|
|
|
- if bitstream_sha256 and str(attestation_payload.get("bitstream_sha256") or "").lower() != bitstream_sha256.lower():
|
|
|
- failures.append("manual_sram_attestation_bitstream_hash_mismatch")
|
|
|
+ if attestation_payload.get("mode") != "PROGRAM_SRAM":
|
|
|
+ failures.append("manual_sram_attestation_wrong_mode")
|
|
|
+ if _safe_int(attestation_payload.get("jtag_speed_hz"), default=0) != 200000:
|
|
|
+ failures.append("manual_sram_attestation_jtag_speed_hz_not_200000")
|
|
|
+ if attestation_payload.get("board_power_present_before_program") is not True:
|
|
|
+ failures.append("manual_sram_attestation_board_power_present_before_program_not_true")
|
|
|
+ if bitstream_sha256 and str(attestation_payload.get("bitstream_sha256") or "").lower() != bitstream_sha256.lower():
|
|
|
+ failures.append("manual_sram_attestation_bitstream_hash_mismatch")
|
|
|
if td_sha256 and str(attestation_payload.get("td_receipt_sha256") or "").lower() != td_sha256.lower():
|
|
|
failures.append("manual_sram_attestation_td_receipt_hash_mismatch")
|
|
|
|
|
|
@@ -2639,10 +2861,18 @@ def _validate_host_sensor_debug921_common(
|
|
|
if ("pid closed-loop pass" in authority or "real pid closed-loop pass" in authority) and not negated_authority:
|
|
|
failures.append("authority_overclaim_pid_closed_loop")
|
|
|
|
|
|
- failure_set = set(failures)
|
|
|
- joined = "\n".join(failure_set)
|
|
|
- if (
|
|
|
- "programming_not_sram" in failure_set
|
|
|
+ failure_set = set(failures)
|
|
|
+ joined = "\n".join(failure_set)
|
|
|
+ jtag_attestation_failures = {
|
|
|
+ "jtag_speed_hz_not_200000",
|
|
|
+ "board_power_present_before_program_not_true",
|
|
|
+ "manual_sram_jtag_speed_hz_not_200000",
|
|
|
+ "manual_sram_board_power_present_before_program_not_true",
|
|
|
+ "manual_sram_attestation_jtag_speed_hz_not_200000",
|
|
|
+ "manual_sram_attestation_board_power_present_before_program_not_true",
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ "programming_not_sram" in failure_set
|
|
|
or "collector_debug_port_writes_to_serial" in failure_set
|
|
|
or "host_transcript_debug_port_writes_to_serial" in failure_set
|
|
|
or "manifest_debug_port_writes_to_serial" in failure_set
|
|
|
@@ -2658,6 +2888,8 @@ def _validate_host_sensor_debug921_common(
|
|
|
or any(item.startswith("safety_flag:") for item in failure_set)
|
|
|
):
|
|
|
final_status = "fail_forbidden_action"
|
|
|
+ elif failure_set.intersection(jtag_attestation_failures):
|
|
|
+ final_status = "fail"
|
|
|
elif "blocked_host_epoch_mixed" in failure_set:
|
|
|
final_status = "blocked_host_epoch_mixed"
|
|
|
elif (
|
|
|
@@ -3154,13 +3386,21 @@ def validate_uart_receipt(receipt_path: Path | str, *, strict: bool = False) ->
|
|
|
path = Path(receipt_path)
|
|
|
receipt = read_json(path)
|
|
|
schema = str(receipt.get("schema") or "")
|
|
|
- failures: list[str] = []
|
|
|
- warnings: list[str] = []
|
|
|
-
|
|
|
- if schema not in UART_SCHEMAS:
|
|
|
- failures.append("fail_schema")
|
|
|
- safety_failures = _validate_safety(receipt)
|
|
|
- failures.extend(safety_failures)
|
|
|
+ failures: list[str] = []
|
|
|
+ warnings: list[str] = []
|
|
|
+
|
|
|
+ if schema not in UART_SCHEMAS:
|
|
|
+ failures.append("fail_schema")
|
|
|
+ if schema == "j6-binary921-evidence-manifest-v1":
|
|
|
+ safety_failures = []
|
|
|
+ failures.extend(_validate_binary921_evidence_manifest(receipt, strict=strict))
|
|
|
+ else:
|
|
|
+ safety_failures = _validate_safety(receipt)
|
|
|
+ failures.extend(safety_failures)
|
|
|
+ if schema == "changxin-temp-uart-publisher-receipt-v1":
|
|
|
+ failures.extend(_validate_changxin_temp_uart_receipt(receipt, strict=strict))
|
|
|
+ if schema == "changxin-temp-uart-tty0tty-receipt-v1":
|
|
|
+ failures.extend(_validate_changxin_temp_uart_tty0tty_receipt(receipt, strict=strict))
|
|
|
|
|
|
status_value = _extract_status(receipt)
|
|
|
validation_schema = _schema_status(receipt)
|
|
|
@@ -3228,8 +3468,8 @@ def validate_uart_receipt(receipt_path: Path | str, *, strict: bool = False) ->
|
|
|
if nested["status"] != "pass":
|
|
|
failures.append(f"fail_soak_round_receipt:{round_index}:{nested['status']}")
|
|
|
|
|
|
- if "forbidden_action_marker" in safety_failures or "safety_flag:flash_attempted" in safety_failures:
|
|
|
- final_status = "fail_forbidden_action"
|
|
|
+ if "forbidden_action_marker" in safety_failures or any(item.startswith("safety_flag:") for item in failures):
|
|
|
+ final_status = "fail_forbidden_action"
|
|
|
elif status_value.startswith("blocked_"):
|
|
|
final_status = status_value
|
|
|
elif status_value.startswith("fail_"):
|