From 24714d26b8929a5339aa443bd9cea44515fdf055 Mon Sep 17 00:00:00 2001 From: ogt Date: Thu, 2 Jul 2026 10:53:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20PChome=20closeout=20receip?= =?UTF-8?q?t=20=E5=8F=AF=E8=A6=8B=E8=A8=88=E6=95=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/pchome_mapping_backlog_service.py | 5 +++-- tests/test_pchome_mapping_backlog_report.py | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/services/pchome_mapping_backlog_service.py b/services/pchome_mapping_backlog_service.py index 774d048..c6ae115 100644 --- a/services/pchome_mapping_backlog_service.py +++ b/services/pchome_mapping_backlog_service.py @@ -4468,8 +4468,9 @@ def build_pchome_direct_mapping_retry_candidate_exception_controlled_apply_recei }, {"check": "replay_does_not_write_database", "passed": safety["writes_database"] is False}, ] - summary["executor_receipt_materialized_count"] = len(materialized_artifacts) - summary["executor_receipt_hash_match_count"] = 1 if actual_sha and actual_sha == receipt_artifact["payload_sha256"] else 0 + existing_receipt_hash_match = bool(actual_sha) and actual_sha == receipt_artifact["payload_sha256"] + summary["executor_receipt_materialized_count"] = len(materialized_artifacts) or (1 if existing_receipt_hash_match else 0) + summary["executor_receipt_hash_match_count"] = 1 if existing_receipt_hash_match else 0 summary["post_executor_receipt_verifier_check_count"] = len(verifier_checks) safety["writes_artifact_count"] = len(materialized_artifacts) return { diff --git a/tests/test_pchome_mapping_backlog_report.py b/tests/test_pchome_mapping_backlog_report.py index e5d34f7..02fefc9 100644 --- a/tests/test_pchome_mapping_backlog_report.py +++ b/tests/test_pchome_mapping_backlog_report.py @@ -1402,6 +1402,15 @@ def test_direct_mapping_retry_candidate_exception_controlled_apply_receipt_repla receipt_payload = json.loads(receipt_path.read_text(encoding="utf-8")) assert receipt_payload["run_id"] == run_id assert receipt_payload["summary"]["post_apply_readback_pass_count"] == 2 + read_only_package = build_pchome_direct_mapping_retry_candidate_exception_controlled_apply_receipt_replay_package( + artifact_root=tmp_path, + run_id=run_id, + materialize_artifacts=False, + engine=engine, + ) + assert read_only_package["summary"]["executor_receipt_materialized_count"] == 1 + assert read_only_package["summary"]["executor_receipt_hash_match_count"] == 1 + assert read_only_package["post_executor_receipt_verifier"]["hash_match"] is True assert call_count["search"] == 2