Files
dacli/docs/decisions
sswandClaude 60f0221561 docs(dacli): ADR 0017 smartProps unification + BS-新141 (AP-fc-9/AP-fu-4)
ADR 0017 (新文件):
- 根因 #2 (AI Login expired): NCPF/SSW 后端 LLM token 失效, dacli 端不可修
  - 检测 isLoginExpired(msg) → 跳过 SSW fallback (避免 5s/10s/20s 浪费)
  - 修复路径必须不依赖 AI: 启发式兜底 + 接受手工 JSON
- 改进 1: smartProps 抽离 SMART_PROPS public API
- 改进 2 (P0): form update --fields 集成 SMART_PROPS, AI 失败 tolerant (try/catch)
- 改进 3 (P0): applyHeuristicDictType 新启发式 (不依赖 AI, 100% 确定)
- 改进 4 (P2): applyHeuristicRelationForm 扩展 select → relationForm
- 实施: e04bcb3 (auto session end) + eca3885 (BS-新141 + 9 tests)
- 验证: typecheck 0 错 / 67 test files / 574 tests 全绿

_anti_patterns.ts 新增 2 条:
- AP-fc-9 (P0, BS-新141): --ai 只决定 jnpfKey, 不绑具体 id (dictType/modelId/
  relationField 永远空, 跟 prompt 是否含 enCode 无关). 修复走 SMART_PROPS
  启发式兜底 + 手工 JSON 补
- AP-fu-4 (P0, BS-新141): 之前 form update --fields 不集成 smartProps,
  用户被迫手工写完整 schema. v2.5+ 默认 ON, --no-smart-props 关. AI
  Login expired 不阻塞, 启发式兜底

cross-refs: BS-新131/132/133/141 + decisions/0017 + decisions/0002

来源: jxcj M2 2026-07-23 实战 + 验证实验 jxcjrelationtest/jxcjdicttest/
jxcjditest (849912141677856005/849913609722004741/849914591969281285)

Co-Authored-By: Claude <[email protected]>
2026-07-28 21:02:33 +08:00
..

dacli Architecture Decision Records (ADR)

记录 dacli 关键设计选择的完整理由 + 替代方案 + 后果, 含来源 (drift round / BS 编号 / 实战 app)。

规则

  • 每篇 ADR 标准结构 (见 template.md): Context / Decision / Alternatives / Consequences / Cross-refs
  • 编号 4 位数, 顺序递增 (0001, 0002, ...)
  • 不撤销旧 ADR; 改设计时新增 ADR 引用旧 ADR 并说明变化
  • 不入 git 的临时调试日志不属于这里

索引

编号 标题 状态
0001 FK 字段必显式 relationForm Accepted
0002 form create --ai 4 限制 Accepted
0003 form update 不同步物理表 Accepted
0004 menu type=3 必传 moduleId Accepted
0005 dict typeCreate 全平台唯一 Accepted
0006 workflow 必传 startFormId Accepted
0007 form --ai 不按依赖顺序 Accepted
0008 test run 不自动注入 FK 数据 Accepted
0009 代码注释卫生规则 Accepted
0017 tdd2 8 模块端到端 10 个 BS 固化 Accepted