Commit Graph
73 Commits
Author SHA1 Message Date
Hermes CI Fix 45832cbf45 feat(kpi): collect cashflow-direct caliber for F_OP_CFLOW/F_FCF
- kpi_value_collector: new calc=cashflow_direct branch (line-level counterpart

  classification: cash vouchers -> operating/financing/investing buckets),

  no hardcoded voucher numbers; optional minus_capex for FCF

- verify_cashflow_direct_caliber.py: 8-period reconcile + identity + negative

  control (voucher-level classification would overstate 2026-06 by 18,700)

task: yanxue-budget-cashflow-kpi-activate-20260914
2026-09-14 18:01:57 +08:00
Hermes CI Fix 40d522cd34 fix(security): retire default-credential surface (yanxue-20260914-cma-defaultcred-code-fix)
- Login.vue: no prefilled default creds; no anonymous entity enumeration on mount

- deploy.sh: readiness polling (0.5s/30s cap) replaces fixed sleep 3; login smoke reads same-source 600 secret file, missing file = explicit abort

- 19 verify/check/gen_report scripts: shared _admin_creds() loader (CMA_ADMIN_ENV -> ops .secrets -> profile copy); no hardcoded creds

- tests: single TEST_USER_PASSWORD fixture constant; docs: pointer to 600 secret file; removed 4 legacy .bak + pycache residue
2026-09-14 17:39:53 +08:00
Hermes CI Fix 8adc783501 fix(budget): attribution backfill computes in-process and previews on dry-run (yanxue-20260914-budget-p13p14-activation) 2026-09-14 17:25:49 +08:00
hermes a6d5d151c4 feat(budget): activate P1 auto-collect + attribution subject mapping (yanxue-20260914-budget-p13p14-activation) 2026-09-14 17:19:49 +08:00
fullstack-bot b815b7f623 fix(security): close unauthenticated CMA user API surface + audit tool (cma-api-auth-surface-audit-20260914)
Root cause: main.py include_router had no global auth dependency; user routers
(products/cost/predict/...) relied on assert_entity_scope, which treats a
missing session token as the Bot service channel and lets the request through.
Result: 46 user endpoints returned data without any token on a public site.

Changes:
- auth_middleware.py: add require_auth_401 (missing Bearer -> 401, delegates to
  require_auth otherwise); 401/403 semantics are explicit.
- router-level Depends(require_auth_401) on products, cost, predict,
  notifications, permissions, tenant, alignment; endpoint-level on
  /auth/roles and /admin/cache/clear.
- deps.py: document that get_entity_id/assert_entity_scope are NOT auth.
- frontend: add the missing Bearer header to 5 tokenless fetch/axios calls that
  hit the newly protected endpoints (KPIAlignment x2, RolePermissions x2,
  Dashboard x1).
- tests: new test_api_auth_surface_20260914.py (58 cases: no-token 401,
  token 200, cross-entity 403, bot channel unchanged); adapt test_predict /
  test_kpi_forecast to send session tokens like production.
- scripts/audit_api_auth_surface.py: reusable FastAPI dependency-graph audit
  (423 endpoints; A bot / B gap / C public), exits 1 when a B-class gap exists.
2026-09-14 16:41:15 +08:00
wecom-fullstack e159db058a fix(alerts): F4b 展示口径与落库口径同源 — summary/suggestions/upcoming_7d 按快照批次 mode 过滤 + raw/excluded/batches 可见 (dama-cashplan-zombie-alert-cleanup-20260913) 2026-09-13 07:38:58 +08:00
Hermes CI Fix 59e65a68b9 fix(alerts): cash_plan 到期未收款预警引擎修复 — entity归属/KPI实体感知/余额快照批次/去重刷新/端点鉴权 (dama-cashplan-alert-engine-fix-20260913)
F1 两处 KPIAlert 显式写 entity_id(列默认 1 → 博海预警错挂酣客);顺带修 deviation_engine/
   alert_generator/deviation_push/bot_bridge/bot_bridge_v2 同表创建点
F2 KPI 选择实体感知:候选码 ∪ 实体前缀后缀码(_AR_BALANCE/_CASH_BALANCE/_AP_BALANCE)
   + 兜底 ORDER BY id(此前命中 uk_entity_kpi 必中 BH_ADM_EXPENSE 437 管理费用)
F3 去重命中改为刷新 alert_message/等级/suggestion.days_late/归属(此前 continue → 文本冻结首版)
F4 余额快照批次(bohai_*_20260630 / receivables_migrate)开关:默认 skip 不逐户,另备
   aggregate(按批次聚合1条) / per_customer(旧行为)
F5 POST /api/cma/admin/alerts/check 补鉴权(无 token 401)+ 可选 entity_id 只跑指定账套
2026-09-13 00:37:10 +08:00
Hermes CI Fix b8f4a3d543 chore(security): 凭据治理收口 — 清除硬编码DB账号/口令,脚本与API统一从 backend/.env 读取(无明文兜底);取消跟踪 .pyc 构建产物 (credential-governance-20260912) 2026-09-12 23:34:35 +08:00
Hermes CI Fix 4f7058f1ea chore(verify): BEP 阈值验收脚本改动态断言(按数据归属实体登录)+历史快照归档加运行守卫 (concurrent-duplicate-session-and-stale-verify-script-20260912) 2026-09-12 20:35:20 +08:00
Hermes CI Fix ce2f6bfe33 fix(bep): pick target period by period-closed signal, sales threshold as fallback only
Defect: _pick_target_period treated "month sales < 30% of 6-month avg" as
"period not closed", so 2026-08 (actually closed: 3103 carry-forward vouchers
present) was skipped because of a low-sales off-season month, pinning the five
F_BEP* KPIs at 2026-07.

Fix: add _is_period_closed() - primary signal voucher_details
(carry_forward=1 AND subject_code='3103'), secondary signal
ZXT_LANDING_DIR/{YYYY.MM}/check.md containing both "issue PASS" and
"P&L carry-forward PASS". _pick_target_period now scans candidate months desc
and returns the first closed one, with no sales filtering; the old sales
threshold path is kept only as a fallback (warns "sales-threshold fallback").

Scope: run_derive() formulas, collector, kpi_definitions and cron untouched.

Verified: period=2026-08; 167.5 / 60.4 / 39.6 / 118.7 / 85.2;
F_BEP_COVER 2026-08 red pending, 2026-07 pending resolved; idempotent on re-run.
2026-09-12 20:08:31 +08:00
Hermes CI Fix 998da4ebd4 fix(okr): 季度复盘提醒审计口径与失败感知加固 — dry_run/sent/failed/skipped 状态语义 + 失败本地留痕+中继告警+退出码契约(0/1/2) (fullstack-okr-reminder-hardening-20260911) 2026-09-12 01:03:31 +08:00
Hermes CI Fix 38968750a3 feat(okr): OKR模板库 tags 多值标签 — 表结构+回填36模板+API过滤 (fullstack-okr-tags-20260911)
- okr_templates 新增 tags JSON 字段(function/cycle/goal_type 固定枚举)
- 回填脚本幂等:36/36 模板 tags 补齐,二次运行跳过
- API: GET /okr-templates 支持 function/cycle/goal_type/tag 过滤,新增 GET /tags/schema
- API: POST 创建 + 新增 PUT 更新接受 tags(非法值 400)
- dimension 四泳道主分类路径不变(回归 11/8/9/8 一致)
2026-09-11 19:33:52 +08:00
Hermes CI Fix e2d2a1c165 feat(okr): 季度复盘提醒机制 — objectives active 清单经企微中继推送 + notification_logs 留痕 (fullstack-okr-kpi-gap-fix) 2026-09-11 19:20:42 +08:00
Hermes CI Fix 4c6fb85cf5 fix(kpi): 阈值红黄绿读写/填写规则修复 — 统一解析器+红灯优先+建议可解析+前端校验+存量修正 (project-20260911-threshold-fix)
① 新建 app/utils/threshold_parser.py 统一解析/判定(单一事实源):
   - 支持负数(>=-100000)、闭区间 A~B、多条件 C1|C2;空串=未设置
   - 判定顺序 red→green→yellow:红灯优先(消除宽黄灯遮蔽红灯),
     green 先于 yellow(green 是主条件,yellow 是更宽兜底带)
② kpis.py / alert_generator.py 双实现收敛到统一解析器(消除重复维护)
③ thresholds.py suggest 输出可解析表达式(原黄色/适中型生成 `52.33~107.67`、`偏离55%` 等
   区间/文字 → 用户点"自动建议"填入后静默失效;另修复大数目标生成 1.6e+06 科学计数法)
④ KPIDetail.vue 三个阈值输入加 placeholder/tooltip/帮助文案 + 保存前格式校验(非法即拒)
⑤ 存量 4 个不可解析表达式修正(id=46 C_REBATE_RATE / id=327 BH_SALES_10),
   改前 mysqldump 备份 backend/scripts/backups/kpi_definitions.bak-20260911.sql +
   threshold_rows_before_20260911.json(可回滚);不可解析 5→0
⑥ 单测 97 条 + 红黄绿判定回归 367 判定点(旧→新差异 14 条,含差异说明)
2026-09-11 17:25:24 +08:00
Hermes CI Fix 9822fbd9ba feat(alerts): 新增客户集中度预警规则 customer_concentration + 预测偏差规则启用/联动每日预警生成
- alert_rules: 新增 rule_type=customer_concentration(单一/前N客户收入占比超阈值触发,黄=超阈值/红=阈值x倍数)
  数据源 zxt_masterbill 客户(往来单位)收入聚合,unit_id<=0 占位剔除;无客户数据可回退 KPI 口径
  复用现有 KPIAlert 生成链路:check-all 内联分支 + 专用端点 POST /run-customer-concentration
- alert_generator(每日9:00): 新增规则引擎步骤,复用上述检查函数跑 forecast_deviation/customer_concentration
- AlertList.vue: 规则类型筛选/编辑项 + 参数表单 + 客户集中度检查按钮
- 测试: tests/test_customer_concentration_rule.py 17 条(规则注册/聚合/双数据源/黄红灯/去重/check-all)
- 验证脚本: scripts/verify_forecast_deviation_rules_e2e.py / verify_customer_concentration_rule_e2e.py
2026-09-10 09:56:50 +08:00
Hermes CI Fix 265714341c fix(maps): _auto_snapshot 补 entity_id 继承地图企业 — 修复 entity2 地图发布后版本行落 entity1 致版本列表为空 (project-20260908-map-versions-page) 2026-09-08 20:24:44 +08:00
Hermes CI Fix 54e39b5493 chore(kpi): BEP阈值+现金口径修复验收脚本 verify_bep_threshold_fix.py (fin-fix-bep-threshold-20260908) 2026-09-08 15:59:41 +08:00
Hermes CI Fix 5bcc65b47f fix(kpi): BEP保本KPI阈值按>=85口径修正 + 新增现金口径派生KPI(剔除折旧560213) + bep-card现金读派生单一事实源 (fin-fix-bep-threshold-20260908) 2026-09-08 15:57:47 +08:00
Hermes CI Fix 1a5356a2d1 feat(kpi): CMA保本点派生KPI F_BEP_REVENUE/COVER/GAP + 每日派生执行器 + 红黄绿静态阈值判定
- kpi_definitions entity1 新增3条派生KPI(456/457/458, formula/threshold/unit齐全)
- 新增 scripts/kpi_bep_deriver.py: 从 voucher_details 按财务口径聚合
  (5001销售收入/5602管理费 YTD月均, 渠补率政策84.61%) → 计算保本销售额/
  覆盖率/缺口 → upsert kpi_values source_type='derived' 幂等 + 同步yellow/red预警
- cron 06:35 注册(紧随 collector 06:30); 自动选最近完整月(8月未结账自动回退7月)
- kpis.py get_kpi: F_BEP_* 派生KPI按静态阈值文本判红黄绿(66.9→黄), 不走target比率
- 阈值经财务Bot 2026-09-08裁决: COVER >=100绿 50~100黄 <50红; GAP <=0绿 <=50黄 >50红
2026-09-08 13:43:20 +08:00
Hermes CI Fix ebe0962c09 feat(frontend): Phase C 固定企业模式 - VITE_FIXED_ENTITY_ID 支持登录无下拉/隐藏切换器
- 新增 src/utils/entity.ts: isFixedEntity/getFixedEntityId/effectiveEntityId
- Login.vue: 固定企业版隐藏企业下拉显示只读徽标, 登录直接带固定 entity_id
- MainLayout.vue: 切换器加 !isFixedEntity() 守卫, 固定版顶部显示企业 tag, logo 带企业名
- ReportCenter.vue: 页内企业切换下拉加守卫, getEntityId 固定版恒取构建锁定值
- .env.example: VITE_FIXED_ENTITY_ID 示例与说明
- 验证脚本 backend/scripts/verify_phase_c_fixed_entity_e2e.py (22项, 双build E2E全过)
2026-09-08 11:27:01 +08:00
Hermes CI Fix 616f444564 fix(verify): 预算版本UI浏览器验证脚本加 tab 导航等待 (about:blank竞态,复跑必挂修复) 2026-09-07 11:34:56 +08:00
Hermes CI Fix f8018aa471 chore(verify): 预算版本管理UI修复验证脚本(API+浏览器双录,可复跑) 2026-09-07 11:04:35 +08:00
Hermes CI Fix d71c7fef67 fix(data): 自动归集空汇总不写0 + Excel导入示例文件防线 (DAMA审计20260906代码类) 2026-09-06 16:57:03 +08:00
Hermes CI Fix 594bb00a38 fix(cash): vouchers-json batch改为纯内容指纹(不含时间戳) — 快照每10分钟重推必须幂等命中
- batch=zxt-{sha1前10},同内容任意时刻重推 → 同一batch → already_imported跳过
- 原带秒级时间戳导致指纹去重失效(靠行级防重兜底,但会产生噪音import_logs)
- 验收脚本补用例4b(三次重发batch不变+already_imported), 13/13 PASS
2026-09-06 16:47:25 +08:00
Hermes CI Fix 3db805db4e feat(cash): 智享通凭证JSON直传导入端点 vouchers-json (zxt-cma-import-v1)
- 新端点 POST /api/cma/cash/import/vouchers-json (X-BOT-KEY鉴权, 独立router避开require_role)
- 兼容三种body: 裸rows数组 / {rows} / {datasets[0].rows} 整包
- 凭证级借贷平衡(替代批级, 已知单边30694记异常拒收), 结转行summary识别
- 日期从summary前缀解析, 无日期行pending拒收(不冒充文件时间)
- 科目解析: 行内subject → DB zxt_account_dict → body subject_map, 未命中拒收
- 幂等: 内容指纹batch + import_logs去重 + 行级业务键防重复
- entity默认1(陕西酣客), active校验; 不触发现金流联动(凭证未证实权威)
- 验收脚本 scripts/verify_zxt_vouchers_json.py 12/12 PASS (SQLite本地)
2026-09-06 16:45:03 +08:00
Hermes CI Fix f884fa5a18 fix(scripts): E2E验证脚本 actual_costs 无remark列, 存量internal计数改前缀排除 (cma-rd-dimension) 2026-09-05 09:11:27 +08:00
Hermes CI Fix 696f8bc934 feat(cost): 成本模型加研发归集维度 research_flag/project_type (cma-rd-dimension-20260905)
- StandardCost/ActualCost 增加 research_flag(int,idx)/project_type(varchar30,idx)
  project_type: platform_dev平台研发/client_delivery客户交付/internal内部管理
- 生产库两表 ALTER 完成, 存量 29+134 行默认 internal(保守防误归研发)
- API: create/update 支持写入维度, 未传默认 client_delivery(录入默认),
  research_flag 未显式传入按 project_type 联动(platform_dev=1);
  create/update/delete 绑定 entity_id(token优先, 防跨账套)
- API: standard/actual 列表支持 project_type/research_flag 过滤
- 前端 CostDashboard: 表单加归集类型下拉(默认客户交付+研发提示),
  列表加归集类型列(标签), 工具栏按归集类型过滤
- tests: test_cost.py +6 用例(默认值/联动/过滤/更新)
- scripts: verify_cost_research_dimension_e2e.py 生产E2E(标记+清理+回查)
2026-09-05 09:10:35 +08:00
Hermes CI Fix 88ec021a58 chore: 清理误提交的.bak备份文件(git历史可恢复,源文件均在) 2026-09-04 00:09:57 +08:00
Hermes CI Fix 9eab9bb8a1 Revert "fix(knowledge): articles共享层语义对齐评审方案——entity_id=0系统共享(替代NULL) (entity-memory-partition 复核对齐)"
This reverts commit 5e96d15888.
2026-09-03 23:09:58 +08:00
Hermes CI Fix 5e96d15888 fix(knowledge): articles共享层语义对齐评审方案——entity_id=0系统共享(替代NULL) (entity-memory-partition 复核对齐) 2026-09-03 23:09:04 +08:00
Hermes CI Fix 96844f0002 test(knowledge): 生产E2E越权验证脚本入库 verify_knowledge_partition_e2e.py (entity-memory-partition) 2026-09-03 23:01:33 +08:00
Hermes CI Fix a3111a25f6 test(frontend): BUG-001验收脚本 3页面x10连刷无卡加载中 (入库留存,2026-09-03) 2026-09-03 18:41:44 +08:00
Hermes CI Fix 9a823e80a6 test(bot-tier): UI实证脚本 SuggestionCenter 默认未应用+类型过滤 (P0-②)
CDP登录→/ai-suggestions→待批列表默认unapplied且可见Bot建议卡+过滤芯片DOM全命中
临时建议SUG_ID=300已清理(回查0)
2026-09-03 18:19:58 +08:00
Hermes CI Fix be71c2296e test(bot-tier): M4 生产E2E实证脚本 verify_bot_write_tiering_e2e.py (P0-②)
全PASS: Bot建议→unapplied→人apply→目标生效+apply_detail before/after→低危kpi-result source_batch落库→audit L2留痕→清理回查=0
2026-09-03 18:15:47 +08:00
Hermes CI Fix 960cd15268 fix(daily-push): 补提交分企业推送 v2——daily-push-split 任务(11:45 .done)漏commit,阻塞CI deploy hook;.gitignore 忽略 *.bak-* (2026-09-03) 2026-09-03 18:15:05 +08:00
Hermes CI Fix 5e0b09e6b6 feat(cashflow): 按项目任务单复核修正——表名cashflow_statements+DoD兼容路径/菜单C组/角色收敛/术语0+验收脚本入库
- 表名: ORM+生产库 RENAME cash_flow_structure_values → cashflow_statements (DoD SHOW TABLES LIKE 字面验收)
- 兼容端点: /api/cma/cashflow/statements(GET/POST)+analysis 注册 main.py (DoD 验收路径)
- 菜单: 移入 🟡C 监控与评价 组(与杜邦分析/管理报表平级), roles 收敛 ceo/finance (前端 ROLE_ROUTES/MENU_ITEMS/router meta + 后端 require_role 四处同步)
- 术语: docstring 改写, grep 现金流肖像=0
- 验收脚本: backend/scripts/verify_cashflow_structure.py (14项断言全PASS: type6→type1双向/瀑布5步/alias路径/权限/清理)
2026-09-03 01:34:13 +08:00
Hermes CI Fix 2241a89fd1 chore(scripts): 提交分解弹窗E2E验证辅助脚本(cdp_driver + review) 2026-08-31 17:05:21 +08:00
Hermes CI Fix dc89b14479 chore(scripts): 提交工作台隔离验证脚本 verify_dashboard_isolation.py(dashboard-optimize 遗留) 2026-08-31 15:57:54 +08:00
Hermes CI Fix 79bc877f31 chore(erp): 清理ERP_API_KEY硬编码默认值+任务脚本小调整(与本次待办跳转修复无关,单独成commit) 2026-08-31 15:33:07 +08:00
Hermes CI Fix 136fe3811f fix: auto-verify cron残留缺陷修复+第三阶段接入 verify-cron-fix (auto_verify_cron 4项对齐verify.py: entity_id过滤/period过滤/OKR幂等/status completed; action_plan_weekly done->completed; action_plans创建自动生成auto_verify_rule) 2026-08-31 07:44:00 +08:00
Hermes CI Fix 6910d90288 fix: auto-verify验证引擎4项缺陷修复 verify-fix (OKR幂等防重累加/entity_id多租户回填/period期间过滤/status done->completed) 2026-08-30 19:16:19 +08:00
Hermes CI Fix ad68471b29 feat: 路线图R1决策建议一键落地+R2机会推送+R5预算闭环
R1(P0): AI建议一键应用到KPI/预算/行动方案
- 新表 ai_suggestions + AISuggestion 模型(init_db自动建)
- /api/cma/ai/suggestions CRUD + /{id}/apply(复用kpis/budget/action_plans) + dismiss
- 应用写 OperationLog(action=ai_suggestion_apply, detail含suggestion_id/before/after)
- 规则驱动建议生成 generate_rule_suggestions(低执行率/高执行率/预算超支/pending预警)
- 幂等: 同entity+type+target_id+title+unapplied不重复建; applied后拒绝重复应用
- 前端: Dashboard AI面板建议卡(应用到/忽略) + 建议中心页 /ai-suggestions

R2(P1): 数据找人扩大-机会类推送
- scripts/opportunity_detector.py: KPI向好(执行率>110%)/预算余量(<70%且actual>0)/预测上行
- scripts/daily_push.py: 异常+机会 每日9:15推企微(8800/send, --dry-run调试)
- crontab: 15 9 * * * (alert_generator 9:00之后)

R5(P0): 预算闭环加固
- auto-decompose批量幂等: 只取年度行(period=YYYY-00)+同KPI多版本取一行
- scripts/closed_loop_check.py: 预算执行率异常→检查现金流/行动同步→缺失提示+报告
- scripts/verify_decompose_idempotent.py: 幂等验证脚本

测试: test_ai_suggestions(10例)+test_roadmap_r2r5(14例); 修test_budget幂等契约适配年度行
全量: 673 passed
2026-08-30 12:05:36 +08:00
Hermes CI Fix 94aeb14e95 feat: 预算系统6项技术改进(告警归因/实际值自动归集/真零基/派生规则/告警路径统一/现金流分类)
P1-③ 告警归因: budget_deviation_alerts+alert_type/attribution/scenario_id, 归因引擎alert_attribution.py(子KPI/科目/量价差/趋势), deviation-check统一写归因+场景, GET /deviation-alerts/{id}/attribution详情(旧告警现场组装)
P1-④ 实际值自动归集: kpi_value_sources/kpi_value_collect_logs表+CRUD+试跑+覆盖率, 采集器kpi_value_collector.py(voucher_details/进销存/cash_plans按entity+period汇总, 幂等upsert不覆盖人工), crontab每日06:30
P2-① 真零基: budget_zero_based_items逐项论证表+generate, method-comparison有论证项逐项求和is_demo=false否则fallback
P2-② 派生规则: budget_derivation_rules配置表, apply-method优先读规则rule_source=configured
P2-⑤ 告警双路径合并: deviation_engine.build_deviation_alert统一函数, 方向列表配置化kpi_alert_higher_better+alert-direction接口
P2-⑥ 现金流分类: cash_plan_classify_rules规则表+cash_plan_unclassified待分类队列, sync-cash-plans未命中进队列不静默跳过
新增: GET /kpis/{kpi_id}/values + 前端kpiApi.values(归集标签页数据源), scenario_suggestions幂等seed(init_db)
测试: test_budget_tech_improve.py 15用例, 预算相关96 passed, 全量646 passed
2026-08-28 18:03:47 +08:00
Hermes CI Fix 3bc68fa1c6 feat: 网银流水导入模板+现金流联动(财务数据通道P1) 2026-08-28 09:59:07 +08:00
Hermes CI Fix 1a6ea8afae chore: CI流程加固+Schema检查门禁
- deploy.sh: 提交纪律检查(本地未提交修改→中止) + 冒烟测试(健康/登录/KPI/BOT/Schema)
- .woodpecker: 加前端typecheck+后端pytest测试步骤, backend-deploy加提交纪律检查
- 新增schema_check.py: ORM与数据库表结构一致性检查
- 修复budget_plans表缺3列(source_kpi_id/source_type/calc_logic)
- 附带入库: budget测试+文档
2026-08-28 07:18:54 +08:00
Hermes CI Fix fdc42d443d feat: 因果链三层验证机制(P2) — 数据验证+人工确认+状态机
- kpi_causality 加列: source_type/verify_status/verified_at/verified_by/entity_id(回填)
- 核心服务: app/services/causality_verification.py (Pearson+滞后对齐+状态机)
- 数据验证脚本: scripts/correlation-check.py (月度cron, 输出JSON报告)
- API: create/update支持source_type, GET /verify-status, PUT /{id}/verify(人工确认)
- 全部端点按entity_id账套隔离, kpi/{id}/network/simulate补跨企业校验
- 前端: KPIDetail因果链页显示验证状态徽标(数据证实/存疑/待检)
- 测试: test_causality_verification.py 37用例 + 原因果链测试全过(59个)
- 50条因果链首轮验证: 1数据证实(#37渠补率到净利润lag1 r=-0.89), 4存疑, 45待检(数据不足)
2026-08-27 15:51:19 +08:00
Hermes CI Fix 61936302b2 feat(KR): KR完整修复 — krs表打通+方向符号operator+权重自由输入
- 后端okr.py: KR读取从ActionPlan改为krs表, 新增KR CRUD API(POST/PUT/DELETE /okr/{objective_id}/krs) + 批量sync
- operator方向符号: krs表加operator/tolerance/weight/sort_order/monthly_milestones列
- progress方向感知计算(>=/>: current/target, <=/<: target/current, =: 容差), 达成→status=achieved
- 关联KPI自动继承方向(threshold_green解析: F_COST_RATIO<=18等)
- maps.py: 保存地图时自动同步objectives+krs表, JSON→krs数据迁移脚本
- 前端: 权重下拉改自由数字输入(可小数33.33) + 方向选择器(≥/≤/>/</=) + 自动平分按钮 + KPI方向继承提示
- pytest: 10个新测试(krs CRUD/方向感知/权重校验/多租户隔离) + 更新旧KR测试
- 迁移: 现有strategic_maps JSON 12条KR已写入krs表
2026-08-27 10:59:56 +08:00
Hermes CI Fix 9de6e522a4 feat: 波士顿产品矩阵 — 四象限分析(明星/现金牛/问题/瘦狗)
- 数据层: product_sales表+导入脚本(93条, 酣客1-8月商品销售排行榜)
- 后端: GET /api/cma/products/matrix?entity_id&months
  横轴=销售趋势(线性回归), 纵轴=加权毛利率, 气泡=销售额
- 前端: ProductMatrix.vue ECharts散点图+象限卡片+明细表, 支持酣客/博海切换
- 验证: API四象限分类正确, 数据联动, 前端路由200, 全部通过
2026-08-25 00:25:11 +08:00
Hermes CI Fix bd9c70ea05 本体三支柱: 科目↔KPI↔OKR三层互联 + 追溯链API + OKR详情页签
- 新表 kpi_subject_map(89映射/24KPI) / objective_kpi(3O×5KPI) / krs(3O×3KR)
- GET /api/cma/ontology/trace?objective_id=N O→KPI→科目逐层追溯
- GET /api/cma/ontology/objectives 三层链路概览
- OkrDetail.vue 新增本体追溯链页签(KR目标/当前值 + KPI→科目标签流)
- 含并发已上线未提交的KPI多粒度列(target_monthly/quarterly/yearly)
- 回归: pytest 409 passed
2026-08-19 22:58:10 +08:00
Hermes CI Fix 5a196dc105 fix: 数据治理P0 规则4前端level过滤+数据清洗 2026-08-15 21:26:27 +08:00