feat: 分离 Alpha 检查与提交限制,优化检查统计与前端展示
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
"""Classify platform evidence without discarding unknown checks or inferring eligibility."""
|
||||
|
||||
|
||||
def is_submission_limit(check):
|
||||
"""Recognize only the confirmed account-limit check; unknown names remain Alpha checks."""
|
||||
return isinstance(check, dict) and check.get("name") == "REGULAR_SUBMISSION"
|
||||
|
||||
|
||||
def split_checks(checks):
|
||||
"""Return Alpha checks and submission limits, retaining malformed Alpha evidence."""
|
||||
items = checks if isinstance(checks, list) else []
|
||||
return ([c for c in items if not is_submission_limit(c)],
|
||||
[c for c in items if is_submission_limit(c)])
|
||||
|
||||
|
||||
def submission_limits(checks):
|
||||
"""Summarize the observed limit, never the account's current allowance or reset time."""
|
||||
_, limits = split_checks(checks)
|
||||
status = "blocked" if any(c.get("result") == "FAIL" for c in limits) else (
|
||||
"not_blocked" if limits and all(c.get("result") == "PASS" for c in limits) else "unknown"
|
||||
)
|
||||
return {"status": status, "checks": limits,
|
||||
"meaning": "仅反映缓存观测时的提交限制,不代表当前额度或正式提交资格"}
|
||||
Reference in New Issue
Block a user