修复(履约绑定): 客户目标到达前禁止历史角色落位

This commit is contained in:
yml
2026-11-26 01:51:04 +08:00
parent d62d56d98d
commit 3c4111796e
8 changed files with 103 additions and 17 deletions
@@ -208,9 +208,6 @@ def build_binding_evidence(
legacy_latest = selected_info_candidate
pending_role = pending_binding_role_from_result(result)
action_pending_role = (
_text((action_pending or {}).get("roleName")) if action_pending else ""
)
legacy_role = _text((legacy_latest or {}).get("roleName"))
action_alias_has_role = any(
item["alias"] in action_aliases and item["roleName"]
@@ -223,20 +220,9 @@ def build_binding_evidence(
# - decision 明确可确认时的角色。
# 不能用 result.role_name / before_bind_info 的 baseline 兜底,否则会把
# 账号上一单的旧角色误报成本次扫码,详情就会和列表的“待扫码”冲突。
decision_role = (
_text(decision.get("role_name"))
if decision.get("confirmable")
and (
selected_alias in action_aliases
or not action_alias_has_role
)
else ""
)
scanned_role = _text(
pending_role
or action_pending_role
or decision_role
)
# scannedRole 必须和列表、客户页、提交确认共用同一个权威 pending 判定。
# actionPending/decision 只保留为诊断字段,不能绕过客户目标校验。
scanned_role = _text(pending_role)
if (
not scanned_role
and action_current is not None