顯示 PChome controlled apply closeout 狀態
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
This commit is contained in:
@@ -1434,6 +1434,40 @@ def test_ai_automation_readiness_makes_automation_visible_without_manual_primary
|
||||
assert readiness["safety"]["llm_calls_in_preview"] is False
|
||||
|
||||
|
||||
def test_ai_automation_readiness_surfaces_controlled_apply_receipt_replay_closeout():
|
||||
readiness = build_pchome_growth_ai_automation_readiness(
|
||||
_payload(),
|
||||
batch_size=1,
|
||||
controlled_apply_receipt_replay={
|
||||
"result": "DIRECT_MAPPING_RETRY_EXCEPTION_CONTROLLED_APPLY_RECEIPT_REPLAYED",
|
||||
"summary": {
|
||||
"target_selector_count": 4,
|
||||
"post_apply_readback_pass_count": 4,
|
||||
"executor_receipt_ready_count": 1,
|
||||
"executor_receipt_materialized_count": 1,
|
||||
"executor_receipt_hash_match_count": 1,
|
||||
},
|
||||
"safety": {
|
||||
"writes_database": False,
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
lanes = {lane["key"]: lane for lane in readiness["automation_lanes"]}
|
||||
assert readiness["result"] == "AI_AUTOMATION_CONTROLLED_APPLY_CLOSEOUT_VERIFIED"
|
||||
assert readiness["summary"]["controlled_apply_replay_selector_count"] == 4
|
||||
assert readiness["summary"]["controlled_apply_replay_readback_pass_count"] == 4
|
||||
assert readiness["summary"]["controlled_apply_receipt_materialized_count"] == 1
|
||||
assert readiness["summary"]["controlled_apply_closeout_verified_count"] == 1
|
||||
assert readiness["automation_policy"]["controlled_apply_closeout"] == "receipt_replay_machine_verified"
|
||||
assert lanes["controlled_apply"]["status"] == "completed"
|
||||
assert lanes["controlled_apply"]["value"] == 4
|
||||
assert lanes["controlled_apply_receipt_replay"]["status"] == "completed"
|
||||
assert lanes["controlled_apply_receipt_replay"]["value"] == 1
|
||||
assert readiness["safety"]["reads_database_for_receipt_replay"] is True
|
||||
assert readiness["safety"]["writes_database"] is False
|
||||
|
||||
|
||||
def test_ai_automation_readiness_reports_candidate_decisions_after_controlled_search():
|
||||
call_count = {"search": 0}
|
||||
|
||||
@@ -16014,7 +16048,7 @@ def test_ai_automation_readiness_route_defaults_to_no_search_and_uses_cached_pay
|
||||
monkeypatch.setattr(routes, "_create_icaim_dashboard_engine", fail_engine)
|
||||
|
||||
app = Flask(__name__)
|
||||
with app.test_request_context("/api/ai/pchome-growth/ai-automation-readiness?batch_size=1"):
|
||||
with app.test_request_context("/api/ai/pchome-growth/ai-automation-readiness?batch_size=1&include_receipt_replay=false"):
|
||||
response = routes.api_pchome_growth_ai_automation_readiness.__wrapped__()
|
||||
|
||||
payload = response.get_json()
|
||||
|
||||
Reference in New Issue
Block a user