Exclude variant review from rescore accepted gate
This commit is contained in:
@@ -116,7 +116,7 @@ def classify_match_attempt_row(
|
||||
elif diagnostics.comparison_mode == "unit_comparable":
|
||||
suggested_status = "unit_comparable_current"
|
||||
gate_pass = False
|
||||
elif diagnostics.score >= min_score:
|
||||
elif diagnostics.score >= min_score and "variant_selection_review" not in reasons:
|
||||
suggested_status = "accepted_current"
|
||||
gate_pass = True
|
||||
else:
|
||||
|
||||
@@ -82,6 +82,26 @@ def test_match_attempt_rescore_audit_keeps_unit_price_cases_out_of_gate_pass():
|
||||
assert "unit_comparable" in decision.reasons
|
||||
|
||||
|
||||
def test_match_attempt_rescore_audit_keeps_variant_selection_review_out_of_gate_pass():
|
||||
from services.competitor_match_attempt_rescore_audit import classify_match_attempt_row
|
||||
|
||||
decision = classify_match_attempt_row({
|
||||
"sku": "8884618",
|
||||
"attempt_status": "true_low_confidence",
|
||||
"momo_product_name": "【KATE 凱婷】怪獸級持色唇膏 水光款/經典款/微發色款(獨家技術持久不沾 高保濕)",
|
||||
"best_competitor_product_name": "【KATE 凱婷】怪獸級持色唇膏(水光) 1.6g",
|
||||
"momo_price": 420,
|
||||
"best_competitor_price": 350,
|
||||
"best_match_score": 0.623,
|
||||
})
|
||||
|
||||
assert decision.current_score >= 0.76
|
||||
assert decision.suggested_status == "low_score_current"
|
||||
assert decision.gate_pass is False
|
||||
assert decision.alert_tier == "identity_review"
|
||||
assert "variant_selection_review" in decision.reasons
|
||||
|
||||
|
||||
def test_match_attempt_rescore_audit_skips_missing_identity_text():
|
||||
from services.competitor_match_attempt_rescore_audit import classify_match_attempt_row
|
||||
|
||||
|
||||
Reference in New Issue
Block a user