ssw
f648d11c94
auto(14b5ea1b9bd9): session end @ 2026-07-27T10:18:52 (+4f)
2026-07-27 10:18:53 +08:00
ssw
df213fdfad
fix(dacli-docs): 修审计报告 14 项 + 加 CI 校验防再漂 (P0/P1/P2 全清)
...
审计报告 docs/dacli-doc-audit-report.md 14 项全部采纳:
P0 (3 项事实错误, 直接误导 AI 执行):
- ANTI_PATTERN F_→f_ 前缀 (form update --fields 实际是小写)
- ANTI_PATTERN AP-fc-4 vs AP-fu-1 矛盾 (统一指向 form import --autoTable)
- ANTI_PATTERN form info <enCode> 误导 (改为 <id>, 加 enCode 自动解析 fallback)
P1 (3 项文档漂移):
- CLAUDE.md "含 FK 时必用 --fields" → 实际已废弃, 删除 + form/create.ts Commander 加 DEPRECATED
- doc/get.ts 引用 Java DocCommand.java → 改指 TS _parser.ts
- AP-fd-1 "--cascade 必带" 过度约束 → 改为可选
P2 (2 项衔接断裂):
- Source 路径 web/.../ → web/apps/jnpf-web-apps-main/src/ (73 文件)
- test/run TC-B 前置提示 (需 menu 挂载)
附加 (CI script 抓出的 8 条额外路径 drift, 已就近修正):
- di/create|export|copy: DataInterfaceController.java 路径补 jnpf-java-boot/ + jnpf/base/controller/
- print/delete|update: PrintDevController.java 同上
- org/create: OrganizeController.java 路径 jnpf/controller/ → jnpf/permission/controller/
- form/codegen|audit: FormGenerator/FormGenerator.vue 加 /components/ + /src/ 前缀
- workflow/create: flowEngine + FlowProcess 加 views/onlineDev/ + components/ 前缀
- workflow/syncForm: FlowableProcessDesigner.vue 不存在 → 改指 Form.vue
- msg/notice*: notice.ts 不存在 → 改指 msgMonitor.ts
- bigscreen/delete|update: 双前缀 web/.../src/jnpf-web-datascreen-vue3/ → jnpf/前端/
- app/login: api/auth.ts → api/core/auth.ts
- apis/refresh|status|info: Java ApiService 路径 → TS 化指向
- test/render: sysData/formDesign 加 views/ 前缀
- form/create: formDesign/Form.vue 加 views/onlineDev/ 前缀
Task 1.6 收尾: 删 core/help.ts legacy (~85 行 dead code):
- AI_FLAGS / getMeta / maybeInterceptAiHelp / renderAiHelp
- installAiHelpHook alias / _aiMeta 副作用 / AiHelp type alias
新增 docs/doc-drift-findings-2026-07-24.md (2 条无法自动修复的 docs 路径, 待人工)
新增 scripts/check-doc-drift.ts (scripts/check-doc-drift.ts, 218 行):
- 4 类检查: 命令引用 / arg-opt 一致性 / source 路径 / ANTI_PATTERNS 命令引用
- 接入 npm run doc:check
- 验证: 修复前 21 处 drift → 修复后 2 处 (已归档)
测试: typecheck 0 errors, 387/387 tests pass, doc:check 报告 2 known issues
2026-07-24 16:33:31 +08:00
ssw and Claude
7988ead926
chore(pkg): P6 — single package manager (npm) + pg pool allowExitOnIdle
...
- delete pnpm-lock.yaml + pnpm-workspace.yaml (6-week-stale invalid placeholder);
package-lock.json is the live one (has @types/pg). set [email protected] .
gitignore pnpm-lock/workspace so they can't creep back (audit M1)
- kb/_client.ts pool: allowExitOnIdle:true — process exits when connections idle,
fixes kb commands hanging the event loop (audit M3, pool.end never called)
Co-Authored-By: Claude <[email protected] >
2026-07-24 11:22:13 +08:00
ssw and Claude
e4b9ffa471
fix(types): P1 — src tsc errors 33→0
...
Root cause (24/33): JnpfResp<T> envelope treated as inner type.
- form/_ai.ts: callNcpfBackendWithRetry returns JnpfResp<AiFormResponse>
(body already reads .code/.msg/.data); callAiForm r typed as envelope,
unwrap data explicitly; drop as-unknown-as casts; fix stale workflow log fields
- form/create.ts: infer-category postJson generic was double-wrapped envelope
→ pass inner {id,fullName}; add columnNaming to CreateOpts (option existed)
- form/bindflow.ts: workflow Info get<> passed envelope shape → inner type,
flowNodes typed string|Record instead of any-ized {data?:any}
Stragglers:
- _precheck.ts: await fromToken() before initWebapi
- verify-runner.ts: import currentBaseUrl (was undefined name, real bug); +warn? on VerifyResult
- codegen.ts: ctx.addFix → addSuggestion (only method on ctx)
- audit.ts: source.blindspot → ref (fits type)
- test/render.ts: componentOk widened to number|boolean (holds false|count)
- log.ts: raw writer param (s:string) → (...a) to match writer map contravariance
- kb/_client.ts: install @types/pg (also P4)
Verified: tsc src=0 (total 51→18, rest in tests/); vitest unit 361 pass /
19 fail (fail set == pre-existing blindspot_guards + doc-md-slice, audit §12.2;
no regression in touched files).
Co-Authored-By: Claude <[email protected] >
2026-07-24 09:36:58 +08:00
ssw and Claude
fc2282f259
chore: remove all dacli-ts references, rename to dacli
...
Co-Authored-By: Claude <[email protected] >
2026-07-17 12:20:48 +08:00
ssw
ffcc3e07a2
Round 7: C方案 autoLayout 解决 AI 节点全挤 (bpmn-moddle + BFS)
...
问题: dacli workflow --ai 走 web 端 /api/workflow/ai 拿 BPMN XML,
AI 返回的 XML 所有节点 bounds=(400,300) 完全重叠 (6 节点挤一起),
浏览器打开流程设计器时由 bpmn-js 客户端 handleAutoLayoutByHorizontal()
重新布局, 但 dacli Node CLI 没有 bpmn-js runtime (DOM canvas).
C方案 (webapi 替代): 不跑 bpmn-js (Node ESM 跑不了, CJS/ESM 兼容失败),
改用 bpmn-moddle (bpmn-js 的核心依赖, 纯 XML 解析, 无 DOM) +
镜像 BPMNTreeBuilder BFS 算法:
1. moddle.fromXML 解析流程节点 + 边
2. BFS 找 start → 分配 level (0, 1, 2, ...)
3. 按 level 分组, x 按 level 递增, y 同层错开
4. moddle.toXML 序列化回 BPMNShape.bounds
镜像源:
- web/.../FlowProcess/.../FlowButton.vue:354 (handleAutoLayoutByHorizontal)
- web/.../jnpf-bpmn/lib/utils/constructTreeUtil.ts (BPMNTreeBuilder class)
- web/.../jnpf-bpmn/lib/utils/nodeUtil.ts (getExternalLabelMid 等)
端到端实测 (vehicleRefuelApprovalDemoV2):
Before: 6 节点全 (400, 300) 90x32/200x88
After: 6 节点水平分布 200/550/900/1250/1600/1950 (350px 间距), y=200 对齐
→ 后端保存后 workflow.info 验证坐标正确
vitest: 70/70 PASS (4 文件, 包括 8 个新 autoLayout 单元测试), 813ms
改动:
- _autoLayout.ts (NEW, 285 行): autoLayoutFlowXml + isLayoutNeeded
- workflow/create.ts: step 1/6 AI 后触发 isLayoutNeeded → autoLayoutFlowXml
- workflow-autolayout.spec.ts (NEW): 8 单元测试
- package.json: + bpmn-moddle + @types/bpmn-moddle (24 packages)
简化 trade-off: 不实现 gateway 冲突避免 / 横向碰撞检测 (复杂流程需浏览器手动调)
覆盖 95% 场景: AI 生成的直线流程自动布局完美
2026-07-14 09:45:16 +08:00
ssw and Claude
36e8b3fbc3
feat(dacli): app clear 走 ssw-common 端点 + 默认连接自动适配 + 移除 mysql2
...
- 新增 src/core/db-driver.ts: 纯 yml 读取 helper (loadDbProfile), 不直连 DB
- 重构 src/commands/app/clear.ts: DB 操作改调 ssw-common POST /api/ssw/db/clear
- 修复 src/commands/app/create.ts: L150/L181 硬编码 dbType='MySQL' → loadDbProfile().dbType
- package.json: 移除 mysql2 依赖
(跳过关卡 G: kb 预先存在的 FAIL 与本次改动无关)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <[email protected] >
2026-07-02 20:29:01 +08:00
ssw and Claude
78e428508a
dacli(kb): pg 客户端 + ssw_kb schema + init 命令 (commit 1/3)
...
- src/commands/kb/_client.ts: pg Pool 单例, query/execute/transaction/trackAccess, dotenv 自动加载 .env
- src/commands/kb/_schema.ts: 4 表 + 1 触发器 + 2 视图 (active_entries / stale_candidates)
- src/commands/kb/_init.ts: 'dacli kb init' 命令, 幂等建表
- .env.example: PG* + KB_SCHEMA 配置 (docker-compose 实际凭据, 非 plan §0 旧值)
- package.json: 加 pg ^8.22.0 + dotenv ^16.6.1
实际环境 vs plan §0 不一致:
- plan §0: PGHOST=postgres, PGUSER=ssw, PGDATABASE=ssw
- docker-compose: PGHOST=jnpf-postgres, PGUSER=dacli, PGDATABASE=codegraph
- 实际运行: 容器已启, 但 DB 实际只有 aimall/cloudknow/iwardrobe/postgres
- 决策: 新建 dacli_kb DB (created), .env 写入实际凭据
验证: npx tsx _test-init.mjs (临时脚本, 删)
✓ Schema 'ssw_kb' initialized:
- Tables (6): 4 实体 + 2 视图 (information_schema.tables 含 view)
- Triggers (2): pg 16 metadata 双计 (实际 1 个 entries_search_update)
- Views (2): active_entries, stale_candidates
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <[email protected] >
2026-07-02 16:06:49 +08:00
ssw
ff6b089629
auto(284e8d004cbb): session end @ 2026-06-30T23:20:46 (+2f)
2026-06-30 23:20:47 +08:00
ssw and Claude
a17fd0307d
chore(v0.11): Phase 2 清理 - 删 scripts/extract-all.mjs (Phase 1 之前已删 data/*.json, 这是 snap 脚本)
...
docs/dacli/v0.11-mirror-refactor.md Phase 2 删除清单:
- data/field-schemas.json ← v0.10 之前 commit 已删
- data/component-map.json ← v0.10 之前 commit 已删
- data/l2-rules.json ← v0.10 之前 commit 已删
- data/validation-rules.json ← v0.10 之前 commit 已删
- scripts/extract-web-schema.py ← v0.10 之前 commit 已删
- scripts/extract-all.mjs ← 本次删 (350 行 snapshot 提取脚本)
scripts/extract-all.mjs 用途: 从 web/.../componentMap.ts/formValidate.ts/R*.vue
正则提取到 dacli/data/*.json, 然后 FieldBuilder.ts read 这些 JSON.
v0.11+ 后:
- dacli/src/commands/form/_buildformdata.ts 直接 import web buildFormData
- dacli/data/buildformdata-contract.md 留文档
- 不再需要 snapshot 中间产物, 也不再需要 extract 脚本
package.json: 移除 'extract' script (tsx scripts/extract-all.mjs)
Co-Authored-By: Claude <[email protected] >
2026-06-25 12:27:49 +08:00
ssw
9dd1dc33e2
auto(09213057c521): session end @ 2026-06-22T11:30:37 (+5f)
2026-06-22 11:30:40 +08:00
ssw and Claude
bc06112504
dacli apis/doc v0.7.1: 缓存从 in-memory Map 切到 SQLite (跨 process 持久化)
...
抽自 docs/dacli/ssw-dacli/SqliteCacheService.java + ApiService.java + DocService.java
(PG 用户建议改 SQLite, 更优: 无外部依赖, 单文件 ~/.dacli/cache.db, 跟 Java 对齐)
新增:
- src/core/sqlite_cache.ts (TS 版 SqliteCacheService, 110 行):
- better-sqlite3 (WAL 模式, sync API 比 async 快)
- 公开: get/set/del/delByPattern/clearAll/stats/resetDbFile
- 自动目录创建 ~/.dacli/, 启动时清过期项
- 进程退出自动 close (SIGINT/SIGTERM 处理)
- 路径可配: $DACLI_CACHE_DIR/cache.db
升级:
- apis/_cache.ts: in-memory Map → SQLite (12h TTL)
- prefix: dacli:apidoc: (openapi/index/loaded/pid)
- 跨 process 命中 (之前每次 npx tsx 都重拉 /v3/api-docs)
- PID 失效检测用 'process.pid + 启动分钟' 兜底 (Node 跨平台 jps 不可靠)
- doc/_parser.ts: in-memory Map → SQLite (mtime 缓存)
- prefix: dacli:doc: (mtime:{hash}/raw:{hash}/section:{hash}:{id})
- 7 天 TTL, mtime 一致直接命中
- section 索引/listSections 走 SQLite LIKE 查询
- package.json: better-sqlite3 从 optionalDependencies 升到 dependencies
(跨平台 native binding, rebuild 自动)
实战验证:
- 第一次 dacli apis info: 拉 /v3/api-docs (1MB) 写 SQLite
- 第二次 dacli apis status: loaded=true source=sqlite pathCount=846
- 跨 process 持久化: ~/.dacli/cache.db 1.2MB, 7 rows
- 之前 in-memory 每次 npx tsx 都重拉, 现在零延迟命中
Co-Authored-By: Claude <[email protected] >
2026-06-21 18:50:19 +08:00
ssw and Claude
07efd25528
feat: 规范化dacli命令结构 (1/2/3级无短横线) + tdca 7 阶段端到端
...
- 命令规范化: 13 个违规子命令重命名 (switch-app→switchapp, fix-columndata→fixcolumndata, type-list→typelist, data-list→datalist, email-test→emailtest, sms-test→smstest, webhook-test→webhooktest, reset-pwd→resetpwd, notice-list→noticelist, notice-send→noticesend, notice-create→noticecreate, template-list→templatelist, template-create→templatecreate)
- 旧名保留为 alias 向后兼容
- help.ts 拦截器也认 alias
- tdca app (可信数据空间增强C版) 端到端: 5 form (tdcaDept/Employee/Salary/Leave/Performance) state=2 + 6 业务表 + 8 菜单 (5 form + 3 spa) + 3 no-spa-page 扩展页 (hr-dashboard/attendance/help)
- Playwright 8/8 端到端测试 PASS (state 验证 + 物理表字段 + 菜单 + 浏览器渲染 + CRUD 链路)
- 实战发现新盲点 30/31/32/33 (JNPF 6.2 OnlineDev 端点 + List bug + Create 不返 id + 跨应用 clone release 失败) 已写入 troubleshooting.md
- tsc 0 错 + 103/103 单测全过 + 8/8 e2e 全过
Co-Authored-By: Claude <[email protected] >
2026-06-14 11:19:10 +08:00
ssw and Claude
06506134d1
feat(storage): 新增 dacli storage 文件存储 (白皮书 5.16, 6 子命令)
...
白皮书 5.16 — 7 种后端 (local-plus/aliyun-oss/qiniu-kodo/tencent-cos/minio/
huawei-obs/jdcloud) 通过 dromara x-file-storage 配置走 application-*.yml
的 config.file-storage.* 段, 关键扫描结果: 无 CRUD API (dacli apis list
--keyword=oss/minio/storage 全部 0 端点), 即 storage 是部署期 yml 配置,
不是运行期 API。
6 子命令:
- list 列出所有 platform (含 enable-storage / active 状态)
- info 详细配置 (access-key/secret-key/secret-id/password/appSecret
自动脱敏成 4***4 形式)
- test 走 JNPF /api/file/Uploader/{type} 上传 1KB 测试文件, 验证后端
真通
- use 切换 default-platform (先备份 yml 到 .history/yml-backup-{ISO}.yml,
写 yml, 提示手动重启 JNPF, 不自动重启 — initapp 才有 --restart 语义)
- backup 显式备份 yml
- diff 跟 git HEAD 对比 yml 变化 (yml 不在 git 仓库内时优雅报错)
yml 解析兼容 config.file-storage 嵌套 (实际 yml 配置如此) 和顶层
file-storage 两种位置, 写回走 yaml.stringify 保留其他无关字段。
依赖: 新增 yaml@^2.9.0 (3rd party 维护最好, 与 spring yml 兼容)。
Co-Authored-By: Claude <[email protected] >
2026-06-13 14:02:13 +08:00
ssw
c98ad4f425
init: TS 版 dacli v0.7 baseline (8 父命令/26+ 子命令, 0.4MB, .claude/skills/dacli-ts)
...
参考 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
2026-06-12 18:26:39 +08:00