baodan/docs/schemas/plan-data-snapshot.schema.json
wsb1224 7a3e2870dc 主要成果:
海报确认、文案生成、海报生成增加服务端失败关闭门禁,绑定文件哈希、解析快照哈希和确认数据哈希,并返回 422 业务错误。[validators.py (line 65)](D:/work/code/python/coding/baodanagent/api/insurance/plan_data/validators.py:65)
缺失金额不再转换为 0;删除错误字段兜底和“年缴×年期=合同总保费”事实推导;里程碑冲突会阻断确认。[normalizer.py (line 14)](D:/work/code/python/coding/baodanagent/api/insurance/ppt/normalizer.py:14)
PPT 渲染器支持可空金额和实际币种,缺失值显示“待确认”,避免 float(None)、空值除法等异常。
模板必须覆盖全部输入保司和产品;自动选择排序确定化,同优先级歧义时阻断。[template_selection.py (line 4)](D:/work/code/python/coding/baodanagent/api/insurance/ppt/template_selection.py:4)
场景判定写入 scenarioOverrideTrace,记录请求、模板、服务端及 Worker 最终判定。[routes.py (line 555)](D:/work/code/python/coding/baodanagent/api/insurance/ppt/routes.py:555)
前端增加哈希提交、人工调整原因、模板歧义提示及真实能力说明。
冻结三份核心 Schema,并建立 Goldens manifest、说明和评估脚本。
验证结果:
后端目标回归:111 passed, 1 skipped
PPT 运行时回归:81 passed
前端生产构建和 vue-tsc:通过
Python compileall:通过
三份 Schema JSON:解析通过
git diff --check:通过,仅有换行符提示
2026-08-02 12:58:41 +08:00

76 lines
2.7 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://baodan.example/schemas/plan-data-snapshot-v1.json",
"title": "Insurance PlanData Snapshot v1",
"type": "object",
"additionalProperties": false,
"required": ["schemaVersion", "snapshotVersion", "status", "document", "planData", "validation", "snapshotHash"],
"properties": {
"schemaVersion": {"const": "plan-data-v1"},
"snapshotVersion": {"type": "integer", "minimum": 1},
"previousSnapshotId": {"type": ["integer", "null"], "minimum": 1},
"status": {"enum": ["draft", "review_required", "confirmed", "superseded", "invalid"]},
"document": {
"type": "object",
"additionalProperties": false,
"required": ["documentId", "sha256"],
"properties": {
"documentId": {"type": "integer", "minimum": 1},
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
}
},
"planData": {
"type": "object",
"additionalProperties": false,
"required": ["identity", "policy", "benefitScenarios", "assumptions"],
"properties": {
"identity": {"type": "object", "additionalProperties": {"$ref": "field-value.schema.json"}},
"policy": {"type": "object", "additionalProperties": {"$ref": "field-value.schema.json"}},
"benefitScenarios": {
"type": "array",
"items": {
"type": "object",
"required": ["scenarioType", "rows"],
"properties": {
"scenarioType": {"type": "string"},
"rows": {"type": "array", "items": {"type": "object"}}
}
}
},
"withdrawals": {"type": "array", "items": {"type": "object"}},
"riders": {"type": "array", "items": {"type": "object"}},
"assumptions": {"type": "object"}
}
},
"validation": {
"type": "object",
"required": ["blockingCount", "warningCount", "conflictCount"],
"properties": {
"blockingCount": {"type": "integer", "minimum": 0},
"warningCount": {"type": "integer", "minimum": 0},
"conflictCount": {"type": "integer", "minimum": 0},
"issues": {"type": "array", "items": {"type": "object"}}
}
},
"snapshotHash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
"confirmedBy": {"type": ["string", "null"]},
"confirmedAt": {"type": ["string", "null"], "format": "date-time"}
},
"allOf": [
{
"if": {"properties": {"status": {"const": "confirmed"}}},
"then": {
"required": ["confirmedBy", "confirmedAt"],
"properties": {
"validation": {
"properties": {
"blockingCount": {"const": 0},
"conflictCount": {"const": 0}
}
}
}
}
}
]
}