 sswandClaude
|
980dbedbbd
|
feat(dacli): print/* 模块 wrapCommand 迁移 (create/delete/info/update, 10 exit 收口)
create 从旧 printCommandEnd 升级 (保留 auto-fix). delete/info/update process.exit → ctx.fail.
step machine 校验失败 → ctx.fail (聚合错误). print/ 模块 process.exit 归零.
Co-Authored-By: Claude <[email protected]>
|
2026-07-21 21:07:48 +08:00 |
|
 sswandClaude
|
2795d7f2db
|
feat(dacli): storage/* 模块 wrapCommand 迁移 (info/test/use, 5 exit 收口)
info 从旧 finally+printCommandEnd 升级 (无 appCode 跳过 L3, DacliError throw 被 wrapCommand catch).
test 批量连通测试用 ctx.partial (fail>0). use 纯 yml 无 appCode, process.exit → ctx.fail/success.
storage/ 模块 process.exit 归零.
Co-Authored-By: Claude <[email protected]>
|
2026-07-21 21:05:16 +08:00 |
|
 sswandClaude
|
2a1fd000a6
|
feat(dacli): schedule/* 模块 wrapCommand 迁移 (create/delete/info/trigger/update, 9 exit 收口)
create 从旧 printCommandEnd 升级 (保留 auto-fix). trigger 从旧 printCommandEnd 升级.
update 复用 DirtyCheckError catch + step machine → ctx.fail. delete/info process.exit → ctx.fail.
schedule/ 模块 process.exit 归零.
Co-Authored-By: Claude <[email protected]>
|
2026-07-21 21:03:07 +08:00 |
|
 sswandClaude
|
183d07bcc6
|
feat(dacli): msg/* 模块 wrapCommand 迁移 (notice+template CRUD 7 文件, 14 exit 收口)
notice/templateCreate 从旧 printCommandEnd 升级到 wrapCommand (保留 auto-fix fixes).
noticeUpdate 复用 DirtyCheckError catch. noticeSend 非 site 通道 → ctx.success (note).
notice/template Delete/Update process.exit → ctx.fail. msg/ 模块 process.exit 归零.
Co-Authored-By: Claude <[email protected]>
|
2026-07-21 21:00:25 +08:00 |
|
 sswandClaude
|
6d190a947c
|
feat(dacli): menu/* 残留 wrapCommand 迁移 (create/unrelease/purge, 4 exit 收口)
create.ts runStepMachine 内部 process.exit → throw (wrapCommand catch).
unrelease 完整 wrapCommand 迁移. purge 批量命令用 ctx.partial (fail>0).
menu/ 模块 process.exit 归零 (delete/list/update 已迁移).
Co-Authored-By: Claude <[email protected]>
|
2026-07-21 20:50:02 +08:00 |
|
 sswandClaude
|
1a9f18285f
|
feat(dacli): dict/* 模块 wrapCommand 迁移 (datacreate/datadelete/dataupdate/typedelete/typeupdate + typecreate 收尾, 12 exit 收口)
datacreate 批量命令用 ctx.partial (fail>0) / ctx.success. typecreate 补齐 (runDictStepMachine process.exit → throw + 移除冗余 pre-wrap check).
data/typeupdate 复用 DirtyCheckError catch. data/typedelete process.exit → ctx.fail.
dict/ 模块 process.exit 归零.
Co-Authored-By: Claude <[email protected]>
|
2026-07-21 20:47:51 +08:00 |
|
 sswandClaude
|
17c0f353ab
|
feat(dacli): role/* 模块 wrapCommand 迁移 (create/delete/info/update, 8 exit 收口)
create.ts 从旧 printCommandEnd 升级到 wrapCommand (runRoleStepMachine 内部 process.exit → throw).
update.ts 复用 DirtyCheckError catch → ctx.fail 模式.
delete/info process.exit → ctx.fail. assign.ts 已迁移 (无变更).
role/ 模块 process.exit 归零.
Co-Authored-By: Claude <[email protected]>
|
2026-07-21 20:44:07 +08:00 |
|
 sswandClaude
|
c6763c4129
|
feat(dacli): user/* 剩余 11 文件 wrapCommand 迁移 (batch2+batch-delete, 全模块收口)
baseinfo/batch-set-position/batch-state/online-kick/delete/resetpwd/
socials-unbind/batch-delete/update/info/create — 全部 process.exit → ctx.fail.
create.ts 从旧 printCommandEnd 模式升级到 wrapCommand (保留 runCommandAutoFix fixes).
update.ts 复用 DirtyCheckError catch → ctx.fail 模式.
user/ 模块 20 文件 process.exit 归零 (100% 收口).
Co-Authored-By: Claude <[email protected]>
|
2026-07-21 20:41:02 +08:00 |
|
 sswandClaude
|
2f7482c7c2
|
feat(dacli): user/* batch1 wrapCommand 迁移 (auth-groups/auth-list/changepwd/set-position/unlock, 5 exit 收口)
Co-Authored-By: Claude <[email protected]>
|
2026-07-21 20:35:35 +08:00 |
|
ssw
|
e091907db7
|
feat(dacli): bigscreen/construct.ts 完整 wrapCommand 迁移 (P6 6 exit 收口)
6 处 process.exit(1) → ctx.fail():
- main action catch (构造失败兜底)
- runConstruct --from-json 文件不存在 (改 throw DacliError → handler catch → ctx.fail)
- runConstruct --from-json JSON.parse 失败 (同上)
- runConstruct validateOnly 校验失败 (原 process.exit(1) 单一分支)
- runConstruct 校验失败 (原 else 分支)
- runConstruct addObj 后端未返 id (同上)
runConstruct 内部 5 处 process.exit(1) → throw new DacliError (P5 已就绪模式)
main action 兜底 catch → ctx.fail. wrapCommand handler 自动 catch 所有 throw.
修改方式: Write 整文件重写.
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
|
2026-07-21 20:25:04 +08:00 |
|
ssw
|
e05d87300f
|
feat(dacli): portal/create.ts 完整 wrapCommand 迁移 (P6 4 exit 收口)
4 处 process.exit(1) → ctx.fail():
- Bug 5 category 解析失败 (resolvePortalCategory throw DacliError catch)
- step machine 校验失败
- 后端 createPortal code !== 200 (含 enhanceFromBackend 错误增强)
- BS-新12 silent fail (后端返 code=200 但 r.id undefined, list 反查仍空)
删 4 处 printCommandEnd (L3 落盘) — wrapCommand 自动调用
保留 runCommandAutoFix pipeline (silent fix 透传)
保留 resolvePortalCategory 内部 DacliError (P5 已就绪)
修改方式: Write 整文件重写.
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
|
2026-07-21 20:23:13 +08:00 |
|
ssw
|
bb2d485d91
|
feat(dacli): app/create.ts 完整 wrapCommand 迁移 (P6 1 exit 收口)
1 处 process.exit(1) → ctx.fail() (catch 末尾):
- runCreate 抛 AppCreateError 或其他 Error → wrapCommand handler catch
- 显式 AppCreateError 分支: ctx.fail([step] msg, { stepName })
- 其他 Error: ctx.fail(app create 失败, { appCode, appName })
runCreate 内部 4 处 throw AppCreateError (v2.1+ P1-2b 已就绪) 不变, wrapCommand
handler 直接 catch 走 ctx.fail 收口.
console.log(JSON.stringify) → log.raw(JSON.stringify+\n) (走 quiet buffer).
修改方式: Edit (导入 + 整块 .action 替换).
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
|
2026-07-21 20:21:39 +08:00 |
|
ssw
|
ab7ed34154
|
feat(dacli): menu/update.ts 完整 wrapCommand 迁移 (P6 4 exit 收口)
4 处 process.exit → ctx.fail():
- 缺 menuId (位置参数 + --id 都缺)
- BS-49 expected-enCode 不匹配 (dirty check)
- --propertyJson JSON 解析失败
- 后端 PUT code !== 200 (含 enhanceFromBackend 错误增强)
修改方式: Write 整文件重写.
与 form/update.ts 同模式 (BS-49 防覆盖 + dirty check + propertyJson 合并).
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
|
2026-07-21 20:20:55 +08:00 |
|
ssw
|
418afb5180
|
feat(dacli): workflow/update.ts 完整 wrapCommand 迁移 (P6 6 exit 收口)
6 处 process.exit → ctx.fail():
- 拉原模板失败 (step 0)
- dirty check 失败 (DirtyCheckError catch, 同 form/update 模式)
- --enabledMark=0 无 API (step 2)
- saveFlow 缺 flowId (step 2)
- saveFlow 缺 flowXml (step 2)
- 后端 saveFlow code !== 200
- 后端 PUT code !== 200 (含 enhanceFromBackend 错误增强)
dirty check 集成: 与 form/update.ts 同模式 (try { dirtyCheckFailAndExit }
catch (e) { if (e instanceof DirtyCheckError) ctx.fail(e.message, ...) else throw })
修改方式: Write 整文件重写.
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
|
2026-07-21 20:20:07 +08:00 |
|
ssw
|
a7bae746b9
|
feat(dacli): doc/get.ts 完整 wrapCommand 迁移 (P6 4 exit 收口)
4 处 process.exit(1) → ctx.fail():
- section 不存在 (含可用 section 列表提示)
- 起始行超出文件长度
- ENOENT 文件不存在
- 其他 catch (log.error wrap)
console.log(sec.text/out.content) → log.raw(sec.text+\n) (走 quiet buffer,
verbose 模式即时输出, json 模式跳过 stdout 表格输出)
修改方式: Write 整文件重写.
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
|
2026-07-21 20:19:23 +08:00 |
|
ssw
|
901a479602
|
feat(dacli): report/save.ts 完整 wrapCommand 迁移 (P6 4 exit 收口)
4 处 process.exit(1) → ctx.fail():
- 拉原报表失败
- validateReportCreate 校验失败
- --cells 不是合法 JSON
- 后端 code !== 200
修改方式: Write 整文件重写.
与 report/release/publish/update 同 pattern.
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
|
2026-07-21 20:18:47 +08:00 |
|
ssw
|
8efb4a55e0
|
feat(dacli): form/update.ts 完整 wrapCommand 迁移 + _dirty_check 改 throw + test 更新
form/update.ts (5 处 process.exit → ctx.fail):
- releaseOnly 模式 后端 code !== 200
- BS-49 enCode 冲突
- --fields JSON 解析失败
- --fields 不是非空数组
- PUT 后端 code !== 200 (含 enhanceFromBackend 错误增强)
关联改动:
1. src/commands/_dirty_check.ts: dirtyCheckFailAndExit 改 throw DirtyCheckError
(替代原 process.exit(2), 让 wrapCommand handler catch → ctx.fail)
新增 DirtyCheckError 类 (entityType/entityId/errorCount 字段供 handler 区分)
2. tests/unit/report_wired.test.ts: 更新 report/create.ts 契约 (3 处断言)
- printCommandEnd 6+ → wrapCommand + ctx.fail 5+
- 成功路径 printCommandEnd success → ctx.success
- 删 printCommandEnd 直接 import 断言 (wrapCommand 内部已包)
form/update 整合 DirtyCheckError 实例化:
try { dirtyCheckFailAndExit(...) }
catch (e) {
if (e instanceof DirtyCheckError) return ctx.fail(e.message, { id, errorCount })
throw e
}
修改方式: Write 整文件重写.
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS (含 test 更新)
- workflow/update.ts 也用 dirtyCheckFailAndExit, 仍兼容 throw (下次迁 wrapCommand 时一并处理)
|
2026-07-21 20:16:59 +08:00 |
|
ssw
|
140c0dc691
|
feat(dacli): report/create.ts 完整 wrapCommand 迁移 (P6 5 exit 收口)
5 处 process.exit(1) → ctx.fail():
- validateReportCreate 校验失败
- --from-json-file 文件不存在
- --from-json-file JSON.parse 失败
- 后端 code !== 200
- BS-新12 silent fail (后端返 code=200 但 r 不可解析为 id)
删分散的 5 处 printCommandEnd (L3 落盘) — wrapCommand 自动调用
保留 runCommandAutoFix pipeline (silent fix 透传)
修改方式: Write 整文件重写.
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
|
2026-07-21 20:14:31 +08:00 |
|
ssw
|
39166d11c6
|
feat(dacli): report/publish.ts 完整 wrapCommand 迁移 (P6 5 exit 收口)
5 处 process.exit(1) → ctx.fail():
- 拉原报表失败
- validateReportCreate 校验失败 (basic info 缺)
- --cells 必传缺失 (publish 隐式 type=1)
- --cells 不是合法 JSON
- 后端 code !== 200 (含 enhanceFromBackend 错误增强)
修改方式: Write 整文件重写.
与 report/release/update 同 pattern (P2-2 cells JSON 预校验保留).
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
|
2026-07-21 20:13:44 +08:00 |
|
ssw
|
06224b8133
|
feat(dacli): report/update.ts 完整 wrapCommand 迁移 (P6 5 exit 收口)
5 处 process.exit(1) → ctx.fail():
- validateBasicInfo 失败 (P1-1)
- validateNumeric 失败
- report id 不存在
- --cells 不是合法 JSON (P2-2)
- 后端 code !== 200
修改方式: Write 整文件重写 (Edit 工具不匹配, step 重排风险).
与 report/release 同 pattern (P1-2 spread 后 delete systemId 保留).
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
|
2026-07-21 20:13:06 +08:00 |
|
ssw
|
4e2ee5f286
|
feat(dacli): portal/setDefault.ts 完整 wrapCommand 迁移 (P6 5 exit 收口)
5 处 process.exit(1) → ctx.fail(), 写 CommandLog (L3):
- 必传校验 (--portalId / --menuId 二选一)
- --portalId 数字校验失败 (P2-4 修复, 输 fullName 提前 fail)
- --menuId 数字校验失败
- BS-110 portalId 解析 menuId 失败
- 后端 code !== 200
迁移模式统一:
- import { setupOutputFilter, addOutputOptions, wrapCommand }
- 删本地 --json (改 addOutputOptions 注入)
- Opts interface 加 verbose?: boolean
- .action 开头 setupOutputFilter(opts)
- 整块业务逻辑 wrapCommand 包 + try/catch → ctx.success/fail
修改方式: Write 整文件重写 (Edit 工具不匹配, step 重排风险).
注: Write tool 转义反引号时产生 quote imbalance, 后续 Python 脚本清理.
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
P6 累计: 剩 workflow/create (9) + form/codegen (8) + workflow/update (6) + form/create (13)
+ bigscreen/construct (6) + app/create (6) + report/update (5) + report/publish (5)
+ report/create (5) + form/update (5) = ~62 exit 散布 10 文件.
|
2026-07-21 20:04:36 +08:00 |
|
ssw
|
b665b8b260
|
feat(dacli): di/create.ts 完整 wrapCommand 迁移 (P6 6 exit 收口, 含 step machine)
6 处 process.exit → wrapCommand handler ctx.fail():
- validation 缺 fullName/enCode/category (exit 2 → fail summary 含 3 个 bool)
- runDiStepMachineCreate 抛错 (替代原 process.exit(1), handler catch → fail)
- --from-json-file 文件不存在
- --from-json-file JSON.parse 失败
- 后端 code !== 200 (含 enhanceFromBackend + formatErrorLine 错误增强)
- (其他 try/catch 兜底)
重构关键:
- runDiStepMachineCreate 内部 process.exit(1) → throw new Error(...)
wrapCommand handler catch → ctx.fail(`step machine 校验失败: ...`)
原版内部 exit 会绕开 L3 CommandLog 落盘, 改抛错后 handler 收口
- 删分散的 4 处 printCommandEnd (L3 落盘) — wrapCommand 自动调用
- 删本地 --verbose/--json (改 addOutputOptions 注入)
- runCommandAutoFix 后 opts.assign 保留 (silent fix 透传)
迁移模式统一:
- import { setupOutputFilter, addOutputOptions, wrapCommand }
- Opts interface 加 verbose?: boolean (原 verbose 已存在)
- .action 开头 setupOutputFilter(opts)
- 整块业务逻辑 wrapCommand 包 + try/catch → ctx.success/fail
- log.error 输出保留 (用户感知) + ctx.fail 收口 (供 L3)
修改方式: Write 整文件重写 (Edit 工具不匹配, step machine 重排 + 6 exit 收口风险).
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
P6 累计: 剩 workflow/create (9) + form/codegen (8) + workflow/update (6) + form/create (13)
+ bigscreen/construct (6) + app/create (6) + report/update (5) + report/publish (5)
+ report/create (5) + portal/setDefault (5) + form/update (5) = ~67 exit 散布 11 文件.
form/audit.ts + log/last.ts 跳过 (semantic 退出码 / meta-recursive).
|
2026-07-21 20:02:32 +08:00 |
|
ssw
|
9a59adc9ac
|
feat(dacli): report/release.ts 完整 wrapCommand 迁移 (P6 6 exit 收口)
6 处 process.exit(1) → ctx.fail(), 写 CommandLog (L3):
- step 1: id 不存在
- step 1.5a: basic info 校验失败 (fullName/enCode/category)
- step 1.5b: numeric 校验失败 (sortCode/enabledMark)
- step 2: --type=1 必传 --cells 缺失
- step 2.5: --cells 不是合法 JSON
- step 4: 后端 code !== 200
每步 summary 含 id/type/code/msg/errors 详细 (供 dacli log last 复盘).
DEPRECATION 警告 (v0.16+) 保留在 wrapCommand 内, log.warn 进 buffer (quiet
模式下汇总输出, verbose 立即可见), 不影响 exit code.
迁移模式统一:
- import { setupOutputFilter, addOutputOptions, wrapCommand }
- 删本地 --json (改 addOutputOptions 注入)
- Opts interface 加 verbose?: boolean
- .action 开头 setupOutputFilter(opts)
- 整块 step machine (step 1-4) wrapCommand 包 + try/catch → ctx.success/fail
- validateBasicInfo/validateNumeric 错误保留 log.error 输出 (用户感知)
修改方式: Write 整文件重写 (Edit 工具不匹配, step machine 重排风险).
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
P6 累计: 剩 form/create (13) + workflow/create (9) + form/codegen (8) + workflow/update (6)
+ di/create (6) + bigscreen/construct (6) + app/create (6) + report/update (5) + report/publish (5)
+ report/create (5) + portal/setDefault (5) + form/update (5) = ~73 exit 散布 12 文件.
form/audit.ts + log/last.ts 跳过 (semantic 退出码 / meta-recursive).
|
2026-07-21 20:01:10 +08:00 |
|
ssw
|
8b8f9cf5b3
|
feat(dacli): di/copy + di/export 完整 wrapCommand 迁移 (P2 收口 P0-9)
2 文件 4 处 process.exit(1) → ctx.fail(), 写 CommandLog (L3):
- di/copy.ts: id 校验失败 / 后端 code!=200 / 后端未返新 id 三路径全 ctx.fail
- summary 含 sourceId/newId/code/msg (供 `dacli log last` 复盘)
- di/export.ts: id 校验失败 / 后端 code!=200 / 后端未返 url 三路径全 ctx.fail
- summary 含 id/name/url (下载 URL 是 OSS/MinIO 预签名短期有效, log 留痕很重要)
每文件统一模式:
- import { setupOutputFilter, addOutputOptions, wrapCommand }
- 删本地 --json (改 addOutputOptions 注入 --verbose --json)
- Opts interface 加 verbose?: boolean
- .action 开头 setupOutputFilter(opts)
- 整块业务逻辑 wrapCommand 包 + try/catch → ctx.success/fail
- log.error 输出保留 (用户感知) + ctx.fail 收口 (供 L3)
修改方式: Write 整文件重写 (Edit 工具不匹配, per handoff 规则 #6).
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
P0-9 (id 校验提示 '用 dacli di list 查 id') + P2 (wrapCommand 化) 一并收口.
剩: P2 form/create + workflow/create + form/codegen (大文件 sub-handler 拆分) + P6 大坑.
|
2026-07-21 18:51:33 +08:00 |
|
ssw
|
aa21fc57ef
|
docs(ADR 0015): P4 v3 全量收口固化 + §4.1 经验教训段
新增 §4.1 'P4 v3 全量收口 (2026-07-21)' 详细段:
- 范围修正: scan 估算 ~330 处, 实际 25 文件 33+ 处真表格. 其余分
(a) 树/key:value dump (dict/typelist + storage/info + user/auth-groups + user/info + menu/info)
(b) 调试日志 (form/_ai + kb/show + apis/info 等)
- 8 批 commit 表格 (15b3361 → 07463cb, 本 session 19 文件 + 前 session 6 = 25/25)
- 迁移模式固化 (代码模板)
- 6 条经验教训 (估算偏差 / Edit vs Write / UUID 截断 / --include-actions / 进度条保留 / 不需新 primitive)
§3 优先级表 P4 v3 行: '待' → '✅ DONE', 加 8 commit 引用 + ~310 散布分类
原 §4.1-4.4 顺延 → §4.2-4.5 (P0 ROI / P1 紧跟 / P3 不放 P1 前 / P5-P6 风险).
验证:
- TS compile baseline 57 不变
- 73/73 vitest PASS
- P4 v3 全量收口闭环: 25/25 REAL_TABLE 文件
|
2026-07-21 18:48:56 +08:00 |
|
ssw
|
07463cb8c9
|
feat(dacli): P4 v3 batch 8 — menu/list.ts (复杂 2 表) wrapCommand + printRawTable
menu/list.ts: 命令路径 P4 v3 全量最复杂文件 (1 文件 2 表 + 多 flag):
- 表 1: system/Menu 树 (4 列 ID/FULL_NAME/ENCODE/URL), maxColWidth=80
- 表 2: form Actions/Module (4 列 FORM_ID/FORM_ENC/TYPE/MENU_PATH), PC+APP 两路平铺
Options 处理:
- --include-actions 默认 ON (--no-include-actions 关), P2-8 修复
- --flat 保留 (但当前版本未实现树形打印, 后续 task)
- --keyword 模糊搜索
改造要点:
- printCommandEnd + try/catch/finally → wrapCommand + ctx.success/fail
- 删本地 --verbose/--json (改 addOutputOptions 注入)
- Opts interface 加 verbose?: boolean
- log.raw('\n') 分隔两个表 (代替原 console.log(''))
- Actions/Module 合并 flatMap: PC/APP 两路展平成多行
- 进度条 process.stderr.write("\r 扫描 form: ...") 保留 (不走 quiet 缓冲, 真实进度可见)
- summary 对象含 systemMenus/formActionsMenus/formActionsScanned/formActionsFailed
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
P4 v3 全量收口: 25 REAL_TABLE 文件全部迁移完毕.
- 已 done (prior session): datasource/list, dm/{list,fields}, dict/datalist, di/list, apis/list (6)
- 本 session (8 batches): report/list, storage/list, workflow/list, apis/{search,tags},
app/list, bigscreen/list, portal/list, doc/{list,toc}, form/selector, kb/list,
msg/{noticeList,templateList}, monitor/online, org/list, print/list, role/{list,selector},
schedule/log, user/{get-position,list}, workflow/{selector,tasks}, menu/list (19)
总计 25/25 = 100%.
|
2026-07-21 18:47:50 +08:00 |
|
ssw
|
4c417cc686
|
feat(dacli): P4 v3 batch 7 — workflow/{selector,tasks} 完整 wrapCommand + printRawTable
2 文件:
- workflow/selector.ts: 4 列 ID/FULL_NAME/ENCODE/CATEGORY (AI 创建菜单挂工作流 type=4 时必跑)
- workflow/tasks.ts: 5 列 TASK_ID/FLOW_NAME/CREATOR/TIME/STATE (我的流程任务 待签/待办/已办/抄送)
每文件统一模式:
- 改 import setupOutputFilter → setupOutputFilter, addOutputOptions, wrapCommand
- 删本地 --verbose/--json (改 addOutputOptions 注入)
- Opts interface 加 verbose?: boolean
- .action 开头 setupOutputFilter(opts)
- 整块业务逻辑 wrapCommand 包 + try/catch → ctx.success/fail
- 原 code!==200 检查 → ctx.fail()
- console.log table → log.printRawTable
workflow/tasks 特殊:
- 5 列最长, default maxColWidth=36 自动截断足够
- 多种 fallback 字段名 (id||taskId, flowName||fullName, creatorUser||userName, ...)
- CATEGORY_NAMES 中文映射 (待签/待办/已办/抄送)
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
剩 1 REAL_TABLE 文件. 下批: menu/list.ts (复杂 2 表 + --include-actions + --flat 选项, 用 Write 全文件重写).
|
2026-07-21 18:46:57 +08:00 |
|
ssw
|
73784f6d73
|
feat(dacli): P4 v3 batch 6 — schedule + user 3 文件 wrapCommand + printRawTable
3 文件:
- schedule/log.ts: 4 列 ID/RUN_TIME/RESULT/DESCRIPTION (定时任务执行日志, 中文 成功/失败)
- user/get-position.ts: 4 列 POSITION_ID/ORGANIZE/POSITION_NAME/IS_MAIN (admin 查用户岗位)
- user/list.ts: 6 列 ID/ACCOUNT/REAL_NAME/ORG/POSITION/ENABLED (P1 权限三角 2 号, 中文 是/否)
每文件统一模式:
- import { setupOutputFilter, addOutputOptions, wrapCommand }
- 删本地 --json (改 addOutputOptions 注入)
- .action 开头 setupOutputFilter(opts)
- 整块业务逻辑 wrapCommand 包 + try/catch → ctx.success/fail
- 原 code!==200 检查 → ctx.fail()
- console.log table → log.printRawTable
schedule/log 特殊:
- maxColWidth=80 (描述字段可能较长)
- '成功'/'失败'/'-' 三态 runResult
user/list 特殊:
- 6 列最长, default maxColWidth=36 自动截断足够
- 中文 启用标记 (是/否)
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
剩 3 REAL_TABLE 文件. 下批: workflow/selector + workflow/tasks (2 文件) + menu/list.ts (复杂 2 表).
|
2026-07-21 18:46:04 +08:00 |
|
ssw
|
12f445b41e
|
feat(dacli): P4 v3 batch 5 — msg + monitor + org + print + role 7 文件 wrapCommand + printRawTable
7 文件:
- msg/noticeList.ts: 4 列 ID/FULL_NAME/ENCODE/STATE (中文 '已发布/未发布')
- msg/templateList.ts: 4 列 ID/FULL_NAME/ENCODE/ENABLED (中文 '是/否')
- monitor/online.ts: 2 列 ID/USER
- org/list.ts: 5 列 ID/FULL_NAME/PARENT_ID/CATEGORY/CHILDREN. UUID 截断 28+.. 保持原视觉
- print/list.ts: 4 列 ID/FULL_NAME/ENCODE/STATE (打印模板)
- role/list.ts: 5 列 ID/FULL_NAME/ENCODE/TYPE/ENABLED (角色列表)
- role/selector.ts: 4 列 ID/FULL_NAME/ENCODE/IS_SYSTEM (AI 选角色 id)
每文件统一模式:
- import { setupOutputFilter, addOutputOptions, wrapCommand }
- 删本地 --json (改 addOutputOptions 注入 --verbose --json)
- .action 开头 setupOutputFilter(opts)
- 整块业务逻辑 wrapCommand 包 + try/catch → ctx.success/fail
- 原 code!==200 检查 → ctx.fail() (不再 process.exit)
- console.log table → log.printRawTable
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
剩 6 REAL_TABLE 文件. 下批: schedule + user (3 文件).
|
2026-07-21 18:44:29 +08:00 |
|
ssw
|
399f50f1d8
|
feat(dacli): P4 v3 batch 4 — doc/{list,toc} + form/selector + kb/list 完整 wrapCommand + printRawTable
4 文件:
- doc/list.ts: 本地文件系统扫描 (无 appCode, 镜像 storage/list 模式), 3 列 PATH/SIZE/MTIME
- doc/toc.ts: HTML section 清单, 3 列 ID/TITLE/LINES. 文件不存在检查改走 ctx.fail (非 process.exit)
- form/selector.ts: webapi/visualDev.getVisualDevSelector, 5 列 ID/ENCODE/FULL_NAME/TYPE/WEBTYPE, 平铺树形
- kb/list.ts: KB domain SQL 聚合查询, 5 列 DOMAIN/STATUS/ENTRIES/SOURCES/STALE. 重写整文件 (原 Command 链顺序错, .option() 必须在 .action() 前)
每文件:
- import { setupOutputFilter, addOutputOptions, wrapCommand }
- 删本地 --json (改 addOutputOptions 注入)
- .action 开头 setupOutputFilter(opts)
- 整块业务逻辑 wrapCommand 包 + try/catch → ctx.success/fail
- console.log table → log.printRawTable (maxColWidth=80 容纳长 path/title)
kb/list.ts 特殊情况:
- 本地 PG/SQLite 查询, 无 JnpfClient, 无 appCode (跟 doc/storage 同模式)
- 用 process.stdout.write 输出 JSON (无 printJson import)
- 原 Command 用 inline builder pattern, 改 var cmd + addOutputOptions + cmd.action
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
剩 13 REAL_TABLE 文件. 下批: msg/noticelist + msg/templatelist + monitor/online + org/list + print/list + role/{list,selector} (7 文件, 大批).
|
2026-07-21 18:42:52 +08:00 |
|
ssw
|
f25a87e26b
|
feat(dacli): P4 v3 batch 3 — app/list + bigscreen/list + portal/list 完整 wrapCommand + printRawTable
3 文件, 相似结构 (4 列 ID/FULL_NAME/ENCODE/[DEL|CATEGORY]):
- app/list.ts: webapi/system.getSystemList, DEL 列 (yes/no for hasDelete)
- bigscreen/list.ts: 原 printCommandEnd + try/catch/finally, 切到 wrapCommand
- portal/list.ts: webapi/portal.getPortalList, 与 app 同样 4 列布局
每文件:
- import { setupOutputFilter, addOutputOptions, wrapCommand }
- 删本地 --json/--verbose 选项 (改 addOutputOptions)
- Opts interface 加 verbose?: boolean
- .action 开头 setupOutputFilter(opts)
- 整块业务逻辑 wrapCommand 包 + try/catch → ctx.success/fail
- summary 对象 (供 L3 CommandLog 落盘)
- console.log table → log.printRawTable
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
剩 17 REAL_TABLE 文件. 下批: doc/list + doc/toc + form/selector + kb/list (4 文件).
|
2026-07-21 18:41:17 +08:00 |
|
ssw
|
a772647d64
|
feat(dacli): P4 v3 batch 2 — apis/{search,tags} 完整 wrapCommand 迁移 + printRawTable
- apis/search.ts: 双表 (Schema + API) → printRawTable. Schema 4 列, API 4 列.
maxColWidth=80 容纳长 path. 整块 .action 套 wrapCommand (ctx.success/fail).
- apis/tags.ts: 单表 (NAME/API_COUNT/DESCRIPTION) → printRawTable. 移除
本地 --json (改 addOutputOptions 统一注入 --verbose --json).
每文件:
- import { setupOutputFilter, addOutputOptions, wrapCommand }
- 删本地 --json 选项, 加 addOutputOptions(cmd)
- Opts interface 加 verbose?: boolean
- .action 开头 setupOutputFilter(opts)
- 整块业务逻辑 wrapCommand 包 + try/catch → ctx.success/fail
- summary 对象 (供 L3 CommandLog 落盘)
- 原 log.warn 后 return → ctx.success(summary) (L3 落 success 状态)
- console.log table → log.printRawTable({ maxColWidth: 80 })
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS
剩 20 REAL_TABLE 文件. 下批: app/list + bigscreen/list + portal/list (3 普通表).
|
2026-07-21 18:40:02 +08:00 |
|
ssw
|
15b3361f15
|
feat(dacli): P4 v3 batch 1 — 3 简单 swap 已 wrapCommand 文件 console.log 表 → printRawTable
- report/list.ts (4 列: ID/FULL_NAME/CATEGORY/ENCODE, 已有 wrapCommand)
- storage/list.ts (6 列: TYPE/NAME/EN-STORE/EN-ACCESS/ACTIVE/YML-PATH, 已有 wrapCommand)
- workflow/list.ts (5 列: ID/FLOW_ID/FULL_NAME/ENCODE/CATEGORY, 已有 wrapCommand)
每文件:
- 替换 header console.log + '-' separator + for-loop padEnd 为单 log.printRawTable() 调用
- 列宽由 printRawTable 自动算 (maxColWidth=36 默认), 不再硬编码 95/120 等
- padEnd 字符串对齐逻辑下沉到 primitive, 输出列宽自适应
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS (含 printRawTable 5 单测)
剩 22 REAL_TABLE 文件待迁 (需新 wrapCommand). 下批: apis/* (search + tags).
|
2026-07-21 18:38:09 +08:00 |
|
ssw
|
e0c3977721
|
ci(skip): no changes (di/edit 全部失败, 跳过 — 改用 Write 重写)
di/copy.ts 和 di/export.ts 大批量 Edit 都失败 (工具 quirk, 文件
字面与 Read 不 100% 一致). 暂时跳过.
下次 session 可用 Write 全文件覆盖, 或单行 Edit.
P6 大坑进展 (~30 文件已 wrapCommand):
- 本 session: menu/delete.ts (6 exit) + role/assign.ts (6 exit)
- 收口纯 P6 raw exit 风险, 不再命令路径只能靠 process.exit(1) 退码
实际累计: 从 c637a58 起共 16 个文件 wrapCommand 迁移 (含本次续 2 个).
|
2026-07-21 18:16:07 +08:00 |
|
ssw
|
d52501b823
|
feat(dacli): P6 续 2 文件 wrapCommand (menu/delete + role/assign)
P6 raw exit 高严重度文件, 之前 0 printCommandEnd 也 0 wrapCommand,
属于 pure P6 raw exit pattern (历史欠 L3 落盘).
menu/delete.ts (6 process.exit 收口):
- 必传 --id 或 --enCode 校验 → ctx.fail
- enCode 模糊匹配 ≤0 / >1 → ctx.fail
- --yes 缺省 → ctx.fail
- cascade 删完后 fail > 0 → ctx.partial
- 删完 fail=0 → ctx.success
role/assign.ts (6 process.exit 收口):
- --userIds 必填 / --action 是 add/remove → ctx.fail
- --roleId / --userIds 雪花 id 格式校验 → ctx.fail
- 后端返非 200 → ctx.fail
每个文件:
- 加 setupOutputFilter + addOutputOptions
- 加 JnpfClient.fromToken() (vs 原懒拿)
- 6 个 process.exit → ctx.fail (P6 大坑收口子集)
验证:
- TS compile 57 baseline 不变 (跟 pre-baseline 一致, 不是我引入)
- 端到端 fail 路径正常: menu delete + role assign 缺参 → ✗ + 错误消息 + exit 1
|
2026-07-21 18:14:18 +08:00 |
|
ssw
|
556709eea3
|
feat(dacli): P4 v3 sample 4 文件 console.log 表 → printRawTable
3 wrapCommand 迁移 + table swap 同步:
- dict/datalist.ts (just swap console.log → printRawTable 内 已迁 wrapCommand)
- di/list.ts (新 wrapCommand + printRawTable, 之前无 L3 接入)
- apis/list.ts (新 wrapCommand + printRawTable, JNPF OpenAPI 接口列表)
每个文件:
- setupOutputFilter + addOutputOptions(--verbose --json)
- wrapCommand + ctx.success/fail
- log.printRawTable 收口 console.log 表格输出
验证:
- TS compile 0 新错误 (baseline 57 不变)
- 73/73 单元测试 PASS (含 printRawTable 5 单测)
剩 ~310 处 console.log 表格散布 (含 dict/typelist printTree 递归, user/info
菜单树等非表格格式, 用户/角色/权限 dump, 不适 printRawTable). 后续批量迁移
可按以下优先级:
- 真表格 (padEnd + '-' separator): 已迁 4 文件, 剩 ~10
- 菜单树状 dump: 建议保留 console.log 或写 printTree 单独 helper
- 用户/角色 dump: 建议保留 key:value 格式, 不动
|
2026-07-21 18:11:18 +08:00 |
|
ssw
|
1fb4f0d208
|
docs(ADR 0015): 同步本 session 累计 (P5 全量 + P6 sample 续 + P4 v2)
|
2026-07-21 18:06:54 +08:00 |
|
ssw
|
a9b7dd5083
|
feat(dacli): P4 v2 log.printRawTable primitive + 3 文件迁移
P4 v2 (2026-07-21): 加 log.printRawTable(headers, rows, opts) 收口 350 处
console.log 表格输出散布.
API:
log.printRawTable(
['ID', 'NAME', 'TYPE'],
[['123', 'myapp', 'MySQL'], ['456', 'test', 'PG']],
{ indent: '', maxColWidth: 36 }
)
- 自动按列宽对齐 (max(header.length, max(cell.length)) 但不超过 maxColWidth)
- 长字段 truncate 省略号 (… 替换最后 1 char, 总长 = maxColWidth)
- 跳过 quiet 模式 (跟 log.raw 同, 直出 stdout)
- 2-space 分隔符, 行末 newline
迁移 3 文件 (示范, 1-2h 后续可推广):
- datasource/list.ts (4 列 表格)
- dm/list.ts (2 列)
- dm/fields.ts (5 列)
新单测 5 个 (基础/长字段 truncate/maxColWidth 自定义/quiet 模式/空 rows).
原 wrapCommand 单测 + auto_fix + report_wired 全部仍 PASS.
验证:
- TS compile 56 baseline 不变 (含原 (s: string) => boolean pre-existing 错)
- 22/22 output_filter 单测 PASS
- 端到端: printRawTable primitive 独立验证输出对齐 + truncate
剩余 P4 v2 范围: 剩 ~330 处 console.log 表格输出待批量迁移, 建议下次 session
继续 (dacli 文档/迁移指南应出 'console.log → log.printRawTable 迁移对照表').
|
2026-07-21 18:06:36 +08:00 |
|
ssw
|
11f94a3dd0
|
feat(dacli): P6 sample 续 7 文件 → wrapCommand + 测试同步
P6 sample 续迁移 7 文件 (累计 14 文件):
- form/list.ts (--summary + --json + 表格 三路径)
- report/list.ts (webapi 化 + DacliError 已有)
- report/info.ts (同上)
- storage/list.ts (无 appCode, wrapCommand 仍能收口 stdout 5c)
- integration/emailtest.ts (DacliError 已有 + 新 wrapCommand)
- integration/smstest.ts (同上)
- integration/webhooktest.ts (DacliError 已有 + 新 wrapCommand)
P5 全量 (commit c6b7fe8):
- portal/create.ts:76,93 (2 throws businessType 字典 + 业务分类)
- bigscreen/construct.ts:269 (1 throw validProps empty)
测试 fix-up:
- tests/unit/report_wired.test.ts 更新 6 个老 pattern 静态契约
- 老 pattern (printCommandEnd + try/finally + cmdError + process.exit(1))
- 新 pattern (wrapCommand + ctx.success/fail + no process.exit)
验证:
- TS compile 56 baseline 不变
- 68/68 单元测试 PASS (output_filter + auto_fix + report_wired + workflow)
- 端到端: form list --summary / report list / storage list / workflow list 都正常
|
2026-07-21 18:01:00 +08:00 |
|
ssw
|
c6b7fe8729
|
feat(dacli): P5 全量 — portal/create + bigscreen/construct throw → DacliError
剩 2 命令路径文件 (其他 9 个用 P5 sample script 已改):
- portal/create.ts:76,93 (2 throw) — businessType 字典为空 input 校验
- bigscreen/construct.ts:269 (1 throw) — validProps empty
剩 throw new Error 全在 SDK/test/helper (跳过):
- form/{_ai,_buildformdata,_browser_verify}.ts (SDK 边界)
- _ssw_retry.ts (网络重试 helper)
- apis/_cache.ts (缓存 helper)
- test/{run,render,generate}.ts (test 预期 throws)
- menu/_helpers.ts (utility)
验证: TS compile 56 baseline, 0 新错误; portal create --help 正常输出
|
2026-07-21 17:56:04 +08:00 |
|
ssw
|
b39024a7ae
|
docs(ADR 0015): 同步表 done 行 (补 P4a/P5 sample/P6 sample)
7 commits 累计 done:
- c637a58 P0 wrapCommand helper
- 715fcb9 P3 18 _validate.ts 统一
- 5ead157 P1 dm/drop TTY + shim 清理
- 22593df P4a + P6 sample
- 45e9f10 P5 sample
剩:
- P2 (2-3h) form/create + workflow/create + form/codegen 高严重度批量
- P4 v2 (1h+) console.log → log.printRawTable 新 primitive
- P5 全量 (2h) ~15 命令路径 throw → DacliError
- P6 大坑 (8+h) 350+ 裸 process.exit 跨多 session 治理
|
2026-07-21 17:47:21 +08:00 |
|
ssw
|
654ce3d2e6
|
docs(ADR 0015): 同步本 session 累计 done (P4a/P5 sample/P6 sample)
7 commits 累计 .:
- c637a58 P0 wrapCommand helper
- 715fcb9 P3 18 _validate.ts 统一
- 5ead157 P1 dm/drop TTY + shim 清理
- 22593df P4a + P6 sample
- 45e9f10 P5 sample
剩:
- P2 (2-3h 高严重度批量)
- P4 v2 (console.log → log.printRawTable 新 primitive)
- P5 全量 (~15 throw → DacliError)
- P6 大坑 (350+ 裸 process.exit 跨多 session 治理)
|
2026-07-21 17:47:04 +08:00 |
|
ssw
|
45e9f1053a
|
feat(dacli): P5 sample 9 文件 throw new Error → DacliError
命令路径 9 文件 throw new Error(改 DacliError (提升 L2 catch 一致性):
- datasource/test.ts (2 throws) — wrapCommand 内 throw
- integration/{emailtest,smstest,webhooktest}.ts (8 throws) — input validation
- report/{info,list}.ts (2 throws) — input failure
- storage/info.ts:38 (1 throw) — platform 不存在错误
- user/{auth-list,batch-state}.ts (2 throws) — 用户管理
跳过:
- test/{run,render,generate} (10 处) — 单元测试 intentional throws
- form/_*.ts SDK helper (_ai/_browser_verify/_buildformdata 等) — 内部 SDK 边界
- _ssw_retry, apis/_cache — 网络重试/缓存 helper
- menu/_helpers.ts — utility
为什么 DacliError 而不是 plain Error:
- DacliError.code 字段 (-1 默认) 让 L2 catch 可分类 (wrapCommand 自动 catch)
- DacliError.raw 字段保留后端原响应
- DacliError extends Error, 现有 (e as Error).message 写法仍兼容
验证:
- TS compile 56 baseline 不变
- 端到端抽样: storage info nonexistent / datasource test --help / integration
webhooktest --help 都正常
|
2026-07-21 17:45:54 +08:00 |
|
ssw
|
22593df7c4
|
feat(dacli): P4a console.error/warn → log.* + P6 sample wrapCommand (7 文件)
P4a (高置信, 0 风险):
- 17 处 console.error/warn → log.error/warn across 11 文件
- 自动 import { log } from '../core/log.ts' (没引过的)
- 影响: _blindspot_guards/app/status/bigscreen/construct/form/release/kb/*/test/*
- 剩 333 处 console.log 是表格输出 (new primitive log.printRawTable 待 ADR)
P6 sample (5-8 文件, 命中 7):
- dm/list, dm/fields, dict/datalist, dict/typelist, form/info
- workflow/info (原本 P6 raw exit, 没落 CommandLog — 顺手补全)
- workflow/list (原本 2 printCommandEnd 重复, 双落 log)
- 全部 try/catch/finally → wrapCommand + ctx.fail/success
- 每个文件消除 1-3 个裸 process.exit
验证:
- TS compile 56 baseline 不变, 0 新错误 (修了一个我自己引入的: workflow/info Opts
interface 缺 verbose? field)
- 端到端: dm list/fields, dict data-list/typeList, form info --summary, workflow
list 都正确输出 + CommandLog 落盘
- workflow/info 同时修了 CommandLog 落盘缺失的 bug (原本裸 process.exit(1), 历史
可追溯不到)
剩余 P5 (throw new Error → DacliError, 37 处) + P6 大坑 (350+ process.exit 跨 session
治理) + console.log → log.printRawTable 新 primitive (P4 v2 范围扩大)
留待后续 session 推进.
|
2026-07-21 17:44:05 +08:00 |
|
ssw
|
5ead157903
|
feat(dacli): P1 dm/drop TTY 拦截 + workflow shim 清理 (11 文件)
P1 (0.5h):
- dm/drop.ts 加 TTY 拦截 — 镜像 form/delete.ts:25 + print/delete.ts:46 +
report/delete.ts:39 已稳定的 pattern: `if (!opts.yes && process.stdin.isTTY)` 时
warn + exit 1; 非 TTY 模式 (CI/脚本) 静默 --yes 走即可. 同步 DOC 注释 + 移除 TODO.
- storage/info.ts:38 DacliError 分叉 — 验证**实际不存在** (`class DacliError`
仅 src/core/types.ts:57 一处定义, 已被 storage/_helpers.ts:21 正确 import).
ADR 0015 §2.2 早期记述有误, 修订清空.
shim 清理 (0.5h):
- 11 个 workflow 子命令 (approve/create/decision/delete/info/launch/list/
selector/syncForm/tasks/update) 把 `import { ... } from './_output.ts'`
改成 `from '../_output_filter.ts'` (1 行 sed × 11 文件).
- 删除 src/commands/workflow/_output.ts shim 文件 (D 掉), 减少 1 个间接层.
- 不影响 L1 输出过滤 / L3 CommandLog 落盘, 因接口签名不变.
验证:
- TS compile: 56 errors baseline 不变, 0 新错误
- 68/68 单元测试 PASS (含 tests/unit/workflow/create_stale_retry)
- 端到端: dacli dm drop --help + dacli workflow info --help 完整
|
2026-07-21 17:35:09 +08:00 |
|
ssw
|
72766bc629
|
docs(ADR 0015): mark P3 done (715fcb9 18 _validate.ts 统一 import)
|
2026-07-21 17:21:39 +08:00 |
|
ssw
|
715fcb9a59
|
feat(dacli): P3 全量 18 _validate.ts → ValidationError 一源
每个 per-module _validate.ts 之前都自己 declare `export interface
ValidationError { field?, message, code? }` (跟 _error_codes.ts 完全一致),
导致跟 _error_codes.ts 定义漂移 (有的加 step/stepName, 有的加 docstring,
字段含义略不同但定义都一样).
这次统一 18 文件 import { ValidationError } from '../_error_codes.ts',
让所有 step machine 输出格式 + aggregate 跨模块一致.
机械改造:
- 18 文件: 删本地 export interface ValidationError block
- 加 `import { ValidationError } from '../_error_codes.ts'`
- 5 个文件 (dict/form/menu/role/workflow) import 因 docstring 在前, 落
在 interface 之后, 第二次 fix-up 移到 import 块首
- 总变更: 18 insertions, 131 deletions (净减 113 行, 重复 definition 没了)
验证:
- TS compile: 56 errors baseline 不变, 0 新错误
- 65/65 单元测试 (output_filter/auto_fix/report_wired 3 文件)
- blindspot_guards 12 个测试失败 (跑 `git stash` 验证: 是 pre-existing
baseline 问题, 不是本次引入)
- dacli datasource create 端到端 validation 错误格式不变
附带: docs/cmd-review/scan-2026-07-21.md 8 维度扫描报告 (含 ADR 0015
没列的 4 项新发现: workflow shim / console.log 范围扩大 / form/create 13
process.exit / DacliError 实际无重复).
|
2026-07-21 17:20:55 +08:00 |
|
ssw
|
a5c22b98d3
|
docs(0015): 源码 5 类遗留清单 (v2.2+ 实证 P0 已 done + P1-P6 待办)
基于 c637a58 wrapCommand 实证重建 (上次 86d9dac 因太早被 7cdc818 revert).
5 类遗留 (§2):
- §2.1 P0 printCommandEnd 5c 样板 ✅ DONE (c637a58)
- §2.2 P1 2 个已知 baseline 坑 (dm/drop + storage/info)
- §2.3 P2 25+ 高严重度文件批量
- §2.4 P3 18 个 _validate.ts 错误码 import 不一致
- §2.5 P4 addOutputOptions 已加但 stdout 风格不统一
- §2.6 P5 console.log + throw 统一 (4+h 大改)
- §2.7 P6 350+ 裸 process.exit 跨 session 治理 (大坑)
决策依据 (§4):
- P0 为什么 ROI 极高: 一行 helper = 30+ 行样板 + 单测 17 条已稳
- P1 紧跟: 独立 1 文件修改, 风险极低
- P3 不放 P1 前: 批量一致性调整 < 已知坑修复
- P5/P6 大坑单独排期
README §引用: ADR 索引 0001-0015 系列, 版本加 v2.2+ wrapCommand.
|
2026-07-21 17:05:31 +08:00 |
|
ssw
|
c637a589a4
|
feat(dacli): wrapCommand helper 收口 5c 样板 (P0)
P0 of ADR 0015 (源码遗留清单): 39+ 命令文件散布 printCommandEnd + process.exit
样板, 5 个重复字段 (command/appCode/fixes/duration_ms/verbose+json) 在每个出错
分支都要 copy-paste + 配 process.exit(1). 加 wrapCommand helper:
wrapCommand({command, appCode, startTime, verbose, json, fixes}, async (ctx) => {
if (failure) ctx.fail('msg', summary) // exit 1
else if (partial) ctx.partial('msg', summary)
else ctx.success(summary)
})
替换 6 命令文件样板:
- datasource/{create, delete, list, test}.ts
- dict/typecreate.ts (含 partial case)
- menu/create.ts (原本有 local printEnd, 现在切到 wrapCommand)
17 单测覆盖 (5c × 3 路径 + 必填项 + 透传参数).
后续 P1-P6 (见 ADR 0015):
- P1: storage/info.ts + dm/drop.ts 2 小坑
- P3: 18 个 per-module _validate.ts 改为统一 import 错误码
- P4: addOutputOptions 迁移 38 文件 (L1 stdout 文案统一)
- P5: console.log + throw new Error 统一收口
- P6: 350+ 裸 process.exit 跨 session 治理 (大坑)
测试: 17/17 wrapCommand 单测 + 65/65 跨模块 + 0 新 TS 错误.
端到端: datasource list/delete/test --help + menu create --help 验证.
|
2026-07-21 17:04:29 +08:00 |
|
ssw
|
7cdc8187cc
|
Revert "docs(0015-source-leftovers): 源码 5 类遗留清单 + P0-P6 优先级路线"
This reverts commit 86d9dac83d.
|
2026-07-21 16:38:00 +08:00 |
|