docs(tasks): 校正标题修补迁移的进度记录与 Bug 历史回填
- PROGRESS-rectification-title-repair-migration-20260916.md:前提复核、 逐字一致的复核命令、幂等两层的说明、基线比对与环境缺口。 - BUG_HISTORY:BUG-699 / BUG-704 的「修复」补记改由迁移承担,「验证」 的欠账改成待产品在 staging 应用后从 NOTICE 回填。不新增编号。 - BLOCKED.md:BLK-002 无 Docker / 无本地 PostgreSQL,test:db 未跑、 db:migrate:check 缺 SCHEMA_DATABASE_URL,附已实跑的替代证据。 - deploy/README.md:一次性数据修补走同一个 Migrate Staging Database 按钮,行数看日志里的 notice 行。 - docs/tasks/README.md:该单改记待验收。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JUei7K13cYxLHE3Axe4A45
This commit is contained in:
co-authored by
Claude Opus 5
parent
d6c359b205
commit
10afdcddeb
+4
-4
@@ -10863,8 +10863,8 @@
|
||||
- 用户现象:点开一条以前的生时校正,标题变成今天的日期,并出现在列表最上面。刷新后位置会回去,标题不会。
|
||||
- 触发条件:点侧栏里已有的校正会话,或从首页校正卡打开一条已存在的可续校正。
|
||||
- 根因:复发自 BUG-553。`openRectificationCase` 构造 `merged` 时 `pinned` / `archivedAt` 从 `existing` 继承,`title` 和 `updatedAt` 却无条件用墙钟重算,再 `persistSession` 把标题写回服务端。`persistSession` 的 update 不写 `updated_at`(BUG-553 的修复仍在),所以排序只是客户端暂时错位。BUG-553 的防复发当时只是一句话,测试只锁了元数据 PATCH 和改名/收藏/归档/换模型/换资料,没有覆盖校正 open。
|
||||
- 修复:已有会话的 `title` / `updatedAt` 继承 `existing`,只有新建才 `resolveSessionTitle` + `timestamp()`。错日期标题按 `created_at` 的 Asia/Shanghai 月日修回;对不上正则的手改标题不动。
|
||||
- 验证:`frontend/tests/session-open-preserves-identity.test.ts`、`rectification-session-title-repair.test.ts`。浏览器级验收见 `docs/testing/rectification-open-identity-20260915.md`。staging 标题修回行数见本单 PROGRESS。
|
||||
- 修复:已有会话的 `title` / `updatedAt` 继承 `existing`,只有新建才 `resolveSessionTitle` + `timestamp()`。错日期标题按 `created_at` 的 Asia/Shanghai 月日修回;对不上正则的手改标题不动。存量错标题的修补已改为一次性迁移 `20260916020000_rectification_session_title_repair.sql`,随 `Migrate Staging Database` 按钮应用(原先只写在 `frontend/scripts/repair-rectification-session-titles.mjs` 里,要 `SCHEMA_DATABASE_URL` 才能跑,产品没有执行通道,所以一次都没跑过);该脚本降级为只读核对工具。
|
||||
- 验证:`frontend/tests/session-open-preserves-identity.test.ts`、`rectification-session-title-repair.test.ts`、`rectification-session-title-repair-migration.test.ts`(比对迁移与核对脚本的 SQL 是否仍逐字一致)。浏览器级验收见 `docs/testing/rectification-open-identity-20260915.md`。**欠账**:staging 标题修回行数待产品点一次 `Migrate Staging Database` 后,从运行日志的 `notice ... repaired_titles=` 回填。无 Docker 环境跑不了 `npm run test:db`,迁移未实跑过。
|
||||
- 防复发:构造可能作用于已有会话的 `ChatSession` 时,不得无条件写 `updatedAt: timestamp()`。`resolveSessionTitle` 的 `at` 默认墙钟,只能用于新建。
|
||||
- 相关记录:BUG-553、BUG-704、BUG-705
|
||||
- 复发自:BUG-553
|
||||
@@ -10943,8 +10943,8 @@
|
||||
- 用户现象:一条校正连着答几小时,侧栏位置仍停在创建那天。叠加上被改成今天的标题后,列表变成「名字是今天、排序是旧日期」。
|
||||
- 触发条件:在生时校正里写 turn、点选、采用或停止。打开、刷新、改名、收藏不触发。
|
||||
- 根因:复发自 BUG-553 的另一半。全仓只有咨询 RPC `append_consultation_question` 写 `chat_sessions.updated_at`。校正 turn 走 `append_agentic_rectification_turn` 等,只推 `agentic_rectification_cases.last_activity_at`,不碰会话表。`persistSession` 的 update 按 BUG-553 故意不写 `updated_at`。
|
||||
- 修复:`last_activity_at` 推进时触发器同步把对应校正会话的 `updated_at` 推到同一时刻,且不得回拨。历史冻结行按最后一条 turn / `last_activity_at` 回填。客户端 `persistSession` 仍不写 `updated_at`。
|
||||
- 验证:`frontend/tests/rectification-v9-migration.test.ts` 的 touch-session 迁移合同。浏览器级见 `docs/testing/rectification-open-identity-20260915.md`。staging 回填行数见本单 PROGRESS。
|
||||
- 修复:`last_activity_at` 推进时触发器同步把对应校正会话的 `updated_at` 推到同一时刻,且不得回拨。历史冻结行按最后一条 turn / `last_activity_at` 回填,该回填同样已改为一次性迁移 `20260916020000_rectification_session_title_repair.sql`(与 BUG-699 的标题修补同一条),随 `Migrate Staging Database` 应用;`updated_at <` 的单调守卫保证只前进不回拨,重复应用影响 0 行。客户端 `persistSession` 仍不写 `updated_at`。
|
||||
- 验证:`frontend/tests/rectification-v9-migration.test.ts` 的 touch-session 迁移合同、`rectification-session-title-repair-migration.test.ts` 的回填 SQL 合同。浏览器级见 `docs/testing/rectification-open-identity-20260915.md`。**欠账**:staging 回填行数待产品点一次 `Migrate Staging Database` 后,从运行日志的 `notice ... refreshed_activity=` 回填。无 Docker 环境跑不了 `npm run test:db`,迁移未实跑过。
|
||||
- 防复发:校正对话活动必须推进 `chat_sessions.updated_at`。元数据 PATCH、打开、刷新不得推进。不得为了修这个让 `persistSession` 重新写 `updated_at`。
|
||||
- 相关记录:BUG-553、BUG-699、BUG-705
|
||||
- 复发自:BUG-553
|
||||
|
||||
Reference in New Issue
Block a user