feat: add Super Alpha research, management and MCP workflows
Deploy production / deploy (push) Successful in 56s

This commit is contained in:
yuxuanhui
2026-09-13 12:32:16 +08:00
parent 7c8188df9c
commit e256d6fef1
59 changed files with 3766 additions and 125 deletions
+16 -1
View File
@@ -117,13 +117,14 @@ async def runs(
source: str | None = Query(None, max_length=100),
reference: str | None = Query(None, max_length=200),
research_id: str | None = Query(None, max_length=200),
alpha_type: Literal["REGULAR", "SUPER"] | None = None,
q: str = Query("", max_length=200),
sort: Literal["name", "created_at"] = "created_at",
direction: Literal["asc", "desc"] = "desc",
):
async with request.app.state.sessions() as db:
return await Business(db).backtests.runs(
limit, offset, source, reference, research_id, q, sort, direction
limit, offset, source, reference, research_id, q, sort, direction, alpha_type
)
@@ -195,3 +196,17 @@ async def attach_reference(attempt_id: str, body: ReferenceInput, request: Reque
async def subset(preview_id: str, body: SubsetInput, request: Request):
async with request.app.state.sessions.begin() as db:
return await Business(db).backtests.subset(preview_id, body)
@router.get("/items/{item_id}/artifact")
async def artifact(item_id: str, request: Request, kind: Literal["snapshot", "components", "pnl"], limit: int = Query(25, ge=1, le=100), offset: int = Query(0, ge=0)):
from fastapi import HTTPException
from ..research_access.contracts import Artifact
from ..research_access.queries import EvidenceQueries
from ..research_access.service import ResearchError
async with request.app.state.sessions() as db:
try:
return await EvidenceQueries(db).artifact(Artifact(item_id=item_id, kind=kind, limit=limit, offset=offset))
except ResearchError as exc:
raise HTTPException(404, str(exc)) from None