Commit Graph
154 Commits
Author SHA1 Message Date
ssw 0a6df00e13 auto(27632decbddc): session end @ 2026-08-01T18:58:21 (+3f) 2026-08-01 18:58:23 +08:00
ssw 066d2cc3b5 auto(27632decbddc): session end @ 2026-08-01T10:18:05 (+4f) 2026-08-01 10:18:05 +08:00
sswandClaude 3cfba24556 feat(sswflow): migrate backend module source files
- 73 文件, 4823 行, 从 /tmp/sswflow/boot/ssw-sswflow 复制
- 11 个 Entity + 11 个 Mapper + 11 个 Service + 4 个 Engine (FlowGraph, SimulationComputeEngine, ComputeEngine, StepContext, StepResult)
- 8 个 Controller (Party, Project, Dataset, DatasetAuth, Datasource, Flow, FlowRun, Operator, SswflowCrud)
- 1 个 SswflowExecutorConfig
- 14 个算子 catalog (operators/catalog.json)
- 状态机 (ProjectPartyStateMachine, DatasetAuthStateMachine) + 测试
- DatasourceConfigMasker + 测试
- WorkflowLinkSchemaMigration (受属性保护的增量 DDL)

⚠️ **未跑 mvn install/build**: 当前 PostgreSQL `sswflow` 业务库不存在 (Task 2 阻塞), 闭源依赖 com.jnpf:jnpf-file-core-spring 不可达 (Task 3 阻塞). 代码语法/编译需环境恢复后验证.

Co-Authored-By: Claude <[email protected]>
2026-08-01 05:07:43 +08:00
ssw 361ea65cda auto(27632decbddc): session end @ 2026-08-01T01:13:49 (+2f) 2026-08-01 01:13:50 +08:00
ssw 18baa04686 chore(boot): .DS_Store 同步 (jxcj 2026-07-30 ssw-loop) 2026-07-31 21:12:22 +08:00
ClaudeandClaude 66e43a7988 fix(ssw-admin): application-dev.yml type-aliases-package 补 ssw.**.entity (BS-15)
preview/prod/test 3 个 profile 都已含 jnpf.**.entity,ssw.**.entity, 仅 dev profile 缺
(ssw-admin 升级 7.0 时遗留). dacli 路径修复后 BS-15 守卫读到该 yml, 暴露此问题.
未修复则启动报 NoSuchBeanDefinitionException: No qualifying bean of type ssw.entity.*Mapper.

Co-Authored-By: Claude <[email protected]>
2026-07-31 15:25:41 +08:00
ssw bb66dffba8 feat(boot/ssw-admin): 从 jnpf 7.0 源创建 ssw-admin 模块 (6.2→7.0 升级)
- 来源: jnpf/jnpf-java-boot/jnpf-admin/ @ 2bf6be8cda (7.0.0-RELEASE, 2026-07-21)
- 包改名: jnpf.* → ssw.* (10 个 java 文件 + SswAdminApplication)
- artifactId: jnpf-admin → ssw-admin, mainClass 同改
- parent: ssw-boot:7.0.0-RELEASE (项目自建 parent, 同步升)
- deps: 18 jnpf-*-controller + ssw-common-controller + jnpf-common-ai-core
- resources: yml 从 6.2 拷过来 + DB 名 j62→j7 + 用 7.0 源 application.yml/application-dev.yml 全替换 (含完整 config.* placeholders)
- jnpf-common-all + parent poms 走本地 maven 仓 (87+25 jars 预 install)
- SswLLMClient 重写适配 7.0 AI API:
  - 6.2 AiService/AiEntity 整类删除 (base_ai 表驱动)
  - 7.0 用 AiProperties + SpringContext 读 yml (spring.cloud.ai.openai.*)
  - spring.cloud.ai.openai 配置加在 application-dev.yml (env 占位 SSW_LLM_API_KEY)
- AuthFilter: import jnpf.util.GatewayUtil → ssw.util.GatewayUtil (我们自己重命名的)
- GatewayUtil: 加 import jnpf.util.UserProvider
- GatewayUtil + scanBasePackages 加 'ssw' (旧 patch 含义继承, 7.0 框架不再自带 ssw 扫描)
- 认证: `--add-opens java.base/*=ALL-UNNAMED` (Java 21 必须)
- 启动耗时 ~120s, 端口 30000, DB=j7, Redis=jnpf-redis
- mvn package → boot/ssw-admin/target/ssw-admin-7.0.0-RELEASE.jar (367M fat jar)

(配套 patch doc: dacli/docs/web-patches/_ssw-admin-creation-from-jnpf-7.0.md
 旧 patch _jnpf-admin-scanBasePackages-ssw.md 已标 superseded)
2026-07-31 14:26:49 +08:00
ssw db43e57f1d auto(e099a090076e): session end @ 2026-07-31T14:20:21 (+34f) 2026-07-31 14:20:21 +08:00
ssw 0f12fa1c25 auto(e099a090076e): session end @ 2026-07-31T14:18:16 (+1f) 2026-07-31 14:18:17 +08:00
ssw 286d1242ce auto(e099a090076e): session end @ 2026-07-31T13:19:26 (+2f) 2026-07-31 13:19:26 +08:00
ssw 46c394b0d0 auto(e099a090076e): session end @ 2026-07-31T13:05:53 (+1f) 2026-07-31 13:05:54 +08:00
ssw ac9bdf94e8 auto(e099a090076e): session end @ 2026-07-31T12:29:40 (+5f) 2026-07-31 12:29:40 +08:00
ssw 793fa10b96 auto(e099a090076e): session end @ 2026-07-31T12:01:26 (+11f) 2026-07-31 12:01:28 +08:00
ssw 3e89ec9b9c auto(14b5ea1b9bd9): session end @ 2026-07-31T10:31:18 (+11f) 6.2 2026-07-31 10:31:22 +08:00
ssw 3402975a95 auto(14b5ea1b9bd9): session end @ 2026-07-29T14:32:03 (+1f) 2026-07-29 14:32:03 +08:00
ssw a63e5ac7a2 auto(14b5ea1b9bd9): session end @ 2026-07-27T10:18:52 (+1f) 2026-07-27 10:18:52 +08:00
ssw 2c0696963e auto(14b5ea1b9bd9): session end @ 2026-07-26T11:29:35 (+2f) 2026-07-26 11:29:36 +08:00
ssw fa459517e2 auto(14b5ea1b9bd9): session end @ 2026-07-25T20:49:24 (+7f) 2026-07-25 20:49:25 +08:00
ssw 6cd970e03e auto(14b5ea1b9bd9): session end @ 2026-07-25T20:20:01 (+3f) 2026-07-25 20:20:01 +08:00
ssw 6ee5c71f39 auto(14b5ea1b9bd9): session end @ 2026-07-25T17:18:06 (+3f) 2026-07-25 17:18:07 +08:00
ssw ba5f1abdbe auto(14b5ea1b9bd9): session end @ 2026-07-25T15:19:24 (+3f) 2026-07-25 15:19:25 +08:00
ssw 05b8696a5a auto(14b5ea1b9bd9): session end @ 2026-07-23T19:20:56 (+3f) 2026-07-23 19:20:57 +08:00
ssw c948fc33b2 auto(14b5ea1b9bd9): session end @ 2026-07-23T18:49:07 (+3f) 2026-07-23 18:49:07 +08:00
ssw 763bc6021a auto(14b5ea1b9bd9): session end @ 2026-07-23T17:38:02 (+15f) 2026-07-23 17:38:05 +08:00
sswandClaude 13d45b29b4 merge: SSW AI proxy fixes
Co-Authored-By: Claude <[email protected]>
2026-07-22 16:56:35 +08:00
sswandClaude 98baa512ca test: cover SSW AI proxy routing
Co-Authored-By: Claude <[email protected]>
2026-07-22 16:51:31 +08:00
ssw f5ce7d925b auto(14b5ea1b9bd9): session end @ 2026-07-22T16:46:31 (+3f) 2026-07-22 16:46:31 +08:00
ssw 3fd7adcdb2 auto(bfc0cfa2c3a4): session end @ 2026-07-16T13:53:17 (+111f) 260716 2026-07-16 13:53:19 +08:00
ssw 22de5177dc auto(bfc0cfa2c3a4): session end @ 2026-07-15T21:41:12 (+9f) 2026-07-15 21:41:12 +08:00
sswandClaude 6469cfda88 stage 7: 修复 Java 编译 (Lombok annotationProcessor + jnpf-generater-base + field rename)
- ssw-jxcj-entity/pom.xml 加 maven-compiler-plugin annotationProcessorPaths
  (Java 9+ Lombok 需要显式声明 annotationProcessor, BS-新56 教训)
- ssw-jxcj-biz/pom.xml 加 jnpf-generater-base 依赖
  (codegen 引用 jnpf.util.GeneraterSwapUtil, 不在 jnpf-common-all 里)
- TopicDirectionEntity.inputnumber_num001 改成 inputnumberNum001
  (AI 幻觉字段 BS-新117 #2, Lombok @Data 按字段名生成 getter, snake_case 字段名生成 getField_under_score
   ServiceImpl 期望 getInputnumberNum001, 改名后 Lombok 生成正确 getter)
- ssw-jxcj-biz BUILD SUCCESS ✅ (8.971s)
- 已知遗留: AnnouncementController + AuditRecordController CodePreview 失败 (trigger=[])
  修复需 web UI 设计器打开 form 保存触发 trigger 修复 (本轮跳过, M2 修)

Co-Authored-By: Claude <[email protected]>
2026-07-15 21:03:28 +08:00
sswandClaude 777f81a4ab stage 4: 11 form codegen (Java entity+model+service+mapper+controller)
- 11 form × (entity + 6 model + 2 service + 1 mapper + 1 controller) = 99 Java files
- ssw-jxcj-entity/pom.xml 加 lombok 依赖 (codegen 用 @Slf4j)
- fix-entity 跑过 (8 entity 加 @TableId), 已 sed 去重
- NCPF AI Login expired 全局问题: announcement + auditrecord CodePreview 失败 (trigger 空), 2 controller 缺失, 8 controller 已生成
- Java 编译待修: lombok 注解处理器未启用 + 表别名 @TableId 重复 (后续迭代修, form 本身可用)

Co-Authored-By: Claude <[email protected]>
2026-07-15 20:20:35 +08:00
ssw cb94dc3307 auto(bfc0cfa2c3a4): session end @ 2026-07-15T18:19:20 (+1f) 2026-07-15 18:19:20 +08:00
sswandClaude 948eff9f9c stage 1: 创建 jxcj app + ssw-jxcj 模块 (entity+biz, 共享 SswMapperConfig §3.6)
- dacli app create --appCode=jxcj (systemId=847134936094737349, dbLinkId=2077163472971890688)
- 创建 boot/ssw-jxcj/{ssw-jxcj-entity, ssw-jxcj-biz} 业务模块 (无 MapperConfig, 依赖 ssw-common-biz)
- boot/pom.xml 加 <module>ssw-jxcj</module>
- mvn compile PASS

Co-Authored-By: Claude <[email protected]>
2026-07-15 18:02:54 +08:00
ssw d318864297 auto(bfc0cfa2c3a4): session end @ 2026-07-15T17:17:04 (+1f) 2026-07-15 17:17:04 +08:00
ssw e3440e037b fix(ssw): FormRepairController ClassCastException + collectDiCategories BS-新47 + FormRepairServiceImpl Java 8 compat 2026-07-15 13:43:20 +08:00
ssw 9e66931b57 feat(ssw-common): FormRepairService + SswFormRepairController (BS-新45)
R13 漂移循环发现 NCPF backend AI 不还原 jnpfKey + F_ 前缀列名.
用户澄清 NCPF backend 问题可走 ssw-common 扩展层修复.

3 新文件:
- ssw-common-biz/.../service/FormRepairService.java (interface)
- ssw-common-biz/.../service/impl/FormRepairServiceImpl.java (220 行, 18 条 label→jnpfKey 启发式)
- ssw-common-controller/.../controller/SswFormRepairController.java (POST /api/ssw/form/repair-fields)

jnpf 0 改动.
2026-07-15 12:13:31 +08:00
ssw b27264dcfa fix: SswLLMClient OpenAI 响应 schema null-check (P0 fastjson NPE)
背景: --ai 路径失败时, 错误信息显示
  Cannot invoke 'com.alibaba.fastjson.JSONArray.getJSONObject(int)'
  because the return value of 'com.alibaba.fastjson.JSONObject.getJSONArray(String)' is null

根因: SswLLMClient.java:160 链式调用
  respJson.getJSONArray('choices').getJSONObject(0).getJSONObject('message').getString('content')

LLM 限流/超时/错误响应可能只有 {error:...} 无 choices, fastjson 返回 null 后链式调用炸.

修复: 完整 null-check, 任一层为 null 抛出明确错误信息 (含响应体), 让上层能 fallback 重试.

实测: --ai 跑 5 次, 4/5 完整成功, 0 NPE.
2026-07-14 18:40:15 +08:00
ssw f66734d9a6 fix(BS-NCPF-400): SSW OpenAI proxy 解 NCPF 400 System abnormality
根因 (jnpf/后端/.../SendAiMessage.java:207-221 aiHttp):
  NCPF /visualdev/ai/form 强制发 'Authorization: Bearer' + 直接 POST {baseUrl}
  但 base_ai.baseUrl 配的是 Anthropic 兼容端点 (api.minimaxi.com/anthropic)
  缺 /v1/messages 后缀 + 缺 x-api-key / anthropic-version 头 → 400

解决方案 (合规扩展层, jnpf/ 0 改动):
  - 新增 SswLLMProxyController (/api/ssw/ai/openai-proxy)
    * 接 NCPF 的 OpenAI 格式请求 (Authorization: Bearer + OpenAI body)
    * 拆 messages → system + user
    * 转 Anthropic body, 直调 MiniMax (X-Api-Key + anthropic-version)
    * 返回 OpenAI 格式响应 (NCPF SendAiMessage.java:101-110 可解析)
  - SswLLMClient.getDefaultConfigForProxy() 暴露 base_ai 配置
  - application.yml gateway.white-url 加 /api/ssw/ai/openai-proxy (NCPF 发的 Authorization 是 base_ai.credential, 非 user token, 需 bypass AuthFilter)
  - base_ai.baseUrl 改 http://nginx/api/ssw/ai/openai-proxy (jnpf 调用入口)

验证 (POST /api/visualdev/ai/form):
  修复前: {code:400, msg:'System abnormality'} / 'AI模型连接失败'
  修复后: {code:200, data:{enCode:'ncpfRepairTest', fullName:'NCPF修复测试',
                            aiModelList:[{tableName:'ncpf_repair_test',
                                          fields:[{fieldTitle:'姓名',...},{fieldTitle:'电话',...}]}]}}

链路:
  NCPF /visualdev/ai/form
    ↓ POST baseUrl + Bearer
  SSW proxy /api/ssw/ai/openai-proxy (whitelist bypass auth)
    ↓ Anthropic 协议 + X-Api-Key
  https://api.minimaxi.com/anthropic/v1/messages
    ↓ Anthropic JSON response
  SSW proxy (包装成 OpenAI 格式)
    ↓ { choices: [...] }
  NCPF 解析 ✓

已知限制:
  - proxy 硬编码 MiniMax URL, 未来换 provider 要改 SswLLMProxyController.callMiniMaxAnthropic()
2026-07-12 13:40:01 +08:00
ssw bc18222485 restore(air): inferComponentProps (00378f2 加回)
00378f2 commit 同时 stub 化 repair/repairWorkflow (regression) 和加 inferComponentProps (新功能).
revert 00378f2 把新功能也撤了, 现从 00378f2 提取 inferComponentProps 部分加回:

- 接口: +inferComponentProps(fieldsJson, dictsJson, formsJson) 声明 (BS-新65)
- impl: +inferComponentProps 实现 + INFER_COMPONENT_PROPS_PROMPT (BS-新65)
- controller: +POST /api/ssw/ai/infer-component-props 端点

验证:
- smartProps: AI 推理 4 字段 props (从 'AI 推理失败' 变成功)
- 直接调 /infer-component-props 返回 200 + 正确 props (port min/max, status dict)
2026-07-12 13:05:37 +08:00
ssw f8d21f82b4 Revert "auto(2b9ed1c9fb01): session end @ 2026-07-07T09:42:49 (+3f)"
This reverts commit 00378f26ee.
2026-07-12 12:46:07 +08:00
ssw 6120e8bfce fix(boot): 注释残留 ssw-jyzs-biz 依赖 (jnpf-admin pom.xml L38-43)
Commit dd26a08 移除了 reactor 中的 ssw-jyzs 模块但漏掉了 jnpf-admin
对此 artifact 的依赖声明. 此 patch 用与 ssw-dr-controller 相同的
注释方式保留历史上下文, 同时避免 clean CI 找不到 artifact 失败.
Co-Authored-By: Claude <[email protected]>
2026-07-07 21:15:29 +08:00
sswandClaude dd26a08338 fix(boot): dos 编译修复 — 移除残留 ssw-jyzs 模块引用 (2026-07-07)
根因: 7bfa21f (2026-06-15) 清删了 ssw-jyzs/{pom.xml,ssw-jyzs-*,ssw-jyzs-controller}
但 boot/pom.xml 仍引用 ssw-jyzs 子模块, 且磁盘残留空 ssw-jyzs/{ssw-jyzs-biz,ssw-jyzs-entity}/target/.
mvn clean 因 'Child module ... does not exist' 失败 → 整个 reactor 无法加载.

修复: 从 boot/pom.xml modules 中移除 ssw-jyzs, 清理空目录.
验证: mvn clean package -DskipTests → BUILD SUCCESS (16.264s),
       3 jar 产物: jnpf-admin-6.2.0-RELEASE.jar (278M),
                     ssw-common-biz-6.2.0-RELEASE.jar (36K),
                     ssw-dos-biz-6.2.0-RELEASE.jar (35K).

Co-Authored-By: Claude <[email protected]>
2026-07-07 21:10:16 +08:00
ssw ce8353b3cc auto(2b9ed1c9fb01): session end @ 2026-07-07T16:05:32 (+2f) 2026-07-07 16:05:32 +08:00
sswandClaude 1156f6bd51 refactor(ssw-common): 精简 ExtDbLinkService — 删 jnpf 替代端点 + DbLinkService 接口
用户反馈 2026-07-07: "DbLinkService 在 jnpf 有没有替代方案, 如果有不要用"

复核结果 (4 端点 → 2 端点):

保留 (jnpf 无/不兼容):
  - POST /common/dblinkExt/create: 创建 DataSource
    jnpf POST /api/system/DataSource 实测 400 NPE (DbLinkBaseForm.oracleExtend null)
  - POST /common/dblinkExt/createDatabase: 真建物理库 (CREATE DATABASE)
    jnpf 无等价端点

已删 (jnpf 替代):
  - GET /common/dblinkExt/id/{enCode}: jnpf GET /api/system/DataSource
  - POST /common/dblinkExt/test: jnpf POST /api/system/DataSource/Actions/Test

同时删除 ssw.common.DbLinkService 接口 (ssw-common 自写, jnpf 无引用).
jnpf.base.service.DbLinkService 已通过 jnpf-system-biz jar 可用, 不冲突.

ExtDbLinkServiceImpl: 移除 implements DbLinkService, 移除 getIdByEnCode/testConnection,
  保留 createDbLink + createDatabase.

端到端验证: dacli app create --appCode=testFullFlow2 5/5 步骤全过.

Co-Authored-By: Claude <[email protected]>
2026-07-07 16:05:13 +08:00
ssw c55a1fa09b auto(2b9ed1c9fb01): session end @ 2026-07-07T15:55:04 (+3f) 2026-07-07 15:55:05 +08:00
ssw bc2706aa7c auto(2b9ed1c9fb01): session end @ 2026-07-07T15:53:31 (+11f) 2026-07-07 15:53:31 +08:00
sswandClaude 558a39a5bf fix(ssw-common): SswLLMClient 失败显式错误 (v0.19+ BS-新71)
源: dos 24 个 P0 漏洞 + 4 步法固化清单

之前: loadDefaultAIConfig 失败时返空 Map, chat() 看到 baseUrl=null 仅 log "配置缺失" + return null.
  端点返 code=400 "组件属性推理失败, 返回空结果", 调用方不知道为啥.

修复:
- loadDefaultAIConfig 失败 (base_ai 无启用) → RuntimeException 含详细 msg:
  "AI 配置缺失 (baseUrl=null, credential=null, model=null). " +
  "请检查 base_ai 表 (主库 dbLinkId=0) 是否有 f_enabled_mark=1 记录"
- HTTP 失败 (resp.isOk()=false) → RuntimeException 含 status + body 前 200 字符
- LLM 响应含 error 字段 → RuntimeException 含 LLM 错误
- 异常 catch → 包装 RuntimeException 透传 (不再吞)
- chat() 方法签名加 @throws RuntimeException 注 (调用方要 try/catch)

影响范围:
- 端点返 ActionResult.fail(e.getMessage()) 透传详细错误
- 调用方 (dacli smart_props, --ai 等) 收到具体错误信息

Co-Authored-By: Claude <[email protected]>
2026-07-07 15:21:06 +08:00
sswandClaude 039ae881af fix(ssw-common): SswLLMClient 改用 jnpf AiService (v0.18+)
用户反馈 (2026-07-07):
1. "ai推理好像用了环境变量,应该只用ai—base表来配置"
2. "ssw/common应该引入了jnpf基础包,不应该用sql查询"

**修改**:
- 单一源: base_ai 表 (经 jnpf AiService.getDefault())
- 删除 SSW_LLM_*/ANTHROPIC_* 环境变量分支 (Claude Code session 自动覆盖 base_ai)
- 改用 jnpf.base.entity.AiEntity + jnpf.base.service.AiService (jnpf 6.2 平台 base_ai 表交互)
- 注入 AiService 替代 JdbcTemplate 直 SQL (避免 ssw-common 直接写 SQL 查 jnpf 表)

**pom.xml 新增依赖**:
- jnpf-system-entity (AiEntity 实体)
- jnpf-system-biz (AiService + AiMapper)

**验证**:
```
[SswLLMClient] AI 配置: jnpf AiService.getDefault() (id=842469211295973445, model=MiniMax-M3)
```
不再被 Claude Code session 环境变量覆盖, 项目级 AI 配置可重现.

注: ssw-common 是 jnpf 业务/平台的扩展层 (CLAUDE.md §11.5),
   应复用 jnpf 基础包访问 jnpf 表, 不直接写 SQL.

Co-Authored-By: Claude <[email protected]>
2026-07-07 14:29:23 +08:00
ssw 00378f26ee auto(2b9ed1c9fb01): session end @ 2026-07-07T09:42:49 (+3f) 2026-07-07 09:42:50 +08:00
ssw 53d2f605e7 fix(ssw-common): SswLLMClient Anthropic X-Api-Key header (BS-新64, v0.17)
## 根因
今天 minimax 默认走 Anthropic 端点 (api.minimaxi.com/anthropic), 401 错误:
'login fail: Please carry the API secret key in the X-Api-Key field of the request header'

旧代码用 'Authorization: Bearer' (OpenAI 协议), minimax anthropic 不接受.

## 修复
按协议分支设置 Authorization header:
- OpenAI 兼容 (deepseek/jnpf官方/oa-compatible 等): 'Authorization: Bearer'
- Anthropic 兼容 (minimax/anthropic 官方): 'X-Api-Key' + 'anthropic-version: 2023-06-01'

## base_ai 配置
base_ai 表 minimaxi 行的 credential 用过期 token (51 字符),
当前会话 ANTHROPIC_AUTH_TOKEN 是新 token (125 字符).
需 SQL UPDATE base_ai.credential 同步环境变量.

## 验证
1. mvn package -pl jnpf-admin -DskipTests ✅
2. 重启 jnpf-admin (23s)
3. POST /api/ssw/ai/repair → 200 OK, 返回完整 form schema
4. dacli form create --ai '<描述>' --autoRelease 端到端跑通 ✅
   - NCPF 400 → SSW fallback → minimax/anthropic → form 自动建表成功
   - id=843949917733912901, enCode=testForm
2026-07-07 04:09:16 +08:00