修正 PChome retry executor 空 selector 狀態
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-02 00:46:14 +08:00
parent a0fbf1684d
commit 034ac63959
2 changed files with 22 additions and 1 deletions

View File

@@ -4037,7 +4037,9 @@ def build_pchome_direct_mapping_retry_candidate_exception_controlled_apply_execu
applied_count = len(applied_records)
if execute_apply and missing_tables:
result = "DIRECT_MAPPING_RETRY_EXCEPTION_CONTROLLED_APPLY_EXECUTOR_BLOCKED_MISSING_TABLE"
elif execute_apply and applied_count == len(selectors) and readback_pass_count == len(selectors):
elif execute_apply and not selectors:
result = "WAITING_FOR_RETRY_EXCEPTION_CONTROLLED_APPLY_PREFLIGHT"
elif execute_apply and selectors and applied_count == len(selectors) and readback_pass_count == len(selectors):
result = "DIRECT_MAPPING_RETRY_EXCEPTION_CONTROLLED_APPLY_EXECUTED"
elif execute_apply:
result = "DIRECT_MAPPING_RETRY_EXCEPTION_CONTROLLED_APPLY_EXECUTION_INCOMPLETE"

View File

@@ -1272,6 +1272,25 @@ def test_direct_mapping_retry_candidate_exception_controlled_apply_executor_writ
assert call_count["search"] == 2
def test_direct_mapping_retry_candidate_exception_controlled_apply_executor_blocks_zero_selector_apply():
package = build_pchome_direct_mapping_retry_candidate_exception_controlled_apply_executor_package(
_payload(),
batch_size=1,
execute_apply=True,
)
assert package["result"] == "WAITING_FOR_RETRY_EXCEPTION_CONTROLLED_APPLY_PREFLIGHT"
assert package["summary"]["target_selector_count"] == 0
assert package["summary"]["applied_record_count"] == 0
assert package["summary"]["executor_receipt_ready_count"] == 0
assert package["summary"]["executor_receipt_materialized_count"] == 0
assert package["controlled_apply_executor"]["write_attempted"] is False
assert "engine_required_for_execute_apply" in package["write_blockers"]
assert "controlled_apply_preflight_not_ready" in package["write_blockers"]
assert package["post_executor_receipt_verifier"]["passed"] is False
assert package["safety"]["writes_database_count"] == 0
def test_ai_automation_readiness_makes_automation_visible_without_manual_primary_flow():
readiness = build_pchome_growth_ai_automation_readiness(_payload(), batch_size=1)