参考 boot/ 仓库结构初始化, 同步到 gitea:3000/ssw/dacli (private). 包括: - src/ 8 父命令 (form/menu/dm/dict/di/apis/doc/workflow + login/status) + core (client/crypto/help/log/types/config) - src/schema/ FieldBuilder (从 JNPF web 源码提取, 避免 53 个手写 builder) - tests/ vitest 单元 + playwright E2E (含 workSystem/developSystem baseline regression) - scripts/ extract-all.mjs (从 jnpf-web 源码生成 schema) + seed-tds-baseline.ts - doc/ architecture/plan/api/extractors/baseline/RESUME/help-system + v0.6/v0.7 changelog - .claude/skills/dacli-ts/ Claude 集成 skill (SKILL.md + 5 references + 7 examples + 3 baseline) - CLAUDE.md (项目说明) + README.md + prompt.md (开发任务说明书) - 配置文件: package.json/lock, tsconfig, vitest.config, playwright.config
135 lines
6.5 KiB
Markdown
135 lines
6.5 KiB
Markdown
# RESUME — 会话恢复指引 (2026-06-12 v0.7)
|
|
|
|
> **下次会话第一句**: 读 `doc/RESUME.md`, 然后看 `doc/v0.7-changelog.md` 知道这一轮做了什么.
|
|
> 当前进度: prompt.md 6 周路线 + v0.7 校准全部落地, **P0 #13 + P1 #15 都闭环**, 留 #16 (Playwright UI CRUD 真点击) 作为下一步.
|
|
|
|
---
|
|
|
|
## 1. 当前状态 (v0.7, 2026-06-12)
|
|
|
|
- **typecheck**: 0 错
|
|
- **vitest**: 33/33 PASS
|
|
- **Playwright**: 18 PASS (含 #13 4/4) + 2 skip + 0 FAIL
|
|
- **dacli 命令**: 8 父 / 26+ 子 (form/dm/dict/menu/di/workflow/doc/apis, menu 加 unrelease)
|
|
- **tds 应用**: 3 张 form
|
|
- `tds_leave` (835168490678657989) — **v0.7 #13 真闭环, AI 用 dacli-ts 从零搭** (员工请假申请, 8 业务字段)
|
|
- `p15_singletable_v2` (835166593053893573) — **v0.7 #15 验证 import autoTable**
|
|
- `leaveApply_ws` (835141419151664069) — v0.6 baseline 残留 (无物理表, 浏览器报错, 视而不见)
|
|
- **tds 物理表**: 2 张 (`tds_leave`, `p15_singletable_v2`) 都在 dbLinkId=2065323991245033472
|
|
- **tds 菜单**: 6 个 (1 新 + 5 老)
|
|
|
|
## 2. 本轮交付清单 (按 v0.7-changelog.md)
|
|
|
|
**dacli 源码** (6 个文件改, 修 4 真 bug):
|
|
- `src/commands/form/export.ts` (重写, 加 `_physicalSchema` 拉物理表 schema)
|
|
- `src/commands/form/import.ts` (重写, 加 `--autoTable` + 表名映射 + 优先级回退)
|
|
- `src/commands/form/release.ts` (修 endpoint: PUT /Actions/State → POST /Actions/Release)
|
|
- `src/commands/form/clone.ts` (同上 release endpoint 修)
|
|
- `src/commands/form/create.ts` (同上 release endpoint 修)
|
|
- `src/commands/dm/create.ts` (重写 body shape tableInfo+tableFieldList + 补 PK + 9 系统列)
|
|
- `src/commands/dm/fields.ts` (parse 兼容 list/fields/array)
|
|
|
|
**测试** (1 新):
|
|
- `tests/e2e/p13-ai-driven-crud.spec.ts` (新, 4 个 P0 #13 验收 — /model URL + form info + dm fields + menu list)
|
|
|
|
**文档/skill** (4 个):
|
|
- `.claude/skills/dacli-ts/SKILL.md` (加 v0.7 校准段)
|
|
- `.claude/skills/dacli-ts/references/troubleshooting.md` (加错误 18-22, 全 v0.7 新坑)
|
|
- `.claude/skills/dacli-ts/references/anti-patterns.md` (加反模式 0: form create type=1/2 不传 --tables)
|
|
- `doc/v0.7-changelog.md` (新, 详细变更)
|
|
- `doc/RESUME.md` (本文件, v0.7 更新)
|
|
|
|
## 3. P0 #13 闭环关键发现 (用户校准的核心)
|
|
|
|
subagent (only dacli-ts skill, 中文需求 "员工请假申请") **真跑通**:
|
|
- ✅ `dm create tds_leave` (19 字段, 自补 PK + 9 系统列)
|
|
- ✅ `form create --type=1 --webType=2 --tables=...` (id=835168490678657989)
|
|
- ✅ `form release` (state=1)
|
|
- ✅ `menu create --type=3 --urlAddress=model/tds_leave` (Actions/Module 失败, fallback 低级路径)
|
|
- ✅ `curl http://nginx/jnpf_app_tds/model/tds_leave` → 200
|
|
- ✅ form info / dm fields / menu list 全部 API 端验证通过
|
|
|
|
**3 个 dacli 真 bug subagent 自己发现 + 自己修** (已固化到源码):
|
|
1. `dm create` body 协议错 (flat vs tableInfo wrapper)
|
|
2. `dm create` PK 自动补全缺失 (DbFieldForm.getPrimaryKey NPE)
|
|
3. `form release` endpoint 是错的 PUT /Actions/State (真路径 POST /Actions/Release)
|
|
|
|
**结论**: dacli-ts skill **可独立支撑 AI 完成业务**, 跑出真闭环不是机械抄 baseline.
|
|
|
|
## 4. 任务面板 (16 个任务)
|
|
|
|
```
|
|
#1 [✓] 验证当前基线 (typecheck + vitest + playwright 全过)
|
|
#2 [✓] 浏览器 0 视觉差 (校准为 #5-7)
|
|
#3 [ ] examples/baseline/all.sh 真一键跑 72 张
|
|
#4 [ ] AI 自检 (prompt W6-D4): 喂 skill 给 subagent 跑请假流程
|
|
#5 [✓] #2.1 浏览器会话管理 (storageState + TTL)
|
|
#6 [✓] #2.2 tds 数据准备 (seed-tds-baseline.ts)
|
|
#7 [✓] #2.3 浏览器层 DOM 对比 spec (列表 PASS, 详情/CRUD 留 #10/#13)
|
|
#8 [✓] #2.4 内化 ssw-e2e-test 到 dacli-ts skill
|
|
#9 [✓] 修 regression spec 真总数 (85/29)
|
|
#10 [✓] 详情页 DOM 等价 (已 spike 验证模式)
|
|
#11 [✓] AI 重建 + CRUD (校准为 #13)
|
|
#12 [✓] 挂菜单 + 真路径 spike (已验证菜单挂上 + 真路径渲染)
|
|
#13 [✓] AI 需求驱动设计 + CRUD 真闭环 (v0.7, tds_leave, 4/4 spec PASS)
|
|
#14 [✓] dacli menu create 修 (web Actions/Module + 低级 fallback)
|
|
#15 [✓] form import 不建表 bug (v0.7, autoTable 默认 true, _physicalSchema)
|
|
#16 [ ] Playwright UI CRUD 真点击 (新增填写保存编辑删除真操作, 不只 API 验证)
|
|
```
|
|
|
|
## 5. 下一步 (优先级排序)
|
|
|
|
### P0: #16 — Playwright UI 真点击 CRUD
|
|
- 现在 #13 spec 只验 API + 页面能开
|
|
- 真 0 差错要: 浏览器层填写表单 → 保存 → 列表能看 → 编辑 → 删除 → 列表少 1 行
|
|
- 难点: vxe-table + ant-form + 字段选择器 (jnpfKey-driven)
|
|
- 建议先用 dacli createModel API 兜底验证后端 OK, 再写 UI spec
|
|
|
|
### P1: examples/baseline/all.sh 真一键跑 72 张 (prompt W5-D5 留尾)
|
|
- 当前只有 developSystem 20 + workSystem 52 的 regression API spec
|
|
- 一键脚本未写完, 包括 export 全 72 张 + import 到 tds + Playwright 截图对比
|
|
|
|
### P2: 持久化 git
|
|
- dacli/ **无 git 仓库** (.claude/.git 只跟踪 .claude/)
|
|
- 选项: `cd $ccWorkDir/dacli && git init && git add -A && git commit` 独立 repo
|
|
- 或: 让 .claude/ git 升级到 ccWorkDir 顶层 (用户决策)
|
|
|
|
## 6. 关键命令 (next session 直接用)
|
|
|
|
```bash
|
|
cd /home/ubuntu/ccWorkDir/dacli
|
|
|
|
# 验证基线
|
|
npx tsc --noEmit # 0 错
|
|
npx vitest run # 33/33
|
|
JNPF_BASE_URL=http://nginx/ npx playwright test # 18/18 PASS
|
|
|
|
# 验 #13 (tds_leave 真闭环)
|
|
npx tsx src/cli.ts switch-app --appCode=tds
|
|
npx tsx src/cli.ts form info 835168490678657989
|
|
curl -s -o /dev/null -w "%{http_code}\n" http://nginx/jnpf_app_tds/model/tds_leave # → 200
|
|
|
|
# 验 #15 (import autoTable)
|
|
# 重跑: form export 任意 dev/workSys form → form import 到 tds → 应自动建物理表
|
|
```
|
|
|
|
## 7. 重要文件路径 (恢复时直接读)
|
|
|
|
- `doc/RESUME.md` ← 本文件
|
|
- `doc/v0.7-changelog.md` ← 本轮详细变更
|
|
- `doc/v0.6-changelog.md` ← 上轮变更
|
|
- `doc/plan.md` ← 6 周路线 + v0.6 段
|
|
- `prompt.md` ← 任务说明书 (原始需求)
|
|
- `.claude/skills/dacli-ts/SKILL.md` ← skill 主入口 v0.7
|
|
- `.claude/skills/dacli-ts/references/playwright.md` ← 浏览器层 ssw-e2e-test 内化
|
|
- `.claude/skills/dacli-ts/references/troubleshooting.md` ← 错误 1-22 (v0.7 新加 18-22)
|
|
- `.claude/skills/dacli-ts/references/anti-patterns.md` ← 反模式 0-8 (v0.7 新加 0)
|
|
- `tests/e2e/p13-ai-driven-crud.spec.ts` ← P0 #13 验收 spec (4/4 PASS)
|
|
|
|
## 8. 上下文 (登录态等)
|
|
|
|
- dacli token: `.dacli-token/token.json` (admin@tds, 7 天 TTL)
|
|
- Playwright storageState: `.auth/admin.json` (TTL 6h, 过期重跑 setup)
|
|
- nginx + JNPF 全通
|
|
- tds 业务库 dbLinkId: 2065323991245033472
|