feat(composite): 三路对拍前端可见性——合成层页第二卡(三路对比表+规则判读+特征贡献+冗余chips+空态)+GET challenge 端点(最新件/坏件skip);修 challenger CLI 断链(__main__ guard 缺失=python -m 静默空跑,11-01 stage6 必空,部署验证现场抓获);spec §4.4 落账含 QA 无合成 UI 核实 [vps]
CI/CD / test (push) Failing after 5s
CI/CD / nas-deploy (push) Has been skipped
CI/CD / nas-verify (push) Has been skipped

This commit is contained in:
2026-10-10 18:57:25 +08:00
parent 0093c0c154
commit e109c06b0f
7 changed files with 271 additions and 2 deletions
+33
View File
@@ -945,6 +945,39 @@ def composite(family: str | None = None) -> dict:
"items": [challenger, incumbent]}
@router.get("/pipeline/composite/challenge")
def composite_challenge() -> dict:
"""三路对拍最新件(等权/ICIR/LGBM 影子实验,spec §4.4 决议 O 前置可視性).
读报告根 challenger_lgbm/ 子目录(challenger_lgbm.py 产物,月度链 stage6
每月覆盖);多件取 as_of 最大,坏件 skip 留痕.无件=空态(11-01 首考),
前端显示"暂无对拍数据"——不造数.
"""
import glob as _glob
sub = os.path.join(_monthly_dir(), "challenger_lgbm")
docs: list[tuple[str, str, dict]] = [] # (as_of, file, doc)
for p in sorted(_glob.glob(os.path.join(sub, "*.json"))):
try:
with open(p, encoding="utf-8") as f:
d = json.load(f)
as_of = str(d.get("as_of") or "")
if as_of:
docs.append((as_of, os.path.basename(p), d))
except Exception as exc: # 坏件 skip: 对拍件非权威数据面,宁缺勿崩
logger.warning("challenge 对拍件坏件 skip %s: %s", p, exc)
if not docs:
return {"challenge": None,
"available": [],
"note": "暂无对拍数据——月度链 stage6 每月产出"
"(11-01 首考);challenger 永不进生产(影子实验)"}
docs.sort(key=lambda t: t[0]) # as_of 字典序=时间序
_, fname, doc = docs[-1]
doc["file"] = fname
return {"challenge": doc, "available": [f for _, f, _ in docs],
"note": ""}
# —— P4-1 假设卡片向导(决议 M:LLM 只做文字→结构,draft 不落库,确认才落) ——
_DRAFT_SENTENCE_MAX = 500