Skip to content

refactor(managed-agent): Consolidate server and broker sources - #14277

Merged
doudouOUC merged 16 commits into
mainfrom
codex/managed-agent-server-layout
Oct 16, 2026
Merged

doudouOUC merged 16 commits into
mainfrom
codex/managed-agent-server-layout

Conversation

@doudouOUC

Copy link
Copy Markdown
Collaborator

What this PR does

Move Managed Agent Server to packages/managed-agent-server, alongside the Java SDK, and compile Runtime Broker production sources, resources and tests in the same Maven module. Remove the separate Broker artifact and test-JAR dependency while preserving Java package names, public APIs, private protocols and schema resources. Update development, container and reference-distribution builds, repository scripts, CI, contract guards and documentation to follow the new layout.

Why it's needed

Managed Agent Server is the only production consumer of the Broker in this repository. The separate module requires an extra fixed-version artifact and test JAR to be installed before building the application, and placing the application inside the Java SDK obscures source ownership. Combining the application sources removes that build dependency and gives the server its own package directory while retaining the internal Java package boundaries.

Reviewer Test Plan

Verify that the application builds after installing only the Java SDK, without resolving a standalone Broker artifact. Confirm that the combined module retains both original source trees, classpath resources, default test coverage, explicit integration profiles and fault gates. Existing tool execution, cancellation and recovery contracts should retain their behavior.

How to verify

Build the Java SDK and then package the application from its new directory. Inspect the application and recovery JARs for both Java package trees and the original schema resources. Run the combined unit tests and explicit fault profile, and check that the relocated development and packaging commands use the new module without a separate Broker installation.

Local validation included repository build, typecheck and bundle, application packaging, a 3,693-case default Java run followed by a successful 175-case rerun of corrected fixture paths and interop checks, 44 passing fault-gate cases, both Checkstyle scopes, SpotBugs, focused script/workflow tests and reference-distribution checksum verification. Eight existing environment or opt-in Java skips remain. The Java figure is coverage from the full run plus the targeted rerun, not a second clean full-suite invocation; the detailed report is posted separately.

An independent inventory check retained all 692 original source, resource and test files. All 278 production Java files and six main resources are byte-identical; 24 Java test files contain relative-path changes only. Independent review returned no actionable findings.

Evidence (Before & After)

N/A — source layout and build refactor with no intended UI behavior change.

Tested on

OS Status
🍏 macOS ✅ tested
🪟 Windows ⚠️ not tested
🐧 Linux ⚠️ not tested

Environment (optional)

macOS arm64, JDK 21.0.8, Maven 3.9.14, Node.js 22.22.3 and pnpm 11.24.0. Java process/fault tests used the locally built CLI bundle. The local reference archive was extracted and verified independently; it was not published.

Risk & Scope

  • Main risk or tradeoff: directory-sensitive consumers and Maven test/profile selection could drift during consolidation. The change updates those consumers together, preserves both existing style scopes and fault exclusions, retains Broker test dependency versions, and keeps separate SDK and server CodeQL coverage.
  • Not validated / out of scope: real MySQL/MariaDB, Linux-specific deployment acceptance, actual Kubernetes/CSI, Docker image execution, external OSS/RocketMQ and remote CI acceptance. No deployment, default capability change or runtime behavior feature is included.
  • Breaking changes / migration notes: internal source/build consumers must use packages/managed-agent-server; the separate qwen-managed-runtime-broker artifact and test JAR are removed. The server still depends on the Java SDK. Java package names, public APIs, runtime protocols and migration bytes are preserved; no database migration is introduced. Historical PR-head checks retain predecessor-path handling, and immutable commit links and recorded latency evidence retain their historical paths.

Design: English | 简体中文. Both versions cover the same decisions, constraints, validation and acceptance criteria.

Linked Issues

None.

中文说明

此 PR 的改动

将 Managed Agent Server 移至 packages/managed-agent-server,与 Java SDK 并列,并在同一个 Maven 模块中编译 Runtime Broker 的生产源码、资源和测试。删除独立 Broker 产物及测试 JAR 依赖,同时保留 Java 包名、公开 API、私有协议和 schema 资源。同步调整开发、容器及参考分发构建、仓库脚本、CI、契约检查和文档,使其使用新的源码布局。

为什么需要

Managed Agent Server 是仓库中唯一的 Broker 生产调用方。独立模块要求构建应用前额外安装固定版本的产物和测试 JAR,应用位于 Java SDK 内部也使源码归属不清晰。合并应用源码后可消除这项构建依赖,并为 Server 提供独立的包目录,同时保留内部 Java package 边界。

评审测试计划

验证应用仅需预先安装 Java SDK 即可构建,不再解析独立 Broker 产物。确认合并模块保留两个原始源码树、classpath 资源、默认测试覆盖、显式集成 profile 和故障门禁。既有工具执行、取消及恢复契约应保持原有行为。

如何验证

构建 Java SDK,然后从新目录打包应用。检查应用及恢复工具 JAR 包含两个 Java package 及原有 schema 资源。运行合并后的单元测试和显式故障 profile,并确认迁移后的开发及打包命令使用新模块,不再单独安装 Broker。

本地验证包括仓库 build、typecheck 和 bundle、应用打包、一次覆盖 3,693 项的默认 Java 测试及随后成功运行的 175 项定向复验(修正夹具路径并验证互操作)、44 项通过的故障门禁、两套 Checkstyle、SpotBugs、相关脚本及工作流测试,以及参考分发包校验和验证。保留 8 项既有环境或显式启用条件下的 Java 测试跳过。Java 数字是全量运行与定向复验的覆盖合集,并非第二次完整运行默认测试;详细报告单独发布。

独立清单检查确认原有 692 个源码、资源和测试文件全部保留。278 个生产 Java 文件和 6 个主资源逐字节保持一致;24 个 Java 测试文件仅调整相对路径。独立审查未发现需要修改的问题。

证据(前后对比)

N/A — 源码布局及构建重构,无预期 UI 行为变化。

测试平台

OS 状态
🍏 macOS ✅ 已测试
🪟 Windows ⚠️ 未测试
🐧 Linux ⚠️ 未测试

环境(可选)

macOS arm64、JDK 21.0.8、Maven 3.9.14、Node.js 22.22.3 和 pnpm 11.24.0。Java 进程及故障测试使用本地构建的 CLI bundle。本地参考压缩包已独立解压并校验,未对外发布。

风险与范围

  • 主要风险或取舍:合并期间依赖目录的调用方与 Maven 测试或 profile 选择可能发生偏移。本次同步调整调用方,保留两套既有样式检查及故障排除规则,保留 Broker 测试依赖版本,并分别覆盖 SDK 与 Server 的 CodeQL 扫描。
  • 未验证及范围外:真实 MySQL/MariaDB、Linux 专用部署验收、真实 Kubernetes/CSI、Docker 镜像运行、外部 OSS/RocketMQ 及远端 CI 验收。本次不涉及部署、默认能力调整或新增运行时行为。
  • 兼容性及迁移说明:内部源码及构建调用方须使用 packages/managed-agent-server;独立的 qwen-managed-runtime-broker 产物及测试 JAR 已删除。Server 继续依赖 Java SDK。保留 Java 包名、公开 API、运行时协议和迁移字节,不引入数据库迁移。历史 PR head 检查保留旧路径处理,固定 commit 链接及已有延迟采样证据保留历史路径。

设计:English | 简体中文。两种版本完整覆盖相同的决策、约束、验证及验收标准。

关联 Issue

无。

@doudouOUC

Copy link
Copy Markdown
Collaborator Author

Local source/build and real-process verification

Verified source revision: 3231ab20a5c96ef85017b1eddd9ee4e5926f5f3b on macOS arm64 with JDK 21.0.8, Maven 3.9.14, Node.js 22.22.3 and pnpm 11.24.0. This is a source/build refactor; model-driven CLI prompts cannot establish Java source ownership, so validation uses the existing Java/HTTP/schema contracts, real worker interoperability and multiprocess fault gates.

Check Result
Baseline Global CLI 0.25.0 recorded; Java SDK unsigned install passed; Broker 69 representative tests passed; Server ran 79 tests with 2 existing MySQL skips
Source inventory All 692 original files retained; 278 production Java files, 6 main resources and 13 test resources byte-identical; 24 Java test files changed only for paths
Combined application package Passed; 278 production and 395 test Java files compile together; all 7 application/recovery JARs contain both original packages and unchanged schema resources
Repository build/typecheck/bundle All passed; local bundled CLI reports 0.25.1
Default Java run 271 classes / 3,693 tests; initial run exposed 33 stale fixture-path errors, zero assertion failures, 10 skips
Corrected fixture and interop rerun All 11 failed classes plus 2 pre-bundle interop classes passed: 175 tests, zero failures/errors/skips
Final default coverage union 3,693 tests, zero remaining failures/errors, 8 existing environment/opt-in skips; this is the original full run plus targeted rerun, not a second clean full-suite run
Explicit fault profile 44 tests across all 7 fault-gate classes passed; zero skips
Both Checkstyle scopes Passed with zero violations; Broker scope independently confirmed to select all 93 production Broker files
SpotBugs Zero high-confidence bug instances and zero errors
Dependency/JAR inspection No separate Broker artifact or test-JAR dependency; all 7 JAR entry points and original resources checked
Focused script and distribution tests 217 unique focused tests plus 8 distribution tests passed
Workflow and routing tests All 17 relevant parsing suites validated, plus 40 routing tests; one unchanged supplemental test exceeded its 20-second timeout under load and passed in a 12.16-second isolated retry
Actual reference archive Exactly Server and operator-recovery components; independent extraction verified both detached checksums and all 11 internal payload checksums
Contract/schema checks Generated WebShell API unchanged; real-tree Flyway guard reports 2 unique migrations
Review Two final clean self-audit passes and independent review with no actionable findings

The remaining default skips are three existing macOS exclusions, four real-MySQL snapshot/locking assumptions and one opt-in Kubernetes worker protocol check. The POSIX fault profile itself skipped nothing. The local archive exercised packaging only and was not published as a reviewed-revision release.

Real MySQL/MariaDB, Linux-specific deployment acceptance, actual Kubernetes/CSI, Docker image execution, external OSS/RocketMQ and GitHub CI acceptance were not run locally. Repository build, typecheck, bundle, application packaging and fault profile were run with their existing commands; the fault invocation is mvn -f packages/managed-agent-server/pom.xml -Pfault-gates test after building the CLI bundle.

中文验证说明

本次为源码及构建布局重构,验证 revision 为 3231ab20a5c96ef85017b1eddd9ee4e5926f5f3b。环境为 macOS arm64、JDK 21.0.8、Maven 3.9.14、Node.js 22.22.3 和 pnpm 11.24.0;使用既有 Java/HTTP/schema 契约、真实 worker 互操作和多进程故障门禁验证。

默认 Java 测试首次运行覆盖 271 个类、3,693 项测试,发现 33 个旧夹具路径错误,无断言失败。修正后,将全部 11 个失败类和 2 个构建 bundle 前跳过的互操作类重新编译复验,175 项全部通过,且无跳过。最终覆盖合集为 3,693 项、无剩余失败或错误、保留 8 项既有环境或显式启用条件下的跳过;未声称第二次完整运行默认套件。显式故障 profile 的 7 个类、44 项全部通过,无跳过。

692 个原始文件全部保留;278 个生产 Java 文件、6 个主资源及 13 个测试资源逐字节一致,24 个 Java 测试文件仅改路径。应用编译打包、仓库 build/typecheck/bundle、两套 Checkstyle 和 SpotBugs 均通过。7 个应用及恢复工具 JAR 的入口、两组 package 和原始资源已核对,依赖中没有独立 Broker 产物或测试 JAR。

217 项相关脚本测试、8 项分发测试、17 套相关工作流解析测试和 40 项路由测试完成验证。一项未修改的补充工作流测试在负载下触发 20 秒超时,单独重试用时 12.16 秒并通过。真实本地参考压缩包仅含 Server 与恢复工具组件,独立解压后内外两层校验和全部通过。生成的 WebShell API 未变,Flyway 检查确认 2 个迁移版本唯一。完成两轮最终无发现自审,独立审查无需要修改的问题。

8 项剩余跳过分别为 3 项既有 macOS 排除、4 项真实 MySQL 一致性或锁假设,以及 1 项需显式启用的 Kubernetes worker 协议检查。未在本地运行真实 MySQL/MariaDB、Linux 部署验收、真实 Kubernetes/CSI、Docker 镜像、外部 OSS/RocketMQ 或 GitHub CI 验收;本地压缩包仅用于打包验证,未发布。

@doudouOUC
doudouOUC marked this pull request as ready for review October 15, 2026 09:02
@doudouOUC
doudouOUC enabled auto-merge October 15, 2026 09:02
@qwen-code-review-bot

qwen-code-review-bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

⏳ Approval still deferred — 2 PR CI workflow run(s) still in progress for e28abea; the finalize job approves automatically once every run lands green. finalize run

⏳ 审批仍在延迟中 —— e28abea 还有 2 个 PR CI workflow 在运行,全部通过后 finalize 任务会自动提交审批。查看 finalize 运行

@qwen-code-review-bot

Copy link
Copy Markdown
Collaborator

Thanks — this is a big diff by file count but a small one by substance, and it holds up.

Template looks good ✓ (including the bilingual section).

Problem: real and observable, not theoretical. At the base commit the standalone Broker artifact had to be installed before the server could build, and that install step was duplicated across five consumers — the module Dockerfile, sdk-java.yml (four separate invocations), verify-maven-repo.yml, qwen-triage.yml and release-managed-agent-reference.yml. Removing the intermediate artifact removes all five. No before/after reproduction is needed for a claim of that shape; the base tree is the evidence.

Direction: aligned. This is build/ownership consolidation inside the managed-agent tree — no runtime behaviour, public API, private protocol, or schema bytes change, and the server is genuinely the only production consumer of the Broker. Nothing here pulls focus from the CLI.

Size: 1,964 changed lines across 844 files (699 pure renames, 140 modified, 2 added, 3 removed). Breakdown: 420 production-logic lines (325 files, but most renames carry zero line changes), 559 test lines (scripts/tests/), 61 Java test lines, 719 docs lines, 205 CI/config lines. It does touch core paths — 10 files under packages/core/src/managed-runtime/ — but every one of those is a 2-line comment path-string update, no logic. You're a repo admin, so the two-tier core gate doesn't apply here; for the record it wouldn't have tripped anyway at 420 production lines (under the 500 threshold, and well under the 1000-line large-PR advisory).

Approach: this is what I'd have done — git mv the module, fold the Broker sources into the same Maven module rather than keeping an artifact dependency, then walk every path consumer. The two details I'd most have expected to be missed are both handled: the contract and Flyway open-PR guards still understand PR heads that predate the move, and the CodeQL Java leg got its own explicit category so the two Java source trees don't overwrite each other's SARIF upload.

One question rather than a blocker: the diff also rewrites 97 existing docs files. Updating forward-looking docs to the new layout is clearly right, but some of what got rewritten is historical record — dated design docs and a commit-pinned acceptance run. Your own description says immutable commit links and recorded latency evidence keep their historical paths; a few spots didn't follow that rule. I've detailed them in the code review.

Risk: no elevated risk signals — none of the revert-correlated paths are touched.

Moving on to code review. 🔍

中文说明

感谢贡献!这个 PR 按文件数看很大,但按实质改动看很小,而且站得住脚。

模板完整 ✓(含中文对照)。

问题: 真实且可观测,不是理论性问题。在 base commit 上,构建 server 之前必须先安装独立的 Broker 产物,而这个安装步骤在五个调用方中重复出现——模块 Dockerfile、sdk-java.yml(四处独立调用)、verify-maven-repo.yml、qwen-triage.yml 和 release-managed-agent-reference.yml。去掉中间产物就同时去掉了这五处。这类结论不需要 before/after 复现,base 树本身就是证据。

方向: 对齐。这是 managed-agent 树内部的构建与源码归属整合——不改变运行时行为、公开 API、私有协议或 schema 字节,而且 Server 确实是 Broker 唯一的生产调用方。不会分散对 CLI 的注意力。

规模: 844 个文件、1,964 行改动(699 个纯重命名、140 个修改、2 个新增、3 个删除)。拆分为:生产逻辑 420 行(325 个文件,但多数重命名零行改动)、测试 559 行(scripts/tests/)、Java 测试 61 行、文档 719 行、CI/配置 205 行。确实触及核心路径——packages/core/src/managed-runtime/ 下 10 个文件——但每一处都是 2 行注释里的路径字符串更新,无逻辑改动。你是仓库 admin,因此两层核心门禁不适用;顺带说明,即便适用也不会触发:生产逻辑 420 行,低于 500 行阈值,也远低于 1000 行大 PR 提示线。

方案: 这正是我会做的——git mv 移动模块,把 Broker 源码并入同一个 Maven 模块而不是保留产物依赖,然后逐个走完所有路径调用方。我最担心被漏掉的两个细节都处理了:contract 与 Flyway 的 open-PR 检查仍能识别迁移前的 PR head;CodeQL 的 Java leg 拿到了独立的 category,两个 Java 源码树不会互相覆盖 SARIF 上传结果。

一个疑问而非阻塞项:diff 还改写了 97 个既有文档文件。把面向未来的文档更新到新布局显然正确,但被改写的内容里有一部分是历史记录——带日期的设计文档,以及一次固定在某个 commit 上的验收运行。你自己的描述里写了"固定 commit 链接与已有延迟采样证据保留历史路径",但有几处没有遵守这条规则。细节我在代码审查里列出。

风险: 无升级风险信号——未触及任何与 revert 相关的路径。

进入代码审查 🔍

— Qwen Code · qwen3.8-max-2026-09-02

Reviewed at e28abea0e8f4b19f5819fc93485e409e533a1741 · re-run with @qwen-code /triage

@qwen-code-review-bot

qwen-code-review-bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Code review

I read this as a static diff (no PR code executed). The mechanical part is clean: I walked every path consumer rather than trusting the description, and the arithmetic checks out. ../core/src/managed-runtime/contracts and ../sdk-java/qwencode/qwen-code-checks.xml both resolve to exactly the targets the old module reached from packages/sdk-java/managed-agent-server/, and the fault-gate CLI entry correctly becomes ../../dist/cli.js. All nine .github files and all eleven scripts/ files that referenced the old paths at base are in the changed set — I found no stale consumer in CI or scripts.

Three things worth fixing, none of them blocking the build.

1. Two of the four version properties carried over from the Broker pom are dead, and the pins they name are silently not applied. The merged pom declares h2.version (2.4.240) and junit-jupiter.version (5.14.1), but neither is referenced anywhere in the file — the com.h2database:h2 dependency carries no <version>, and there is no junit-jupiter dependency at all (JUnit arrives via spring-boot-starter-test). So both now resolve from the Spring Boot BOM, not from the Broker's pins. By contrast fastjson2.version and jacoco-maven-plugin.version are wired up correctly. The Broker also pinned jackson-databind 2.20.0 as a compile dependency, which likewise has no counterpart now.

This is cosmetic in effect — the suite passes, and Boot-managed versions are a reasonable thing to inherit — but the properties actively mislead: a future maintainer reads h2.version=2.4.240 and assumes it applies. Your description says the change "retains Broker test dependency versions"; as written it doesn't, it just looks like it does. Either drop the two dead properties (and let the BOM own those versions deliberately), or apply them — <version>${h2.version}</version> on h2, plus a junit-bom import and an explicit junit-jupiter test dependency to actually get 5.14.1.

2. docs/verification/13532-linux-h3/probe-inputs.md rewrites a reproduction that is pinned to an immutable commit. The manifest command there runs git ls-tree -rz --name-only 669b2f0f91b0c787f7d8a26971c7c34210b935e1 -- … and the surrounding prose states that it reproduces a specific 5,042-path manifest with SHA256 a4aeadf5fbfbb8583ec1eec5b5e08cc0d4ff1f3c7ed0c3d49f6eca4168cd232b. Both old Java paths in that command were rewritten to packages/managed-agent-server/src/main — which does not exist at 669b2f0f, so the command as edited can no longer reproduce the manifest or its digest. The same edit also leaves the path listed twice on consecutive lines. Separately, the recorded systemd-run invocation (real VM paths, unit qwen-h3-publication-gate-20261009-1007) and a quoted qa_classpath line from the run's own diff were rewritten, so they no longer describe what was actually executed. The file's preamble is explicit that "environment-specific paths … are preserved as evidence". I'd revert this file to its historical paths — it's the case your own description said you were preserving.

3. .qwen/skills/verify-pr/SKILL.md is tracked, and it still documents the old /verify context contract. It tells the agent that java-prepare.log ends with qwencode=<n> runtime-broker=<n> and to "reinstall that module" if either code is non-zero — but qwen-triage.yml now emits only qwencode=<n>, and the Broker pom no longer exists, so an agent following that instruction would fail on a missing file. The same paragraph says the lane sets QWEN_VERIFY_JAVA=1 only when the diff touches packages/sdk-java/, while the workflow now matches ^packages/(sdk-java|managed-agent-server)/. Small edit, but it's the one consumer of this change that lives outside the diff.

Credit where due on the parts I specifically tried to break:

  • Checkstyle. Both scopes survive, and the new includeTestSourceDirectory=false on the Broker scope is equivalent, not a coverage loss — the old Broker module never set that flag, so Maven's default already excluded its test sources.
  • SpotBugs. The deleted Broker spotbugs-excludes.xml was an empty <FindBugsFilter/>, so nothing was lost by dropping it, and the gate test now asserts withSkip is empty — no workflow step may carry spotbugs.skip any more. That's stricter than before.
  • Open-PR guards. CONTRACT_DOCUMENT_PREDECESSOR is used only to read a historical PR head at its own touched.path, never the checkout, and the Flyway guard normalizes old head paths behind a relocated check. This is the right way to do it.
  • Migration range. migrationRange() collapsing from a two-module union to a single directory is correct, since the Broker's db/managed-schema resources moved into the same module.

Test evidence

Fetched once for e28abea0e8f4b19f5819fc93485e409e533a1741, not polled — three checks were still running when I read them. Nothing is red.

The important caveat is coverage, not colour: sdk-java.yml triggers on schedule and workflow_dispatch only, so it never runs on a PR. That means the Java half of this consolidation — mvn test, both Checkstyle scopes, SpotBugs, the fault-gate profile, and the MySQL/failsafe integration tests — has no automated coverage on this PR, and won't get any until the nightly runs post-merge.

What PR CI does cover is more than nothing: the Managed Agent reference PR #14277 dry run job compiles and packages the merged module (mvn -f packages/managed-agent-server/pom.xml -DskipTests clean package) and then assembles and checksums the reference distribution, so a broken merge, a missing resource directory, or a lost schema resource would fail there. That job was still pending at read time.

Not verified, and why: the Java test counts in your description (3,693 + 175 rerun, 44 fault-gate cases, both Checkstyle scopes, SpotBugs) are your claim from a local macOS run — I did not re-run them, and per this repo's rules I don't execute PR-derived code in CI. Linux and Windows are untested by your own account. My findings above come from reading the diff and the base tree, not from running anything.

Sandboxed verification would settle the part CI can't: @qwen-code /verify — that the merged module still yields a server JAR containing both managedagent and runtimebroker package trees plus the original schema resources, and that the fault-gates profile still selects its 44 cases after the surefire excludedGroups/groups split moved into the combined pom, is not observable from the diff. More directly, a maintainer can workflow_dispatch sdk-java.yml against codex/managed-agent-server-layout to get real Java-lane coverage on this head before merging — given the nightly is the only other path to it, that seems worth the run.

CI results for e28abea — this table auto-updates as CI workflows complete:

Check Conclusion
Test (ubuntu-latest, Node 22.x) ⏳ running
Classify PR ✅ success
Integration Tests (no-AK, No Sandbox) ✅ success
Lint & Static (ubuntu-latest, Node 22.x) ✅ success
OpenTUI no-flicker gate ✅ success
Serve A/B (ubuntu-latest, Node 22.x) ✅ success
TUI parity snapshots (ink vs opentui) ✅ success

One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。

中文说明

代码审查

我是以静态 diff 的方式审查的(未执行任何 PR 代码)。机械改动部分很干净:我逐个走完了所有路径调用方,而不是采信描述。路径运算是对的——../core/src/managed-runtime/contracts 与 ../sdk-java/qwencode/qwen-code-checks.xml 都精确解析到旧模块从 packages/sdk-java/managed-agent-server/ 出发所到达的同一目标,fault-gate 的 CLI 入口也正确变为 ../../dist/cli.js。base 上引用旧路径的 9 个 .github 文件和 11 个 scripts/ 文件全部在改动集合内——CI 与脚本中没有发现遗漏的调用方。

有三处值得修,但都不阻塞构建。

1. 从 Broker pom 带过来的四个版本属性中有两个是死属性,它们声明的版本其实并未生效。 合并后的 pom 声明了 h2.version(2.4.240)与 junit-jupiter.version(5.14.1),但文件中任何位置都没有引用它们——com.h2database:h2 依赖没有 <version>,也完全不存在 junit-jupiter 依赖(JUnit 由 spring-boot-starter-test 引入)。因此两者现在都由 Spring Boot BOM 决定版本,而不是 Broker 原来的固定版本。相对地,fastjson2.version 与 jacoco-maven-plugin.version 是正确接上的。Broker 还把 jackson-databind 2.20.0 作为 compile 依赖固定,现在同样没有对应项。

实际影响很小——测试通过,继承 BOM 版本也是合理选择——但这两个属性有误导性:后来的维护者看到 h2.version=2.4.240 会以为它生效了。你的描述写"保留 Broker 测试依赖版本",而按现状并没有保留,只是看起来保留了。要么删掉这两个死属性(明确让 BOM 接管这些版本),要么真正应用它们——给 h2 加上 <version>${h2.version}</version>,并补一个 junit-bom import 与显式 junit-jupiter test 依赖,才能真的用上 5.14.1。

2. docs/verification/13532-linux-h3/probe-inputs.md 改写了一个固定在不可变 commit 上的复现命令。 该文件的清单命令是 git ls-tree -rz --name-only 669b2f0f91b0c787f7d8a26971c7c34210b935e1 -- …,正文明确说明它复现出特定的 5,042 路径清单及 SHA256 a4aeadf5fbfbb8583ec1eec5b5e08cc0d4ff1f3c7ed0c3d49f6eca4168cd232b。命令中的两个旧 Java 路径都被改写成了 packages/managed-agent-server/src/main——该路径在 669b2f0f 上并不存在,因此改后的命令已无法复现清单及其摘要。同一次改动还让该路径在相邻两行重复出现。另外,记录在案的 systemd-run 调用(真实 VM 路径、unit 名 qwen-h3-publication-gate-20261009-1007)以及该次运行自身 diff 中被引用的 qa_classpath 行也被改写,因此它们不再描述当时实际执行的命令。该文件开头明确写着"环境相关路径……作为证据保留"。建议把这个文件恢复为历史路径——这正是你描述里说要保留的那一类。

3. .qwen/skills/verify-pr/SKILL.md 是纳入版本控制的,而它仍在描述旧的 /verify 上下文契约。 它告诉 agent:java-prepare.log 末尾是 qwencode=<n> runtime-broker=<n>,若任一退出码非零则"重新安装该模块"——但 qwen-triage.yml 现在只输出 qwencode=<n>,且 Broker pom 已不存在,agent 照此执行会因文件缺失而失败。同一段还写着只有 diff 触及 packages/sdk-java/ 时该 lane 才设置 QWEN_VERIFY_JAVA=1,而 workflow 现在匹配的是 ^packages/(sdk-java|managed-agent-server)/。改动很小,但这是本次变更中唯一位于 diff 之外的调用方。

几处我特意尝试推翻、结果确认没问题的地方:

  • Checkstyle。 两套 scope 都保留了,Broker scope 上新增的 includeTestSourceDirectory=false 是等价而非覆盖损失——旧 Broker 模块从未设置该标志,Maven 默认本来就不检查它的测试源码。
  • SpotBugs。 被删除的 Broker spotbugs-excludes.xml 是空的 <FindBugsFilter/>,删掉不损失任何内容;而门禁测试现在断言 withSkip 为空——任何 workflow step 都不再允许带 spotbugs.skip。这比之前更严格。
  • open-PR 检查。 CONTRACT_DOCUMENT_PREDECESSOR 只用于按 PR 自身的 touched.path 读取历史 PR head,绝不用于 checkout;Flyway 检查的旧 head 路径归一化也放在 relocated 判断之后。做法是对的。
  • 迁移版本区间。 migrationRange() 从两模块并集收敛为单目录是正确的,因为 Broker 的 db/managed-schema 资源已并入同一模块。

测试证据

针对 e28abea0e8f4b19f5819fc93485e409e533a1741 只拉取一次,未轮询——读取时有三个检查仍在运行。没有红项。

真正需要注意的是覆盖范围而非颜色:sdk-java.yml 只在 schedule 与 workflow_dispatch 上触发,因此它从不在 PR 上运行。 这意味着本次合并的 Java 那一半——mvn test、两套 Checkstyle scope、SpotBugs、fault-gate profile、MySQL/failsafe 集成测试——在这个 PR 上没有任何自动化覆盖,要等合并后的 nightly 才会有。

PR CI 覆盖的部分并非毫无价值:Managed Agent reference PR #14277 dry run 会编译并打包合并后的模块(mvn -f packages/managed-agent-server/pom.xml -DskipTests clean package),随后组装并校验参考分发包。因此模块合并出错、资源目录缺失或 schema 资源丢失都会在那里失败。该 job 在读取时仍为 pending。

未验证项及原因:你描述中的 Java 测试数字(3,693 + 175 定向复验、44 项 fault-gate、两套 Checkstyle、SpotBugs)是你在本地 macOS 上的声明——我没有重跑,并且按本仓库规则我不会在 CI 中执行 PR 代码。Linux 与 Windows 按你自己的说明未测试。上述结论全部来自阅读 diff 与 base 树,而非运行任何东西。

沙箱验证可以补上 CI 补不了的部分:@qwen-code /verify——合并后的模块是否仍产出同时包含 managedagent 与 runtimebroker 两套 package 及原有 schema 资源的 server JAR,以及在 surefire 的 excludedGroups/groups 拆分移入合并 pom 之后 fault-gates profile 是否仍选中那 44 个用例,这些无法从 diff 观察得到。更直接的办法是:维护者可以对 codex/managed-agent-server-layout 手动 workflow_dispatch 一次 sdk-java.yml,在合并前拿到真实的 Java lane 覆盖——鉴于 nightly 是唯一的其他途径,这一次运行是值得的。

— Qwen Code · qwen3.8-max-2026-09-02

Reviewed at e28abea0e8f4b19f5819fc93485e409e533a1741 · re-run with @qwen-code /triage

@qwen-code-review-bot

Copy link
Copy Markdown
Collaborator

Confidence: 4/5 — the mechanical move is correct everywhere I could check it, and the three things I found are all fixable in a few lines; none of them changes runtime behaviour.

Going in, my own plan for this was the same one you took: move the module, fold the Broker sources into one Maven module instead of keeping an artifact dependency, then walk every consumer. So the approach isn't the question. What I spent the time on was trying to find the consumer you missed, because a 699-file rename is exactly the shape where one stale path survives and only fails in a lane nobody ran. I checked the base tree for every reference to the old paths and cross-referenced against the changed set: all nine .github files and all eleven scripts/ files that referenced them are updated, the pom's relative paths resolve to the same absolute targets as before, and the two gates I expected to be quietly weakened (Checkstyle test-source scope, SpotBugs) are respectively equivalent and stricter. That's the part I'd want a reviewer to actually verify rather than accept, and it holds.

What keeps this at 4 and not 5 is that two of your claims are slightly ahead of the diff. The Broker's h2 and JUnit version pins didn't survive — the properties are there but nothing reads them, so the BOM owns those versions now — and one commit-pinned acceptance record got rewritten when your description said it wouldn't be. Both are small, and neither is a reason to hold the PR. I'd rather you fixed them than filed a follow-up, since the misleading part is that they look handled.

I'm comfortable approving on the merits. The honest limit on my confidence is coverage, not the diff: sdk-java.yml is nightly-only, so the Java test suite, both Checkstyle scopes, SpotBugs and the fault-gate profile never run on a PR, and the only Java thing CI checks here is that the merged module compiles and packages. I'm relying on your local run for the rest and saying so plainly rather than presenting it as verified. If you want that gap closed before merge, dispatching sdk-java.yml against the head branch is the cheapest way; otherwise the nightly will catch it within a day of merging.

Approval is deferred until CI lands green on e28abea0e8f4b19f5819fc93485e409e533a1741 — three checks (unit tests, lint, Serve A/B) plus the reference-distribution dry run were still in flight when I read them, and I won't attest to a result that doesn't exist yet. If anything lands red or the head moves, the deferred approval is withheld and the status comment says so.

中文说明

Confidence: 4/5 — 机械性的迁移在我能核查的每一处都是正确的;我发现的三件事都可以在几行内修掉,且都不改变运行时行为。

一开始我自己对这个目标的方案和你采取的一致:移动模块、把 Broker 源码并入同一个 Maven 模块而不是保留产物依赖,然后逐个走完调用方。所以方案本身不是问题。我把时间花在找出你漏掉的调用方上——699 个文件的重命名正是这种形状:某个陈旧路径残留下来,只在没人跑过的 lane 里才失败。我在 base 树上检查了所有对旧路径的引用,并与改动集合交叉比对:引用它们的 9 个 .github 文件和 11 个 scripts/ 文件全部更新;pom 的相对路径解析到与之前相同的绝对目标;我原以为会被悄悄削弱的两个门禁(Checkstyle 测试源码 scope、SpotBugs)分别是等价与更严格。这部分是我最希望审查者真正去验证、而不是直接接受的内容,而它站得住。

让它停在 4 分而不是 5 分的是:你的两处描述略微超出了 diff 的实际情况。Broker 的 h2 与 JUnit 版本固定没有保留下来——属性在那里,但没有任何地方读取它们,因此这些版本现在由 BOM 决定;另外有一份固定在 commit 上的验收记录被改写了,而你的描述说不会改写它。两者都很小,都不构成扣住这个 PR 的理由。我更希望你直接修掉,而不是留一个 follow-up,因为它们最容易误导人的地方正是看起来已经处理过了。

就实质内容而言我可以放心批准。我的信心真正的边界在于覆盖范围,而不在于 diff:sdk-java.yml 只跑 nightly,因此 Java 测试套件、两套 Checkstyle scope、SpotBugs 与 fault-gate profile 从不在 PR 上运行;CI 在这里唯一检查的 Java 部分,是合并后的模块能否编译与打包。其余我依赖你的本地运行结果,并且明确说明,而不是把它当作已验证呈现。如果你想在合并前补上这个缺口,对 head 分支手动 dispatch 一次 sdk-java.yml 是成本最低的方式;否则 nightly 会在合并后一天内覆盖到。

批准将推迟到 CI 在 e28abea0e8f4b19f5819fc93485e409e533a1741 上全绿之后——我读取时还有三个检查(单元测试、lint、Serve A/B)以及参考分发包 dry run 在运行中,我不会为一个尚不存在的结果背书。若有任何一项变红或 head 发生移动,这个延迟批准将被撤回,并在状态评论中说明。

— Qwen Code · qwen3.8-max-2026-09-02

Reviewed at e28abea0e8f4b19f5819fc93485e409e533a1741 · re-run with @qwen-code /triage

@qwen-code-review-bot

qwen-code-review-bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

🩺 serve daemon A/B

Built the PR base vs this PR head c4c1f2a, drove a fixed endpoint set against each, and diffed the JSON responses. Only fields that changed are shown.

health-deep-with-session

field PR base (before) this PR (after)
activeWorkStaleMs 4 5

— Qwen Code · serve A/B

Move the combined Java application beside sdk-java and remove the standalone Runtime Broker artifact. Update build, development, packaging and CI references while preserving Java package identities, runtime protocols and schema resources.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
chiga0
chiga0 previously approved these changes Oct 15, 2026

@chiga0 chiga0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the three core claims:

649 production Java files — pure renames (0+/0-).
I enumerated all 673 renamed Java files via the files API: 649 have exactly 0 additions and 0 deletions (byte-identical); the remaining 24 are all in src/test/.

24 test Java files — relative-path adjustments only.
Every diff for the 24 renamed-with-changes test files shows the same mechanical change: relative path strings shortened from 3 path components (packages/sdk-java/managed-agent-server/…) to 2 (packages/managed-agent-server/…). Examples checked: HostedBackgroundPublicationGate.java (../../.. → ../..), ManagedAgentPropertiesTest.java (fallback README.md path), CsiNativeReadbackProtocolTest.java.

All resource files — pure renames (0+/0-).
The 6 main resources (application.yml, csi-native-file-declarations.json, V1/V2 schema SQL, legacy-table-map.tsv, public-api OpenAPI) and all test resources are pure renames with zero content changes.

Build/module correctness:

  • The new packages/managed-agent-server/pom.xml removes both qwen-managed-runtime-broker entries (jar + test-jar) and directly compiles broker sources from src/main/java/com/alibaba/qwen/code/runtimebroker/. Checkstyle is split across two executions — default checks exclude the broker package; a dedicated runtime-broker-checkstyle execution covers it with the broker's own config. No extra source directory plugin needed since sources live directly under the module tree.
  • packages/sdk-java/runtime-broker/pom.xml removed, artifact qwen-managed-runtime-broker stripped from the verify-maven-repo cache drop list and from all workflows.

CI / workflow updates verified:
All 9 changed workflows reference packages/managed-agent-server consistently. The verify-maven-repo.yml cache key now includes packages/managed-agent-server/pom.xml; the path trigger and strip-artifacts list are consistent. CodeQL gains a second Java job entry (name: managed-agent-server, sourceroot: packages/managed-agent-server) with its own category tag — the first SDK-java job intentionally has no category to keep its existing database ID. The workflow test asserts this explicitly.

Backward compatibility for open PRs:

  • check-flyway-open-prs.js: the new evaluate loop normalises file paths from both packages/sdk-java/managed-agent-server/… and packages/sdk-java/runtime-broker/… to the combined module before the collision check. Tests cover all three cases: collision (fail), same migration (pass), delete-predecessor + add-replacement (success).
  • check-contract-open-prs.js / contract-version-utils.js: CONTRACT_DOCUMENT_PREDECESSOR is the old path; headDocument now takes the path it found (touched.path) rather than hard-coding CONTRACT_DOCUMENT, so a PR still carrying the old path is read correctly.
  • ci.yml contract check: if git show FETCH_HEAD:${DOCUMENT} fails (base predates the move), the script uses previous_filename from the PR's file list to locate the file in the base tree.

No findings. Approving.

…idance

Restore commit-pinned H3 probe inputs and align the Java verification environment contract with the consolidated server layout.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@github-actions

Copy link
Copy Markdown
Contributor

Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration.

中文

请勿对活跃的 PR 执行 rebase 或 force-push,因为这会使已有的评审评论失效。另外,供日后参考:作为集成流程的一部分,机器人始终会自动将所有改动压缩(squash)为单个提交。

@doudouOUC

Copy link
Copy Markdown
Collaborator Author

Follow-up to the triage code review, pushed in fdf7de2a1728c8a18a4cd9dcfb2ca83834e27a5f after rebasing onto 6acaa286cf1.

Item Action and evidence
H2 and JUnit version properties Not changing these: the Spring Boot parent consumes both properties. Maven's resolved dependency tree confirms H2 2.4.240 and JUnit Jupiter 5.14.1, so the retained pins already apply. Jackson remains Boot-managed at 2.21.4.
Commit-pinned H3 probe inputs Restored the complete historical record, including the original Java paths and recorded commands. It is byte-identical to the main-branch evidence file; its manifest command again selects 5,042 paths at 669b2f0f, versus 4,789 with the rewritten paths.
Java verification environment instructions Updated the tracked verification skill to recognize both Java package trees, the single qwencode=<n> preparation result, and the SDK as the only preinstalled sibling. Base-side comparisons still install whatever siblings that base requires.
Merge conflict Rebased the relocation onto current main and retained all 9 newly added files in the combined module. All 279 production Java files, 7 main resources, and 13 test resources match main byte for byte; the existing 24 Java test edits remain path adjustments.

Follow-up validation: repository build and typecheck passed; 58 tests across all 7 newly relocated test classes passed with no skips; both Checkstyle scopes passed; 81 Flyway/workflow tests passed; the real-tree Flyway check reports 3 unique migrations. Formatting and whitespace checks passed. No full Java-suite rerun, real-database, Linux/CSI, or Docker acceptance is claimed by this follow-up.

Review-thread read-back found 0 unresolved inline threads. The existing human approval was submitted against the previous head e28abea0; fresh CI and approval status for this head must be checked separately.

中文说明

已在 rebase 到 6acaa286cf1 后推送 fdf7de2a1728c8a18a4cd9dcfb2ca83834e27a5f,处理本轮审查建议:

项目 处理与证据
H2 与 JUnit 版本属性 不修改:Spring Boot 父 POM 会使用这两个属性,Maven 实际依赖树确认 H2 为 2.4.240、JUnit Jupiter 为 5.14.1,固定版本已经生效。Jackson 继续由 Boot 管理为 2.21.4。
固定 commit 的 H3 探测记录 完整恢复历史路径与实际执行命令,文件与 main 上的历史证据逐字节一致。命令在 669b2f0f 上重新选出记录中的 5,042 个路径;修正前只有 4,789 个。
Java 验证环境文档 更新已跟踪的验证 skill:识别两个 Java 目录,准备日志仅为 qwencode=<n>,预安装依赖仅为 SDK。A/B 的 base 侧仍按该版本实际需要安装依赖模块。
合并冲突 已 rebase,并将 main 新增的 9 个文件完整迁入合并模块。279 个生产 Java 文件、7 个主资源与 13 个测试资源均与 main 逐字节一致;已有 24 个 Java 测试仍仅调整路径。

本轮验证:仓库 build、typecheck 通过;新增迁移涉及的 7 个测试类、58 项测试全部通过且无跳过;两套 Checkstyle 通过;81 项 Flyway/工作流测试通过;实际目录 Flyway 检查确认 3 个迁移版本唯一。格式和 whitespace 检查通过。本轮未重新运行完整 Java 套件,也不声称完成真实数据库、Linux/CSI 或 Docker 验收。

回读确认 0 个未解决行内线程。现有人类 APPROVE 针对旧 head e28abea0,新 head 的 CI 与审批状态需要另行确认。

Keep Maven property arguments intact on Windows and stop before Broker tests when the SDK install fails. Exercise both successful and failed SDK installation in the workflow regression tests.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@doudouOUC

Copy link
Copy Markdown
Collaborator Author

Fixed the Windows / Java 21 failure in fd3eff4f514b9fe728f888799576667dfc2f91d0 with a normal follow-up commit.

Item Action
Failed Windows job PowerShell split a Maven property argument and the SDK install failed with Unknown lifecycle phase ".skip=true". The following Broker command then failed to resolve the uninstalled SDK. The hosted Broker step now explicitly uses Bash, preserving the arguments and stopping immediately on SDK-install failure.
Regression coverage The test failed before the fix. It now executes the parsed workflow script with both successful and failed SDK-install outcomes, checks intact Maven property/test-selector arguments, and verifies that an SDK exit code of 23 prevents Broker tests from running. All 8 workflow-consuming suites passed: 313 tests passed, 10 existing platform skips. ESLint, Prettier and whitespace checks passed. The test engineer independently verified the local contract.
Cancelled checks The cancelled Serve A/B and label runs already have later runs for the same head; they were not rerun.
Force-push reminder Acknowledged. This fix is a normal commit that preserves the current PR history.

Fresh SDK Java validation is scheduled for this exact head. Native Windows success remains pending; the local verification ran on macOS with Bash and a Maven test function. This follow-up changes only the workflow shell and its tests. Unchanged production build/typecheck results remain the previously reported fdf7de2a validation, not a new run.

There are 0 unresolved inline review threads; no inline thread required a reply or resolution in this cycle.

中文说明

已通过普通后续提交 fd3eff4f514b9fe728f888799576667dfc2f91d0 修复 Windows / Java 21 检查失败,保留当前 PR 历史。

项目 处理
Windows 失败 PowerShell 拆分了 Maven 属性参数,SDK 安装报 Unknown lifecycle phase ".skip=true",后续 Broker 测试因 SDK 未安装而无法解析依赖。现将 hosted Broker 步骤显式设为 Bash,保持参数完整,并在 SDK 安装失败时立即停止。
回归验证 新检查在修复前失败;修复后执行实际解析出的工作流脚本,覆盖 SDK 安装成功与失败两种结果,验证 Maven 属性及测试选择参数完整,并确认 SDK 返回 23 时不会运行 Broker 测试。全部 8 套相关工作流测试通过:313 项通过、10 项既有平台跳过。ESLint、Prettier 和空白检查通过;测试代理独立复验了本地契约。
取消的检查 Serve A/B 和 label 的取消运行已有同一 head 的后续运行替代,因此未重跑。
Force-push 提醒 已知悉。本次采用普通提交,保留现有 PR 历史。

新 head 的 SDK Java 验证已触发,原生 Windows 成功结果仍待确认。本地验证环境为 macOS,使用 Bash 和 Maven 测试函数。本轮仅修改工作流 shell 及对应测试;生产代码未变,build/typecheck 沿用先前针对 fdf7de2a 记录的结果,不声称本轮重新运行。

目前 0 个未解决行内 review 线程,本轮没有需要回复或解决的行内线程。

Follow the repository yamllint single-quote rule without changing the parsed workflow configuration.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@doudouOUC

doudouOUC commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Fixed the Lint & Static failure in c12d1566cc583a98b0cc2c7ce39fb2e3c463ba1b. My previous shell fix missed the repository's mandatory YAML single-quote rule; the value is now shell: 'bash'.

Item Result
YAML lint Reproduced with CI's yamllint 1.35.1, then passed the complete repository command node scripts/lint.js --yamllint after the one-line correction.
Behavior preservation Deep comparison confirms the entire parsed workflow is identical before and after. The Broker step still selects Bash with unchanged commands and environment.
Regression checks 55 workflow tests passed; Prettier and whitespace checks passed. The test engineer independently reproduced the failure and verified the fix using the same linter.
Java validation queue Started fresh SDK Java validation for this exact head. Requested cancellation of the two superseded runs to release the branch concurrency slot; run 38719570368 is confirmed cancelled. Run 38716592732 did not stop after normal cancellation, so GitHub accepted a force-cancel request; its final cancellation and the new run are still pending. Native Windows and database results remain unverified.

No old failing lint run was blindly retried. There are 0 unresolved inline review threads; none required a reply or resolution in this cycle.

中文说明

已在 c12d1566cc583a98b0cc2c7ce39fb2e3c463ba1b 修复 Lint & Static 失败。我上轮的 shell 修复遗漏了仓库强制要求的 YAML 单引号,现已改为 shell: 'bash'。

项目 结果
YAML 检查 使用与 CI 相同的 yamllint 1.35.1 复现后,单行修正通过了仓库完整命令 node scripts/lint.js --yamllint。
行为保持 深度比较确认修改前后整个工作流的解析配置完全一致,Broker 步骤仍使用 Bash,命令与环境未变。
回归验证 55 项工作流测试通过,Prettier 和空白检查通过;测试代理使用同一 linter 独立完成复现与修复验证。
Java 验证队列 已为当前 head 触发新 SDK Java 验证,并请求取消两个被替代的运行以释放分支并发位。已确认 38719570368 取消。38716592732 在普通取消后仍未停止,GitHub 已受理强制取消请求,其最终取消及新运行的执行仍待确认。原生 Windows 和数据库结果尚未验证。

没有直接重跑旧 head 的确定性 lint 失败。当前 0 个未解决行内线程,本轮没有需要逐条回复或解决的行内线程。

Preserve the new G3 recovery gates from main and adapt their source lookup to the consolidated server module.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@doudouOUC

Copy link
Copy Markdown
Collaborator Author

Resolved the mergeability blocker by merging main 95468e293fd68f3af703a62abda5379e28af6b42 into the PR with ordinary merge commit 702ed25eb879b12e9ae2bf39440ea008d45fd2c6. No PR history was rewritten.

Item Action and evidence
Incoming recovery gates Preserved main's G3 Step 3 gates, runner updates, test additions and paired design documentation. Git merged the changes automatically; the only manual adaptation was one new test source lookup from the old Java module path to the consolidated Server path.
Path regression The incoming test failed with ENOENT on the old path before adaptation and passed afterwards. Inventory verification preserves all 701 current-main source/resource/test files; only the existing 24 Java test path adjustments differ from their mapped main versions.
Local validation Repository build and typecheck passed. 324 script/workflow tests passed, with 10 existing platform skips. 53 Java integration tests passed, with no skips. Both Checkstyle scopes, complete YAML lint, changed-script ESLint, formatting and whitespace checks passed. Commit hooks made no further changes.
Prior Windows fix The Windows / Java 21 check passed on the previous head c12d1566cc; this is prior-head evidence, not a claim for the new merge head.
Fresh validation Dispatched SDK Java validation for this exact merge head and requested cancellation of the superseded c12d1566cc run. New-head CI and native database/process acceptance remain pending.

There are 0 unresolved inline review threads; none required a reply or resolution in this cycle.

中文说明

已用普通合并提交 702ed25eb879b12e9ae2bf39440ea008d45fd2c6 将 main 的 95468e293fd68f3af703a62abda5379e28af6b42 合入 PR,处理合并阻塞,未重写 PR 历史。

项目 处理与证据
新增恢复门禁 完整保留 main 的 G3 Step 3 门禁、runner 更新、新测试和中英文设计文档。Git 自动完成合并;唯一手动适配是把新增测试的一处 Java 源码引用从旧模块路径改到合并后的 Server 路径。
路径回归 新增测试在适配前因旧路径报 ENOENT,适配后通过。清单核对确认 main 当前 701 个源码、资源和测试文件全部保留;相对映射后的 main 版本,仅有既有 24 个 Java 测试的路径调整。
本地验证 仓库 build、typecheck 通过;324 项脚本/工作流测试通过,保留 10 项既有平台跳过;53 项 Java 集成测试通过且无跳过。两套 Checkstyle、完整 YAML lint、相关脚本 ESLint、格式与空白检查通过,提交 hook 未产生其他改动。
上轮 Windows 修复 旧 head c12d1566cc 的 Windows / Java 21 检查已通过;这是旧 head 的验证证据,不代表新合并 head 已完成验证。
新验证 已为当前合并 head 触发 SDK Java 验证,并请求取消被替代的 c12d1566cc 运行。新 head 的 CI 和真实数据库/进程验收仍待完成。

当前 0 个未解决行内线程,本轮没有需要逐条回复或解决的行内线程。

Preserve current main changes while mapping RocketMQ diagnostic artifacts to the consolidated server directory.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@doudouOUC

Copy link
Copy Markdown
Collaborator Author

Follow-up main sync pushed as 3dc7ec7, merging ac92a0f with a normal merge. This preserves the 41 incoming files, including the latest runtime fixes, RocketMQ diagnostics, and exact-commit release gates. The source migration still retains all 701 mapped main source/resource/test files; the existing 24 Java test differences remain relative-path adjustments.

Item Result
Conflict resolution Preserved main's latency JSON wildcard and JFR artifacts under the consolidated packages/managed-agent-server/target directory.
Workflow/script regression tests 334 passed, 10 skipped across 9 relevant suites.
Targeted Java tests 241 passed, 0 skipped, covering runtime broker service, server integration, and committed-event publishing.
Static checks Both Java Checkstyle scopes, full YAML lint and actionlint, affected-script ESLint/Prettier, and whitespace checks passed.
Build/typecheck Core build passed. CLI build exhausted the default 4 GiB Node heap; retry with an 8 GiB heap passed, as did the full repository typecheck with 8 GiB. The full root build had also passed on the preceding main sync.
Current review state No unresolved inline threads; approval is still required. GitHub currently reports this head as mergeable.
Exact-head CI SDK Java verification dispatched for this commit: https://github.com/QwenLM/qwen-code/actions/runs/38731945141. Completion remains pending. Cancellation of the superseded 702ed25 run was requested; the older c12d156 run is confirmed cancelled.
中文说明

已通过普通合并提交 3dc7ec7 同步主线 ac92a0f。保留了本次主线的 41 个变更文件,包括最新运行时修复、RocketMQ 诊断和按精确提交校验的发布检查。源码迁移仍保留主线映射后的全部 701 个源码、资源和测试文件;原有 24 个 Java 测试差异仍为相对路径调整。

项目 结果
冲突处理 保留主线的延迟 JSON 通配符和 JFR 产物,并映射到合并后的 packages/managed-agent-server/target 目录。
工作流和脚本回归测试 9 个相关测试套件共 334 项通过、10 项跳过。
Java 定向测试 241 项通过、0 项跳过,覆盖 Runtime Broker 服务、Server 集成和已提交事件发布。
静态检查 两套 Java Checkstyle、完整 YAML lint 和 actionlint、相关脚本 ESLint/Prettier 与空白检查均通过。
构建和类型检查 Core 构建通过。CLI 构建在默认 4 GiB Node 堆下内存不足,增加至 8 GiB 后通过;完整仓库类型检查也在 8 GiB 下通过。前一次主线同步的完整根目录构建同样通过。
当前评审状态 未解决的行内线程为 0,仍需审批。GitHub 当前报告此提交可合并。
当前提交 CI 已为此提交触发 SDK Java 验证:https://github.com/QwenLM/qwen-code/actions/runs/38731945141,尚待完成。已请求取消被替代的 702ed25 验证;更早的 c12d156 验证已确认取消。

@chiga0 chiga0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review (round 4): refactor(managed-agent): Consolidate server and broker sources

Verdict: APPROVE — five commits added since the dismissed round-3 review; all are main-sync material at the correct consolidated path. No new blockers.


New commits since round-3 head (d5d501d4ea9c)

30b5f53972c5 — chore(managed-agent): Sync main after the FG8 import fix
Import fix follow-up; TypeScript only. No Java production changes.

9f6ad8b44c7f — chore(managed-agent): Sync SQL and CSI changes into the standalone module
Brings in the managed-sql-millisecond-timestamps and managed-sql-query-cleanup main-branch work:

  • packages/managed-agent-server/src/main/resources/db/managed-schema/V1__managed_schema.sql: renames created_at/updated_at → gmt_create/gmt_modified (BIGINT UNSIGNED) across all tables; aligns ix_ma_session_list index to the new column name.
  • V3__session_list_created_at.sql: corresponding column-name alignment.
  • Store classes (AutomationLedgerStore, ChannelInstanceStore, ChildResultRelayStore, ChildWorkspaceStore, JdbcChannelDeliveryRepository, JdbcChannelRouteRepository, ManagedActionStore, ManagedAgentDefinitionStore, ManagedAgentStore, ManagedExtensionRecordStore, ManagedProjectionResourceCollector, ManagedReceipts, ManagedSchemaJdbcTemplate, ManagedSessionRetirementStore, ManagedSessionStore, ManagedSnapshotStore, ManagedTaskEventStore, ManagedToolResultProjector, ManagedToolResultStore, SessionMessageRelayStore, SessionResourceCollectionCollector, ToolPublicationAdmissionStore, ToolPublicationCollector): column reference updates, timestamp precision changes.
    All of these changes landed on main and were reviewed separately; this commit places them at the correct consolidated path.

4078245e3677 — chore(managed-agent): Sync latest main and align close fixtures

  • SessionLifecycleCoordinator.java: 86 additions — main-branch close-sequence work reviewed on main.
  • SessionLifecycleCoordinatorTest.java: 484 additions — corresponding tests.

17fc6826660a — chore(managed-agent): Sync main and reconcile CI fixtures
CI fixture reconciliation. No production Java changes.

c4c1f2a1db38 — test(managed-agent): Align Hosted fault fixtures with harness scope
Integration test helper updates (hosted-shell-output-driver.ts, hosted-store-failure-driver.ts, hosted-broker-reply-loss-driver.ts, hosted-cancellation-driver.ts, hosted-process-crash-driver.ts): adds harnessScoped tracking for SSH runtime-broker endpoints (/runtimes:warm, /tool-sessions:active-holds). These endpoints are harness-scoped rather than session-scoped and should not assert on runtimeSessionId; the fix is correct and consistent with the SSH Tool Runtime support from #14318.
HostedTeamLeadMySqlIT.java: minor fixture alignment.


Accumulated verified claims (all rounds)

  • All 649 production Java files: pure renames, 0+/0-.
  • 24 test files: relative path depth adjustments only.
  • Backward-compat scripts handle open PRs against old paths (CONTRACT_DOCUMENT_PREDECESSOR, historical Flyway paths).
  • CI fixes: shell: 'bash' for hosted Broker step; workflow_call support; concurrency group; cgroup v2 delegation.
  • Apache Commons utilities at consolidated path.
  • FG8 gate fixtures and Maven profile at consolidated path.
  • SQL timestamp and store query changes at consolidated path (main-reviewed separately).
  • Integration test helpers correctly scoped for SSH runtime-broker paths.

@yiliang114 yiliang114 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at head c4c1f2a1db (base c24e99e9cb, MERGEABLE). Delta re-review: my earlier vote at d5d501d4 was dismissed by five pushes, so I re-verified what actually moved rather than re-running a fresh pass. No P0/P1.

The delta past d5d501d4 is four origin/main merges plus exactly one branch-side content commit. git log --first-parent d5d501d4..c4c1f2a1db gives 30b5f539 / 9f6ad8b4 / 4078245e / 17fc6826 (all merges, second parents d98d1c70 / 25ef506c / 4a80f0a6 / c24e99e9 = current main tip) and c4c1f2a1db itself — 6 files, all test/harness. Base merges are not a free pass on a relocation PR, since main's edits land in the very trees this PR rewrites, so I checked the merged result instead of assuming it.

Production surface is byte-identical to current main. Mapping packages/sdk-java/{runtime-broker,managed-agent-server}/src/main/** onto packages/managed-agent-server/src/main/** and comparing blob SHAs: 288/288 identical (281 Java + 7 main resources), diff empty. Test side 428/428 by count. Retired roots: 0 paths; new module: 724. There is no production semantic change to review — the whole thing is the move.

Migrations tracked main instead of freezing. V1__managed_schema.sql moved 454f9c41 → c1a5872c and V3__session_list_created_at.sql 8720e29d → 03dd776b since d5d501d4; both now equal main's blobs exactly, as does V2 (88975986). Head and main each carry exactly V1/V2/V3, so no Flyway version collision.

The one branch-side commit is main-sanctioned, not a weakened gate. The five fault drivers now exempt two routes from assert.equal(fields.runtimeSessionId, promptId). Those two — /runtimes:warm and /tool-sessions:active-holds — are precisely main's two harnessRequest() call sites (hosted-workspace-broker.ts:180, :706), and main's own harnessRequest (:754) sends { harnessSessionId } only, documenting "Harness-scoped routes carry and answer no Runtime Session identity ... so a new harness-scoped caller cannot forget to exempt itself (#13986 R1-5)". The previous unconditional assertion was checking something production no longer does. Exclusion is scoped to the ledger only, the messages were honestly re-worded ("must not contact Broker" → "must not execute Broker operations") rather than quietly loosened, and the effect guards stay (acknowledge/release still asserted absent, "Unsettled execution must retain its owner" intact). hosted-shell-output-driver.ts allowing active-holds during restoring is main's #13930 R1-2 restart drain read, which is its documented purpose.

The IT expectation flip follows main's own contract. HostedTeamLeadMySqlIT went leadCloseWaitsForItsRunningMember → leadCloseCancelsItsRunningMember in merge 17fc6826, matching main's 2026-10-14-managed-close-stops-child-turn.md (#13875, option B: the cascade cancels the child's Turn itself) — child Turn ends CANCELLED, and releases.get("carol").getCount() == 1 proves the close did not wait out the held model response. Worth flagging for whoever owns #13875: main's own copy of this IT still asserts the old "waits" behaviour, and that doc says the real-stack acceptance probes "remain to be rerun" — this PR happens to bring the real-stack IT to the new contract ahead of main. The companion HOLD guard added in c4c1f2a1db is correctly indexed (MEMBER is H4EB1_MEMBER_([a-z]+)_(WAIT|HOLD|DONE), so group(2) is the verb) and right in substance: after cancellation the exchange is disconnected, so writing a natural report would be the bug.

Broker coverage did not shrink with main's new tests. The -Dtest=com/alibaba/qwen/code/runtimebroker/**/{Test*,*Test,*Tests,*TestCase}.java selector leaves 19 of 116 files unselected; all 19 are fixtures/helpers/contract bases and each carries @Test=0 (ExecutionTakeoverContract, RuntimeRecoveryContract, JdbcRepositoryContract, TestWorkspaces checked individually). Nothing real drops out.

CI at head is green — Test, Lint & Static, Serve A/B, Integration Tests (no-AK), reference distribution build, web-shell E2E, TUI parity, OpenTUI no-flicker all SUCCESS; only review-pr is QUEUED and the rest are expected SKIPPED. wenshao's independent A/B at d5d501d4 (23/23 assertions, no broker artifact resolves, 3807 default tests == base's 943+2864, identical failure sets, fault-gates 44/44) is pinned one head back, but the surface it certified is byte-identical to what is here now.

Still standing, both non-blocking and already acknowledged by the author — restating so they are not lost, not asking for them here:

  • P2 .github/workflows/ci.yml:1137 — the per-PR contract-version gate keys on packages/managed-agent-server/...openapi.json with a previous_filename fallback, while the two open-PR guards in this same diff were deliberately taught about the retired root. Deferred as follow-up.
  • P3 .github/workflows/sdk-java.yml:406 still declares MARIADB_DATABASE: 'runtime_broker_test' although this diff deleted the only step that connected to it. Harmless but actively misleading, since that is exactly the database whose emptiness ManagedSchemaMySqlIT documents as a precondition. Context-only line, so it cannot take an inline comment.

Not verified on this box: no MySQL/MariaDB, Docker or Linux execution, so the database-backed ITs (including the two files above) and the fault-gate profile are unread here — matching the PR's own out-of-scope list. Note sdk-java.yml has no pull_request trigger, so those lanes do not gate this PR either way; worth a glance at the first nightly after merge.

中文说明

在 head c4c1f2a1db 批准(base c24e99e9cb,MERGEABLE)。这是增量复审:我在 d5d501d4 的那票被五次推送 dismiss 掉了,所以只核对真正动了什么,没有重跑一遍全量。无 P0/P1。

  • 增量形态:d5d501d4..c4c1f2a1db 的 first-parent 链是四次 origin/main 合并 + 唯一一个分支侧内容提交 c4c1f2a1db(6 个文件,全是 test/harness)。搬家类 PR 不能把 base merge 当免费通过——main 的改动正落在本 PR 重写的那两棵树上,所以查的是合并结果而非假设。
  • 生产面与当前 main 逐字节一致:把 packages/sdk-java/{runtime-broker,managed-agent-server}/src/main/** 映射到 packages/managed-agent-server/src/main/** 比 blob SHA,288/288 全同(281 Java + 7 主资源),diff 为空。旧根 0 条路径,新模块 724 个文件。生产语义零改动,整个 PR 就是搬家。
  • 迁移跟着 main 走而不是被冻住:V1 从 454f9c41 变 c1a5872c、V3 从 8720e29d 变 03dd776b,两者现在都精确等于 main 的 blob,V2 亦然;head 与 main 都只有 V1/V2/V3,无 Flyway 版本号相撞。
  • 唯一的分支侧提交是 main 认可的口径,不是放水:五个 fault driver 放宽的两条路由 /runtimes:warm、/tool-sessions:active-holds 正是 main 自己两处 harnessRequest() 调用点,而 main 的 harnessRequest 只发 harnessSessionId,注释明写「Harness-scoped routes carry and answer no Runtime Session identity」。旧断言在校验生产已不再做的事。放宽只作用于 ledger,断言文案是诚实改写而非静默削弱,效果守卫(acknowledge/release、「Unsettled execution must retain its owner」)全部保留。
  • IT 期望翻转跟的是 main 自己的契约:leadCloseWaitsForItsRunningMember → leadCloseCancelsItsRunningMember 对应 main 的 #13875(option B,级联自己取消子 Turn),子 Turn 终态 CANCELLED,且 releases.get("carol").getCount() == 1 证明 close 没有等模型那条 held 响应。顺带提给 #13875 的负责人:main 自己那份 IT 仍写着旧的「waits」,设计文档也说真机验收探针「remain to be rerun」——本 PR 反而先把真机 IT 带到了新契约。配套的 HOLD 守卫索引正确(MEMBER 正则 group(2) 就是动词),语义也对:取消之后连接已断,再写自然报告才是 bug。
  • broker 覆盖没因 main 新增测试而缩水:-Dtest=...runtimebroker/** 选择器下 116 个文件里有 19 个未被选中,逐个查过 @Test=0,都是 fixture/helper/contract 基类,没有真测试漏掉。
  • head 的 CI 全绿,只有 bot 的 review-pr 在排队。wenshao 在 d5d501d4 的独立 A/B(23/23、broker 产物不解析、3807 例等于 base 两臂之和 943+2864、失败集合相同、fault-gates 44/44)钉在上一个 head,但它认证的生产面与现在逐字节相同。
  • 两条仍在、均非阻塞且作者已确认:P2 ci.yml:1137 契约版本门的触发路径;P3 sdk-java.yml:406 残留的 MARIADB_DATABASE: 'runtime_broker_test'(上下文行,挂不了 inline)。

本机未验证:无 MySQL/MariaDB、Docker、Linux,所以数据库 IT 与 fault-gate profile 未实跑,与 PR 自述的 out-of-scope 一致。另 sdk-java.yml 没有 pull_request 触发器,这些车道两边都不为本 PR 把关,建议合并后看一眼首个 nightly。

@doudouOUC
doudouOUC merged commit 28415dd into main Oct 16, 2026
63 of 64 checks passed
@doudouOUC
doudouOUC deleted the codex/managed-agent-server-layout branch October 16, 2026 00:29
yiliang114 added a commit to yiliang114/qwen-code that referenced this pull request Oct 16, 2026
Main relocated the managed-agent-server and runtime-broker sources (QwenLM#14277).
This merge carries the PR's changes across that move to
packages/managed-agent-server, leaving no files at the old
packages/sdk-java paths, and refreshes the lint-gate baseline
(eslint.config.js, .github/workflows/ci.yml).

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmva9zka98o
wenshao added a commit that referenced this pull request Oct 16, 2026
…lisecond SQL)

Merge origin/main 28415dd. Main moved the server to
packages/managed-agent-server, folded the Runtime Broker into it
(#14277), and switched persisted timestamps to BIGINT UNSIGNED epoch
milliseconds with gmt_create/gmt_modified names and explicit column
projections (#14185).

- V1 schema: keep consecutive_failures, budget_exempt_failures and
  budget_exempt_attempt next to main's unsigned millisecond columns.
- ManagedSchemaProjection: add the three columns to TURN and OPERATION.
  The mappers read them through additiveInt, which answers 0 for an
  absent column, so without this every Turn and operation would read a
  zero failure count and a zero answered watermark and the retry
  budgets would never close.
- Port this branch's SQL to the new conventions: updated_at becomes
  gmt_modified, the claim fences compare against
  ManagedSchemaTime.SQL_NOW, and the failed-lifecycle lookup orders by
  gmt_modified and gmt_create.
- claimOperation keeps this branch's re-drive of every blocked
  lifecycle shape (R6-2) with main's millisecond lease fence.
- Tests: pass the ManagedAgentService that #14218 added to
  SessionLifecycleCoordinator, and move fixture SQL to gmt_* columns and
  millisecond lease arithmetic.
qwen-code-dev-bot added a commit that referenced this pull request Oct 16, 2026
Resolve the module relocation from #14277
(packages/sdk-java/managed-agent-server -> packages/managed-agent-server):
the PR's new EventTransportBrokerGateStatisticsTest moves with the rename,
and its import block is reordered to the enforced Checkstyle group order
(*, java, then statics), which the relocated file violated.
yiliang114 added a commit to yiliang114/qwen-code that referenced this pull request Oct 16, 2026
Clears the "Check lint gate freshness" failure in Lint & Static: main moved
eslint.config.js (28415dd, QwenLM#14277) and .github/workflows/ci.yml
(c3012a5, QwenLM#14298) after this branch's baseline, so the lane was checking
out a stale gate definition. Pure mechanical merge, no hand edits: the merged
tree is byte-identical to `git merge-tree --write-tree` and the PR delta is
unchanged (24 files, +1773/-51).

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Patrol-Run: qwen-pr-conflict/jmvaik7ci93
@qwen-code-review-bot

Copy link
Copy Markdown
Collaborator

Released in v0.25.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/sdk type/enhancement Non-bug improvement or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants