feat: 分离 Alpha 检查与提交限制,优化检查统计与前端展示

This commit is contained in:
yuxuanhui
2026-09-12 22:11:11 +08:00
parent 5eb6008ef7
commit 45eb4c3a17
13 changed files with 300 additions and 21 deletions
+6 -1
View File
@@ -7,6 +7,7 @@ from sqlalchemy import func, select
from ..alphas import number, sanitize
from ..backtests.contracts import fingerprint
from ..models import BacktestItem, BacktestResult, BacktestRun, Pnl
from ..platform_checks import is_submission_limit
from ..research.serialization import encode_snapshot
@@ -26,6 +27,8 @@ def checks_summary(snapshot):
if "checks" in snapshot:
raw = snapshot["checks"]
checks.extend({"section": "root", "raw": c} for c in (raw if isinstance(raw, list) else [raw]))
submission_checks = [c for c in checks if is_submission_limit(c["raw"])]
checks = [c for c in checks if not is_submission_limit(c["raw"])]
counts = Counter({key: 0 for key in ("PASS", "FAIL", "PENDING", "WARNING", "UNKNOWN")})
non_pass = []
for check in checks:
@@ -36,7 +39,9 @@ def checks_summary(snapshot):
if state != "PASS":
non_pass.append({**check, "status": state})
return {"status": "unknown" if not checks else "reported", "counts": dict(counts),
"total": len(checks), "non_pass": non_pass}
"total": len(checks), "non_pass": non_pass,
"submission_limits": submission_checks,
"meaning": "Alpha 检查统计不含提交限制;限制为快照观测,不代表实时提交资格"}
def item_summary(item, result):