Commit Graph
5 Commits
Author SHA1 Message Date
Hermes CI Fix a0762b367f fix(cma): entity isolation batch4 (cash plan writes, budget ownership, read leaks, okr template)
P0-A cash.py: scope api_update_plan / api_delete_plan / api_complete_plan /
api_register_payment to session entity (cross-entity id -> 404, aligning with
the file's existing get_entity_id endpoints).
P0-B budget.py: write entity_id on BudgetPlan creation + require the KPI to
belong to the session entity; scope /comparison, /comparison/kpi/{id} and
/deviation-report reads to the session entity.
P1 notifications.py: explicit field whitelist (name/config/enabled) on
update_channel to close mass-assignment.
P1 read leaks scoped to session entity: bot_kpis list, data_quality check/stats
(KPI calibre only; quality-log table has no entity_id column), kpis causality
chain + associate-map (KPI and map ownership), dashboard my-kpis,
customer_dashboard list, kpi_governance audit, budget_generate candidates,
driver_budget history (+ entity_id on its write path), expenses stats
(+ entity_id on its write path).
P2 okr_templates.py: write entity_id on the StrategicMap created by apply.

tests: tests/test_cross_entity_isolation_batch4_20260921.py (30 cases;
RED before fix = 22 failed, GREEN after = 30 passed; full suite 1302 passed /
1 xfailed / 0 failed).
2026-09-21 09:37:38 +08:00
Hermes CI Fix 8103ee4788 feat: KPI治理规则2增加kpi_name必填校验 — 防空名KPI
- META_FIELDS 增加 kpi_name(KPI名称)
- 验证: 空名→规则2拦截; 有名称→通过; 审计仍95/95合规
- 背景: F_REVENUE曾空名未被发现
2026-08-21 16:28:23 +08:00
Hermes CI Fix b787d22fdf fix: KPI治理审计白名单 FB_/BH_前缀 + 补6个元数据 + BH_ZERO_TARGET单位
- 规则3: FB_(财务Bot, process维度) 加入 LEGACY_PREFIX_DIM; BH_(博海品牌) 加入 BRAND_PREFIXES 跨维度合法
- 规则2: 补6个KPI数据来源/责任人(客户调研/CRM/客服部, 人事培训系统/人事部等)
- 规则1: BH_ZERO_TARGET unit '-' → '%'
- 审计结果: 95/95 合规(原36个不合规清零)
- 回归: pytest 451 passed
2026-08-21 16:18:32 +08:00
Hermes CI Fix f9e20bc9bc fix: KPI历史数据治理批量修复 — 元数据补全321条+编码规范处理222条
- 规则2: 补全321条元数据 (formula 207 / data_source 57 / data_owner 57)
  - EXT_科目KPI: formula按财务维度默认'财务指标计算'
  - F_/C_/P_/L_经典KPI: 精确公式(6条) + 数据源按维度(财务系统/业务系统)
  - data_owner优先取负责部门, 否则默认财务部
- 规则3: 审计规则白名单化EXT_前缀(科目余额表导入, 仅限finance维度),
  EXT_编码与dimension保持一致不改动; FB_/BH_ 21条真实前缀冲突
  输出人工确认清单 docs/kpi_governance_human_review.md
- 验证: GET /api/cma/kpi/governance/audit → rule_counts {1:0, 2:0, 3:21, 4:0}
  未改动任何kpi_code及引用表, 评分/地图/KPI列表接口正常
2026-08-10 23:50:14 +08:00
Hermes CI Fix 37f26148fe feat: 数据治理4条规则 — 入库必检+元数据+编码规范+战略分级 2026-08-10 23:40:31 +08:00