mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-23 22:42:01 +00:00
完善口径管理、主动调查与后台任务,修复通用问题
- 完善口径编辑、只读试运行、统一质量验证与执行语义指纹 - 增加可执行指标约束、有预算的主动调查和过程评测 - 提取发布检查、证据读取与起草服务,支持任务停止、重试和检查点恢复 - 增加版本传递影响分析,修复并发覆盖、敏感值遮罩、异常评分及页面状态问题 - 修复 SQLite 复合查询追溯和 microVM 可选依赖缺失处理 - 纳入当前设计文档及部署配置调整 验证:相关主回归 3822 项通过,4 项跳过、8 项预期失败;补充回归通过。 前端构建、文案检查及 git diff --check 通过。 全量检查仍有环境权限、PostgreSQL 可选依赖和既有部署配置、SQLite 文件基线差异导致的未通过项。
This commit is contained in:
@@ -135,6 +135,33 @@ def test_metric_ids_are_unique_and_entry_fields_are_normalized():
|
||||
assert plan["entry_fields"][0]["required"] is True
|
||||
|
||||
|
||||
def test_document_drafting_fields_are_kept_and_normalized():
|
||||
"""文档起草里的粒度、时间字段、分子分母、维度、过滤条件不能在校验时丢掉:草稿页要逐行展示。"""
|
||||
metric = {**METRIC, "grain": " 日 ", "time_field": " 支付时间 ", "numerator": "退款订单数",
|
||||
"denominator": "已支付订单数", "dimensions": ["门店", "", 3, " 区域 "],
|
||||
"filters": ["只算已支付", " ", None]}
|
||||
plan, problems = draftplan.normalize_plan(raw(metrics=[metric]), CHUNKS, allowed_tables=TABLES)
|
||||
got = plan["metrics"][0]
|
||||
assert got["grain"] == "日" and got["time_field"] == "支付时间"
|
||||
assert got["numerator"] == "退款订单数" and got["denominator"] == "已支付订单数"
|
||||
assert got["dimensions"] == ["门店", "区域"] and got["filters"] == ["只算已支付"]
|
||||
# METRIC_FIELDS 要列全:校验后的指标带着这些业务字段(前端按它画)
|
||||
assert set(draftplan.METRIC_FIELDS) >= {"grain", "time_field", "numerator", "denominator",
|
||||
"dimensions", "filters"}
|
||||
assert set(got) >= set(draftplan.METRIC_FIELDS)
|
||||
assert not [p for p in problems if p["name"] == "销售额"]
|
||||
|
||||
|
||||
def test_empty_document_drafting_fields_do_not_leave_empty_string_keys():
|
||||
"""没写的业务字段不留空字符串:没有内容就没有这个键(dimensions、filters 里的空项也丢掉)。"""
|
||||
metric = {**METRIC, "grain": " ", "time_field": "", "numerator": None, "denominator": [],
|
||||
"dimensions": ["", " "], "filters": []}
|
||||
plan, _problems = draftplan.normalize_plan(raw(metrics=[metric]), CHUNKS, allowed_tables=TABLES)
|
||||
got = plan["metrics"][0]
|
||||
assert not [key for key in ("grain", "time_field", "numerator", "denominator", "dimensions", "filters")
|
||||
if key in got]
|
||||
|
||||
|
||||
# ==========================================================================
|
||||
# build_graph
|
||||
# ==========================================================================
|
||||
|
||||
Reference in New Issue
Block a user