- 修复 dacli form lint parser 严格只认 3 元组, tds2 8D 实战用 6 元组表达 form 元数据 (webType/enableFlow/flowId) 全部被误判 0 form - regex 改为 (?:(?:None|\d+|'[^']*')\s*,\s*)* 接受 0-N 个 metadata 元素 - 验证: tds2 03_forms.py 20 form / 189 字段 / 5 BS 全部 PASS - 单元测试 10/11 (T1.9 引用已删 tdss 路径, 与本改进无关) changelog: doc/v0.8.4-changelog.md troubleshooting: 错误 37 (f_description BS-38) + 错误 38 (f_version BS-39) + 规则 R5 (dm→form 流程)
2.1 KiB
2.1 KiB
v0.8.4 Changelog (2026-06-21)
来源: tds2 8D 补全实战 (tds2 8D → 10 form + 8D menu 挂载)
改进
1. dacli form lint parser 支持 6 元组 FORMS (盲点 38/39 防御延伸)
问题 (tds2 8D 实战):
- 03_forms.py 用 6 元组表达 form 元数据:
('enCode', 'fullName', webType, enableFlow, flowId, [fields]) - webType / enableFlow / flowId 是设计期关键约束, 注释承载信息易丢失
- 旧 parser 只识别 3 元组, 6 元组被忽略, lint 报 "解析 0 form" (误判!)
修复 (1 行 regex 升级):
- 文件:
src/commands/form/_parsers.ts:32 - 旧:
/^\s*\(\s*'([^']+)'\s*,\s*'([^']+)'\s*,\s*\[/gm - 新:
/^\s*\(\s*'([^']+)'\s*,\s*'([^']+)'\s*,\s*(?:(?:None|\d+|'[^']*')\s*,\s*)*\[/gm - metadata 模式:
None或 数字 或 字符串, 逗号分隔 - 验证: tds2 03_forms.py 20 form 全部解析, BS-23/31/32/15/V2 全部 PASS
AI 防错:
- 设计期 03_forms.py 可用 6 元组表达 form 元数据, lint 不再误判 0 form
- 旧 3 元组继续兼容, 渐进迁移
待办 (tds2 8D 实战暴露, 未在本版本修复)
D-7: form create 检测 f_version 自动改 f_version_no (盲点 39)
- 业务版本号字段命名冲突
- 实战 tds2 命中 2 张 form (tds2_app, tds2_policy_template)
- 防御: form create 检测
__vModel__=='f_version'→ 自动改名 + warn
D-8: form create --tables 接受单层格式 (规则 R5)
- 旧: --tables 期望双层
{tableInfo, tableFieldList}(web 真路径) - 新: --tables 接受单层
[{table, fields}], 自动转换 - 实战 tds2 8D 命中 8/8 form --tables 路径失败
- 防御: --tables 接受单层, 自动转双层 + build tableInfo
D-9: dm create 检测 f_description 自动改 f_desc (盲点 38)
- 业务描述字段与系统自动注入列冲突
- 实战 tds2 命中 1 form (tds2_app)
- 防御: dm create 检测
field=='f_description'→ 自动改名 f_desc + warn (D-5 warn 升级为自动改)
验证
dacli form lint --from-script=docs/tds2/scripts/03_forms.py解析 20 form / 189 字段 / 5 BS 全部 PASStests/unit/form-lint.test.ts10/11 PASS (T1.9 引用已删 tdss 路径, 旧代码同样失败, 与本改进无关)