feat: add Super Alpha research, management and MCP workflows
Deploy production / deploy (push) Successful in 56s
Deploy production / deploy (push) Successful in 56s
This commit is contained in:
@@ -448,7 +448,7 @@ class BacktestLane:
|
||||
|
||||
def safe_progress(self, value):
|
||||
# Store useful protocol evidence, never arbitrary upstream diagnostics or credentials.
|
||||
result = {k: value[k] for k in ("status", "alpha", "regular", "settings", "location") if k in value}
|
||||
result = {k: value[k] for k in ("status", "type", "alpha", "regular", "selection", "combo", "settings", "location", "warnings") if k in value}
|
||||
message = value.get("error") or value.get("message")
|
||||
if isinstance(message, str):
|
||||
for secret in list(self.client.credentials or ()) + list(self.client.client.cookies.values()):
|
||||
@@ -485,11 +485,13 @@ class BacktestLane:
|
||||
matched = [
|
||||
i
|
||||
for i in items
|
||||
if i.expression == expression
|
||||
if ((i.alpha_type == "REGULAR" and evidence.get("type", "REGULAR") == "REGULAR" and i.expression == expression)
|
||||
or (i.alpha_type == "SUPER" and evidence.get("type") == "SUPER"
|
||||
and i.selection == code(evidence.get("selection")) and i.combo == code(evidence.get("combo"))))
|
||||
and isinstance(settings, dict)
|
||||
and all(k in settings and settings[k] == v for k, v in i.settings.items())
|
||||
]
|
||||
if count == 1:
|
||||
if count == 1 and items[0].alpha_type == "REGULAR":
|
||||
matched = (
|
||||
items
|
||||
if (expression == items[0].expression or (not expression and detail is None))
|
||||
@@ -499,6 +501,9 @@ class BacktestLane:
|
||||
)
|
||||
else []
|
||||
)
|
||||
if count == 1 and items[0].alpha_type == "SUPER" and detail is None:
|
||||
# A known receipt can record progress, but saving SUPER requires full type/input evidence.
|
||||
matched = items if not any(k in evidence for k in ("type", "selection", "combo", "settings")) else matched
|
||||
# Identical inputs within a multi-submit are intentionally not position-matched.
|
||||
if len(matched) != 1 or (matched[0].simulation_id not in (None, child)):
|
||||
return
|
||||
@@ -513,6 +518,9 @@ class BacktestLane:
|
||||
if not await db.get(BacktestResult, item.id):
|
||||
from datetime import datetime
|
||||
|
||||
if item.alpha_type == "SUPER":
|
||||
from ..superalpha.evidence import save_actual_components
|
||||
await save_actual_components(db, item, detail, receipt["observed_at"])
|
||||
db.add(
|
||||
BacktestResult(
|
||||
item_id=item.id,
|
||||
|
||||
Reference in New Issue
Block a user