Move BUG-705 bootstrap selection + session lookup into resolveLookupBootstrap so Home only awaits once. The 1951 cap in chart-view-route.test.ts is unchanged.
59 lines
4.1 KiB
Markdown
59 lines
4.1 KiB
Markdown
# PROGRESS · 校正会话列表身份(BUG-699 / 704 / 705,2026-09-15)
|
||
|
||
- 执行分支:`codex/rectification-p0-20260915`(与交付卡单同一分支,两单文件几乎不重叠,一次推 staging)
|
||
- 工作树:`.worktrees/rectification-p0-20260915`
|
||
- 基线:rebase 后 `origin/staging` @ `d3a2c48b`
|
||
|
||
## 做了什么
|
||
|
||
任务 1–2、4(BUG-699)此前已由 `2d7698ea` 合入 staging。本轮补任务 5 / 6 与任务 3 的 `updated_at` 回填。
|
||
|
||
任务 1.3 `messages: []`:**无害,保持原样。** `persistSession` 的 update 不写 `messages`,也不写 `updated_at`。
|
||
|
||
任务 5(BUG-704):新增迁移 `20260915010000_rectification_touch_chat_session.sql`。`agentic_rectification_cases.last_activity_at` 推进时,触发器把对应 `chat_sessions.updated_at` 推到同一时刻,且不得回拨。打开 / GET / 元数据 PATCH 不碰 `last_activity_at`,因此不 bump。`persistSession` 仍不写 `updated_at`。
|
||
|
||
任务 5.3 / 任务 3:运维脚本 `frontend/scripts/repair-rectification-session-titles.mjs` 同时统计并(`--apply`)修:
|
||
|
||
1. 日期标题与 `created_at` 的 Asia/Shanghai 月日不一致的校正会话(原任务 3)。
|
||
2. `updated_at` 早于最后一条 turn / `last_activity_at` 的校正会话。
|
||
|
||
默认只读。本机没有 `SCHEMA_DATABASE_URL`,**staging 未跑**,损坏面数字待产品在 staging 执行后回填。
|
||
|
||
任务 6(BUG-705):`resolveBootstrapSessionSelection` 对未出现在已加载页的合法 UUID 返回 `lookup`,不再直接 `missing`。`resolveLookupBootstrap` 调 `GET /api/sessions/{id}`:200 并进列表并选中;404 才 `SESSION_MISSING_NOTICE` 并清 `?c=`;5xx 保留 URL,提示「这条对话暂时读不到,请稍后重试。」popstate 走同一条 lookup。非法 `?c=` 仍立即 missing。
|
||
|
||
任务 6.3 侧栏高亮:lookup 命中后 `mergeHydratedSession` 把该会话并进本地列表,`visibleSessions` 再 `sortSessions`,当前项可以高亮。不依赖无限滚动把它翻出来。无限滚动本身未改。
|
||
|
||
## 测试数字
|
||
|
||
定向见本提交的前端测试。全量 `npm test` 数字写在同分支的交付卡 PROGRESS。
|
||
|
||
## 生产 `7b620c7a`
|
||
|
||
该 SHA 没有 `use-rectification-surface.ts`。当时 `page.tsx` 的 `merged` 用固定标题「生时校正」,没有墙钟日期,也没有 `persistSession(merged)`。生产不受「标题写成今天并写库」影响。任务 3 **不必在生产跑**。BUG-704 / 705 的代码路径当时也不同;生产是否要跑 `updated_at` 回填由产品定,默认不必。
|
||
|
||
## 编号冲突
|
||
|
||
任务书预占 BUG-700 / 701。七政单随后写入了 BUG-700~703,星历页占了 BUG-707。本轮落地号:**BUG-704**(校正 `updated_at`)、**BUG-705**(`?c=` lookup)。交付卡单用 706 / 708 / 709。
|
||
|
||
## 偏离
|
||
|
||
- 任务 3 / 5.3 staging 核对因本机没有库连接而未跑。产品在 staging 跑:`node frontend/scripts/repair-rectification-session-titles.mjs` 看行数,确认后加 `--apply`。
|
||
- 浏览器项见 `docs/testing/rectification-open-identity-20260915.md`,不得写成通过。
|
||
|
||
## 验收补正(2026-09-15,`f51e494c`)
|
||
|
||
Claude 在 Linux 上验收 `f51e494c`:六条缺陷全部实现且实现方式正确。
|
||
|
||
| 项 | Linux 实测 |
|
||
| --- | --- |
|
||
| `tsc --noEmit` | 0 错 |
|
||
| `npm run lint` | 0 error / 119 warning(全部既有) |
|
||
| 本轮 8 个合同套件 | 130 项全绿 |
|
||
| `npm run build` | exit 0;`/` 仍是 `○ Static` |
|
||
| 首屏 JS gzip-9 | 584,413 B(对上一次 583,660 B,**+0.13%**) |
|
||
| 全量测试 | 父提交 `d3a2c48b` fail **32** → `f51e494c` fail **33** |
|
||
|
||
多出来的一条是 `frontend/tests/chart-view-route.test.ts` 的 `page.tsx does not grow to host the chart page`:`page.tsx` 从 1951 涨到 1964 行。增长来自 BUG-705 接线,逻辑已在 lib 里,超的只是 `page.tsx` 里那十来行。
|
||
|
||
执行方本机把全量 TAP 记成 Windows 缺口,没有对照 Linux 的 32→33,所以当时没看见这条红。修复见 `TASK-rectification-p0-fix-20260915.md` / `PROGRESS-rectification-p0-fix-20260915.md`:接线搬进 `resolveLookupBootstrap`,`page.tsx` 回到 1951,上限未放宽。
|