feat(dacli): Tier 1 跟进 4 项 — 容错/dbPing/menuIntegrity --fix/reuse wrapper
回应用户"都去完善" — 落地 4 项 tdd8 smoke test 暴露的痛点:
[1/4] non-JSON 容错 (src/core/client.ts)
- 修 schedule list / monitor flow 等命令报"unexpected response shape"崩
- parseJson(): HTTP 2xx + 空 body → 返 envelope-style {code:200, data:null} (JNPF 端点 bug 已知)
- HTTP 2xx + 非 JSON body → graceful degrade 同上, 不 throw
- 实战: schedule list 之前 100% 崩, 现在返 200 + 空 data (语义清晰)
[2/4] dbPing 真实实现 (src/commands/app/status.ts)
- 替换 /system/DataSource/TestConnection (404) → /system/DataModel/{dbLinkId}/Tables
- 端点真实, dm list 端点, 走通即 DB 连得上
- 4xx/5xx 都报真错误, 不再 skip
- 实战: dbPing 75ms 真检查 (之前永远 skip, 防不住 BS-E14)
[3/4] menuIntegrity --fix 跟进 (src/commands/app/status.ts)
- 新选项: --fix-menu-url 自动重建空 urlAddress 菜单
- 策略: 拉 form list → enCode 匹配 → PUT /system/Menu/{id} urlAddress=model/{enCode}
- 非 form 菜单 (enCode 不在 formList) → skip + log "需手填"
- tdd8 实测: 4 项空 urlAddress 可自动修 (需你确认执行)
- DacliHelp 同步更新 notes
[4/4] --reuse-if-exists 通用化 (src/commands/_reusable_create.ts)
- 新增通用 wrapper: reusableCreate({cmdName, enCode, findExisting, runCreate})
- form/dict/menu create 全部接入 (各 ~20 行)
- 6 个新单元测试 (复用场景, 异常容错, 空 enCode 等)
- 4 个命令统一 shape: ctx.success({enCode, id, fullName, state, reused: true, mode: 'reuse-if-exists'})
- dm/workflow 跳过 (enCode 概念不直接适用, tableName/flowId 走不同路径)
验证:
- typecheck 0 errors
- vitest 39 文件 / 389 tests pass (含 6 个新 reusable_create 测试)
- doc:check 0 drift (扫描 271 文件)
- quality gate 4/4 (tsc + vitest + doc:check + smoke)
意外: dict/typecreate.ts 文件在 case-insensitive fs 上 cp 时被误删, git restore 恢复 — 提醒后续 case-sensitivity 风险