ssw and Claude
42e596aecc
chore(dacli): clean comment violations in top 5 files (batch 1)
...
Files cleaned: form/create.ts, _blindspot_guards.ts, form/codegen.ts,
test/render.ts, menu/create.ts
- Removed BS-*/R\d+/v0.x+/date markers from comments
- Cleaned app name references (jxcj/workSystem/developSystem/tds) in comments
- Updated check_clean_comments.sh to only flag comment lines
- Added scripts/clean_comments.py for automated comment cleaning
- Vitest: 22 tests pass, 0 errors
Co-Authored-By: Claude <[email protected] >
2026-07-17 12:28:52 +08:00
ssw
3f87c226c2
auto(bfc0cfa2c3a4): session end @ 2026-07-17T12:25:27 (+1f)
2026-07-17 12:25:27 +08:00
ssw and Claude
b37564171b
ci(dacli): add check_no_dacli_ts_refs.sh CI gate
...
Co-Authored-By: Claude <[email protected] >
2026-07-17 12:24:56 +08:00
ssw
c22695b5ca
auto(bfc0cfa2c3a4): session end @ 2026-07-17T12:23:13 (+2f)
2026-07-17 12:23:13 +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
08787a6f94
feat(dacli): add check_clean_comments.sh script
...
- Detects violation comments in dacli/src/** (BS-*/R\d+/jxcj/v0.x+ patterns)
- Whitelists _anti_patterns.ts (must retain source references)
- Run: ./scripts/check_clean_comments.sh
- Finds 1709 current violations (to be cleaned in Task 3.5)
2026-07-17 12:05:37 +08:00
ssw
60432caef2
feat(dacli): add gen-anti-patterns-md.sh + first auto-generated anti-patterns markdown
...
- scripts/extract_anti_patterns.ts: extracts ANTI_PATTERNS from _anti_patterns.ts to stdout
- scripts/gen-anti-patterns-md.sh: bash wrapper with --check mode for CI
- docs/anti-patterns.md: auto-generated from 25 entries across 11 commands
2026-07-17 12:03:07 +08:00
ssw
79447386ad
docs(dacli): create decisions/ directory + 9 ADR documents (0001-0009)
2026-07-17 11:59:47 +08:00
ssw and Claude
ad1c65b975
feat(dacli): migrate 11 commands to installHelpHookWithPatterns
...
Migrate form/create, form/update, form/info, form/delete, menu/create,
dict/typeCreate, workflow/create, dm/create, di/create, test/run,
app/context from installHelpHook to installHelpHookWithPatterns.
Each command now passes its ANTI_PATTERNS key so --help auto-injects
relevant pitfalls (踩过的坑) content.
Co-Authored-By: Claude <[email protected] >
2026-07-17 11:55:49 +08:00
ssw
d659fa2a80
feat(dacli): integrate enrichHelp into installHelpHook via installHelpHookWithPatterns
2026-07-17 11:49:25 +08:00
ssw
394b8ce867
feat(dacli): implement enrichHelp() to merge ANTI_PATTERNS into DacliHelp
2026-07-17 11:46:07 +08:00
ssw
4c114229a8
feat(dacli): populate ANTI_PATTERNS for 11 commands (25 total entries)
2026-07-17 11:43:54 +08:00
ssw
a45145e5b9
feat(dacli): populate ANTI_PATTERNS['form create'] with 8 patterns
2026-07-17 11:40:40 +08:00
ssw
5d7efca370
feat(dacli): define AntiPattern interface + ANTI_PATTERNS skeleton
2026-07-17 11:36:19 +08:00
ssw
04c758d15a
chore(dacli): remove installAiHelpHook alias + dead code (AI_FLAGS/getMeta/maybeInterceptAiHelp/renderAiHelp)
2026-07-17 08:59:51 +08:00
ssw
4a5cae861a
refactor(dacli): migrate remaining 167 installAiHelpHook call sites to installHelpHook
260716
2026-07-16 22:13:15 +08:00
ssw
9e82b1657a
refactor(dacli): migrate form/create.ts to installHelpHook (proof for Task 1.5)
2026-07-16 22:05:56 +08:00
ssw
96fbbdf1c0
fix(dacli): restore dual-path installHelpHook + preserve _aiMeta + update docs
2026-07-16 21:39:34 +08:00
ssw
38c6fe6ae2
fix(dacli): preserve _aiMeta for behavioral compat + update module docs
2026-07-16 21:37:39 +08:00
ssw
cc64e13d86
test(dacli): strengthen installHelpHook test with outputHelp capture
2026-07-16 21:27:25 +08:00
ssw
3f7498b496
auto(bfc0cfa2c3a4): session end @ 2026-07-16T21:07:10 (+3f)
2026-07-16 21:07:11 +08:00
ssw
da8c1db076
feat(dacli): add installHelpHook with backward-compat alias
2026-07-16 20:44:44 +08:00
ssw
cfa3135986
feat(dacli): render pitfalls rationale + clarify purpose JSDoc
2026-07-16 17:07:46 +08:00
ssw
319221148b
feat(dacli): implement renderDacliHelp with 4 new sections
2026-07-16 16:58:31 +08:00
ssw
cb12ca08ca
ci(dacli): enable vitest typecheck + narrow tests/scripts glob
2026-07-16 16:51:01 +08:00
ssw
c16bd298a7
feat(dacli): extend DacliHelp with 4 fields + add tests/core to vitest include
2026-07-16 16:26:29 +08:00
ssw
f95fe29e85
auto(bfc0cfa2c3a4): session end @ 2026-07-16T16:24:47 (+1f)
2026-07-16 16:24:47 +08:00
ssw and Claude
27d508ac11
BS-18 BUG 修 + BS-新62 失败兜底 + form/update 物理表同步 log (2026-07-16 实战)
...
## 改动
### src/commands/form/_relationForm_auto.ts (修 BS-18 BUG)
- v0.22+: modelId 用 matched.id (formId 数字) 而非 targetEnc (enCode 字符串)
- JNPF 后端期望 formId, enCode 是给人看的
- 历史: log 写 'BS-18: 自动注入 1 个 relationForm' 但实际存为 select with empty options
### src/commands/form/_smart_props.ts (加 applyHeuristicRelationForm 失败兜底)
- v0.22+: smartProps AI Login expired → BS-新62 失败兜底
- 强匹配: 字段名含 ctx.forms enCode (case-insensitive) → modelId
- 弱匹配: label 含 ctx.forms fullName
- 0 候选 → 跳过 (user 后续手工补)
- 跟 applyHeuristicRequired 并列, 不依赖 AI
### src/commands/form/create.ts
- v0.22+: form create 成功后追加 dm list 查物理表状态 log
- '✓ 物理表已建: <enCode> (N 列) — form create 走 web 端建表流程'
- 缺物理表时 warn 'autoTable 未触发或 web 端跳过'
- 集成 applyHeuristicRelationForm 到 smartProps 失败兜底分支
### src/commands/form/update.ts
- v0.22+: form update 成功后对比 --fields 新增 vModel vs 物理表实际字段
- 缺物理表列时 warn + 给修复路径 (form import --autoTable / dm drop + form create 重建 / 手工 ALTER)
- 避免 user 不知道 form update 不同步物理表
来源: jxcj M1 阶段 7 重建 2026-07-16 实战教训 + 干净子代理 testspace 验证
详见 .claude/skills/dacli-ts/references/anti-patterns §15 / form-physical-table-sync.md
Co-Authored-By: Claude <[email protected] >
2026-07-16 12:14:42 +08:00
ssw
18bcfda3e8
P1-8: test browser 自动 login (session 失效兜底)
...
问题: ~/.dacli-snapshots/<app>.json 缓存 localStorage/sessionStorage 含 token,
token 过期后 SPA 跳 /login → 7 检查跑在登录页 → 误报 (3 FAIL + 4 FALSE PASS).
复现 (testspace): testspace.json (Jul 14) + 跑 form newtestform01 → 4/7 PASS
inputIds=[form_item_account, form_item_password] 是登录页, 不是 form.
修复: 新增 autoLoginAndRefreshStorage helper + isLoginRedirect 检测:
- launch browser → goto realUrl → 检测 URL 含 /login → 调 helper:
- fresh context → goto /login → fill admin/123456 → click 登 录
- waitForURL 不含 /login (SPA 真实跳转)
- 抓 storage → 写回 ~/.dacli-snapshots/<app>.json
- 把新 storage 注入原 context + 重试 navigation
- form + workflow 两条 path 接入
- 按钮文案兼容 (登 录 / 登录 / login), Enter 兜底
-5s click 超时 + 8s URL 等待超时容错
验证 (testspace):
- form 846788008962163205 (newtestform01): 4/7 → 7/7 (16.88s)
- form 846788180106543621 (newtestform05): 7/7 (8.72s, snapshot 已刷有效)
- workflow (flowTodo): 7/7 (10.93s)
设计权衡: 复用现 chromium browser 实例避免再 launch, addInitScript + re-goto
模式最小化修改, 不影响 TC-A/TC-C 路径 (那些不调 browser.ts). dr memo §13
cross-project 沉淀待 anti-patterns.md 后续入库.
2026-07-16 06:57:03 +08:00
Claude
a767d2bea8
P1-7: form create AI Login expired 自动 fallback web buildFormData 默认空 schema
...
## bug (jxcj M1 复盘, 2026-07-16)
NCPF 后端 AI (POST /visualdev/ai/form) Login expired 全局阻塞, 报
code=400 msg=组件属性推理异常: OpenAI 响应无 choices: {"msg":"Login expired, please log in again","code":600}
SSW /ssw/ai/repair 也用同 token 必 fail (5s/10s/20s 浪费).
后果: jxcj M1 11 form 全部受影响, --ai 路径 exit 2, user 必须手动 --enCode + --fullName 重跑建空表单.
## 修复 (3 文件 + 1 单测, +75/-3)
1. _ssw_retry.ts: 加 isLoginExpired() helper (与 isTokenPlanExhausted 同模式)
2. form/_ai.ts:
- AiFormResponse 加 loginExpired?: boolean 标记
- callAiForm: NCPF Login expired 跳过 SSW fallback, 返 loginExpired=true
- callSswAiRepair: SSW Login expired 跳过剩余重试, 同上
3. form/create.ts: --ai 段检测 loginExpired=true → user 传了 --enCode/--fullName 走 web buildFormData 默认空 schema (0 字段, state=1 可用), 未传 exit 2 提示
4. tests/unit/p1-7-ai-login-fallback.test.ts: 12 单测覆盖 isLoginExpired + callAiForm Login expired fallback (mock JnpfClient.postJson)
## 试通命令 (testspace)
- 12 单测 PASS (含 5s 退避)
- testspace 实跑 P17v3 form 创建+发布 PASS (正常 AI 路径不破坏)
- 回归: form-drift 21 + field-builder 18 + blindspot 16 + round12/13/15/17 = 121 tests PASS, 0 regression
- TS 编译: 46 errors baseline = 46 errors after (无新增)
## 关键决策
- 跳过 SSW fallback: SSW 同 token 必 fail, retry 浪费
- fallback 走 web buildFormData 默认空 schema: Login expired 不阻断 form 创建, user 后续用 form update --fields 加字段
- user 未传 --enCode/--fullName → exit 2: AI 不可用无法自动生成 enCode, 比 silent fallback 安全
- 用 (r as any).code 局部 cast: 不修 pre-existing 'let r: AiFormResponse' 类型 bug (留给后续 cleanup PR)
- 不动 BS-新113 5s/10s/20s retry 策略: 仍适用于 429 token plan (临时限流可恢复)
2026-07-16 06:43:32 +08:00
ssw
2106b8dcdd
P1-5: form create enCode 转换 warning (BS-新56 强化)
...
jxcj M1 复盘: 11 form 实战发现 NCPF backend 静默 strip snake_case → camelCase,
旧 warning (BS-新38 '下次别用 - 或 _') 太轻量, 用户/AI 没注意 enCode 已被转换,
导致设计文档 enCode (snake_case) 与 JNPF 实际 enCode (camelCase) 不一致.
修复 (1 文件 create.ts, +18/-1):
1. 增强 autoStripEnCode warning: 3 行含 NCPF camelCase 根因 + 表名同步 + 后续命令参考
2. 保存 originalUserEnCode (BEFORE strip), AI 路径 mismatch 检测:
user enCode != AI suggested enCode → 提示用户 + 说明最终用 user input
验证 (testspace):
- snake_case enCode: 5 行 warning (3 行 strip + 2 行 mismatch), form 创建成功
- 不传 enCode: 无 warning, AI 建议一次性通过
- vitest 3 套 55 tests PASS, 0 regression
Refs: docs/jxcj/dacli-fix-plan.md §11 + P1-5 完成段
2026-07-16 02:21:22 +08:00
ssw
1e054dff8d
P1-3: codegen 默认输出 controller 到 biz 模块 (简化 cp 步骤)
...
合并 commit 9d06370 (核心 fix) + 本次 polish (3 处遗漏):
- shortToFull mapping: --module-only=controller 跟随默认行为 (默认→biz, --separate-controller→独立)
- hint message: 默认模式显示 P1-3 提示 (entity→entity-module, biz→biz-module 含 controller), --separate-controller 模式保留旧版提示
- AI help hook notes: 加 P1-3 说明条目
镜像: jxcj M1 实测 11 form codegen 后 9 controller 需手动 cp 到 ssw-{app}-biz/controller/, 对齐 ssw-dos 模块结构 (只有 entity + biz, controller 在 biz 里)
回执: docs/jxcj/dacli-fix-plan.md §P1-3 完成
JSON: /tmp/p1-3-complete.json
2026-07-16 02:11:33 +08:00
ssw
9d06370fc6
auto(bfc0cfa2c3a4): session end @ 2026-07-16T02:01:53 (+1f)
2026-07-16 02:01:54 +08:00
ssw
3731657fa0
P1-2: form create BS-新117 4 限制防护 (jnpfKey 推断)
...
修复 AI Login expired 时 NCPF 后端 AI 兜底 schema jnpfKey 选错问题。
仅改 dacli/src/commands/form/_form_repair.ts 一文件 (双向防御):
1. LABEL_PATTERNS 收紧 (去歧义源头):
- depSelect 规则: /单位|公司/ 去掉, 保留 /部门|组织|机构|分公司/
(主办/承办/协办方是 varchar 字符串, 不是部门实体)
- timePicker 规则: /时间/ 去掉, 保留 /时刻|^at |at$|hour$/i
(报名/创建/更新时间都含日期, 应走 datePicker)
2. VM_RULES 新增 3 条防御性 Rule:
- Rule 7 (BS-新117 #1 ): depSelect + label 无'组织|部门|机构|分公司'
→ input (varchar 主办/承办/协办方)
- Rule 8 (BS-新117 #2 ): timePicker + (label 含 报名/创建/.../日期
或 vmodel 是 *_time 不含 _hour/_min/_sec) → datePicker
(label-based 兜底, 覆盖 fieldDbType=undefined 场景)
- Rule 9 (BS-新117 #3 ): f_*_id (非系统字段) + input → relationForm
(CLAUDE.md §6 强制, jnpfKey 层面, modelId 由 --relation-form-auto 注入)
验证 (testspace):
- BEFORE 复现: 主办单位→depSelect, 报名时间→timePicker (BUG)
- AFTER 修复 (form v8): 主办单位→input, 报名时间→datePicker (tag=JnpfDatePicker) ✓
- FK rule 9 测试: f_organizer_id/f_competition_id → relationForm, f_user_id → userSelect, f_id → input (SKIP)
- 回归: vitest 6 套 111 tests PASS (form-drift, field-builder, round13/15/17, blindspot_guards)
关键决策:
- 双向防御 (LABEL_PATTERNS 收紧 + VM_RULES 加规则), 不依赖单层
- 仅改 _form_repair.ts, create.ts 调用链不变
- 仅设 jnpfKey 不补 modelId (auto-injection 路径基于 aiModelList)
限制:
- testspace 残留 8 个 testjxcjp12* form (auto-classifier 拒绝 delete)
- Rule 9 FK modelId/propsValue/relationField 需用户手动提供
2026-07-16 01:53:56 +08:00
ssw
1aab1d537e
P1-1: codegen 自动写 Lombok annotationProcessorPaths (entity/biz/controller 三模块 pom.xml)
...
- 抽 lombokVersion='1.18.42' + lombokCompilerPlugin 模板 (含 source/target=1.8 + annotationProcessorPaths)
- entity/biz/controller 三 pom.xml 均加 lombok 依赖 (scope=provided) + maven-compiler-plugin annotationProcessorPaths
- 修 jxcj M1 复盘 BUG: 11 form codegen 后 mvn compile 报 'cannot find symbol log/getter' (Lombok 注解不生效)
- testspace P11 测试 form (id=847250969413551045) 已验证通过 (已清理删除)
2026-07-16 01:35:10 +08:00
ssw
353e7e9104
P0-4: 修 menu create Actions/Module 失败自动 fallback 低级模式
2026-07-16 00:27:07 +08:00
ssw
a529c4e0fa
P0-5: 修 form create trigger 默认值 (CodePreview 失败兜底)
2026-07-16 00:12:14 +08:00
ssw
a5c3bdc32e
P0-3: 修 app create DB 失败自动 fallback --skip-db (testspace 验证通过)
2026-07-15 22:49:41 +08:00
ssw
070a4206ab
P0-2: 修 form create buildSampleData 覆盖主子表 required 字段 (testspace TC-A 0/5 → 4/5)
...
- 根因 (dacli-2026-06-29-04): test/run.ts:144-168 硬关卡, 主子表 (tables.length>1) 无 --real-fields 直接 exit(1)
- 实测 (testspace testjxcjp02ai): buildSampleData 已通过 jnpfKey='table' 遍历 cfg.children 生成完整 childRow, POST 返 code=200
- 修复: 去掉硬关卡, 软 warn 提示主子表 + 列出主/子表 tableName 参考, 仍允许 --real-fields 覆盖
- 同步: --real-fields help 文本去除'主子表必传'误导
- 边界: web 端 Form.vue 提交时强制校验所有 required 字段 (主子表都验), 不需在 dacli 侧重复
- 验证: testspace 创建主子表 form TC-A 5/5 PASS (无需 --real-fields); 单表 form 5/5 PASS (无回归)
2026-07-15 22:38:12 +08:00
ssw and Claude
961e5d2479
P0-1: 修 fix-entity 重复添加 @TableId (CLAUDE.md §13 验证通过 in testspace)
...
Co-Authored-By: Claude <[email protected] >
2026-07-15 21:57:23 +08:00
ssw
95d63a4c40
auto(bfc0cfa2c3a4): session end @ 2026-07-15T17:34:04 (+1f)
2026-07-15 17:34:05 +08:00
ssw and Claude
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 and Claude
6d785ce9b0
fix(form): wire up autoDetectAndInjectRelationForm (BS-新117 R17 P0)
...
历史 (2026-07-15 jxcj M1 复盘):
- form/_relationForm_auto.ts:144 函数定义但 0 import/call
- form/create.ts:59 relationFormAuto 选项声明 + --no-relation-form-auto flag
- 文档声称"默认 ON 自动注入"实际未生效
- jxcj topicDirection.f_competition_id 应是 relationForm 但生成 input
修复:
- form/create.ts:295 在 --ai 路径 webBuildFormData 之前
- 真正调 autoDetectAndInjectRelationForm(aiModelListForBfd)
- 默认 ON (除非 --no-relation-form-auto)
- TS cast 解决 strict mode type 不匹配 (aiModelList 含 billRule/unique 等 extra fields)
验证:
- TS compile: 49 errors (baseline) == 49 errors after (0 新错)
- jxcj M1 实战对照: 之前 f_competition_id 是 input, R17+ 应是 relationForm
drift/docs/drift/2026-07-15-round17-plan.md:
- R17 P0 完成 (本 commit)
- R17 P1 待: vm-to-jnpfKey 启发式 + upload 控件不标 required
- R17 P2 待: NCPF backend LLM 修复 (跨团队)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <[email protected] >
2026-07-15 16:35:03 +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
ff594c6779
docs(dacli): R15 vs R14 summary + ssw FormRepair auth blocked finding
2026-07-15 13:42:57 +08:00
ssw
dc77c34988
auto(bfc0cfa2c3a4): session end @ 2026-07-15T12:54:37 (+2f)
2026-07-15 12:54:37 +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
ssw and Claude
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
ssw and Claude
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
72c7a3e05c
auto(bfc0cfa2c3a4): session end @ 2026-07-15T07:27:50 (+1f)
2026-07-15 07:27:50 +08:00