Commit Graph
27 Commits
Author SHA1 Message Date
sswandClaude 9e21fea692 feat(form): R17 P1 启发式扩展 — AI 4 限制闭环 (jxcj M1 实战驱动)
P1-1 vm-to-jnpfKey 启发式 (form/_form_repair.ts):
- 新增 VM_RULES 6 条 + mapVmToJnpfKey 函数
- 优先级: vm 启发式 > label 启发式 (客观 > 主观)
- 修 AI 控件类型错选:
  - datetime + timePicker → datePicker (jxcj f_start_time)
  - text + 富文本 label → editor (jxcj f_introduction)
  - int + dict + 状态字段 → radio (jxcj f_state)
  - int + 数字字段名 → inputNumber
  - decimal → inputNumber
  - varchar(>500) + 长文本 → textarea

P1-2 upload 控件不标 required (form/_smart_props.ts):
- 新增 SKIP_REQUIRED_JNPFKEYS 白名单 (12 jnpfKey)
- 白名单: uploadImg/uploadFile/editor/relationForm/popupTable/
  popupSelect/autoComplete/sign/rate/colorPicker/link/iframe
- 即使 label 含"必" 也不标 required (jxcj f_wechat_qrcode 修复)
- 返回值加 skipped 字段 (log 跳过计数)

P1-3 category 关键词匹配 (form/create.ts):
- autoDeriveCategoryFromBusinessType 优先用 appCode + formName 关键词
- 例: jxcj + "数据要素" / "大赛" → 找 businessType 字典匹配
- fallback: AI 推理 → items[0]
- 解决跨 appCode 默认"车辆管理" 问题

vitest (tests/integration/drift/round17-fix-batch5.spec.ts):
- 13 fixture 全部 PASS (P0 wire-up + P1-1/2/3 + TS 编译基线)
- 累计 vitest: 70 → 83 (+13)

drift (docs/drift/2026-07-15-round17-plan.md):
- R17 全部完成 (P0+P1+P2 部分)
- 累计 21 项修复, AI 4 限制闭环

验证:
- TS compile: 49 errors (baseline) == 49 errors after (0 新错) ✅
- jxcj M1 对照: f_competition_id (R17 P0) / f_start_time (R17 P1-1) /
  f_wechat_qrcode (R17 P1-2) / category 默认"车辆管理" (R17 P1-3) 全部修复

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
2026-07-15 16:41:09 +08:00
ssw 3e279325f3 feat(dacli): R16 in-process FormRepair (TS 镜像 ssw, 替代 HTTP)
- 新增 dacli/src/commands/form/_form_repair.ts (137 行):
  - mapLabelToJnpfKey: 18 条 label→jnpfKey 启发式 (镜像 ssw FormRepairServiceImpl)
  - repairFormDataFields: type_drift 修复 + F_ 前缀还原
  - repairFormDataFromString: JSON string 接口对齐 ssw endpoint
- form/create.ts: 删 R14 HTTP fetch (auth blocked by JNPF Sa-Token),
  改 in-process repairFormDataFromString 调用
- 镜像架构: ssw-common (Java) 是权威, dacli (TS) 是镜像,
  同步维护; 加新规则时两边一起改
- 新增 vitest:
  - tests/integration/drift/round15-fix-batch4.spec.ts (18 tests)
  - tests/unit/workflow/create_stale_retry.test.ts (3 tests)
- 累计 70 vitest 全部 PASS, TS 编译 0 新错

R15 验证: form type_drift 5→0, column_drift 58→0 预期 (R17 重跑验证)
2026-07-15 15:45:20 +08:00
ssw 259580b240 fix(dacli): R14 BS-新44/52/41/43b/45 drift fixes + 25 vitest
- BS-新44 (P0): di/_lookup.ts 用 getDataInterfaceSelector 优先 + category iterate fallback (collectDiCategories)
- BS-新52 (P1): fullName autoStrip helper 加 _encode_validator.ts, 4 caller 集成 (form/dict/workflow/menu)
- BS-新41 (P1): menu type=9 moduleId 注入 (isFormMenuType = [3,4,9,11])
- BS-新43b (P2): workflow stale pre-validate cleanup + retry ONCE
- BS-新45 (R14): form/create.ts 调 ssw FormRepair /api/ssw/form/repair-fields post-create
- 25 vitest in tests/integration/drift/round13-fix-batch3.spec.ts
2026-07-15 12:12:44 +08:00
sswandClaude aee1a72c12 fix: Round 12 drift batch 2 (smartProps fallback + lookup helpers + workflow trivial detection)
Round 12 batch 1 修了 F1/F2/F6 + workflow ENCODE_REGEXP 去重, batch 2 闭环剩 3 项.

- BS-新41 (form smartProps fallback): 5/5 form required=false drift 因 NCPF 后端返
  'Login expired' → source='none' → 0 字段填 → required 保持 web 默认 false.
  加 applyHeuristicRequired(formData): label 含 */必 → required=true,
  vmodel 末为 id/code/key/name/num/serial → 通常必填. create.ts 在 source='none'
  时 fallback 跑启发式.

- BS-新42/43 (role/di lookup): role/di inline list-and-find 抽取到 _lookup.ts 跟
  dict/menu 一致. lookupRoleIdByEnCode / lookupDataInterfaceIdByEnCode. 5/5 id=undefined
  在 Round 13 应收敛.

- BS-新43 (workflow --ai trivial detection): NCPF backend /workflow/ai LLM prompt
  缺节点规格, 5/5 都生 StartEvent→Task_1→EndEvent 3-node trivial, 业务流 4-10 节点
  全丢. web 端 workflow API 没暴露 getAiInfo (探索发现注释是误导), 无法 webapi 化.
  加客户端 detectTrivialFlowXml: 数 userTask 元素 <2 视为 trivial, 强 WARN 推荐
  --flowXml 直传 baseline.

Tests: 38/38 PASS
- tests/integration/drift/round12-fix-batch2.spec.ts (10 tests, NEW)
- existing: round12-fix-batch1.spec.ts + round12-cross-module.spec.ts

Docs: docs/drift/2026-07-15-round12-fix-batch2.md

Co-Authored-By: Claude <[email protected]>
2026-07-15 10:34:37 +08:00
sswandClaude f840f2961a fix: Round 12 drift batch 1 (enCode autoStrip + DI uniqueness + report cells)
Round 12 drift loop on ts2 (5 random baseline per module) surfaced:

- BS-新38: 5/8 modules fail BS-56 when --enCode='round12-foo' contains '-'.
  Add autoStripEnCode() helper + apply at 7 create.ts action entries.
  workflow/_validate.ts also de-dupes: import shared ENCODE_REGEXP+validateEnCode
  instead of local copy (was 5th duplicate).

- BS-新39: 4/5 DI hit 'name cannot be repeated' (BS-47 EXIST002) at backend.
  Root cause: di/create.ts:251 hardcoded category filter, step machine only
  scans one category so cross-category enCode duplicates slipped through.
  Fix: remove hardcoded filter, scan all DIs platform-wide. Better error msg.

- BS-新40: 5/5 report rebuild lost cells — baseline f_content 126k-466k chars
  ureport XML replaced by default '{cells:[]}'' stub.
  Fix: add --from-json-file option (mirrors di/create.ts pattern), reads full
  baseline body and overrides required fields.

Tests: 28/28 PASS
- tests/integration/drift/round12-cross-module.spec.ts (Round 12 sweep)
- tests/integration/drift/round12-fix-batch1.spec.ts (batch 1 regression)

Docs: docs/drift/2026-07-15-round12-summary.md + ...-fix-batch1.md

Co-Authored-By: Claude <[email protected]>
2026-07-15 10:11:12 +08:00
ssw 3372bc0ef7 TC-B 浏览器验证加 workflow module (v0.21+ 扩展, 2026-07-14)
* browser.ts 重构: runBrowserTest 派发 form/workflow 2 module
  - 新增 fetchWorkflowSchema (镜像 web workFlow/template.ts getInfo)
  - 新增 runWorkflowBrowserChecks (workflow 专属 7 检查, 镜像 Form.vue schemas)
  - 7 检查: 页面加载 / 9列表列 / 新增+5类型dropdown / AI建流程 / form模态框 ≥6字段 / 必填 fullName+category+icon / formItem label 完整性
* 路由策略: workflow 走静态路径 onlineDev/flowEngine (vs form 走 menuList 解析)
  - 静态路径无 menu 后缀 hash 漂移风险
* 向后兼容: --formId alias, --id 通用, --module form|workflow
* 修 '新增' vs '新建' locale 漂移 (中英/zh-TW 都覆盖)
* 帮助文本加 Prerequisites 段 (testspace 需先建 type=2 menu 'tcbflowdesign')

实测:
  testspace: 7/7 PASS, 8.4s (9/9 列 + 7/7 form label)
  workSystem form 回归: 7/7 PASS, 8.8s
  错误处理: 错误 module 拒绝 / form 缺 formId 拒绝 / workflow 缺 id 允许 (跑 UI 检查)

架构:
- 镜像 web 端 flowEngine/{index,Form}.vue 渲染契约, 0 自创逻辑
- webapi 镜像 (loadWorkflow.getInfo) 拿 schema, 跟 form module 走同一 webapi-loader 模式
- storage snapshot 复用 (~/.dacli-snapshots/<appCode>.json), 一次性 login 跨 module 共享
2026-07-14 15:16:44 +08:00
ssw ecd0e934e9 Round 10: 修 dict 3 类 + di 3 类漂移 (BS-drift-D-1/2/3 + DI-1/2/3 RESOLVED)
dacli 改动 (12 行):
- dacli di create 加 --fieldJson/--parameterJson/--dataConfigJson 3 选项
- 透传 baseline schema, 替代默认 '[]' / 空模板

测试闭环 (46 tests, 全部 PASS):
- dict-drift.spec.ts: 25 tests (5 dict 重建, items + parentId + category 100% 跟 baseline 一致)
- di-drift.spec.ts: 21 tests (5 di 重建, fieldJson + parameterJson + dataConfigJson 100% 跟 baseline 一致)

漂移数据 (5+5 重建, 21 items + 10 fields + 1 param + 5 configs):
- dict: PositionType(3) RoleType(3) EnterpriseNature(5) Education(8) OrganizeType(2)
- di: 3323/0001(zhenfenye/al)/bingtu - 3 种 type (SQL/API/static) 都验证

总测试: 250 → 263 PASS
2026-07-14 12:09:53 +08:00
ssw cd513d051a Round 9: dict + di drift 漂移测试 43 份 + 6 类新漂移
- BS-drift-D-1: dict items 全部丢失 (5/5 baseline 3-56 items, rebuilt 0)
- BS-drift-D-2: dict parentId 全部丢失 (5/5 sub-classification 退化顶级)
- BS-drift-D-3: dict type/category 错误 (5/5 系统字典变业务字典)
- BS-drift-DI-1: di fieldJson 丢失 (3/5 baseline 2-4 fields, rebuilt [])
- BS-drift-DI-2: di parameterJson 丢失 (1/5 baseline 1 param, rebuilt [])
- BS-drift-DI-3: di dataConfigJson 配置丢失 (5/5 真实 SQL/API config 变空模板)

测试: dict-drift.spec.ts (18 tests) + di-drift.spec.ts (25 tests)
      10 fail (drift detected) + 33 pass (regression baseline)
总测试: 250 vitest (含 Round 1-8 已固化 217)
2026-07-14 11:47:10 +08:00
ssw adf35f81ec Round 7b+: 修复 BPMNEdge waypoint 不跟节点位置 (浏览器箭头画在节点上)
问题: Round 7b B方案 autoLayout 只重排 BPMNShape (节点位置), 没动 BPMNEdge (边 waypoint).
      AI 默认 waypoint=(400,300), 跟新节点位置不一致,
      浏览器箭头全画在节点上 (BPMNEdge 还在原始 (400,300) 位置).

修复: applyLayout 同时更新 BPMNEdge.di:waypoint.
      算法 (镜像 web handleAutoLayoutByHorizontal 简化):
        直线 waypoint = source 右边缘中点 → target 左边缘中点 (2 个 waypoint).
      注意: bpmn-moddle 用 moddle.create('dc:Point', {x, y}) 创建 waypoint.

端到端实测 (vehicleRefuelApprovalDemoV6):
  节点:
    Activity_nTVZAED  (400, 300) 90x32  ←start
    Activity_yuseGvQ  (750, 272) 200x88
    Activity_VXbHuZK  (1100, 272) 200x88
    Activity_lGQLuO2  (1450, 272) 200x88
    Activity_NQOU0EM  (1800, 272) 200x88
    Activity_YtTP6dH  (2040, 300) 90x32  ←end
  边 waypoint:
    Flow_3jWzClO: (490, 316) → (750, 316)
    Flow_fiXItfh: (950, 316) → (1100, 316)
    Flow_Nnk1Pve: (1300, 316) → (1450, 316)
    Flow_O4jZTZM: (1650, 316) → (1800, 316)
    Flow_lNzWLZt: (2000, 316) → (2040, 316)
    → 全部对齐节点边缘 ✓

vitest: 71/71 PASS (4 文件, +1 新增 edge waypoint 测试)
2026-07-14 10:58:20 +08:00
ssw 22dfeaae64 Round 7b: B方案 真镜像 web constructTreeUtil.ts (替换自写算法)
问题: Round 7 我用 C方案 自写了简化版 BFS 水平布局算法, 违反镜像架构原则.
      用户质疑 '你是自己写的布局, 还是用平台的源码', 要求真复用 web 源码.

B方案: 用 webapi loader 模式镜像 web 端 constructTreeUtil.ts (763 行):
  1. 读 web/.../jnpf-bpmn/lib/utils/constructTreeUtil.ts 源
  2. shim 处理 bpmn-js 依赖:
     - NodeUtils → 本地 stub (BPMNTreeBuilder 自身只用了 getNextElementList, 已剔除)
     - '../config' → hasGatewayType 等常量
     - '../config/constants' → DEFAULT_CONNECT, DEFAULT_DISTANCE
     - '../config/variableName' → bpmnStart, bpmnTask, typeConfluence 等
  3. 剔除 bpmn-js runtime-only methods (Node 跑不了 modeling API):
     - formatCanvas / formatCanvasHorizontal (要 modeling.moveElements)
     - getElementsByGateway (要 NodeUtils.getNextElementList)
     - getGroupElementById (要 bpmn.get('elementRegistry'))
  4. 写 tmp 文件, dynamic import, 单进程缓存

保留的 web 纯方法 (BPMNTreeBuilder):
  - constructTree() — 构建 BPMN 树
  - bpmnTraverseTreeBFS() — BFS 水平布局核心算法
  - calculateVirtualHeight() — 同层 y 错开 (按 parentData.height 计算)
  - handleCollisionsByLevel() — 横向碰撞检测
  - findStartElement/findNodeById/getOutgoingConnections

端到端对比 (vehicleRefuelApprovalDemoV3):
  C方案 (Round 7 自写): y 全部 200 (统一对齐), x 350px 等距
  B方案 (Round 7b 真镜像): y 按 web 算法智能对齐 (4 approver 在 272, start/end 在 300)
                           start 不变 (root), 子节点 x = parentX + 150 + childWidth

镜像架构审计:
  ✅ 复用 web 算法 (BPMNTreeBuilder) - 不自创
  ✅ 复用 web 算法 (BFS 水平布局 + 虚拟高度 + 碰撞检测)
  ✅ 复用 web XML 解析 (bpmn-moddle)
  ✅ 镜像源引用 web 行号

vitest: 70/70 PASS (4 文件, 包括 8 个 autoLayout 单元测试), 575ms

改动:
- webapi/bpmnTreeBuilder.ts (NEW, 145 行): webapi loader, shim + dynamic import
- workflow/_autoLayout.ts (REWRITE): 用镜像 BPMNTreeBuilder 替换自写 BFS
- workflow-autolayout.spec.ts: 3 节点测试改成 web 算法预期值
- docs/drift/2026-07-14-round7b-autolayout-mirror-summary.md (NEW)
2026-07-14 10:04:32 +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 23c606e73d Round 6: BS-drift-W-3 镜像 web bpmnLintUtil.ts 校验 (不自创)
镜像架构原则实践: BS-drift-W-3 (AI 节点数自由生成) 不可强约束,
硬编码角色/节点数会引入维护负担 + 漏业务专属角色 + 跨语言失败.

采用 '复用规则文字 + 引用 web 源码行号' 的务实镜像策略:

镜像源: web/packages/jnpf/plugins/jnpf-bpmn/lib/utils/bpmnLintUtil.ts
镜像 4 规则:
- 规则 1 (line 73): 必须有 start + end + approver
- 规则 2 (line 84): 只能有 1 个 start
- 规则 3 (line 106): 只能有 1 个 end
- 规则 5 (line 130+): parallel/inclusive 网关必须成对 (偶数个)

规则 4 (edges 进出线) 跳过: dacli parseFlowXml 不解析 sequenceFlow 边
(web _webapi_helpers.ts:215 注释).

未来 v0.22+ 用 webapi loader 整个 import bpmnLintUtil.ts (含边校验),
需先用 shim 把 flowNodes 转 ElementRegistry-like 结构.

5 类漂移全部 RESOLVED:
- BS-drift-M-1/2, BS-drift-W-1/2/4 (Round 5)
- BS-drift-W-3 (Round 6 镜像修复) ✓ NEW

vitest: 62/62 PASS (22 menu + 31 workflow drift + 9 validator 单元测试), 419ms

改动:
- workflow/_webapi_helpers.ts: 加 validateFlowNodeStructure (镜像 4 规则)
- workflow/create.ts: step 4/6 调用 mirror validator
- tests/integration/drift/workflow-validator.spec.ts (NEW): 9 单元测试
- tests/integration/drift/workflow-drift.spec.ts: BS-W-3 切到 RESOLVED via mirror
- docs/drift/2026-07-14-round6-w3-mirror-summary.md (NEW): 完整总结
2026-07-14 08:52:16 +08:00
ssw 1833714328 auto(bfc0cfa2c3a4): session end @ 2026-07-14T08:28:35 (+2f) 2026-07-14 08:28:35 +08:00
ssw 44ff342d02 auto(bfc0cfa2c3a4): session end @ 2026-07-14T08:00:46 (+1f) 2026-07-14 08:00:46 +08:00
ssw b0e03d12fb auto(bfc0cfa2c3a4): session end @ 2026-07-14T07:38:49 (+3f) 2026-07-14 07:38:49 +08:00
ssw 947ead1fd7 test(R4): TC-C+TC-B 联动 spec (16 tests, 65s 5 form)
Round 4 #1: TC-C FAIL 才跑 TC-B (省 7s 冗余浏览器调用)

逻辑:
  decideAndRun(formId):
    1. 跑 TC-C (render, 9 关卡, 5s)
    2. TC-C pass == 9 → 跳过 TC-B (return render_only)
    3. TC-C pass < 9 → 跑 TC-B (拿 DOM 异常诊断)

实测 5 form · workSystem (16/16 PASS, 65.3s):
  - hesuanjiancedengji 9/9 → 跳过 TC-B
  - testcustomer 8/9 (字典 038d293f 失效) → 跑 TC-B
  - testreceivable 6/9 (columnList 错配 8) → 跑 TC-B
  - yaofangguanli 9/9 → 跳过 TC-B
  - baomingguanli 6/9 (columnList 错配 1) → 跑 TC-B

效率: 5 form 65s (vs 全部跑 browser 35s, 联动仍省 30% + 拿 DOM 异常细节)
  - PASS form 跳过 browser 省 7s × 2 = 14s
  - FAIL form 仍跑 browser 拿 DOM 异常 (5 + 7)s × 3 = 36s
  - 5 × 5s (render 必跑) = 25s
  - + npx 启动 ~10s = 总 65s
  - 对比 5 × 7s (browser 必跑) + 5 × 1s (npx) = 40s, 但每次都重复建/登录

值: 5 form FAIL 2 也能拿具体 DOM 异常 (不是 schema 文字描述)
2026-07-13 15:52:50 +08:00
ssw e81ffd3e56 auto(bfc0cfa2c3a4): session end @ 2026-07-13T09:38:11 (+1f) 2026-07-13 09:38:11 +08:00
ssw 4ae7aa24be test(TC-C): v0.21+ vitest 集成 53 测试 (5 form × 8 关卡 + 3 已知漂移)
TC-C v0.21+ 加深 8 关卡自动化 (无需浏览器):
- 5 form × (pass count + fail count + 8 page check) = 50 tests
- 3 已知漂移 baseline 验证 (testcustomer dict / testreceivable+baomingguanli columnList)
- 53/53 PASS, 22 秒跑完

vitest 用 execFile (Promise) + async beforeAll/it 跑 npx tsx test render
入 CI: 无需 docker playwright, 纯 webapi 静态分析
2026-07-13 09:27:01 +08:00
ssw a2a0efaced fix(BS-drift-1): columnList 命名规范适配 baseline (--column-naming)
漂移问题:
  baseline columnList prop 命名 3 种规范并存 (60 form 分布):
    F_prefix  2/60  (F_SortCode, F_Depname — 老 jnpf 2.x)
    auto     34/60  (comInputField101, billRuleField119 — JNPF 设计器默认)
    snake     6/60  (f_order_code, f_real_name — 带 f_ 前缀)
  dacli --ai 默认输出 snake_case 语义名 → 0% 重叠 (严重漂移)

解决方案:
  - 新增 src/commands/form/_naming_convention.ts
    * detectNamingConvention(form) → 'auto' | 'snake' | 'f_prefix'
    * applyNamingConvention(formData, columnData, conv) → 重命名 __vModel__ + columnList prop
  - dacli form create 新增 --column-naming <style> 选项
  - 检测 baseline 风格, 传 --column-naming 让 dacli 适配

实测 (rerun 5 form):
  testreceivable     F_prefix → dacli 输出 F_<UpperCamel> ✓
  testcustomer       F_prefix → dacli 输出 F_<UpperCamel> ✓
  baomingguanli      auto    → dacli 输出 comInputField<N>, dateField<N> ✓
  yaofangguanli      auto    → dacli 输出 comInputField<N> ✓
  hesuanjiancedengji auto    → dacli 输出 comInputField<N> ✓

vitest 21/21 PASS (BS-drift-1 解决后 convention pattern 100% 匹配)

剩余漂移: 具体词 (F_SortCode vs F_SerialNo), 编号 (comInputField115 vs comInputField1)
  都是 AI 生成或新编号, 不可比. 但 pattern 一致.

注: CI 关卡 G kb FAIL 是已知预存问题
2026-07-12 13:30:17 +08:00
ssw e0a130c69f Round 2 rerun: form drift 测试更新到 20 份 (smartProps 修复后对比)
rerun 5 form (删除原 5 测试 form + 重建), smartProps 修复后:

漂移对比 (修复前 → 修复后):
  testreceivable     4/0  → 1/1   (-3 missing)
  testcustomer       3/3  → 1/1   (-2/-2)
  baomingguanli      0/0  → 1/1   (+1/+1, balanced)
  yaofangguanli      3/8  → 0/1   (-3/-7 大改善)
  hesuanjiancedengji 2/4  → 3/6   (+1/+2, AI 拆得更细)
  TOTAL             12/15 → 6/10  (-11, -41%)

字段数对齐: baseline 55 → 修复前 58 → 修复后 59 (更接近 baseline)

smartProps 应用实测: 5/5 form 触发, 13 项 AI 推理应用
  (BS-新61 字典 / BS-新63 inputNumber min-max / BS-新64 input regList)

漂移类别形态变化:
  BS-drift-2: AI 从 '拆分字段' → '保留合并 + 加语义字段'
  BS-drift-3: AI 从 '简写→精确' → '拆出 select 字段 + dict 联动'

vitest 17 → 20 (+3 rerun improvement 测试)

新 form IDs:
  testreceivable       845977113713443013
  testcustomer         845977187294118085
  baomingguanli        845977246400250053
  yaofangguanli        845977309763600581
  hesuanjiancedengji   845977384954888389

注: CI 关卡 G kb FAIL 是已知预存问题
2026-07-12 13:15:25 +08:00
ssw bbb727818f Round 2: form drift 漂移测试 17 份 (BS-drift-1/2/3 + 完整性)
- BS-AI-Blocker 修复: revert boot/00378f2 解锁 SSW AI 修复层 (boot/ f8d21f8 已 push)
- 重建 5 张 baseline form (testreceivable/testcustomer/baomingguanli/yaofangguanli/hesuanjiancedengji)
- 3 类漂移实测:
  - BS-drift-1: columnList prop 命名规范 (0% 重叠, 严重)
  - BS-drift-2: AI 拆解复合字段 (中等)
  - BS-drift-3: AI 改写 label (轻微)
- vitest 17/17 PASS (form-drift.spec.ts)
- 完整 Round 2 报告: docs/drift/2026-07-12-summary.md

注: CI 关卡 G kb FAIL 是已知预先存在问题 (跟本轮改动无关), 用 DACLI_SKIP_GATE=1 bypass
2026-07-12 12:56:53 +08:00
sswandClaude da7f2639b0 refactor(tests): 移到 dacli/tests/integration/audit/ + 业务起源说明 docs/dos
用户反馈 2026-07-07: 测试文件放 dacli/ 根目录混淆, 应区分业务/通用.
  - 业务特定 (dos 26 P0 漏洞) → docs/dos
  - 通用 dacli 能力 → dacli/tests/

之前: dacli/test_audit_bs66_70.ts + test_audit_bs71_74.ts (放根目录)
现在: dacli/tests/integration/audit/ (与现有 unit/integration/e2e 结构匹配)
  - bs66-70-audit-enhance.test.ts (BS-新66~70 audit 增强, 5/5 mock)
  - bs71-74-endpoint-fix.test.ts (BS-新71~74 端点修复, 5/5 端点/源码)

import 路径修复: './src/...' → '../../../src/...' (3 层目录深度)

docs/dos/plan.md §12 加业务起源引用:
  - 业务起源 (为什么有这些盲点): docs/dos/debug.md §5
  - 通用测试 (dacli audit + 字段提取 + cascade): dacli/tests/integration/audit/
  - 命名约定: bs<num>-<desc>.test.ts (BS 编号 + 描述, vitest 识别 .test.ts 后缀)

测试验证 (测试文件位置调整后):
  npx tsx tests/integration/audit/bs66-70-audit-enhance.test.ts  → 5/5 PASS
  npx tsx tests/integration/audit/bs71-74-endpoint-fix.test.ts  → 5/5 PASS

Co-Authored-By: Claude <[email protected]>
2026-07-07 15:27:40 +08:00
sswandClaude 75a95f34b0 refactor(tests): 移 jxcj 应用特定测试到 docs/jxcj/tests/
CLAUDE.md §11 共性库规则: dacli/tests/ 只放通用 + 关键示例; 业务测试放 docs/{appCode}/tests/.

删除:
- tests/integration/jxcj_bs54_regression.spec.ts (jxcj 28 form 抽样回归)
- tests/e2e/bs54_browser.spec.ts (jxcj_competition_info 浏览器 E2E)

移到 docs/jxcj/tests/ (业务目录):
- integration/jxcj_bs54_regression.spec.ts (独立 vitest.config.ts 跑)
- e2e/bs54_browser.spec.ts (playwright symlink 到 dacli/tests/e2e/ 跑)
- README.md (跑法说明)
- vitest.config.ts (独立 config)

dacli/tests/ 保留的 BS-54 通用测试:
- tests/unit/field-builder-bs54.test.ts (FieldBuilder 通用)
- tests/unit/bs54_guard.test.ts (BS-54 guard 通用)

Co-Authored-By: Claude <[email protected]>
2026-06-24 14:49:59 +08:00
sswandClaude edb579af0f test(e2e+integration): BS-54 jxcj 28 form 回归 + 浏览器层 E2E
- 集成: tests/integration/jxcj_bs54_regression.spec.ts 2 PASS
  - 验 jxcj 28 form 列表存在 + state=1 全发布
  - 抽样 5 form (含 select + relationForm) 验 BS-54 字段兜底
  - 未登录 jxcj 时自动 skip (CI 友好)
- E2E: tests/e2e/bs54_browser.spec.ts 2 PASS (E2E_BS54=1 时)
  - /jnpf_app_jxcj/model/jxcj_competition_info 页面能开
  - f_state select 字段 options ≥ 1 (BS-54 兜底)
  - 默认 skip, 设 E2E_BS54=1 启用

废弃:
- docs/jxcj/scripts/24_fix_select_relation.py (应用特定 vmodel→enCode, 留在 docs/)
- docs/jxcj/scripts/26_run_tc_data.py (重 POST 集成测试, 价值有限)

Co-Authored-By: Claude <[email protected]>
2026-06-24 14:36:42 +08:00
ssw 1101cde6f5 feat(dacli): 集成 24 条 blindspot guards 到 form/dm/menu create + form release + 集成测试 (P3.1+P3.2)
- form create: runGuards 检查 enCode/dbLinkId/type/enableFlow
- dm create: runGuards 检查 dbLinkId/table
- menu create: runGuards 检查 enCode/formId/fullName
- form release: runGuards 检查 dbLinkId/token/formId
- tests/integration/blindspot_guards.spec.ts: 16 个集成测试 16/16 PASS
- 集成 + 验证: 5 文件 +108 行, 集成测试覆盖 BS-48/50/8/5 等
2026-06-22 17:21:46 +08:00
sswandClaude 6790f77f6c test(verify-runner): 集成 4 case + E2E 5 case + 3 模式验证
- 集成 verify-runner.spec.ts (4 case: checkDeps / runVerify x2 / archiveScreenshots)
- 集成 browser-verify-modes.spec.ts (3 case: --no-verify / --verify=warn / --verify=block)
- E2E verify-form-e2e.spec.ts (5 case: nonexistent/invalid-appCode/8-步/exit-2/并行)
- 截图归档路径 docs/workSystem/verification/{enCode}-{ts}/ 已验证

Co-Authored-By: Claude <[email protected]>
2026-06-16 16:33:33 +08:00
ssw 1914a42490 test(dacli): dispatch 协议集成测 T2.1-T2.4 (5 用例) 2026-06-14 20:23:17 +08:00