feat: 重构 AuditView 支持规则/技能分类,新增 Agent 开发文档

This commit is contained in:
caoxiaozhu
2026-05-11 01:53:30 +00:00
parent 0c6ac50b31
commit f738b6cdd4
33 changed files with 5853 additions and 204 deletions

View File

@@ -0,0 +1,126 @@
# 财务单据标准模型
## 1. 为什么需要标准模型
OCR、MCP、用户填写、业务数据库可能都描述同一张发票但字段名和格式不同。
如果没有标准模型:
- 规则无法复用。
- Agent 难以解释。
- Hermes 难以批量统计。
- MCP 返回结果难以合并。
## 2. 标准对象
第一版建议定义这些对象:
```text
Invoice
Receipt
ReimbursementRequest
PaymentRequest
BankTransaction
Contract
Customer
Vendor
Employee
CostCenter
```
## 3. Invoice 标准模型
```json
{
"invoice_id": "",
"invoice_code": "",
"invoice_number": "",
"invoice_type": "",
"seller_name": "",
"seller_tax_no": "",
"buyer_name": "",
"buyer_tax_no": "",
"issue_date": "",
"total_amount": 0,
"tax_amount": 0,
"currency": "CNY",
"verify_status": "",
"ocr_confidence": 0,
"source_document_id": ""
}
```
## 4. ReimbursementRequest 标准模型
```json
{
"request_id": "",
"request_no": "",
"employee_id": "",
"department_id": "",
"expense_type": "",
"amount": 0,
"currency": "CNY",
"status": "",
"submitted_at": "",
"approval_stage": "",
"invoices": [],
"attachments": [],
"risk_flags": []
}
```
## 5. BankTransaction 标准模型
```json
{
"transaction_id": "",
"bank_account": "",
"transaction_date": "",
"amount": 0,
"currency": "CNY",
"counterparty_name": "",
"summary": "",
"matched_object_type": "",
"matched_object_id": "",
"match_status": ""
}
```
## 6. 字段来源优先级
建议优先级:
```text
人工确认字段
> MCP 验真字段
> 业务系统字段
> OCR 字段
> LLM 推断字段
```
LLM 推断字段必须标记来源和置信度。
## 7. 与语义本体关系
语义本体识别的是用户意图和对象。
标准模型承载对象的结构化字段。
```text
ontology.entities[].type = invoice
-> 映射到 Invoice 标准模型
```
## 8. 开发阶段建议
```text
Step 1: 定义 Invoice 标准模型
Step 2: 定义 ReimbursementRequest 标准模型
Step 3: OCR 输出映射到 Invoice
Step 4: MCP 输出映射到 Invoice
Step 5: 规则中心基于标准模型执行
Step 6: 扩展 AR/AP 标准模型
Step 7: 建立字段血缘和置信度
```