Files
mnote/design/04-tree-domain/done/4-25-trash-empty-isolated-workspace-smoke-v1.md
T
lix-2026 47e224d419 chore: align sqlite control plane architecture
- replace default Convex control-plane wording with Rust SQLite control-plane across architecture, AGENTS, Reasonix, and design docs

- retire root Convex functions source and deploy script into recycle while keeping explicit cloud/compat/sync-replica boundaries

- add control-plane migration guard/docs and keep CodeGraph refreshed after the SQLite control-plane cutover
2026-05-22 17:45:22 +08:00

65 lines
3.6 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.
# 4-25 Trash Empty 隔离 Workspace 验收设计
> 状态:done
> 来源:`design/10-review/07-vscode-explorer-filetree-trash-gap-review.md` 阶段 3
> 范围:页面、附件、mindmap、table 删除进垃圾箱后,执行 workspace 级 empty trash,并确认 Convex 行与关联数据被永久清理。
## 背景
`documents.emptyTrashByWorkspace``mediaAssets.emptyTrashByWorkspace``mindmaps.emptyTrashByWorkspace``tables.emptyTrashByWorkspace` 都是 workspace 级破坏性操作。默认测试账号 `mnote.e2e@example.com` 已有长期工作区与历史垃圾箱数据,不能直接在该 workspace 上点击“清空垃圾箱”做 smoke,否则可能误删非本轮测试数据。
阶段 3 的验收必须先建立隔离边界,再执行真实清空。
## 目标
- 使用本轮独立身份或独立 workspace 创建测试页面、子页面、附件、mindmap、table。
- 对五类对象执行默认删除,确认进入对应垃圾箱。
- 执行页面垃圾箱清空与资源垃圾箱清空。
- 查询当前 source 的持久化状态;历史 Convex source smoke 才确认 document / media_asset / mindmap / document_table / document_table_rows 不再存在。
- 记录关联清理边界:Storage、OCR、LightRAG、page references、recent pages、favorites。
## 推荐方案
优先使用一次性 SQLite control-plane Auth 用户:
1. 通过 Rust `/api/auth` 走 password `signUp`,邮箱使用 `mnote.trash.<timestamp>@example.com`
2. 使用同一 browser/request context 打开 `/`,触发 `workspaces.ensureDefaultWorkspace` 创建独立 personal workspace。
3. 在该 workspace 内创建:
- 根页面 `TEST-10REVIEW-07-P3-root-*`
- 子页面 `TEST-10REVIEW-07-P3-child-*`
- 附件 `TEST-10REVIEW-07-P3-file.txt`
- mindmap `TEST-10REVIEW-07-P3-mind`
- table `TEST-10REVIEW-07-P3-table`
4. 通过 Rust 3000 主壳 API 执行软删除:
- 页面:`POST /api/tree/commands``action: "archive"`
- 附件:`POST /api/media/batch``action: "delete"`
- mindmap`DELETE /api/mindmap/{docId}/{mindmapId}`
- table`DELETE /api/tables/{tableId}`
5. 打开 `/trash?workspaceId=<isolated>`,确认页面区与资源区出现本轮数据。
6. 调用:
- `POST /api/documents/empty-trash`
- `POST /api/media/empty-trash`
- `POST /api/mindmap-trash/empty`
- `POST /api/tables/empty-trash`
7. 使用 Convex query 或 Rust 只读 API 查询,确认本轮对象不存在。
## 禁止方案
- 不得在默认测试账号既有 workspace 上执行 workspace 级清空。
- 不得只用 UI 列表消失作为永久删除证据。
- 不得把 route fixture 单测等同于真实 Convex 清空验收。
## 执行结果
- 已新增 `scripts/task427-trash-empty-isolated-workspace-smoke.js`,覆盖“一次性用户注册 -> 独立 workspace -> seed 五类对象 -> 删除进垃圾箱 -> 清空 -> Convex 不存在断言”。
- 2026-05-15 执行通过:一次性 workspace `ws_req_1778793827876_33` 内,页面、子页面、附件、mindmap、table 均完成删除进垃圾箱与 empty trash 后不可查询断言。
- Rust 3000 已补资源软删除兼容入口;正式 `tree.resource.*` 命令仍由 10-review 阶段 5 收口。
- LightRAG 目前可见 ingest 任务入口,未见 purge 反向删除索引路径;阶段 3 验收只能记录该边界,不能标为已清理。
## 验收产物
- 新增或复用一个 smoke 脚本,默认只操作一次性用户 / 一次性 workspace。
- 输出本轮 `workspaceId``documentId``childDocumentId``assetId``mindmapId``tableId`
- 输出清空前后的 Convex 查询摘要。
- 将结果回填到 `design/10-review/07-vscode-explorer-filetree-trash-gap-review.md` 阶段 3。