fix(rectification): start new case from homepage
Staging Backend Quality Gate / validate (pull_request) Successful in 24m42s
Staging Backend Quality Gate / publish (pull_request) Has been skipped

This commit is contained in:
Jesse_Chen
2026-08-12 21:20:51 +08:00
parent 90199b4d9b
commit 4deb5c2378
12 changed files with 273 additions and 45 deletions
+16
View File
@@ -3020,3 +3020,19 @@
- 防复发:持久化行与对话消息不是一对一时,恢复投影必须显式展开全部逻辑消息,不得用 `coalesce` 静默舍弃其中一侧。
- 相关记录:BUG-173、BUG-174、BUG-175
- 修复版本:本次提交(staging 精确 SHA 以发布记录为准)
## BUG-177 | 首页生时校正被未完成 Session 强制劫持,无法新建独立校正
- 状态:resolvedstaging 发布与真实环境验收以本次发布记录为准)
- 首次发现:2026-08-12
- 最近更新:2026-08-12
- 影响面:首页生时校正卡片、`POST /api/rectification/cases/open`、V9 Case 并发约束
- 用户现象:账户存在任意未完成的生时校正时,从首页点击“生时校正”会直接回到旧 Session;用户无法保留旧记录并另开一段校正。
- 触发条件:存在 `draft``collecting_evidence``candidate_ready``candidate_accepted``needs_rebaseline``paused` Case 后点击首页生时校正卡片。
- 根因:V9 初始设计把首页 `homepage` intent 定义为 resume-or-create,并用 `agentic_rectification_cases_one_resumable_per_user` 部分唯一索引和 `active_case_conflict` 强制每用户最多一个 resumable Case;首页 UI 又据 entry summary 显示“继续上次校正”。该安全约束错误扩大成产品限制。
- 修复:首页入口始终作为显式创建动作;新增向前迁移 `20260813040000_allow_parallel_rectification_cases.sql`,删除每用户单 resumable 唯一索引并重定义 open RPC,使 `homepage`/`new` 创建独立 Case + Session`session` 仍按精确 Session 恢复;requestId 幂等与同用户 advisory lock 保留。首页有未完成记录时明确提示可从左侧历史继续,但主 CTA 仍是新建。
- 验证:入口、Case service、迁移静态合同等聚焦测试共 119 项,113 通过、0 失败;6 项真实 PostgreSQL 测试因本机 Docker 不可用跳过(测试已覆盖不同 requestId 新建多个 resumable Case、同 requestId 幂等和精确 Session 恢复)。目标 ESLint 与 `git diff --check` 通过;全量 TypeScript 检查仅命中仓库既有的 `dayjs` 缺失及无关测试类型错误。
- 防复发:首页“新建”和历史“继续”必须使用不同 intent;不得用“存在 resumable Case”改变首页主 CTA 或阻止新 Case;同一 requestId 重试只能返回同一 Case。
- 相关记录:BUG-163
- 复发自:BUG-163
- 修复版本:本次提交(staging 精确 SHA 以发布记录为准)