diff --git a/tools/validate_report_packet_sync_v1.py b/tools/validate_report_packet_sync_v1.py index 8a010def..b4527249 100644 --- a/tools/validate_report_packet_sync_v1.py +++ b/tools/validate_report_packet_sync_v1.py @@ -44,6 +44,8 @@ def _as_number(value: str | None) -> float | None: def _compare_numeric(errors: list[str], label: str, packet_value: float | int | None, report_value: str | None, tolerance: float = 0.01) -> None: report_number = _as_number(report_value) + if packet_value is None and (report_value is None or report_value.strip().lower() in {"n/a", "null", "data_missing"}): + return if packet_value is None or report_number is None: errors.append(f"{label} missing comparison value") return @@ -74,12 +76,14 @@ def main() -> int: pred_section = _find_section(report, "prediction_evaluation_improvement_report") _compare_numeric(errors, "PASS_100 score_0_100", pass_100.get("score_0_100"), _extract_table_value(pass_100_section, "score_0_100")) - if str(pass_100.get("gate") or "") != str(_extract_table_value(pass_100_section, "게이트")): - errors.append(f"PASS_100 gate mismatch: packet={pass_100.get('gate')} report={_extract_table_value(pass_100_section, '게이트')}") + pass_gate_report = _extract_table_value(pass_100_section, "게이트") + if not (pass_100.get("gate") is None and str(pass_gate_report or "").lower() in {"n/a", "null", "data_missing"}) and str(pass_100.get("gate") or "") != str(pass_gate_report): + errors.append(f"PASS_100 gate mismatch: packet={pass_100.get('gate')} report={pass_gate_report}") _compare_numeric(errors, "execution_readiness min_axis_score", exec_readiness.get("min_axis_score"), _extract_table_value(exec_section, "min_axis_score")) - if str(exec_readiness.get("gate") or "") != str(_extract_table_value(exec_section, "게이트")): - errors.append(f"execution_readiness gate mismatch: packet={exec_readiness.get('gate')} report={_extract_table_value(exec_section, '게이트')}") + exec_gate_report = _extract_table_value(exec_section, "게이트") + if not (exec_readiness.get("gate") is None and str(exec_gate_report or "").lower() in {"n/a", "null", "data_missing"}) and str(exec_readiness.get("gate") or "") != str(exec_gate_report): + errors.append(f"execution_readiness gate mismatch: packet={exec_readiness.get('gate')} report={exec_gate_report}") _compare_numeric(errors, "prediction match_rate_pct", prediction.get("match_rate_pct"), _extract_table_value(pred_section, "일치율"))