业务本体与标准实体:跨源键值对齐、对账共变算子、健康证据链与实体助手

- 新增标准业务实体(CanonicalEntity)模型、确定性跨源编码翻译、后台候选实体扫描与文档驱动实体智能助手
- 新增指标本体图谱(factor / reconciles_with / upstream_driver)、DAG 防环校验以及 ontology_neighbors / source_health 内置工具
- 新增跨源对账(analysis_reconcile)与滞后共变(analysis_cochange)分析算子,打通 [[h:H1]] 数据源健康证据链、报告导出与本体消融评测
- 数据目录新增「标准业务实体」视图与候选审阅工作台,口径页集成指标本体拓扑面板与端到端浏览器检查
This commit is contained in:
ThearchyHelios
2026-11-12 12:57:53 +08:00
parent 2f90f0eb3a
commit 8d9a712eae
106 changed files with 16654 additions and 295 deletions
+7 -2
View File
@@ -32,8 +32,8 @@ NODE_TYPE = "analysis"
#: 设置分组的键:settings 里的 analysis 一组、run.options["analysis"]
SETTINGS_KEY = "analysis"
Op = Literal["decompose", "baseline", "trend", "differ", "comparable"]
OPS: tuple[str, ...] = ("decompose", "baseline", "trend", "differ", "comparable")
Op = Literal["decompose", "baseline", "trend", "differ", "comparable", "reconcile", "cochange"]
OPS: tuple[str, ...] = ("decompose", "baseline", "trend", "differ", "comparable", "reconcile", "cochange")
#: 有模式的算子和它们的模式;其余算子 mode 为 None
MODES: dict[str, tuple[str, ...]] = {
"decompose": ("additive", "ratio", "factor"),
@@ -50,6 +50,8 @@ METHODS: dict[tuple[str, str | None], str] = {
("differ", "mean"): "differ.welch@2",
("differ", "rows"): "differ.welch_rows@2",
("comparable", None): "comparable@2",
("reconcile", None): "reconcile@1",
("cochange", None): "cochange.mad@1",
}
#: agent 分析工具的名字(tools/builtin 里注册),一个算子一个工具:参数各自聚焦,模型少写错
TOOL_NAMES: dict[str, str] = {op: f"analysis_{op}" for op in OPS}
@@ -57,6 +59,7 @@ TOOL_NAMES: dict[str, str] = {op: f"analysis_{op}" for op in OPS}
#: (engine/labels 的 ANALYSIS_OP_LABEL / ANALYSIS_MODE_LABEL 引用这里)、「{叫法}没有做成」的判定语都用它(method_label 拼成一句)
OP_LABELS: dict[str, str] = {
"decompose": "变化拆解", "baseline": "波动基线", "trend": "趋势判断", "differ": "差异检验", "comparable": "可比性检查",
"reconcile": "跨源对账", "cochange": "伴随异动",
}
MODE_LABELS: dict[str, str] = {
"additive": "可加", "ratio": "比率", "factor": "乘积", "rate": "比率", "mean": "均值", "rows": "逐行明细",
@@ -82,6 +85,8 @@ VERDICTS: dict[str, tuple[str, ...]] = {
"trend": ("rising", "falling", "no_trend"),
"differ": ("differs", "no_evidence"),
"comparable": ("comparable", "conditional", "incomparable"),
"reconcile": ("aligned", "diverged", "missing_counterpart"),
"cochange": ("co_anomalous", "target_normal", "primary_normal"),
}
#: 算不了的原因(细案 01 §8.2)。算不了也记成结论:写作者可以照实写「历史只有 5 周,判断不了是否异常」。最后两种是分析卡
#: 里随数据变化的调用错误记成的(analysis.run 的 refuse_data_errors,见 app/analysis 的 DATA_ERRORS):parent_refused 上一层