Files
X-Financial/document/development/2026-07-16/dev-logs/bugs/reimbursement-approval-task-access-error-mapping.md
caoxiaozhu 787bc3a481 feat(platform): close AI expense value loop
Add tenant-safe value, telemetry, connector, commercial, and production-readiness foundations.
2026-07-17 14:14:08 +08:00

13 lines
2.2 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.
# 报销审批非参与者错误映射与陈旧测试契约
日期2026-07-16
文档路径document/development/2026-07-16/dev-logs/bugs/reimbursement-approval-task-access-error-mapping.md
## 修复记录
- 21:38记录 bug 修复报销审批非参与者错误映射与陈旧测试契约。bug-log:242d68c3
- Git 提交检查:已手工执行 `git fetch --all --prune`upstream `origin/main` 无本地尚未包含的新提交;当前分支 ahead 17 且工作区已有其他智能体和用户的未提交改动因此未自动合并或变基。ahead 包括审批任务与风险链 `242d68c3``28b834ed``4940ebc4`AI/费用学习与预审链 `ee88a36b``6bdf65bc``ae3f02c3``54754b55``211f85d9``5b246307``a662cfe6`Expense Case/时间线与事务链 `5ed34c2b``1347366b``22669a90``a616b30c``661990b2`,以及迁移安全 `11275e4b`、认证会话 `653eda05`
- 修改:`reimbursement_approval_actions.py` 将审批任务访问策略抛出的 `LookupError` 显式映射为 404避免非任务参与者通过报销审批/退回接口触发 500`test_expense_claim_service.py``test_reimbursement_endpoints.py` 同步到正式审批任务的资源隐藏与任务冲突契约,并增加申请人审批、退回均无状态和动作账本副作用的 HTTP 回归。
- 操作:完整读取 `agent-change-log` Skill沿 `ExpenseClaimActionProtocolMixin → ApprovalTaskLifecycleService → ApprovalTaskAccessPolicy` 诊断调用链;保留“非参与者不可读取任务”的权限语义,没有放宽审批人、管理员、申请人或租户边界;随后运行日志 helper 创建本记录并补齐实际证据。
- 验证:在 `local-x-financial-linux` 容器中,原失败用例与新增 HTTP 用例 2 项通过;审批任务、审批路由和报销接口组合 65 项通过;费用服务审批、退回和付款相关筛选回归 30 项通过;相关 Python 文件 Ruff F/I 检查通过。
- 影响:申请人或其他非任务参与者调用审批动作时稳定返回 404不再出现服务端 500也不会创建动作账本、审批事件或修改 Claim可见但不可操作的任务仍按既有策略返回 403状态/版本冲突继续返回 409。