Files
junhong_cmp_fiber/.scratch/tech-global-audit/issues/21-outbox-recovery-audit-adapter.md

21 lines
1.7 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.
# 21 — 接入 Outbox 人工恢复正式审计 Adapter
**What to build:** 在 Outbox 人工恢复的 Application 组合根注入正式 Audit Writer Adapter使每次受控恢复完整记录操作者、原因、批次和状态变化并与恢复事实同事务失败关闭。由真实全局审计替换公共基础的未装配占位不创建临时审计表或旁路 goroutine。
**Blocked by:**
- 01 — 交付不可变 Audit Event 写入闭环
- `.scratch/tech-public-foundation/issues/04-outbox-observability-and-recovery.md` — 04 — 提供 Outbox 监控和受控恢复能力
**Status:** ready-for-agent
**架构通道:** 主通道为 Application + Port/Adapter辅助通道为 Infrastructure。
**完整业务边界:** 本票仅收口 Outbox 人工恢复既有用例的正式审计装配、事务一致性和测试。明确不改变恢复资格与租约规则、不建设 Outbox 前端页面、不迁移其他业务审计。
- [ ] 注册 Outbox 人工恢复的稳定动作编码、中文名称、风险等级及允许资源类型,并写入全系统审计覆盖基线。
- [ ] Outbox 状态变更与 Audit Event 使用同一 GORM 事务;记录操作者、中文原因、恢复批次、事件标识及恢复前后状态,审计失败时恢复回滚。
- [ ] 组合根显式注入正式 Audit Writer Adapter未装配时失败关闭禁止回退到空实现、旧审计表或裸 goroutine。
- [ ] PostgreSQL 集成测试覆盖成功同事务、审计失败整体回滚、重复恢复裁决、有效租约不可恢复和未装配失败关闭。
- [ ] 发布检查能证明生产组合根已装配正式 Adapter并由 19 号一次性切换门禁纳入停机演练。