feat: 扩展风险规则体系、审批动态路由与预算中心列表化改造

- 新增 25+ 条风险规则(预算/报销/申请/通用类),完善风险规则模拟与反馈发布机制
- 引入费用审批动态路由、平台风险分级、预审与风险阶段管理
- 预算中心列表化改造,优化票据夹仪表盘与数字员工工作看板
- 新增 Hermes 风险线索收集器、Agent 链路追踪中心
- 扩展数字员工能力库(18 个领域 Skill)与交通费用自动预估
- 完善报销申请快速预览、权限控制与前端测试覆盖
This commit is contained in:
caoxiaozhu
2026-06-01 17:07:14 +08:00
parent 7989f3a159
commit 92444e7eae
285 changed files with 25075 additions and 2986 deletions

View File

@@ -17,7 +17,7 @@ class AgentAssetJsonRuleMixin:
if rule_library not in RULE_LIBRARY_NAMES:
raise ValueError("规则库目录不合法。")
rule_document = config_json.get("rule_document")
rule_document = self._resolve_working_json_risk_rule_document(asset, config_json)
if not isinstance(rule_document, dict):
raise ValueError("规则资产缺少 rule_document 配置。")
@@ -26,6 +26,27 @@ class AgentAssetJsonRuleMixin:
raise ValueError("规则资产缺少 JSON 文件名。")
return rule_library, file_name
@staticmethod
def _resolve_working_json_risk_rule_document(
asset: AgentAsset,
config_json: dict,
) -> dict | None:
revision = config_json.get("revision_draft")
if isinstance(revision, dict):
revision_version = str(revision.get("version") or "").strip()
working_version = str(asset.working_version or "").strip()
published_version = str(asset.published_version or "").strip()
revision_document = revision.get("rule_document")
if (
revision_version
and revision_version == working_version
and revision_version != published_version
and isinstance(revision_document, dict)
and str(revision_document.get("file_name") or "").strip()
):
return revision_document
return config_json.get("rule_document")
def read_rule_json(self, asset_id: str) -> AgentAssetRuleJsonRead:
asset = self.repository.get(asset_id)
if asset is None: