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:
@@ -16,10 +16,16 @@ class Platform:
|
||||
self.detail_fail = False
|
||||
self.fail_child = None
|
||||
self.missing = False
|
||||
self.selection_reads = []
|
||||
self.selection_result = {"count": 2, "results": [{"id": "component1", "value": 0.3}, {"id": "component2", "value": 0.7}]}
|
||||
self.actual_components = {"count": 2, "results": [{"id": "component1"}, {"id": "component2"}]}
|
||||
self.secret = "synthetic-platform-secret"
|
||||
|
||||
def __call__(self, request):
|
||||
path = request.url.path
|
||||
if path == "/simulations/super-selection":
|
||||
self.selection_reads.append(dict(request.url.params))
|
||||
return httpx.Response(200, json=self.selection_result)
|
||||
if path == "/authentication":
|
||||
return httpx.Response(201, json={})
|
||||
if path == "/simulations" and request.method == "POST":
|
||||
@@ -39,29 +45,35 @@ class Platform:
|
||||
ids = []
|
||||
for i, item in enumerate(data):
|
||||
child = parent if len(data) == 1 else f"{parent}c{i}"
|
||||
aid = self.existing_alpha_ids[i] if self.existing_alpha_ids else f"alpha{parent}{i}"
|
||||
aid = self.existing_alpha_ids[i] if self.existing_alpha_ids and item["type"] != "SUPER" else f"alpha{parent}{i}"
|
||||
progress = {
|
||||
"status": "COMPLETE",
|
||||
"alpha": aid,
|
||||
"regular": item["regular"],
|
||||
"regular": item.get("regular", ""),
|
||||
"settings": item["settings"],
|
||||
}
|
||||
if i == self.fail_child:
|
||||
progress = {
|
||||
"status": "FAILED",
|
||||
"regular": item["regular"],
|
||||
"regular": item.get("regular", ""),
|
||||
"settings": item["settings"],
|
||||
"message": "invalid expression",
|
||||
}
|
||||
self.simulations[child] = progress
|
||||
self.alphas[aid] = {
|
||||
"id": aid,
|
||||
"regular": {"code": item["regular"]},
|
||||
"regular": {"code": item.get("regular", "")},
|
||||
"type": "REGULAR",
|
||||
"settings": item["settings"],
|
||||
"is": {"sharpe": None, "fitness": 0.8},
|
||||
"status": "UNSUBMITTED",
|
||||
}
|
||||
if item["type"] == "SUPER":
|
||||
assert len(data) == 1, "SUPER must be submitted singly"
|
||||
self.simulations[child].update(type="SUPER", selection=item["selection"], combo=item["combo"])
|
||||
self.simulations[child].pop("regular", None)
|
||||
self.alphas[aid].update(type="SUPER", selection={"code": item["selection"], "description": "Selection rationale"}, combo={"code": item["combo"], "description": "Combo rationale"}, components=self.actual_components)
|
||||
self.alphas[aid].pop("regular", None)
|
||||
ids.append(child)
|
||||
if len(data) > 1:
|
||||
self.simulations[parent] = {
|
||||
|
||||
Reference in New Issue
Block a user