feat(api): 因子出生链落 description——注册块/factors/detail 三处带出,registered 回传 [vps]

This commit is contained in:
2026-10-09 19:55:56 +08:00
parent d43ddd851d
commit 2b9186b6d6
3 changed files with 27 additions and 2 deletions
+5 -1
View File
@@ -451,6 +451,7 @@ def factors() -> dict:
# D7 件②:origin 身份戳+来源卡回链血统(manual=缺省)
"origin": e.get("origin") or "manual",
"hypothesis": e.get("hypothesis"),
"description": e.get("description") or "",
"icRecentT": t, # 最近批(12M 滚动窗)即近窗 t
"icFullT": None, # eval_store 每批单窗 t,无全史批数据源,如实 null
"promotedAtT": e.get("promotion_t") or None,
@@ -587,6 +588,7 @@ def factor_detail(name: str) -> dict:
return {"factor": {
"name": name, "status": e["status"],
"origin": e.get("origin") or "manual", "hypothesis": hyp_id,
"description": e.get("description") or "",
"expression": params.get("expression"),
"source": params.get("source"),
"justification": params.get("justification"),
@@ -1137,7 +1139,8 @@ async def _decompose_worker(hyp_id: str, config, job_id: str | None = None) -> d
for cand in result["passed"]:
src = derive_source(cand["expression"]) # 已过门,必为 str
vr.upsert_factor(reg, cand["name"], hypothesis=hyp_id,
status="incubating", origin="decomposer")
status="incubating", origin="decomposer",
description=cand.get("description"))
vr.add_version(reg, cand["name"], commit="decompose",
params={"expression": cand["expression"],
"source": src, "origin": "decomposer",
@@ -1145,6 +1148,7 @@ async def _decompose_worker(hyp_id: str, config, job_id: str | None = None) -> d
effective_from=today)
registered.append({"name": cand["name"], "source": src,
"expression": cand["expression"],
"description": cand.get("description", ""),
"justification": cand["justification"]})
vr.save_registry(rt, reg)
if card["state"] != "building": # building 态二次分解=纯增量注册(D3 矩阵无自迁移边)