refactor(management): 种子函数移入management包+深拷贝冻结配置+清理死代码

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-09 17:06:14 +08:00
parent afc71e61ef
commit 8b555a5ad4
3 changed files with 42 additions and 35 deletions
@@ -36,7 +36,6 @@ def test_metric_definitions_cover_scored_metrics():
# 每个参与评分的 metric_code 都有元数据(名称/单位/方向)
for dim in DEFAULT_SCORE_CONFIG["dimensions"].values():
for code in dim.get("metrics", {}):
md = METRIC_DEFINITIONS[code if code in METRIC_DEFINITIONS else "active_share"]
# band 型指标的 key 带 _band 后缀,spec 里有 metric 字段:
spec = dim["metrics"][code]
src = spec.get("metric", code)
@@ -46,7 +45,7 @@ def test_metric_definitions_cover_scored_metrics():
async def test_seed_and_idempotent(make_session):
from app.sync.cli import _seed_score_config # 纯会话函数
from app.management.metric_definitions import _seed_score_config # 纯会话函数
s = make_session
v1 = await _seed_score_config(s)
await s.commit()