Files
X-Financial/document/development/ontology-field-governance/FIELD_AUDIT.md
caoxiaozhu 34457f9c3e feat: 本体字段治理与风险规则模板执行器重构
- 新增本体字段注册表与字段治理审计脚本
- 重构风险规则模板执行器、DSL 验证与清单分类器
- 完善票据夹服务与差旅请求详情页交互
- 优化趋势图表与总览页数据展示
- 增强报销平台风险分级与模拟公司筛选
- 补充本体字段、风险规则生成与票据夹服务测试覆盖
2026-06-03 15:46:56 +08:00

41 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 本体字段纠察记录
## 纠察口径
所有会参与意图识别、申请/报销草稿、费用明细、风险规则、审批或预算判断的字段,必须先进入本体字段注册表。
字段分为三类:
- 本体业务字段:可被业务逻辑、规则、页面表单直接消费。
- 输入兼容别名:只允许在语义入口归一,不允许在业务判断中继续直接读取。
- 上下文元数据:只表达会话、上传、编辑态、权限和执行链路,不作为业务事实。
## 已注册的业务字段
- 费用事实:`expense_type``time_range``location``reason``amount``transport_mode``attachments`
- 对象事实:`customer_name``merchant_name``participants`
- 员工事实:`employee_name``employee_no``department_name``employee_position``employee_grade``manager_name`
- 预算事实:`budget_period``budget_subject``budget_amount``cost_center``warning_threshold``control_action`
- 申请关联事实:`application_claim_id``application_claim_no``application_days``application_date``application_policy_estimate`
## 已登记为元数据的字段
- 会话与流程:`conversation_id``conversation_history``conversation_scenario``conversation_intent``session_type``entry_source`
- 编辑与动作:`review_action``draft_claim_id``application_edit_mode``application_edit_claim_id`
- 上传与 OCR`attachment_count``attachment_names``ocr_documents``ocr_summary``review_document_form_values`
- 客户端运行态:`client_now_iso``client_timezone_offset_minutes`
- 权限与调试:`role_codes``is_admin``simulate_tool_failure``simulate_orchestrator_exception`
## 当前审计结论
- 未注册字段:已清零。
- 历史别名直接读取:主要集中在员工上下文顶层字段,例如 `name``grade``department``position`
- 第一轮已把申请/报销关键链路的表单字段统一到 `expense_type``time_range``location``reason``amount``transport_mode`
## 后续清理策略
1. 新增业务字段前,先更新 `ontology_field_registry.py`
2. 旧字段只作为输入别名保留,入口归一到 canonical 字段。
3. 业务模块逐步停止直接读取旧别名。
4. 使用 `server/scripts/audit_ontology_context_fields.py --strict` 作为收口质量闸。