Files
Jyotisha/docs/tasks/PROGRESS-session-list-rebuild-20260921.md
T
jesse-ux e71e4f9200
Independent Staging Quality Gate / validate (push) Failing after 16m52s
Independent Staging Quality Gate / publish (push) Skipped
fix(web): keep rectification sessions listed and persist chats on first send
Empty-consultation filtering is now session_type scoped so birth-time rows stay in the sidebar. Subtitles use updatedAt with sort/group/cursor. New chats stay local until the first send.
2026-09-21 16:39:32 +08:00

51 lines
3.5 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.
# PROGRESS · 会话列表重建(2026-09-21)
工作树:`.worktrees/session-list-rebuild-20260921`
分支:`codex/session-list-rebuild-20260921`
基线:`origin/staging` @ `f8d65e48`(任务书;代码基线 `0c3c9d6b`)
## 任务状态
| 任务 | 状态 | 说明 |
| --- | --- | --- |
| T1 列表不得吞掉生时校正 BUG-987 | 完成 | 过滤改为 `session_type.neq.consultation,messages.neq.[]`;归档同一规则 |
| T2 显示时间与排序同源 BUG-988 | 完成 | 副标题改 `updatedAt`;`SESSION_LIST_COLUMNS` 去掉 `created_at` |
| T3 第一问之前不落库 BUG-989 | 完成 | 删除复用与 `draft`;本地新建;`send()` 先 POST 再建问 |
| 记录 | 完成 | BUG-987/988/989、CHANGELOG、DESIGN、BLOCKED 划掉 120 行那条 |
## 开工基线
| 项 | 值 |
| --- | --- |
| 分支 | `codex/session-list-rebuild-20260921` 跟踪 `origin/staging` @ `f8d65e48` |
| `page.tsx` 行数 | 1826 |
| `Home()` useState / useRef | 未改装配;帽 36 / 37 |
## 实现要点
- 服务端与客户端共用 `excludeEmptyConsultations` / `isListedSidebarSession` / `cloudListIncludesSession`。校正会话 `messages` 永远是 `[]`,不能当空咨询删。
- 副标题、排序、分组、游标都用 `updated_at`。详情接口仍返回 `created_at`(`home-cloud-sync` 回落链未动)。
- `startNewChat` 只替换本地未开口咨询,不 POST、不写 `?c=`。`persistSession("create")` 成功后才 push URL。落库失败撤销本地会话,且发生在 `setDraft("")` 之前,输入框草稿仍在。
- 已成功建行的 id 记入 `cloudCreatedIds`,避免第一问失败后再发时重复 POST。
## 测试
| 项 | 结果 |
| --- | --- |
| `page.tsx` 行数 | **1791**(开工 1826,未增长) |
| `tsc --noEmit` | 0 错 |
| `npm run lint` | 0 error(既有 warning 未动;去掉新建路径里未再使用的 `setCreatingSession` 解构,避免新增 warning) |
| 定向 | chat-session-authority / session-list-filter / session-groups / chat-session-url / local-postgres-or / chart-library-session / session-list-lifecycle / composer-isolation / home-shell-growth / chat-session-write **全部通过** |
| `npm test` | **3598** 条,**3509** 通过 / **89** 失败。失败几乎全是本机 Windows:`database-*.test.ts` 因 Docker 网段耗尽(`all predefined address pools have been fully subnetted`,其它 worktree 留下的 postgres 网络),以及 symlink / chmod / shell 脚本类用例。与本单相关的源码合同失败 1 条已修(`chat-session-write.test.ts` 启动不再 `writeChatSession(initialSession)`)。未在本机重跑 `0c3c9d6b` 全量作逐条基线。 |
| `npm run test:db` | Docker 在 PATH 里,但创建 compose 网络失败(同上网段耗尽)。**不得写成通过。** `database-session-list-visibility.test.ts` 照提交。 |
| `next build` / `--webpack` | 编译与 tsc 通过;收集 `/api/consult` 等页数据时 `symlink ... EPERM`(Windows 无开发者模式)。本机看不到 `/` Static 与 gzip。 |
## 让步
T1–T3 都做了,功能上无让步。
环境缺口(替代证据):
1. **真实 Postgres 列表可见性**:本机 Docker 网段被其它会话占满,`test:db` 跑不起来。替代:`local-postgres-or.test.ts` 编译 `session_type.neq.consultation,messages.neq.[]`;`session-list-filter.test.ts` 跨层对断;`chat-session-authority.test.ts` 断言路由走 `excludeEmptyConsultations`。
2. **next build 静态与 gzip**:Windows symlink EPERM。未量首屏 gzip。