This commit is contained in:
+13
-4
@@ -31,16 +31,20 @@ def snapshot_columns(settings, metrics, checks, *, checked=False):
|
||||
Sync snapshots with no failures are PRE_CHECK; a completed explicit /check
|
||||
with no failures is PASS. WARNING/PENDING do not count as failures, matching
|
||||
the legacy workflow. Empty, malformed or unknown results remain PENDING.
|
||||
No submission eligibility or activity eligibility is inferred here.
|
||||
A sole PURE_POWER_POOL_THEME failure is a PPAC candidate, not confirmation
|
||||
of current submission or activity eligibility. Raw failures stay available.
|
||||
"""
|
||||
settings = settings if isinstance(settings, dict) else {}
|
||||
metrics = metrics if isinstance(metrics, dict) else {}
|
||||
blocked = submission_limits(checks)["status"] == "blocked"
|
||||
checks, _ = split_checks(checks)
|
||||
valid = [check for check in checks if isinstance(check, dict)]
|
||||
failures = len(failed_checks(checks))
|
||||
failed_names = failed_checks(checks)
|
||||
failures = len(failed_names)
|
||||
by_name = {check["name"]: check for check in valid if isinstance(check.get("name"), str)}
|
||||
if failures:
|
||||
if failed_names == ["PURE_POWER_POOL_THEME"]:
|
||||
check_type = "PPAC_CANDIDATE"
|
||||
elif failures:
|
||||
check_type = "FAIL_1" if failures == 1 else "FAIL_2"
|
||||
elif not checks or len(valid) != len(checks) or any(check_result(check) not in ("PASS", "WARNING", "PENDING") for check in valid):
|
||||
check_type = "PENDING"
|
||||
@@ -75,7 +79,7 @@ def check_summary(checks, *, check_type):
|
||||
"check_type": check_type,
|
||||
"failed_checks": failed_checks(checks),
|
||||
"submission_limits": submission_limits(checks),
|
||||
"meaning": "PRE_CHECK 为同步无失败项;PASS 为主动检查完成且无失败项。PENDING/WARNING 不算失败,不代表全部检查项 PASS 或当前可提交",
|
||||
"meaning": "PRE_CHECK 为同步无失败项;PASS 为主动检查完成且无失败项;PPAC_CANDIDATE 为唯一失败项是 PURE_POWER_POOL_THEME 的候选。PENDING/WARNING 不算失败,不代表全部检查项 PASS 或当前可提交",
|
||||
}
|
||||
|
||||
|
||||
@@ -199,6 +203,11 @@ def list_statement(filters):
|
||||
query = query.where(Alpha.submission_blocked == filters.submission_blocked)
|
||||
if filters.submission_blocked:
|
||||
query = query.where(submission_condition("UNSUBMITTED"))
|
||||
if filters.ppac_candidate is not None:
|
||||
candidate = Alpha.check_type == "PPAC_CANDIDATE"
|
||||
query = query.where(candidate if filters.ppac_candidate else ~candidate)
|
||||
if filters.ppac_candidate:
|
||||
query = query.where(submission_condition("UNSUBMITTED"))
|
||||
if (filters.local_correlation_status is not None or filters.local_correlation_min is not None
|
||||
or filters.local_correlation_max is not None):
|
||||
# One cache row per Alpha keeps totals/export stable; stale overrides the displayed status.
|
||||
|
||||
@@ -9,7 +9,7 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator, model_valida
|
||||
|
||||
ResearchState = Literal["inbox", "candidate", "optimizing", "archived"]
|
||||
Submission = Literal["UNSUBMITTED", "SUBMITTED"]
|
||||
CheckType = Literal["PENDING", "PRE_CHECK", "PASS", "FAIL_1", "FAIL_2"]
|
||||
CheckType = Literal["PENDING", "PRE_CHECK", "PASS", "PPAC_CANDIDATE", "FAIL_1", "FAIL_2"]
|
||||
SortField = Literal[
|
||||
"id",
|
||||
"name",
|
||||
@@ -74,6 +74,7 @@ class AlphaFilters(Contract):
|
||||
local_correlation_min: float | None = Field(default=None, ge=-1, le=1)
|
||||
local_correlation_max: float | None = Field(default=None, ge=-1, le=1)
|
||||
submission_blocked: bool | None = None
|
||||
ppac_candidate: bool | None = None
|
||||
submission: Submission | None = None
|
||||
source: str | None = Field(default=None, max_length=100)
|
||||
source_reference: str | None = Field(default=None, max_length=200)
|
||||
|
||||
Reference in New Issue
Block a user