docs: 补强 V1 数据与测试设计

- 扩展 SQLite schema:新增 batches、Excel 行定位、stage/status、时间戳和重试字段

- 明确 SQLite worker 并发规则:独立 connection、WAL、busy_timeout、短事务

- 调整 AI 接入顺序:先做模型清单后端,再接真实 ai.py,设置页复用后端

- 补充 unittest 测试基座要求和分层验证策略

- 敏感信息改为本地明文保存,配合 gitignore、UI 打码和日志脱敏
This commit is contained in:
chengma
2026-06-26 16:27:33 +08:00
parent 92735ae7a4
commit 3832697fc4
15 changed files with 152 additions and 62 deletions
+12
View File
@@ -180,4 +180,16 @@
- 新增 `workers.py` 作为可选模块承载 PySide6 worker/QThread 编排。
- 下一步:继续处理 SQLite/Excel schema 与 AI 接入任务依赖。
## 【2026-06-26】补强 · 数据模型 / AI 顺序 / 测试 / SQLite 并发 / 明文敏感信息
- 状态:DONE(仅文档)
- 变更:更新 `docs/04-architecture.md`、`docs/api.md`、`docs/06-tasks.md`、`docs/03-tech-stack.md`、`docs/05-coding-rules.md`、`docs/00-ai-start-here.md`、`docs/02-requirements.md`、`docs/current-state.md`、`docs/routes.md`、`AGENTS.md`、`CLAUDE.md` 与 UI 线框。
- 决策:
- 数据模型补强:新增 `batches` 表;`tasks` 增加 `source_file_abs/source_sheet/source_row/row_key`、`stage/status` 分离、时间戳、attempts、`last_error`,用于可靠回写、重试与断点续跑。
- SQLite 并发:每个 worker 独立 connection;统一 `foreign_keys=ON`、`journal_mode=WAL`、`busy_timeout=5000`、`synchronous=NORMAL`;短事务单条提交。
- AI 顺序:先做 T-005 AI 模型清单后端,再做 T-301 真实 AI 接入;T-501 只做设置页 UI。
- 测试策略:引入 `tests/` + stdlib `unittest` 基座,优先覆盖 appconfig/db/excel/prompts 纯逻辑;CDP/Shopee/真实 AI 作为集成或手动验证。
- 不做加密:密码与 AI Key 本地明文保存,文件必须 gitignore;UI 打码,日志/导出脱敏,不自动登录。
- 下一步:继续按任务看板从 Phase 0 开始实现,建议优先 T-003/T-006 或 T-001。
<!-- 新一轮从这里向下追加记录。 -->