Commit Graph

392 Commits

Author SHA1 Message Date
c379f5b1ea feat(ai): require admin for AI agent mutation/action endpoints
AiAgentController's endpoints relied only on the SecurityFilterChain (prod: /api/** authenticated; dev: permitAll), so any authenticated user could trigger AI writes/actions (auto-develop, local-apply, change-sets, deployment packages) - a lower bar than the comparable overlay/standard-page write endpoints which require admin.

Gate the 14 mutating/action POST endpoints with requireAdmin() (UserSession CURRENTUSER == ADMIN), aligned with PageSchemaController.requireAdmin / AdminWriteController. Read GETs and the pure validate-schema/access-check endpoints stay open. Actual three-truth writes are now admin + localhost double-gated.

Tests: AiAgentControllerTest + AiAgentApiPipelineTest run under an ADMIN session (+ AfterEach clear); added a 403 test for non-admin. 61 platform-ai tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 16:22:17 +08:00
bac69d85a7 fix(page-schema): scope typed-recipe gate to AI drafts, not designer overlay saves
putOverlay hard-rejected (400) any overlay using components/actions outside the ~35-component AI recipe whitelist. Existing converted pages use 13 unregistered component types (search-box/dialog/mapping/tabs/each/tree-select/input-date-range/…) plus 6 onEvent action types that are structurally actionType-without-type (ACTION_WITHOUT_COMPONENT), so editing+saving virtually any existing list page in the designer returned 400.

Split path: putOverlay (designer write path) now validates-and-warns instead of blocking; the strict typed gate stays on POST /api/page/schema/validate and the AI draft pipeline. Clears the only existing-page regression blocking the ai-agent merge to main. TDD: PageSchemaControllerTest#20 rewritten RED->GREEN; 37 schema tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 15:49:26 +08:00
bd4c642766 merge ai agent module 2026-06-19 14:01:09 +08:00
a51f35317f test edit form page resolution
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 17:17:48 +08:00
dbf5b6c86a fix edit form page resolution
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 17:16:45 +08:00
ccd74710fa fix schedule job notify editor
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 17:15:10 +08:00
62188a557f docs: verify treegrid entity filtering
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 16:44:21 +08:00
d218c2ba6f fix framework treegrid search and formeditgrid editors 2026-06-18 16:35:51 +08:00
b6e6964913 fix framework p2 custom views 2026-06-18 15:35:17 +08:00
55b9c201d6 docs: mark framework P2 gate complete
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 13:25:30 +08:00
ffd8c31e7e fix: gate function template downloads 2026-06-18 13:24:43 +08:00
22211b2557 feat(附件): 双态组件 + 新建/编辑保存落库打通
- 转换器 buildAttachmentField: 附件字段收敛为单个 input-file 双态组件
  (staticOn ${__readonly} 查看只读可下载/编辑可增删; joinValues:false,extractValue:false
  提交附件对象数组), 删除 each+service 容器, 查看/编辑同位置同布局
- FlowController 读路径 resolveAttachmentFields: 把保真层大写 DOCUMENT
  ({SYS_DOC_ID,FILENAME,FILESIZE}) 归一为 amis 小写契约 {id,name,value,url,sizeKb},
  修掉"查看附件空白图标"
- FlowController 写路径 normalizeAttachmentFieldsForWrite(按 url=/api/file/ 签名识别):
  修改流 → [{SYS_DOC_ID}] 交保真层 updateAttachments 对账(留/软删/不重复插);
  新建流 → 捕获 docId+剥离 DOCUMENT, 保存后用返回主键 relinkInsertedAttachments
  UPDATE sys_doc.businesskey 改挂(直接改挂、非复制 → 无 UNKNOWN 孤儿)
- FileController.upload: businesskey 右补白 36 位对齐保真层 getDoc(CHAR(36) 主键),
  否则 loadDoc 读不到新附件; 响应补 value
- 测试: converter 154 + metadata 368 全绿
  (新增 4c 读契约归一 / 4d 修改归一 / 4e 新建改挂 / FileController 补白)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 13:09:36 +08:00
75885f9d7d docs: mark framework P2 complete
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 11:19:22 +08:00
5636b37220 feat: complete framework P2 deltas 2026-06-18 11:18:40 +08:00
be9d1c8e71 docs: record work calendar status
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 10:27:08 +08:00
eafd872271 feat: restore work calendar view 2026-06-18 10:26:07 +08:00
03bf036d87 docs: record treegrid entity filtering status
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 10:10:28 +08:00
1ef3de1cc2 fix: restore entity type filtering for treegrid views
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 10:09:41 +08:00
9cdd043af3 docs: record schedule and data import status
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 10:01:15 +08:00
c9e4d35ca1 feat: wire schedule notifications and data import downloads
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 09:59:55 +08:00
46dfa9c5a2 docs: record script editor status
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 09:40:36 +08:00
3523007f16 feat: add framework script editor actions
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 09:39:07 +08:00
0b8a9c4ce4 docs: record process monitor status
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 09:03:45 +08:00
a019af8e3a feat: wire process monitor actions 2026-06-18 09:02:54 +08:00
7192c2aaa6 docs: record process form removal status
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 08:56:10 +08:00
1d8a4fec60 feat: wire process form removal actions 2026-06-18 08:55:17 +08:00
d82ef94da8 docs: record workflow task commit hash
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 08:12:54 +08:00
61f31527bc feat: wire my started workflow tasks 2026-06-18 08:12:15 +08:00
f736d33a20 docs(platform): record approval history completion
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 02:13:09 +08:00
21e3865dcf fix(platform): restore approval history drawer 2026-06-18 02:12:27 +08:00
278b0da422 fix(platform): resolve picker load defaults
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 01:51:59 +08:00
cfb7451e62 docs: update framework todo for short message
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 01:19:58 +08:00
723443ea1e fix(platform): implement short message send 2026-06-18 01:19:15 +08:00
f690f30552 fix(platform): repair message detail views
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 00:49:03 +08:00
bf7bb2515b fix(platform): complete picker parity and message detail
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-18 00:30:01 +08:00
c380659ef0 docs: update picker todo status
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-17 23:56:20 +08:00
0d6fab4a5e fix(converter): map user selectors to amis picker
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-17 23:48:39 +08:00
2c1ec5f54e fix(converter): avoid amis mode collision for user picker
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-17 23:15:43 +08:00
57f011e801 feat(metadata): restore legacy user transfer picker flow
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-17 22:36:33 +08:00
78d27847dd fix(metadata): make user picker searchable and show selections
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-17 22:04:26 +08:00
88ff6f6bfb feat(metadata): wire legacy process selector
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-17 21:45:12 +08:00
1581a99d75 feat(metadata): wire legacy user select picker
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-17 21:31:11 +08:00
380d1f17ca docs: update framework todo verification status
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-17 21:06:50 +08:00
5ea4607817 docs: correct framework todo completion status
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-17 20:58:12 +08:00
7fd11fe6a4 docs: add framework todo tracker 2026-06-17 20:50:32 +08:00
57c3412aff fix(flow): restore workflow task converted pages 2026-06-17 20:44:52 +08:00
5946afa6e6 docs: 同步本会话进展到状态总览(real-first/树编辑布局/时间段过滤+Wave A两项)
Some checks failed
ci / build-test-parity (push) Has been cancelled
README §0/§1.1/§1.3 更新:
- §1.3 横向能力新增 3 个全站通用保真修复(树编辑 <layout> 布局保真、搜索时间段
  过滤 date-range→DateTime[]、real-first 流解析)+ 机制①扩出整页改写器。
- §1.1 功能模板下载/枚举组 → ✅,日志组 → 🟡(删除按钮接+real-first修通+时间段通)。
- §0 加本会话进展提要(6 提交已 push origin/main)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 18:02:20 +08:00
fb8a37ddc5 fix(flow): 搜索时间段过滤——amis date-range 串转 DateTime[] 接通引擎区间查询
Some checks failed
ci / build-test-parity (push) Has been cancelled
操作日志等"时间段查不动"(设了起止仍返回全部)根因:amis input-date(time)-range
把时间段提交为 "起,止" 逗号串,但引擎 GeneralPO 的搜索 where 构建只对 DateTime[]
值生成区间条件 (col>=起 AND col<=止)——收到 String 识别不了,整条时间段过滤被忽略。
且保真层的 coerceByFlowId 只在写流(NAMED_WRITE)调用,读流(SEARCH)根本不 coerce。

修:
- FlowInputCoercer.coerceValue DATE/TIME 支持区间:含逗号 → 拆两段各 parse → DateTime[]
  (空段→null,引擎该侧不加约束);解析失败保留原值(fail-safe)。
- coerceDate 增 10-11 位 unix 秒识别(amis input-date(time)-range 默认 format=X 提交秒),
  原仅认 13 位毫秒;ISO/yyyy-MM-dd[ HH:mm:ss] 等格式不变。
- 新增 coerceSearchDatesByFlowId / coerceSearchDatesByTable:只转 DATE/TIME 列
  (其它过滤参一概不动 → 对已工作的文本/枚举/picker 搜索零回归)。
- FlowController 在 NAMED_READ / SYNTHESIZED(读流)路径调用上述方法。

注:单值日期 → DateTime(引擎 = 精确匹配,忠实老引擎);区间才是常见用法。

live 实证 SYS_DATA_LOG_SEARCH:无过滤 748179,远古区间 45643,2026-06 区间 535,
2026-06-15~18 格式化 53——不同区间返回不同结果(秒/毫秒/格式化字符串均识别)。
FlowInputCoercerTest 43 绿(+6 日期/区间用例)。已重建 platform-app + 重启 8093。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 17:57:46 +08:00
3276774037 fix(converter): 树编辑表单按 <layout> 槽位排版+隐藏未布局字段
type=3 可编辑树 master-detail(buildEditableTreeMasterDetail)原直接
form.put("body", formItems) 把 view_page <fields> 全平铺为可见输入框,
无视 <layout>——泄露 VERSION/主键/引用 id 等隐藏字段(标签还是裸列名),
且字段不按布局顺序。

老引擎 FormPageTemplateComponent 用 Vaadin CustomLayout:只渲染 <layout>
里有 <div location="X"> 槽位的字段(按文档序),无槽位字段绑进 FieldGroup
供提交但不显示。EDITFORM(convertForm)早已走 buildFormBody 复刻此行为,
唯独树编辑路径漏了。

改:buildEditableTreeMasterDetail 解析 pageRoot 后同样走 buildFormBody
(tabs + <div location> 文档序归位 + 未布局字段 hidden=true 收尾,提交不丢)。
影响 41 个可编辑树页(含功能模板下载/菜单维护/实体分类等)。

live 实证 13accf09:可见仅 ISOPEN/BUTTONCAPTION/DOCUMENT(布局序+正确标签),
VERSION/SYS_MENU_ID/VIEW_TEMPLATE_DOWNLAD_ID/VIEW_TEMPLATEID 隐藏。
全量重转 dry-run 深度 diff=41 页变(余保真),已重导收敛 0 diff。
converter 156 测试绿(树 master-detail 测试改递归取字段穿透布局容器)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 17:37:55 +08:00
b5fe995344 feat(converter): 机制①整页改写器 + 功能模板下载门控(去添加按钮/改标题)
EngineclassDelta 原仅支持「crud 工具栏追加按钮」。新增 MUTATORS 注册表
(engineclass FQN → 整页 schema 改写器),apply 拆为 applyToolbarButtons
(crud 加按钮,行为不变)+ applyMutators(任意 body 整页改写),覆盖非
crud 加按钮类 delta。

注册 FuncDownloadComponent(功能模板下载模板管理 0246d4bd / 设置 13accf09,
type=3 树页 grid → 左 input-tree + 右 button-toolbar[添加] + form):复刻
refreshRightLayout —— ① 移除右表单「添加/删除」按钮(附件随菜单/实体生成
不应手工增删,老 cl.removeComponent(insert)/(del)),空 toolbar 整条移除;
② 右表单标题改「编辑模板附件」(老 panel.setCaption)。改写器重建列表回填,
兼容转换器的不可变 List.of 列 body(原地 removeIf 会 UOE)。

未做:老「仅 VIEW_TEMPLATEID 非空才显示右表单」门控——amis form visibleOn
依赖自身 initApi 数据成循环,正解需树节点携带该列(改 TemplateTreeController),
价值低暂延后。

另核对:实体分类-枚举组(b114351f) 老 EntityEnumerateType 用 UUID 当树节点 id
(Vaadin 懒加载防重复 addItem),EIP4 树端点用 PK 唯一 + 跨级去重 + 一次性全量
建树,结构上天然规避,实测 598 节点零重复 → 已覆盖,无需移植。

全量重转 dry-run 深度 diff 确认语义仅 2 页变(余 2725 页保真),已重导上线
(live 实证 13accf09 无「添加」按钮 + 标题「编辑模板附件」)。converter 156 测试绿。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 16:57:44 +08:00