Commit Graph

359 Commits

Author SHA1 Message Date
ffb2f042d0 报表保真层安全/OOM收口(platform-report):SQLi门/IDOR授权/XXE/并发字节超时
审计揪出真问题(jatools引擎预编译不可改,全在包装层收口):
- SQL注入(Critical):${PARAM}经evalTemplate字符串拼接进SQL后prepareStatement执行(无占位符绑定)
- IDOR:render/frame对templateId无对象级授权,任意已认证用户可渲染任意报表
- XXE:报表XML经裸DocumentBuilderFactory解析(外部实体/SSRF/OOB)
- ?tpl任意本地文件读+路径穿越;RBAC旁路(固定DB账号);OOM链(结果集全量物化+无并发闸+无超时+产物多副本)

实现:
- ReportParamGuard:模板${name}引用白名单 + isSafeValue字符白名单(拒空格挡无引号注入/拒--/::) +
  身份数据域保留集{CURRENTUSER,CURRENTDEPART,CURRENTORG,USERID,DEPARTID,ORGID}剥客户端+服务端注入可信值
- ReportXmlGuard.hasDoctypeInBytes:字节级拒DOCTYPE(防BOM/UTF-16编码绕过)
- ReportTplGuard + profile守卫:?tpl限定templates-dir内、仅.xml、仅旁路profile
- ReportController.enforceReportAccess:菜单授权对象级鉴权(超管bypass/匿名跳过/认证态无身份fail-closed)
- RenderConcurrencyLimiter(429)/LimitedByteArrayOutputStream(413)/JatoolsConfig注入statement_timeout+socketTimeout
- 错误响应改通用文案(细节仅落日志)

验证:69单测全绿(TDD);真库live e2e全绿(数值注入=400/IDOR=403/合法render+PDF=200/forged USERID剥离);
对象授权SQL逐对实证;独立security-reviewer对抗复审揪修2真漏(无引号数值注入绕黑名单、身份注入护错变量名)。

残留(非本层可修):凭据外泄(模板${property("DBPassword")}同解析路径,需模板创作授权+DB只读账号);
结果集全量物化OOM根因在引擎;预编译jar高危CVE(log4j1.2.8/commons-collections3.0/bsh)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 07:51:54 +08:00
6512a706fa Merge feat/report-drill-link-rewrite: 报表钻取链接改 EIP4 渲染路由
Some checks failed
ci / build-test-parity (push) Has been cancelled
parity-nightly / nightly-parity (push) Has been cancelled
JOR <Url>reportviewer.jsp?xmluuid=X 钻取链接(HtmlExport 渲为 <a href')经 ReportService.rewriteDrillLinks
改写为 /api/report/render/X?format=html(仅 HTML 通道,短路+字面量替换)。6 单测+jar 发射证实+全语料 xmluuid 首参实证
+live round-trip 无损;点击直通待完整客户库。code review APPROVE。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 23:24:59 +08:00
61b8658f44 feat(report): 钻取链接 reportviewer.jsp → EIP4 渲染路由
JOR 报表 <Hyperlink><Url>reportviewer.jsp?xmluuid=<目标报表ID>&PARAM=${PARAM}…</Url> 经 jatools
HtmlExport 渲成 <a href='reportviewer.jsp?xmluuid=…' target='_blank'>(jar 内确认 <a href' 发射);
EIP4 下老 jsp 已失效,点击钻取 404。ReportService.rewriteDrillLinks(仅 HTML 通道,渲染后处理)正则
reportviewer\.jsp\?xmluuid=([^&'"\s<>]+) → /api/report/render/$1?format=html,其余查询参原样保留
→ 点击钻取在新标签渲出目标报表(目标自身钻取链接亦被同一步递归改写,因每次 render 都过此步)。

- 短路:无 "reportviewer.jsp" 子串原样返回(302/339 报表跳过正则);Pattern 静态编译一次。
- replaceAll(Function) 字面量拼接,即便目标 id 含 $/\ 也不破坏替换(评审 MINOR-1 收口)。
- 6 单测:真发射锚格式(单引号 href+&amp;+target=_blank)/裸&分隔/多处/无链接短路同实例/null。

验证边界:钻取行在报表明细行,eip4dev 缺源数据 → dev 渲不出 drill 链接,点击直通须完整客户库;
本批=改写逻辑单测 + jar 发射证实(HtmlExport <a href')+ 评审实证全 37 张 xmluuid 恒首参 +
live 正常报表(5558497f CJK)HTML round-trip 无损、drill 报表渲染 200 不报错。code review APPROVE。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 23:24:59 +08:00
d78de96530 Merge docs/report-bclass-chart-backlog: B 类图表 backlog + 报表收尾纪要
Some checks failed
ci / build-test-parity (push) Has been cancelled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 23:08:37 +08:00
3a04b869fe docs(report): B 类图表验证结论=暂缓为独立 ECharts 小特性 + 收尾纪要
design §7 记录 B 类图表验证:ischart=true 仅 4 张且 reportfile 全空——不是 JOR/jfreechart,
是老客户端从图表数据流(POST 写流,GET 被拒)画的 ECharts,当前降级成加载不出数据的破表。
faithful 迁移=独立特性(POST 图表端点 + 流结果→amis chart option,但图表类型/系列映射在老客户端、
每张形状不同难通用、出图保真须完整客户库),仅 4 张低优先,待产品定夺口径。用户拍板暂缓。
§6 遗留同步:中文字体保真 + PDF/Excel 下载入口已收尾(均真镜像/真验)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 23:08:37 +08:00
fda9e20fe5 Merge feat/report-export-buttons: 报表查看器 PDF/Excel 导出下载入口
Some checks failed
ci / build-test-parity (push) Has been cancelled
查看器 filter.actions(有查询条件)/headerToolbar(无)加导出 PDF/Excel 按钮,指向 /api/report/render
携当前查询参;端点对 pdf/xls 回 Content-Disposition: attachment + RFC5987 中文文件名(view_template.name),
html 仍 inline。code review 通过(注入中和+RFC5987 收口)。浏览器+curl 真验下载保真。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 23:01:56 +08:00
1b4dab9701 feat(converter): 报表查看器加导出 PDF/Excel 按钮
convertReportViewer 产导出按钮(actionType:url,blank,指向 /api/report/render 端点 + format=pdf|xls)。
有查询条件 → 落 crud.filter.actions(与 查询[submit]/重置[reset] 同排,读 filter 实时值,
URL 带各字段 ${name} 占位,amis 点击时插值为当前选择);无查询条件 → 落 headerToolbar(无参,导全量)。
field name 为校验过的元数据标识符(UiTypeMapper IDENT),裸拼安全;${name} 须保字面量供 amis 插值。

- buildReportExportParams(filter):filter 各字段 → &NAME=${NAME}。
- reportExportButton(label,url):url 动作按钮。
- 2 单测:filter.actions 含 查询/重置/导出PDF/导出Excel + URL 带 ${字段};无 filter → headerToolbar 无参。

真验(浏览器):选工程→查询(重载 iframe,不触发下载);导出PDF→下载「在建项目收付款信息表.pdf」(有效 PDF/中文正确);
导出Excel→下载 .xls。339 报表页已重转重导 eip3.sys_page_schema(329 更新)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 23:01:45 +08:00
a6eced0761 feat(report): pdf/xls 导出加 Content-Disposition attachment + 中文文件名
报表查看器 iframe 用 format=html(inline 内嵌);导出按钮用 format=pdf|xls,端点须触发
下载而非内嵌渲染。render() 对 pdf/xls 设 Content-Disposition: attachment;文件名取报表名
(view_template.name,经 RFC5987 filename*=UTF-8'' 编码中文,ASCII 回退 filename="<templateId>.<ext>"
供老客户端);html 不设此头(查看器内嵌不变)。

- ReportTemplateRepository.loadReportName(templateId):取 view_template.name 作文件名,最佳努力
  (找不到/异常返 null → 回退 templateId,绝不因取名失败影响渲染)。
- contentDisposition(fmt,name,templateId)/sanitizeFilename:纯函数。sanitizeFilename 剔除
  CR/LF/引号/反斜杠/正斜杠/控制符,杜绝响应头注入(CRLF 拆头)与 filename 属性逃逸。
  filename* 修正为 RFC5987 attr-char 口径(空格→%20、*→%2A)。
- ReportDownloadTest:5 单测(html 无头/pdf RFC5987 中文名/xls 扩展/注入中和/空名回退 templateId)。

真验(curl):pdf/xls 回 attachment + filename*=UTF-8''在建项目收付款信息表.{pdf,xls};html 无 Content-Disposition。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 23:01:45 +08:00
e9357e2eef Merge fix/report-pdf-cjk-font: 生产镜像 CJK 字体,报表 PDF 中文保真
Some checks failed
ci / build-test-parity (push) Has been cancelled
platform-app 镜像装 fontconfig + fonts-wqy-zenhei + fonts-dejavu-core;docker 真镜像内
渲染验证 PDF 中文零豆腐块、字体嵌入子集可移植、套打版式全保真(圈码/全角¥/CJK标点全覆盖)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 22:30:48 +08:00
f8ef09ebdc fix(deploy): 生产镜像装 CJK 字体 + fontconfig,报表 PDF 中文保真
platform-app 生产镜像(eclipse-temurin slim JRE)原仅装 curl,无任何字体——headless
AWT/Graphics2D + iText 渲染报表 PDF 时无 CJK 字形,套打报表中文渲成豆腐块(□)甚至报错。
装 fontconfig + fonts-wqy-zenhei(/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc,= JatoolsConfig
兜底候选 + font.dirs 覆盖)+ fonts-dejavu-core(拉丁/数字),fc-cache -f 刷新缓存。

验证(docker 真镜像 + 真库 + 真渲染,非推断):
- fc-list :lang=zh 命中 wqy-zenhei;字形覆盖探测(fonttools)报表全字符集 100% 覆盖
  (汉字/CJK 标点 、()。/圈码 ①-⑩/全角¥/数字拉丁,无缺字)。
- Linux 容器内 /api/report/render?format=pdf 渲出「在建项目收付款信息表」:嵌入子集字体
  VXMDCT+WenQuanYiZenHei(emb/sub/uni 全 yes,可移植+可抽取文本),pdftotext 中文正确,
  pdftoppm 渲图零豆腐块——多级合并表头/公式列①②③④=①+③/签字栏版式全保真,与 macOS 渲染等价。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 22:30:48 +08:00
53f3c258a9 Merge feat/report-viewer-converter: 报表查看器转换器化(Phase 2/3) + 工程 picker 认证根因修
Some checks failed
ci / build-test-parity (push) Has been cancelled
转换器对 type=200(JOR 套打)产报表查看器(crud.filter 查询条件 + /api/report/frame → iframe 渲 JOR 保真版式),
铺到全部 339 报表页;并修认证 admin 未被引擎识别为超管(CHAR(36) 补白 ADMIN 常量 exact-equals 不匹配)
致工程 picker「暂无该数据源的查询权限」的根因。code+security 双评审已收口。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 22:19:45 +08:00
9a99754f72 fix(auth): admin 引擎上下文归一为规范 ADMIN 常量(修工程 picker「暂无权限」)
工程 picker「选不到」的真因不是转换器/页面结构,而是认证 admin 的引擎身份未被识别成超管:
JWT 注入 CURRENTUSER="ADMIN"(5 字符),而引擎跳过行级数据过滤的判定是 exact
ctx.get(CURRENTUSER).equals(LoggedInUser.ADMIN)——该常量是 CHAR(36) 补白的 "ADMIN"+31 空格。
5 字符 ≠ 36 字符 → admin 被当普通用户走数据权限 → PM_PROJECT 无规则 → PrivilegeException
→ picker/列表「暂无该数据源的查询权限」。(无 token 的 curl 走 ADMIN 默认上下文,故易误判后端正常。)

修:EngineContextBinder.bind() 对系统管理员把 CURRENTUSER 归一为引擎规范 36 字符 LoggedInUser.ADMIN,
引擎识别超管→跳过行级过滤(恢复引擎本就设计的 ADMIN 豁免)。isSystemAdmin 与全站 requireAdmin
逐口径对齐:userId trim 后 equalsIgnoreCase "ADMIN";account trim 后精确小写 ='admin'
(不放宽大小写——SYS_USER.ACCOUNT 无唯一约束、建号去重又区分大小写,防 'Admin' 变体账号静默提权,
安全评审 M-1)。各 requireAdmin 门控均 trim().equalsIgnoreCase,对补白形式同样判真,不破鉴权门。
非 admin 行为逐字节不变。

测试:4 个新用例(admin→36字符归一/USER_ADMINISTRATOR 不误判/account='Admin' 变体不提权/
account='admin' 精确小写识别);全 platform-auth 46 测试绿。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 22:19:34 +08:00
8e5e2410d1 feat(converter): convertReport 对含 JOR 套打的 type=200 产报表查看器
EIP3 真报表(jatools JOR 套打)此前被转换器降级成 amis 表格。现 convertReport 分流:
含 <reportfile>(JOR 套打版式,328/339)→ convertReportViewer 产 page→crud:
- api=/api/report/frame/{templateId}(currentTemplateId,缺则回落 entityId);
- filter=buildSearchFilter(查询条件,F3-1 过滤主键列)——picker 落 crud.filter 工作上下文;
- 单 html 列把 ${__url} 渲成 <iframe>(JOR HTML 独立加载、CSS 隔离保真);
- 有查询条件时 initFetch:false(等用户「查询」再加载,避免必填工程为空时空参渲染报错);
- header/footer toolbar 置空(报表查看器无新增/批量/分页)。
无 reportfile(9/339,纯数据报表)→ 保留原数据表降级行为不变。

测试:替换旧 JOR 降级用例为 4 个查看器用例(api/单 html iframe 列/picker 落 crud.filter+initFetch/
templateId 入 api/无 reportfile 保留表格);全 platform-converter 186 测试绿。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 22:19:18 +08:00
3090906f9e feat(report): /api/report/frame 端点 + Phase 2/3 报表查看器设计
报表查看器数据源端点 GET /api/report/frame/{templateId}:回显 amis CRUD 单行信封
{status:0,data:{items:[{__url}],total:1}},__url=/api/report/render/{id}?format=html&<查询参数>。
报表页是 amis crud——查询条件落 crud.filter(实测唯一能让 picker 正常加载选项的上下文;
独立 form 里 picker 弹窗恒空),单 html 列把 __url 渲成 <iframe>,JOR HTML 独立加载、CSS 隔离保真。
「选条件→查询」时 crud 携 filter 参数请求 frame→拿到带新参数的 __url→iframe 重载→按工程过滤刷新。

- reportParamsFrom:frame 专用,剥 format/tpl/page/perPage(crud 自动追加分页位),多值取首、跳空。
- buildFrameUrl:templateId 路径段 + 参数键值全 UTF-8 URL 编码,防注入(__url 注入 iframe src,
  编码确保 " & # / < > 不破坏 query 结构或逃逸属性);templateId 实为 view_template_id(UUID)编码无副作用。
- frameResult:单行信封。collectReportParams(/render)保持原有 format/tpl-only 行为不变(与 frame 分流)。
- ReportFrameTest:5 个纯逻辑单测(剥参/编码/信封/注入中和)。

design(含 Phase 2/3 实现纪要 + 认证根因)见 docs/plans/2026-06-25-报表迁移-JOR引擎重宿主-design.md §6。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 22:19:02 +08:00
b1c818fb2d Merge feat/report-jor-rehost: JOR 报表引擎重宿主(Phase 1 后端 + /api/report)
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-25 17:56:50 +08:00
702b5e9229 feat(report): JOR(jatools)报表引擎重宿主 — platform-report 后端 + /api/report 端点
EIP3 真报表=jatools JOR 套打模板(非 amis 表格)。本批次把报表引擎重宿主进 EIP4
(复用客户已持有的预编译引擎 jar,非移植 900 源文件;非重建引擎)。Phase 1 后端完成+真验。

- platform-report 模块:18 个预编译 jar(jatools 引擎 + 改造版 BeanShell + itext/jxl/
  jsqlparser/jfreechart/barcode4j/zxing/…)经项目内 local-repo(install-libs.sh)正常依赖,
  打进 fat jar(BOOT-INF/lib 已确认,非 system scope)。
- ReportService:走 jatools.engine.ReportJob(查询参数 setParameter→declareExternalVariables
  →SQL ${PARAM});headless(java.awt.headless)。三格式 HTML/PDF/XLS。
- JatoolsConfig:把 EIP4 spring.datasource 注入引擎 System2.properties(无 CWD 文件依赖)+
  注册 CJK 字体供 PDF。
- ReportController:GET /api/report/render/{templateId}?format=html|pdf|xls&<查询参数>;
  按 templateId 从 view_template(type=200)的 <reportfile> CDATA 取 JOR 渲染;?tpl= dev 覆盖。
- SecurityConfig:X-Frame-Options DENY→SAMEORIGIN(报表查看器同源 iframe 内嵌;生产 nginx 单源)。

真验:全 reactor mvn clean install 绿(0 失败);8093 端点 GET /api/report/render/{id} 三格式
HTTP 200(HTML 48K/PDF 106K/XLS 21K);查询参数 PROJECTID 流进 SQL 48×;浏览器内 amis 菜单页
(查询表单+iframe 查看器)渲染出 JOR 套打报表(在建工程项目收付款信息表,公式列/分组小计/签字栏)。

边界:Phase 2 前端「报表页 body 换查看器」当前以单页 sys_page_schema 运行态改动演示(非本提交代码);
铺到全部 339 张 type=200 报表页 = Phase 3(转换器侧生成查看器 body)。数据保真须对完整客户库验证
(eip4dev 为部分 dev 库,部分报表源表缺)。design 见 docs/plans/2026-06-25-报表迁移-JOR引擎重宿主-design.md。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 17:56:50 +08:00
2ff826505f Merge chore/a10-w1-converge-bootstrap-single-source: db/migration 平台表单一真相
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-25 15:16:35 +08:00
fa3c92b698 chore(A10 W1): 收敛重复 bootstrap,db/migration 成平台表 DDL 单一真相
W1 引入 db/migration/V1-V3 后,平台表 DDL 在迁移与各模块 bootstrap-*.sql 重复
(评审揪出的"易漂移")。本次收敛,db/migration 成唯一真相:

- 删 3 份重复 bootstrap:bootstrap-page-schema(=V1)/bootstrap-datastatus(=V2)/
  bootstrap-ai-agent(=V3)。三者无运行态 classpath 消费者(已全仓核实)。
- AiAgentDdlTest(platform-ai,原读 bootstrap-ai-agent.sql)删除,等价覆盖迁入
  platform-app 新增 PlatformMigrationDdlGuardTest:① 守 V3 声明全部 AI 平台表/索引;
  ② 守 SchemaImportCli.CREATE_DDL ≡ V1(独立 CLI 兜底 DDL 防漂移)。
- SchemaImportCli.CREATE_DDL 由包私有改 public 供上述 guard 比对;两处过时注释改指 V1。
- ci.sh 平台表预灌改指 db/migration/V1(注:app 启动 Flyway 已幂等建表,此预灌仅冗余兜底)。
- docs 对齐:AI_AGENT_AUTO_DEVELOPMENT(spring.sql.init→Flyway)、docs/sql/SYS_PAGE_SCHEMA
  /SYS_AI_AGENT 头注释(待办→已落地)、A10 design 残留收敛标完成、deploy/README 残留项标完成。

边界:platform-parity 的 bootstrap-{sys,privilege,auth,xservice,multidim,flow}.sql 是
eip3 schema 对拍测试 fixture,非平台表副本,原样保留。

验证:全 reactor mvn clean install 绿;PlatformMigrationDdlGuardTest 2/2;独立 code-reviewer
评审 GO(零 CRITICAL/HIGH/MEDIUM,含 guard substring 逻辑对真实 V1 仿真核实)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 15:16:35 +08:00
b7fbae4cae Merge deploy/a10-w4-compose-demo-fix: W4 内置演示库自洽 + W1 真验文档对齐
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-25 15:01:02 +08:00
2db44a6231 fix(A10 W4): 内置演示库自洽起栈 + 文档对齐 W1 真验
整栈 docker compose up 对内置空 postgres 真起验证(本地 daemon + PG 15.15),
揪修并文档化两处:

- postgres-init/01-create-schemas.sql(新):首次初始化预建 eip3+flowable schema。
  原空库起 flowable-service 报 "no schema has been selected to create in"——
  platform-app 的 Flyway 会自建 eip3,但 flowable 的 Liquibase 不自建 schema。
- docker-compose.yml:postgres 挂载 postgres-init/;刷新过时头注释
  (W1 Flyway 已含,不再"假定 DB 已置备"自举平台表)。
- README:验证状态改为 2026-06-25 本地真验记录——
  platform-app 在 prod profile + W1 Flyway 启动自建 eip3 落 9 张 sys_* 表、
  readiness UP、nginx 单源反代 /api→401(prod 严格认证链生效);
  flowable-service 空演示库 by-design 无法起(databaseSchemaUpdate=false 红线,
  需预置 Flowable 6.8.1 引擎 DDL),已显式文档化边界。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 15:01:02 +08:00
f7675c9c2f Merge feat/a10-w1-flyway: A10 W1 Flyway 平台表迁移(本地 PG 真验)
Some checks failed
ci / build-test-parity (push) Has been cancelled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:44:26 +08:00
7b01e918e4 feat(A10 W1): Flyway 平台表迁移单一真相(本地 PG 真验)
platform-app 加 flyway-core+flyway-database-postgresql(10.10.0,Boot BOM 管版本);db/migration/V1__sys_page_schema/V2__sys_datastatus/V3__sys_ai_agent(DDL 从既有幂等 bootstrap 迁入,V2 去测试种子行);application.yml 启 Flyway(baseline-on-migrate + baseline-version=0,只管 EIP4 新增 SYS_* 平台表,不碰客户业务表);dev/local 的 spring.sql.init 收敛移除→app 运行态 provisioning 单一走 Flyway。FlywayMigrationLocalIT 对真实 PostgreSQL 15.18 验:①全新 schema→V1-V3 建全表+幂等;②既有非空 schema(已有 sys_page_schema+数据)→baseline V0→V1-V3 幂等应用、既有行不破坏(=客户库接管)。docker build 两镜像真验过(daemon 已起)。全 reactor mvn clean install 绿(无 surefire @SpringBootTest 受 Flyway 影响)。残留 follow-up:bootstrap-*.sql(ci.sh/AiAgentDdlTest/parity fixture 用)与 db/migration 文档级重复,全收敛(删 bootstrap/ci.sh repoint)后续。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:44:26 +08:00
f5f4754e5f Merge docs/a10-w1-spec: A10 W1 Flyway 规格 + ai-agent 单一真相注释
Some checks failed
ci / build-test-parity (push) Has been cancelled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:17:42 +08:00
2507d6c435 docs(A10 W1)+bootstrap: Flyway 执行规格 + ai-agent 单一真相注释
承接 afee2d5 去重:A10 design 补 §3.1 W1 Flyway ready-to-run 规格(迁移清单/baseline-on-migrate=0/跨模块 ai-agent/spring.sql.init 收敛/dev-PG 验证门);platform-ai bootstrap-ai-agent.sql 头注释标注为唯一 classpath 源(platform-app 经依赖传递消费)。纯文档/注释,全 reactor 已绿。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:17:42 +08:00
11e668a455 Merge fix/dedup-ai-agent-bootstrap: 去重 bootstrap-ai-agent + A10 W1 Flyway 规格
Some checks failed
ci / build-test-parity (push) Has been cancelled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:16:08 +08:00
afee2d5083 fix(bootstrap)+docs(A10 W1): 去重 bootstrap-ai-agent + Flyway 执行规格
去重(§10.2 两份易漂移实锤):platform-app 与 platform-ai 各有 bootstrap/bootstrap-ai-agent.sql 且同 classpath 路径(platform-app→platform-ai 依赖传递)→spring.sql.init 解析歧义。删 platform-app 副本,单一真相归 platform-ai;dev/local 配置经依赖传递解析到该文件不变;AiAgentDdlTest 仍读自身副本。全 reactor mvn clean install 绿。A10 design 补 §3.1 W1 Flyway ready-to-run 规格(迁移清单 page-schema/datastatus/ai-agent + baseline-on-migrate=0 + 跨模块 ai-agent 处理 + spring.sql.init 收敛 + dev-PG 验证门);W1 代码未发=动客户库启动路径且 headless 无法验 migrate(PG 专有 SQL/无 PG/daemon 未起无 testcontainers),接 PG 即可执行。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:16:08 +08:00
97a0eb12ae Merge feat/a10-mvp-containerization: A10 MVP W2-W4 部署骨架
Some checks failed
ci / build-test-parity (push) Has been cancelled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:05:56 +08:00
ade4c928bb feat(deploy): A10 MVP W2-W4 容器化+nginx 单源+compose 编排骨架
platform-app/flowable-service Dockerfile(JRE21+非root+COPY 预构建 jar+健康探针);deploy/nginx.conf(单源:serve dist+反代 /api、/flowable);deploy/docker-compose.yml(4服务 postgres+platform-app+flowable-service+nginx,healthcheck/depends_on);deploy/.env.example(prod 密钥/DB env,fail-fast);deploy/systemd/*(D3 禁Docker客户兜底);deploy/README.md。验证:docker compose config 通过(4服务+插值);docker build 待 daemon(本机未起,已诚实标注)。验证揪修 flowable-service 双数据源 FLOWABLE_JDBC_*/BIZ_JDBC_* env 漏传。.gitignore 加 deploy/.env。W1 Flyway 下一批次:当前 compose 假定 DB 已置备,尚不能从零自举。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 14:05:56 +08:00
997d51c5a4 Merge docs/a10-prod-eng-design: A10 生产上线工程化 design
Some checks failed
ci / build-test-parity (push) Has been cancelled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:53:12 +08:00
191c2baf60 docs(A10): 生产上线工程化 design(待拍板 D1-D6 + W1-W6)
钉在现状的工程化设计:现状底数(2 SB 进程 platform-app/flowable-service + PG + 前端;散落 bootstrap SQL 含 bootstrap-ai-agent 两份;无 docker/nginx;PG/Flowable runbook 备而未执行)+ 目标四服务拓扑 + W1-W6 分解(Flyway 收敛/容器化/nginx 单源/compose/runbook 执行/性能灰度)+ D1-D6 待拍板(单源形态/Flyway 范围/是否容器化/密钥/灰度/生产 PG)。关键边界:保真层跑客户既有 eip3 库,EIP4 只新增平台表,Flyway 仅管新增表 baseline-on-migrate。MVP=W1-W4 不卡环境可 headless 做。§3 A10 + §7 nav 已挂。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:53:12 +08:00
6e144447ee Merge feat/parity-nightly: 夜间对拍 job(§10.2 对拍解冻)
Some checks failed
ci / build-test-parity (push) Has been cancelled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:47:03 +08:00
9dbba1b272 ci(P1 §10.2): 接夜间对拍 job 解冻对拍框架
新增 .gitea/workflows/parity-nightly.yml(cron 每日 02:00 CST + workflow_dispatch,跑 scripts/ci.sh 全量 seed+all+privilege 对拍 + 归档报告)。ParityCli 本就直连 JDBC 基线 vs 引擎 REST 逐行 diff、不一致退出码 2=「非0即阻断」内建;此前只 push 时跑,无提交的日子不跑→隐性漂移逃逸。夜间 job 补上。RowDiffTest 30/30 框架健康。§10.2 标 🟡:真正重拍刷新基线需 dev/CI 起引擎+真 DB 实跑(headless 跑不了),激活需 Gitea runner;--discover/--realprivilege 纳硬门前需真跑核实退出语义。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:47:03 +08:00
bbdeee3af7 Merge docs/scriptcommands-noop: §10.2 scriptCommands 有界修标记
Some checks failed
ci / build-test-parity (push) Has been cancelled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:40:35 +08:00
bcfb8f7102 docs(总览): §10.2 scriptCommands 哑火标记有界安全修完成(2026-06-25)
6 哑火动词改显式跳过+告警(eip4-web 68d797e);完整动态必填/选项/过滤需转换器侧数据绑定属 L 留排期。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:40:35 +08:00
afc1a8ca62 Merge docs/ai-agent-srp-done: §10.2 AiAgentService SRP 完成标记
Some checks failed
ci / build-test-parity (push) Has been cancelled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:20:00 +08:00
fa63d1c654 docs(总览): §10.2 AiAgentService SRP 收窄标记完成(2026-06-25)
AiAgentService 1846→1329(-28%):SQL 簇→AiDeploymentSqlBuilder、门禁簇→AiDraftGateValidator,行为零变更 platform-ai 79 全绿;AiRunStore 丢弃(持久化已在 AiAgentStore)。反映 origin/main 285d601。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:20:00 +08:00
285d601c3d Merge feat/ai-agent-service-split: AiAgentService SRP 收窄(§10.2,抽 SQL/门禁两簇)
Some checks failed
ci / build-test-parity (push) Has been cancelled
1846→1329 行(-28%):部署/回滚 SQL 簇→AiDeploymentSqlBuilder、草稿门禁电池→AiDraftGateValidator,各带黄金/直测;行为零变更(platform-ai 79 全绿),全 reactor mvn clean install 绿。AiRunStore 丢弃(持久化已在 AiAgentStore)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:18:53 +08:00
b409f9757f refactor(ai): 抽 AiDraftGateValidator 收窄 AiAgentService(§10.2 SRP slice 2)
把按 artifact 类型分发的门禁电池(validateDraft + 必填/amis-schema/typed-page-schema/page-recipe/实体/服务流XML/菜单/smoke-plan/render-plan 各 gate + SchemaGate 懒加载状态 + 4 个正则常量 + XML/数组校验 helper)逐方法移入新 AiDraftGateValidator;判定逻辑零变更(D3 红线焊在门禁里,搬迁不动阈值/正则/分支)。AiAgentService 1677→1329 行(累计自 1846 -28%),委托 validateDraft/validateSchemaGate/validateTypedPageSchema/typedMessages。新增 AiDraftGateValidatorTest 7 用例直测各类 pass/fail;AiAgentServiceTest 22/22 + AiAgentControllerTest 11/11 + pipeline 行为不变,platform-ai 79 全绿,全 reactor 绿。slice 3(AiRunStore)经评估丢弃:持久化已由现有 AiAgentStore 承担,另抽会重复。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:18:53 +08:00
1a57000458 refactor(ai): 抽 AiDeploymentSqlBuilder 收窄 AiAgentService(§10.2 SRP slice 1)
把 AiAgentService 内联的部署/回滚 SQL 生成簇(deploymentSql/serviceFlowSql/pageSchemaSql/menuSql/rollbackSql/serviceFlowRollbackSql/entityDeploymentNote + json/sqlString/sha256)逐字移入新 AiDeploymentSqlBuilder(构造取 ObjectMapper,终构造器内 new,不改对外构造签名);AiAgentService 1846→1677 行,SQL 文本字节零变更(红线逐字节对拍)。新增 AiDeploymentSqlBuilderTest 8 用例钉死关键 token(表名/AI_AGENT 审计字面量/ON CONFLICT/version+1/::xml·::jsonb/单引号转义/占位符回退/entityId 替换);AiAgentServiceTest 22/22 行为不变,全 reactor 绿。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 13:00:32 +08:00
1102601424 Merge docs/p0-security-closeout: 进度总览 §10.1 安全 P0 收口
Some checks failed
ci / build-test-parity (push) Has been cancelled
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 12:43:47 +08:00
add67353b0 docs(总览): §10.1 四项 P0 安全 + 评审 2 孪生 + Groovy 沙箱标记收口(2026-06-25)
§10.1 表 4 项 🔴critical→✅已修(06-25)+补安全基线批次落地块(逐项 commit/手法/验证/运维 checklist/DEFER);§0 加安全基线收口行。反映 eip4-platform eba9ce1 / eip4-web 2a37251。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 12:43:47 +08:00
eba9ce1fc1 Merge feat/groovy-sandbox-hardening: 强化 Groovy 沙箱拦 RCE 原语
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-25 安全评审 DEFER 的 MEDIUM:硬化 SecureASTCustomizer/MethodCallExpressionChecker(反射/进程执行/元编程/动态求值全拒),收口所有 Groovy sink(ScriptReplay/EditGrid/服务流)的残余沙箱弱点。TDD+1428 脚本语料零回归,全 reactor 绿。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 12:18:16 +08:00
9526e43a15 security(P0 followup): 强化 Groovy 沙箱拦 RCE 原语(2026-06-25 安全评审 MEDIUM)
SecureASTCustomizer import 白名单挡不住内联全限定名/反射/元编程/GDK 进程执行;旧 checker 仅禁 System.exit。强化 MethodCallExpressionChecker:按危险接收类(Runtime/ProcessBuilder/Process/ClassLoader/Thread/GroovyShell/GroovyClassLoader/Eval/javax.script.*/java.lang.reflect.*)+ 通用危险方法名(exec/execute/forName/newInstance/loadClass/getClassLoader/invoke/getDeclared*/get|setMetaClass)拒;System 仅拒危险方法(exit/getenv/getProperty/setProperty/load…)保留 out;metaClass 属性拒;覆盖 MethodCall/StaticMethodCall/ConstructorCall/Property。覆盖两条运行时 Groovy 路径(服务流 + onEvent/editgrid 重放,均经 SecureGroovyScriptEngineFactory)。纯 AST 零 com.eip4 依赖。TDD 8/8;1428 改写脚本语料编译零加固回归(103 失败全为 test classpath 缺 Vaadin/app 类,与加固无关)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 12:18:16 +08:00
0e0311abbd Merge feat/p0-security-hardening: P0 安全洞收口(2026-06-24 架构评审)
Some checks failed
ci / build-test-parity (push) Has been cancelled
①permitAll fail-open→fail-safe profile+prod配置+JWT弱密钥守卫 ②asUser/roles 越权 JWT 身份权威(EntityController+PickerController) ③脚本RCE/任意DROP拆控制器隔离+路径穿越守卫+Poc门禁+TodoController advanced-script 守卫 ④CI孤儿迁Gitea+JDK21。含独立 security-reviewer 对抗评审揪出的 2 个孪生漏洞(TodoController RCE/PickerController IDOR)。全 reactor mvn clean install 绿。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 11:41:37 +08:00
1a0985ffa5 ci(P0④): CI 孤儿迁 Gitea Actions + JDK21 + ci 旁路 profile
.github/workflows/ci.yml(GHA 语法在 Gitea 上孤儿+JDK17 写死)迁至 .gitea/workflows/ci.yml(JDK21)。ci.sh 起服务加 --spring.profiles.active=ci(配合 P0① fail-safe,否则健康检查 401/对拍免令牌失效)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 11:41:21 +08:00
bc9ae8cf44 security(P0③ followup): 关 TodoController advanced-script 生产 RCE
/api/workflow/process/{id}/advanced-script 执行请求体 Groovy,原无 @Profile/无角色门=任意认证用户 prod RCE(独立安全评审揪出的 ScriptExecuteController 孪生)。注入 Environment + SecurityProfiles.isBypassActive 守卫:严格 profile 直接 amisFail 不执行脚本。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 11:41:21 +08:00
980d83ed15 security(P0③): 脚本端点拆分隔离 RCE + 路径穿越守卫 + Poc 控制器门禁
拆 ScriptExecuteController(执行请求体任意 Groovy=RCE)为 @Profile(BYPASS) 仅非生产装配;生产改写脚本重放迁至新 ScriptReplayController(只取脚本库内已审产物)。RewrittenScriptStore.load 加 templateId 路径包含校验(resolve+normalize+startsWith,+NUL 字节兜底)防穿越读库外脚本。三个 Poc*Controller(含裸拼 DROP TABLE)全 @Profile(BYPASS)。抽 ScriptFacadeRunner 共享。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 11:41:21 +08:00
1f2365fa26 security(P0②): buildCtx JWT 身份权威,关 asUser/roles 冒充提权(IDOR)
EntityController 与孪生 PickerController 的 buildCtx 调换优先级:JWT 已绑定的认证身份恒优先,客户端 asUser/roles 仅在无 JWT 身份时(非生产旁路)生效。杜绝已认证用户传 asUser=他人/roles=ADMIN 冒充提权读越权数据。PickerController 实例由独立安全评审揪出(原架构评审 under-scope)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 11:41:21 +08:00
24160db684 security(P0①): 安全链改 fail-safe 默认 + prod 配置 + JWT 弱密钥守卫
宽松 permitAll 链由 @Profile("!prod") 改为显式 opt-in @Profile(dev|local|ci|parity);严格认证链覆盖默认(含裸 java -jar)与 prod。新增 SecurityProfiles 作旁路名单唯一真相、JwtSecretSafetyCheck(严格 profile 下拒开发默认密钥启动)、application-prod.yml(密钥/DB 无默认强制环境变量)。修 2026-06-24 架构评审 P0:未设 profile 即全放行的 fail-open 默认。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 11:41:21 +08:00
a132e67a20 Merge feat/arch-review-followup: 架构评审改进批次(A4 ArchUnit/稳定性三件套/A5 AiReleaseWriter/可观测性/D5 LocalHostPolicy)
Some checks failed
ci / build-test-parity (push) Has been cancelled
2026-06-24 11:31:21 +08:00