Repository navigation
feat(managed-agent): enable external workspace execution - #15684
Conversation
🩺 serve daemon A/BBuilt the PR base vs this PR head
|
| field | PR base (before) | this PR (after) |
|---|---|---|
activeWorkStaleMs |
67 |
55 |
— Qwen Code · serve A/B
main landed step 3a (#15654) and the design doc's status line changed under it. Keep the slice-A amendment and state both increments in one status line instead of letting either side's sentence win: step 3a (provisioning prerequisite) and bounded slice A (external Workspace materialization) are implemented; both are inert and no Session can use them yet ... Everything else merged cleanly: capability-parity.ts keeps main's autofix_pr_watches row next to EXTERNAL_WORKSPACE_MATERIALIZE, and ExternalStorageRegistrationTest keeps main's provisioner read-path tests with this PR's controller constructor.
…branch The base moved when the stack base merged main, so the two design documents conflicted on the same status-line region: the base carries #15684's combined status line for slices A and step 3a, while this branch's document already supersedes it with the A / step 3a / B0 / B1 / B2 milestone status and §14. Take this branch's document for both files: every base-only line is the older framing (§12's status paragraph, the A-only admission limits) that this branch's §13/§14 explicitly supersede and reference, and the bounded-slice-A amendment is present and further qualified here. The merge therefore changes no file content; it records that the branch contains the current stack base.
|
@- |
|
The one red check on this head is the automated review workflow failing before it read the PR:
Every code lane on this head is green: SDK Java (fast) / ubuntu-latest / Java 21, Lint & Static, Test, Integration Tests (no-AK), TUI parity, web-shell E2E, Serve A/B — 21 pass, 0 failing code checks. Local verification within the module's budget (JDK 21.0.12.1 / Maven 3.10.0): ExternalWorkspaceMaterializationTest + ExternalStorageRegistrationTest = 20 tests / 0 failures; ManagedAgentApiContractTest + SurfaceRegistryGateTest + SurfaceRegistryGateNegativeTest + ManagedSurfaceCaptureTest + Because this PR carries #15654's step-3a merge on top, the reviewer-visible diff against main is exactly this PR's 13 files (+612/−24) — read it that way rather than against the stacked branch. |
chiga0
left a comment
There was a problem hiding this comment.
Review: feat(managed-agent): materialize inert external workspaces
Summary
This PR introduces the materialization step for external workspaces — a new REST endpoint POST /internal/managed-workspaces/v1/workspace:materialize-external that creates the metadata (ma_workspace, OWNER grant, EXTERNAL_WORKSPACE receipt) for an already-registered EXTERNAL storage. Critically, the materialized workspace is inert by design: no session can use it yet. That gate is the next PR.
What I checked
- Idempotent materialization: The store correctly handles exact retries returning the original receipt even after grant revocation/rename/removal. The idempotency key + tenant-scoped lock is the right pattern.
- Inert-by-design enforcement:
ManagedWorkspaceRegistryfilters EXTERNAL workspaces fromcanCreateSession(),findReadable(), andreadableGrant()— all three surfaces consistently block session creation. - Schema contract: New
EXTERNAL_WORKSPACEenum value inReceiptNamespacewith V1 CHECK constraint update (WHEN 'EXTERNAL_WORKSPACE' THEN 18). Monotonic sequence ordering is preserved. - Concurrency: Placement-domain lock (
lockPlacementDomain) serializes materialization against other tenant-scoped operations. The concurrency test verifies same-key replays and different-key one-winner semantics. - Test coverage: 360 lines of unit tests covering materialization, no-resurrection after receipt, session denial, operator boundary, closed body validation, receipt identity/conflict, persisted tuple drift, and concurrency.
Finding: summary() and readableGrant() changed from static to instance
Severity: Non-blocking (correctness concern)
File: ManagedWorkspaceRegistry.java
The summary() and readableGrant() methods changed from static to instance methods because they now call externalFilesAllowed() which requires externalFilesActivation (a Spring @Autowired bean). This is a reasonable change, but it introduces an implicit dependency: these methods are now called from within RowMapper lambdas during SQL result processing, which happens inside a JDBC transaction. If externalFilesActivation is not yet initialized (e.g., during early startup), these queries could NPE.
Mitigation: The @Autowired(required = false) on externalFilesActivation and the null check in externalFilesAvailable() handle this correctly — if the bean is absent, external files are unavailable, and the EXTERNAL filter stays blocked. So this is safe in practice.
Verdict
Approve. Clean, well-scoped foundation PR. The inert-by-design approach is the right way to build this incrementally — materialize first, enable execution in a separate PR with its own guards. The idempotent materialization pattern and comprehensive concurrency tests set a strong foundation for the lifecycle work in #15685.
Review by AI00002265 (阿奇) — pr-review skill
doudouOUC
left a comment
There was a problem hiding this comment.
QwenCode Reviewer 评审报告 — PR #15684
总体评价
本 PR 实现了 external Workspace materialization(有界切片 A),为已注册的外部存储别名创建元数据和幂等回执,不分配存储、不启动 worker、不启用 Session 执行。设计清晰、安全边界明确、测试覆盖充分。
评审结论:通过 ✅
改动内容与方案正确性
-
新增
POST /internal/managed-workspaces/v1/workspace:materialize-external端点 (ExternalStorageRegistrationController.java:127-149)- 请求体严格限定为 5 个字段 + 可选 trace-only
requestId,16 KiB 上限 - 复用已有 operator loopback + bearer token 认证(提取为
requireOperator()私有方法),安全边界不变 - 输入校验完整:tenant/alias/displayName/ownerActorId/idempotencyKey 均有正则或长度约束
- 请求体严格限定为 5 个字段 + 可选 trace-only
-
ExternalWorkspaceMaterializationStore.materialize()(新文件,131 行)- 事务内获取 placement-domain 锁,检查注册记录一致性(tenant、alias identity、provider/physical identity、revision、mount root)
- 拒绝已有 Workspace、Runtime binding、holder 或 maintenance 状态
- 原子创建
ma_workspace+OWNERgrant +EXTERNAL_WORKSPACEreceipt - 幂等重放返回原始回执,不恢复已撤销/改名/移除的状态 — 符合设计文档描述
-
Discovery 限制 (
ManagedWorkspaceRegistry.java:213-237, 252-257)- EXTERNAL storage 的
canCreateSession和canSelectDirectory均为 false - 批量 readable grant 也一致限制
- JOIN
ma_storage获取storage_kind的方式合理
- EXTERNAL storage 的
-
Schema 变更 (
V1__managed_schema.sql:607)- 新增
EXTERNAL_WORKSPACEnamespace 到 CHECK 约束,长度值 18 正确 - 遵循 fresh-catalog 策略,无 migration — 与设计文档一致
- 新增
-
Capability parity (
capability-parity.ts:598,SurfaceRegistry.java:446-449)- 新增
EXTERNAL_WORKSPACE_MATERIALIZEcapability,标记为 managed-only not-a-gap - Surface registry 正确注册路由与 rule class
- 新增
安全审查
- ✅ Operator 认证:loopback listener + local addr + remote addr + bearer token 四重校验,使用
MessageDigest.isEqual常量时间比较 - ✅ 输入校验:所有字符串参数有正则/长度/控制字符检查,
displayName拒绝 ISO control characters - ✅ 无硬编码密钥/Token
- ✅ SQL 注入防护:全部使用参数化查询
- ✅ 事务完整性:receipt insert 失败会回滚 workspace 和 grant(有专门测试
receiptInsertFailureRollsBackWorkspaceAndGrant) - ✅ 并发安全:同键并发只产生一个 Workspace(有 MySQL 并发测试)
- ✅ 回执不包含敏感信息(测试验证不含 operator-secret)
测试覆盖
ExternalWorkspaceMaterializationTest:360 行,覆盖正常流程、幂等重放、不复活、operator 边界、闭合请求校验、内容冲突、持久化元组漂移、忙碌 owner、已有 Workspace/Runtime 拒绝、MySQL 并发ExternalWorkspaceMaterializationMySqlIT:MySQL 集成测试ExternalStorageRegistrationTest:更新构造函数适配- 测试质量高,边界条件覆盖全面
CI/门禁状态
- Build and verify reference distribution: ✅ pass
- Check TUI impact: ✅ pass
- Integration Tests (no-AK, No Sandbox): ✅ pass
- Lint & Static: ✅ pass
- Test (ubuntu-latest, Node 22.x): ✅ pass
- Serve A/B: ✅ pass
- web-shell E2E Smoke: ✅ pass
- TUI parity snapshots: ✅ pass
- SDK Java tests: ✅ pass/skipping (expected)
review-pr: ❌ fail — 这是仓库自身的 AI review bot,非代码质量门禁,不影响合入标准Installed npm Node26 private Bun acceptance: ⏳ pendingfallback-comment: ⏳ pending
建议项(非阻塞)
-
ExternalWorkspaceMaterializationStore.java:139:input.requestId() != null && !input.requestId().matches(...)中 Jackson 对未知字段的处理依赖FAIL_ON_UNKNOWN_PROPERTIES=false(已在 ObjectMapper 配置),但如果未来有人修改 ObjectMapper 配置,可能导致意外行为。建议在MaterializeRequestrecord 上显式标注@JsonIgnoreProperties(ignoreUnknown = true)或在类级别文档说明此依赖。 -
设计文档同步: 中英文设计文档更新详尽,保持了良好的双语同步习惯 👍
安全审查结论:无安全漏洞发现。
本 PR 是一个精心设计的惰性元数据操作,安全边界清晰,测试覆盖充分,可以合入。
doudouOUC
left a comment
There was a problem hiding this comment.
QwenCode Reviewer 评审报告 — PR #15684
总体评价
本 PR 实现了 external Workspace materialization(有界切片 A),为已注册的外部存储别名创建元数据和幂等回执,不分配存储、不启动 worker、不启用 Session 执行。设计清晰、安全边界明确、测试覆盖充分。
评审结论:通过 ✅
改动内容与方案正确性
-
新增
POST /internal/managed-workspaces/v1/workspace:materialize-external端点 (ExternalStorageRegistrationController.java:127-149)- 请求体严格限定为 5 个字段 + 可选 trace-only
requestId,16 KiB 上限 - 复用已有 operator loopback + bearer token 认证(提取为
requireOperator()私有方法),安全边界不变 - 输入校验完整:tenant/alias/displayName/ownerActorId/idempotencyKey 均有正则或长度约束
- 请求体严格限定为 5 个字段 + 可选 trace-only
-
ExternalWorkspaceMaterializationStore.materialize()(新文件,131 行)- 事务内获取 placement-domain 锁,检查注册记录一致性(tenant、alias identity、provider/physical identity、revision、mount root)
- 拒绝已有 Workspace、Runtime binding、holder 或 maintenance 状态
- 原子创建
ma_workspace+OWNERgrant +EXTERNAL_WORKSPACEreceipt - 幂等重放返回原始回执,不恢复已撤销/改名/移除的状态 — 符合设计文档描述
-
Discovery 限制 (
ManagedWorkspaceRegistry.java:213-237, 252-257)- EXTERNAL storage 的
canCreateSession和canSelectDirectory均为 false - 批量 readable grant 也一致限制
- JOIN
ma_storage获取storage_kind的方式合理
- EXTERNAL storage 的
-
Schema 变更 (
V1__managed_schema.sql:607)- 新增
EXTERNAL_WORKSPACEnamespace 到 CHECK 约束,长度值 18 正确 - 遵循 fresh-catalog 策略,无 migration — 与设计文档一致
- 新增
-
Capability parity (
capability-parity.ts:598,SurfaceRegistry.java:446-449)- 新增
EXTERNAL_WORKSPACE_MATERIALIZEcapability,标记为 managed-only not-a-gap - Surface registry 正确注册路由与 rule class
- 新增
安全审查
- ✅ Operator 认证:loopback listener + local addr + remote addr + bearer token 四重校验,使用
MessageDigest.isEqual常量时间比较 - ✅ 输入校验:所有字符串参数有正则/长度/控制字符检查,
displayName拒绝 ISO control characters - ✅ 无硬编码密钥/Token
- ✅ SQL 注入防护:全部使用参数化查询
- ✅ 事务完整性:receipt insert 失败会回滚 workspace 和 grant(有专门测试
receiptInsertFailureRollsBackWorkspaceAndGrant) - ✅ 并发安全:同键并发只产生一个 Workspace(有 MySQL 并发测试)
- ✅ 回执不包含敏感信息(测试验证不含 operator-secret)
测试覆盖
ExternalWorkspaceMaterializationTest:360 行,覆盖正常流程、幂等重放、不复活、operator 边界、闭合请求校验、内容冲突、持久化元组漂移、忙碌 owner、已有 Workspace/Runtime 拒绝、MySQL 并发ExternalWorkspaceMaterializationMySqlIT:MySQL 集成测试ExternalStorageRegistrationTest:更新构造函数适配- 测试质量高,边界条件覆盖全面
CI/门禁状态
- Build and verify reference distribution: ✅ pass
- Check TUI impact: ✅ pass
- Integration Tests (no-AK, No Sandbox): ✅ pass
- Lint & Static: ✅ pass
- Test (ubuntu-latest, Node 22.x): ✅ pass
- Serve A/B: ✅ pass
- web-shell E2E Smoke: ✅ pass
- TUI parity snapshots: ✅ pass
- SDK Java tests: ✅ pass/skipping (expected)
review-pr: ❌ fail — 这是仓库自身的 AI review bot,非代码质量门禁,不影响合入标准Installed npm Node26 private Bun acceptance: ⏳ pendingfallback-comment: ⏳ pending
建议项(非阻塞)
-
ExternalWorkspaceMaterializationStore.java:139:input.requestId() != null && !input.requestId().matches(...)中 Jackson 对未知字段的处理依赖FAIL_ON_UNKNOWN_PROPERTIES=false(已在 ObjectMapper 配置),但如果未来有人修改 ObjectMapper 配置,可能导致意外行为。建议在MaterializeRequestrecord 上显式标注@JsonIgnoreProperties(ignoreUnknown = true)或在类级别文档说明此依赖。 -
设计文档同步: 中英文设计文档更新详尽,保持了良好的双语同步习惯 👍
安全审查结论:无安全漏洞发现。
本 PR 是一个精心设计的惰性元数据操作,安全边界清晰,测试覆盖充分,可以合入。
qqqys
left a comment
There was a problem hiding this comment.
APPROVE at head 68b02f94.
Critical-only scan found no blocking defect. I read all five production files and the schema change, and I checked the three places this shape can fail: the managed-schema CHECK, the new store's transaction discipline, and the authorization guard that the controller refactor moved.
1. The schema CHECK edit is literal-only, and the boot lane confirms it
V1__managed_schema.sql adds one arm to ck_ma_request_namespace: WHEN 'EXTERNAL_WORKSPACE' THEN 18. Two things make this safe where a schema edit usually is not:
- The declared length is right.
EXTERNAL_WORKSPACEis 18 characters, and the constraint compares the CASE result againstCHAR_LENGTH(namespace), so the arm admits exactly the enum value it names and nothing else.ELSE -1still rejects any unlisted namespace. - No function MySQL canonicalizes was introduced. The added tokens are a string literal, an integer and two keywords.
CHAR_LENGTHwas already in the constraint and prints back fromCHECK_CLAUSEunchanged, so the verbatim token comparisonManagedSchemaCatalog.validateChecksperforms still matches. Had this used a synonym MySQL folds on store —OCTET_LENGTHresolving toItem_func_lengthand printing aslength— the context would fail to boot.
That reasoning is corroborated rather than left standing on its own: Build and verify reference distribution passes at this head, which is the lane that boots the exact archive and runs ManagedSchema.validate. ManagedSchemaContract.ReceiptNamespace gains EXTERNAL_WORKSPACE in the same commit, so the Java enum and the DDL arm stay in lockstep. Editing V1 in place is the established convention here — the same CASE already carries nine namespaces accumulated the same way — and ExternalWorkspaceMaterializationMySqlIT is added to pin the scenario against a real MySQL.
2. The new store locks before it reads, and fails closed on every ambiguity
ExternalWorkspaceMaterializationStore gets the ordering right, which is the part most likely to be wrong: WorkspaceStorageKindGuard.requireFreshTransaction() runs before transaction.execute, and lockDomain(jdbc, tenant, 10) is the first statement inside it. Every read therefore happens after the lock is held and inside a fresh snapshot, so there is no discovery→lock→re-read window in which a REPEATABLE READ snapshot pinned before the lock could serve stale evidence.
The admission chain requires exactly one row at each step and refuses otherwise: the ma_storage registration is selected FOR UPDATE with storage_kind = 'EXTERNAL' AND registration_state = 'REGISTERED' and registrations.size() != 1 throws; a COUNT(*) re-check binds (alias_key, tenant_key, storage_key, physical_key, registration_revision); the ma_storage_owner row is selected FOR UPDATE and must be mount_state = 'UNVERIFIED' with holder_key, binding_id, runtime_generation, runtime_session_id, maintenance_id and maintenance_generation all NULL — so a storage already bound to a runtime cannot be materialized; and an existing ma_workspace claiming either the id or the storage conflicts. Every refusal is 409 with retryable=false.
Input validation is strict and rejects the whole call on any failure: regex-bounded tenant, registeredAliasId and idempotencyKey, a non-blank displayName under 128 characters with no code point satisfying Character.isISOControl, and a non-blank ownerActorId. Idempotency binds the replay to the request: a prior receipt with a different requestDigest throws idempotency_conflict rather than returning the earlier result. All SQL is parameterized, transaction.setTimeout(10) bounds the unit, and I counted the two INSERTs' columns against their placeholders and arguments — ma_workspace is 12 columns / 8 placeholders / 8 arguments in order, ma_workspace_access 4 / 3 / 3.
3. The authorization extraction does not weaken the guard
Moving the loopback-operator check into requireOperator(request) is the riskiest edit in the diff, since a subtle loss would silently open an internal write route. I compared the removed block against the method at head line by line: the loopbackListener derivation, all three loopback tests (getLocalAddr, getRemoteAddr, and the listener address), the token == null || token.isBlank() refusal, the authorization.length() > 4096 cap and the MessageDigest.isEqual constant-time comparison are all present and unchanged, and the 403 external_storage_registration_denied refusal is identical. It is called at both endpoints — register (line 51) and materialize (line 82) — before either reads the request body.
The new route also carries the surrounding hygiene: Cache-Control: no-store set on the response and repeated as cacheControl(noStore()), the same 16384-byte body cap with a 413 on overflow, requestId constrained to [\x21-\x7e]{1,128} before RequestIdFilter.useClientId, and the shared strict ObjectMapper.
4. The registry join cannot multiply rows, and its new terms only restrict
findReadable gains LEFT JOIN ma_storage s ON s.tenant_id = r.tenant_id AND s.storage_id = r.storage_id. ma_storage is unique on (tenant_key, storage_key), both CHAR(64) and both derived deterministically from the tenant and storage ids the join uses — the store itself builds them via storageFenceKey(tenant) and storageFenceKey(registeredAliasId) — so the join is one-to-one and cannot duplicate a grant. Where no storage row exists the LEFT JOIN yields NULL, and !"EXTERNAL".equals(null) is true, so non-external workspaces keep exactly the capabilities they had.
The three added && !"EXTERNAL".equals(result.getString("storage_kind")) terms appear in summary's operator-capable flag, summary's owner-root flag (alongside the existing SSH_LOCAL and CSI exclusions) and readableGrant. All three only ever turn a capability off, which is the correct direction for materializing workspaces the design describes as inert.
5. Surface parity is consistent across all three pins
The new internal route is registered coherently: managed-surface.txt gains EXTERNAL_WORKSPACE_MATERIALIZE POST /internal/managed-workspaces/v1/workspace:materialize-external internal with its sha256 header updated, SurfaceRegistry.java gains the name, and capability-parity.ts adds EXTERNAL_WORKSPACE_MATERIALIZE to MANAGED_ONLY_NOT_A_GAP beside the existing EXTERNAL_STORAGE_REGISTER — so an internal-only operator route is not reported as a missing client capability. The @PostMapping path matches the pinned line exactly.
6. Scope of verification, and CI
I did not compile or run the Java suite — no JRE on this machine — so the execution evidence is CI's. At review time: 22 pass, 41 skipping, 15 pending, 1 fail. The failure is review-pr, which is not a gate in any state. Green and load-bearing here: Build and verify reference distribution (boots the archive, validates the schema), SDK Java (fast) / ubuntu-latest / Java 21 (compiles and runs the new 360-line ExternalWorkspaceMaterializationTest), both Flyway migration version uniqueness lanes, Managed Agent fast tier, and Lint & Static for the TypeScript parity change. Still pending: the SDK Java (full) tier, including Runtime Broker and Managed Agent MySQL / MariaDB, which is what would execute ExternalWorkspaceMaterializationMySqlIT. I did not wait on them, and they are not what this verdict rests on — but the MySQL-specific behaviour of the new store is the one thing not yet executed anywhere I can see.
Not read: the design-doc deltas and the bulk of the 360-line unit test. The docs are non-executable, and the tests are additive for new code rather than edits to an existing gate.
* feat(managed-agent): add the external-workspace provisioning prerequisite (#15512) Step 3a of the external Hosted Workspace plan: a new `external-workspace` Runtime provisioner kind that places a session-isolated worker on a registered EXTERNAL storage tree and mints the boot document the shipped worker already admits (`managed-context/1` plus the existing `storage` member). The storage identity comes only from the durable registration: a read-only primary-key lookup that admits `REGISTERED` rows, bounds the revision to 2^53-1, joins the owner row on its own primary key, and fails closed when a persisted row disagrees with itself. A registration that cannot be read to completion stays retryable (`runtime_external_unavailable`) so the Broker keeps the placement adoptable instead of burying it. `external-workspace` accepts only the closed evidence set {storageRef, mountRoot, continuity}; `mountNonce` from the design is deferred and explicitly refused, because the registration record cannot persist it yet and an unverifiable claim must not be ignored. Hosted tools, EXECUTION admission, publication consumption, `stopDrained` and close gating are not enabled: `supportsDrainedStop()` stays false, every managed Workspace feature remains refused, and preflight now states the prerequisite in an `external-prerequisite` warning. No Session can be placed yet, and every placement fails closed. `external-scratch` behavior and wording, the shipped worker boot/storage/registration.json contract, the schema and the CLI are unchanged. * test(managed-agent): pin external storage refusal in lock canary * fix(managed-agent): require exact external workspace digest * fix(managed-agent): reject storage evidence for non-running workers * feat(managed-agent): add inert exact-worker external drain * feat(managed-agent): fence external workspace ownership and drain * feat(managed-agent): enable external files with verified close * docs: record verified external files and remaining phase two work * fix(web-shell): avoid recovery warning for closed sessions
0f7b8c0
|
Recording it so a re-run or a later look has a baseline; nothing else is known about the cause from the job metadata alone. The three approvals on |
… list #15685 adds HostedExternalPublicFilesIT, so hosted-process-ci.test.js's expected class list must carry it; the meta-test pins which IT classes the hosted-process lane runs and had 35 entries against 36 discovered.
|
Review scope changed on this head, so it needs a fresh look rather than the earlier approvals. What landed since the approvals: #15685 merged into this PR's base branch ( One real fix in this head: Since the merge: conflicts were only the two design documents (main's step-3a status line vs this PR's bounded-slice-A amendment) — resolved by keeping the amendment and writing one status line naming both shipped increments, zh in sync. Everything else auto-merged; the merged tree differs from main by exactly this PR's files. Local verification on the merged tree, within the module's 10-minute budget (JDK 21.0.12.1 / Maven 3.10.0): What to review now: the combined managed-agent external-workspace surface against main — materialization (this PR) and the files-with-verified-close path (from #15685) — and whether the combined diff still reads as two clearly separable increments. CI note: the |
doudouOUC
left a comment
There was a problem hiding this comment.
QwenCode Reviewer 复审报告 — PR #15684 (Incremental Re-review)
HEAD 变更确认
上次评审 HEAD: 68b02f9 → 当前 HEAD: 2aaee5e
新增 3 个 commit:
68b02f9Merge origin/main into feat/15512-completion0f7b8c0feat(managed-agent): enable external files with verified close (#15685) — squash merge of PR #156852aaee5etest(ci): pin HostedExternalPublicFilesIT in the hosted-process class list
增量 diff 59 files / +4760 lines,主体为 PR #15685 的内容合入(已在上一轮独立评审中完整审查并通过),加上一个 CI 配置 commit(仅将 HostedExternalPublicFilesIT 添加到测试列表,安全无风险)。
原始 slice A 代码(04306a9)未发生变化。
复审结论:通过 ✅
依据:
- 原始 slice A(external Workspace materialization)代码不变,上次评审结论仍然有效
- 合入的 #15685 内容已在独立评审中完整审查并通过(工具白名单、optional lanes 闭合、SQL-level physical ownership、drain proof 校验、attestation pinning 等安全护栏均确认完备)
- 新增 CI pin commit (
2aaee5e) 仅添加测试类名到列表,无功能变更 - 设计文档 §14 正确记录了 A/B0/B1/B2 里程碑边界和剩余门禁
CI/门禁状态
已完成 check 均 pass:
- Lint & Static: ✅ pass
- Integration Tests (no-AK, No Sandbox): ✅ pass
- Test (ubuntu-latest, Node 22.x): ✅ pass
- Serve A/B: ✅ pass
- OpenTUI no-flicker gate: ✅ pass
- Build and verify reference distribution: ✅ pass
- SDK Java (fast) / Flyway migration version uniqueness: ✅ pass
- SDK Java (fast) / Real daemon E2E / Java 11: ✅ pass
- Check TUI impact: ✅ pass
- Classify PR: ✅ pass
Pending(运行中):
- SDK Java (fast) / ubuntu-latest / Java 21
- web-shell E2E Smoke
- Installed npm Node26 private Bun acceptance
- Capture web-shell visuals
- TUI parity snapshots
无失败 check。
安全审查
- ✅ 原始 slice A 安全边界不变(operator 四重认证、输入校验、事务原子性、幂等重放、并发安全)
- ✅ 合入的 #15685 安全护栏已在上次评审中确认(工具白名单、physical ownership 排他锁、drain proof schema 校验、redirect 防护、late write 409)
- ✅ CI pin commit 无安全影响
- ✅ 无硬编码密钥/Token、无 SQL 注入风险
建议项(非阻塞,延续上次评审)
MaterializeRequestrecord 建议显式标注@JsonIgnoreProperties(ignoreUnknown = true)ManagedAgentStore.javainsertTurn SQL 中 hex literalX'7177656e2d636f6465'建议加注释WorkspaceRuntimeTransport.java第二个构造函数重复赋值verifyExternalAcquisition建议移除- PR 现含 68 files / +5306 lines(含 #15685 内容),后续类似规模可考虑拆分
安全审查结论:无安全漏洞发现。
本 PR 原始 slice A 代码未变,合入的 #15685 内容已通过独立评审,CI pin 安全无风险。复审通过,待 CI 全部完成后可合入。
doudouOUC
left a comment
There was a problem hiding this comment.
QwenCode Reviewer 复审报告 — PR #15684 (Incremental Re-review)
HEAD 变更确认
上次评审 HEAD: 68b02f9 → 当前 HEAD: 2aaee5e
新增 3 个 commit:
68b02f9Merge origin/main into feat/15512-completion0f7b8c0feat(managed-agent): enable external files with verified close (#15685) — squash merge of PR #156852aaee5etest(ci): pin HostedExternalPublicFilesIT in the hosted-process class list
增量 diff 59 files / +4760 lines,主体为 PR #15685 的内容合入(已在上一轮独立评审中完整审查并通过),加上一个 CI 配置 commit(仅将 HostedExternalPublicFilesIT 添加到测试列表,安全无风险)。
原始 slice A 代码(04306a9)未发生变化。
复审结论:通过 ✅
依据:
- 原始 slice A(external Workspace materialization)代码不变,上次评审结论仍然有效
- 合入的 #15685 内容已在独立评审中完整审查并通过(工具白名单、optional lanes 闭合、SQL-level physical ownership、drain proof 校验、attestation pinning 等安全护栏均确认完备)
- 新增 CI pin commit (
2aaee5e) 仅添加测试类名到列表,无功能变更 - 设计文档 §14 正确记录了 A/B0/B1/B2 里程碑边界和剩余门禁
CI/门禁状态
已完成 check 均 pass:
- Lint & Static: ✅ pass
- Integration Tests (no-AK, No Sandbox): ✅ pass
- Test (ubuntu-latest, Node 22.x): ✅ pass
- Serve A/B: ✅ pass
- OpenTUI no-flicker gate: ✅ pass
- Build and verify reference distribution: ✅ pass
- SDK Java (fast) / Flyway migration version uniqueness: ✅ pass
- SDK Java (fast) / Real daemon E2E / Java 11: ✅ pass
- Check TUI impact: ✅ pass
- Classify PR: ✅ pass
Pending(运行中):
- SDK Java (fast) / ubuntu-latest / Java 21
- web-shell E2E Smoke
- Installed npm Node26 private Bun acceptance
- Capture web-shell visuals
- TUI parity snapshots
无失败 check。
安全审查
- ✅ 原始 slice A 安全边界不变(operator 四重认证、输入校验、事务原子性、幂等重放、并发安全)
- ✅ 合入的 #15685 安全护栏已在上次评审中确认(工具白名单、physical ownership 排他锁、drain proof schema 校验、redirect 防护、late write 409)
- ✅ CI pin commit 无安全影响
- ✅ 无硬编码密钥/Token、无 SQL 注入风险
建议项(非阻塞,延续上次评审)
MaterializeRequestrecord 建议显式标注@JsonIgnoreProperties(ignoreUnknown = true)ManagedAgentStore.javainsertTurn SQL 中 hex literalX'7177656e2d636f6465'建议加注释WorkspaceRuntimeTransport.java第二个构造函数重复赋值verifyExternalAcquisition建议移除- PR 现含 68 files / +5306 lines(含 #15685 内容),后续类似规模可考虑拆分
安全审查结论:无安全漏洞发现。
本 PR 原始 slice A 代码未变,合入的 #15685 内容已通过独立评审,CI pin 安全无风险。复审通过,待 CI 全部完成后可合入。
qqqys
left a comment
There was a problem hiding this comment.
COMMENT at head 2aaee5e1 — not approving. This is not a re-review of the change I approved at 68b02f94; the branch absorbed #15685 and the PR grew from 13 files/+612/−24 to 68 files/+5364/−317, so my approval was dismissed and the scope is now roughly nine times what I certified. Everything I read at this head is sound. I am not able to scan the rest in this pass's budget, and most of it is surface I explicitly named as unread when I reviewed #15685 an hour ago.
1. What the head now contains
Two commits landed after 68b02f94: 0f7b8c00 (feat(managed-agent): enable external files with verified close (#15685)) and 2aaee5e1 (test(ci): pin HostedExternalPublicFilesIT in the hosted-process class list). The first brings in the whole of #15685 — step 3b, which turns the inert external workspaces this PR materializes into ones that can actually serve files. The second is one line, adding 'HostedExternalPublicFilesIT' to the hosted-process class list in scripts/tests/hosted-process-ci.test.js; I confirmed that class exists at this head (packages/managed-agent-server/src/test/java/.../HostedExternalPublicFilesIT.java), so the pin names a real gate rather than a phantom one.
The two changes are complementary rather than redundant: #15684 creates an EXTERNAL workspace with its capability flags forced off, and #15685 supplies the predicate that turns files back on once the binding is provably current. That combination is what makes the merged form of ManagedWorkspaceRegistry worth reading closely, since neither of my prior reviews saw it.
2. What I verified at this head
#15684's own contributions survived the merge. V1__managed_schema.sql still carries WHEN 'EXTERNAL_WORKSPACE' THEN 18 in ck_ma_request_namespace, and ManagedSchemaContract.ReceiptNamespace still declares EXTERNAL_WORKSPACE — the DDL arm and the Java enum are still in lockstep, and 18 is still the correct CHAR_LENGTH for that literal. ManagedWorkspaceRegistry still carries the LEFT JOIN ma_storage s ON s.tenant_id = r.tenant_id AND s.storage_id = r.storage_id, now at three query sites rather than the one #15684 added.
The capability relaxation is fail-closed on every axis I could reach. #15685 changed summary's operator-capable flag from #15684's unconditional !"EXTERNAL".equals(storage_kind) to (!"EXTERNAL".equals(storage_kind) || externalFilesAllowed(tenantId, workspaceId)). A relaxation of an access predicate is the thing to read hardest, so I followed it:
externalFilesAllowed(String, String)first requiresexternalFilesAvailable(), then queriesma_workspaceby tenant and workspace and requiresrows.size() == 1before delegating — an ambiguous or absent row is a refusal, not a pass.externalBindingCurrentthen requires, conjunctively: non-null binding/properties/registrations;cwdRelativeexactly"."(root, not a subdirectory); the binding'scontextConfigRefequal toCONTEXT_CONFIG_REF; ama_workspacerow pinned on tenant, workspace,workspace_generation,storage_id,workspace_kind = 'ROOT'andstate = 'ACTIVE', whoseconfig_refandpolicy_refboth equal the profile constants, withrows.size() != 1 || !rows.getFirst()refusing; and finally a three-way identity agreement — the registration exists for that tenant and storage,binding.getWorkspaceId()equalsregistered.tenantWorkspaceId(), and the configuredexternalProviderIdequalsregistered.providerId().- Every one of those paths returns
false. There is no default-true branch and no exception that escapes as permission.
The generation pin is the detail that makes this more than a name comparison: a stale binding from an earlier workspace generation cannot satisfy it. And line 449 adds an independent gate — isExternal(binding) && (!externalFilesAllowed(binding) || !".".equals(binding.getCwdRelative())) — so the tool path refuses an external binding whose cwd is not the root even when files are allowed.
The owner-root flag at line 284-288 keeps the unconditional !"EXTERNAL".equals(storage_kind) alongside the existing SSH_LOCAL and CSI exclusions, so the relaxation is confined to the operator-capable flag and does not leak into root ownership.
3. What I did not read, which is why this is not an approval
The production surface I verified an hour ago on #15685 and still have not read — now part of this PR: JdbcExternalWorkspaceOwnership.java (+373, entirely new, and the file that carries ownership and identity for external workspaces), WorkspaceExecutionStore.java (+176/−5), RuntimeBrokerService.java (+159/−33), WorkspaceRuntimeTransport.java (+159/−16), HttpRuntimeTransport.java (+121/−3), ExternalWorkspaceProvisioner.java (+129/−8), hosted-harness-session.ts (+125/−38), hosted-workspace-tool-turn.ts (+45/−4), ManagedAgentStore.java (+52/−15), EmbeddedRuntimeBroker.java (+39/−8), WorkspaceMigrationAdmission.java (+37, new), and ManagedSessionsPage.tsx. Also unread: the remainder of ManagedWorkspaceRegistry's own +78/−7 beyond the two predicates above, and the ~2,500 lines of tests.
Two things follow from the merge that no prior review of either PR covers. First, the reconciled form of every file both PRs touched — ManagedWorkspaceRegistry is the one I checked, and its combined shape is deliberate rather than accidental, but I only read two of its methods. Second, #15684's materialization produced workspaces that were inert by construction; with #15685 present in the same branch, the inertness now depends entirely on externalFilesAllowed returning false. That is a correct design, and the predicate is well guarded, but it means the safety property I approved at 68b02f94 is no longer structural — it is conditional, and the condition lives in code paths I have only partly read.
4. CI
14 pass, 9 skipping, 5 pending, 0 fail at review time. The suite had been retriggered by the two new commits and was still materializing, so this is a snapshot rather than a verdict; I did not wait on it and CI is not what this comment rests on.
Next step
The useful next round is on #15685's surface as it now stands inside this branch, starting with JdbcExternalWorkspaceOwnership.java and the two transport diffs. If the intent is to land #15684's materialization on its own, note that the branch no longer contains only that change — the approval I gave at 68b02f94 covered a 13-file increment and does not extend to this one, which is why I am recording a comment rather than re-issuing it.
chiga0
left a comment
There was a problem hiding this comment.
审查总结
这是一个大型 PR(68 个文件,+5364/-317),实现了外部 workspace 的完整生命周期管理。相比之前的版本,新增了 Java 后端实现(48 个文件),形成了完整的前后端集成方案。
主要变更
1. TypeScript 前端(15 个文件)
- 新增
hosted-workspace-external-files/1profile,仅支持read_file,write_file,edit,glob - 明确禁用 shell、monitor、capture、skills 等高级功能
- 添加外部 workspace 的准入检查和生命周期管理
2. Java 后端(48 个文件)
ExternalWorkspaceMaterializationStore: 外部 workspace 物化存储,包含严格的输入验证和事务管理WorkspaceExecutionStore: 执行存储,支持外部 workspace 的 claim/hold/release 操作ManagedWorkspaceRegistry: workspace 注册表,管理外部 workspace 的准入SessionLifecycleCoordinator: 生命周期协调器,处理 drain 和 closeWorkspaceRuntimeProvisioner: runtime provisioner,管理外部 runtime 的创建和销毁
3. SQL 迁移
- 在
ma_request_receipt表中添加EXTERNAL_WORKSPACEnamespace 支持
4. 测试覆盖
- 大量单元测试覆盖各个存储层和业务逻辑
HostedExternalPublicFilesIT: 896 行的端到端集成测试,覆盖完整的注册→物化→执行→关闭流程- 设计文档中提到在 remote191 上通过了真实 MySQL 环境的验证
安全性分析
优点:
- 所有 SQL 查询都使用参数化查询,防止 SQL 注入
- 严格的事务隔离和锁定机制(
FOR UPDATE) - 幂等性检查防止重复操作
- 多层权限验证(operator, owner)
- 存储状态验证(REGISTERED, UNVERIFIED)
- 输入验证使用正则表达式,防止恶意输入
需要关注的点:
- 代码复杂度高,特别是
WorkspaceExecutionStore中的多个重载方法 - 事务超时设置为 10 秒,需要确认是否足够
- 外部 workspace 的 claim/hold/release 逻辑需要仔细验证并发安全性
测试覆盖评估
测试覆盖非常全面:
- 单元测试:覆盖各个存储层的核心逻辑
- 集成测试:
HostedExternalPublicFilesIT覆盖完整流程 - 设计文档中提到使用真实 MySQL 8.4.13 环境验证
建议
- 性能优化:
WorkspaceExecutionStore中的isExternal方法每次都查询数据库,可以考虑缓存 - 代码简化:
authorizeAttachment有多个重载版本,可以考虑合并或提取公共逻辑 - 文档更新:设计文档非常详细,但代码中的注释相对较少,建议补充关键逻辑的注释
结论
这是一个复杂但实现良好的 PR,覆盖了外部 workspace 的完整生命周期。代码质量高,测试覆盖全面,安全性考虑充分。虽然代码复杂度高,但通过严格的验证和事务管理确保了正确性。
建议:批准合并
主要理由:
- 设计文档详细,明确了实现边界和限制
- 代码实现与设计方案一致
- 测试覆盖全面,包括端到端集成测试
- 安全性考虑充分,使用了参数化查询、事务隔离和权限验证
- 设计文档中提到已在真实环境中验证通过
需要注意的是,这个 PR 仍然是完整目标的一部分(#15512),后续还需要实现 shell、monitor、capture 等功能。
|
Blocking red checks on the current head
None of these is a required status check, so they don't show up on the PR page, but |
…ain claim The external-files increment resolved the Workspace above the Agent pin, so a request whose stored definition cannot take effect, or whose revision cannot be selected, was refused on Workspace grounds first: it answered 404 workspace_required and a bare IllegalStateException instead of 409 agent_definition_unsupported / 400 unsupported_feature. Resolve the pin first again and keep the external pin rewrite once the Workspace is known. The close-claim validation admitted only DRAINING, but drainClaimedBinding deliberately keeps a LOST binding in LOST until its stop proof commits, so the arm refused its own claim with runtime_close_claim_pending instead of surfacing the stop's runtime_broker_recovery_blocked. BindingRenewal now records that its claim was taken on a LOST binding and admits that state. The settlement probe reads the storage kind to refuse an EXTERNAL tree the bridge holds no mount for, so its fixture needs the managed catalog rather than an empty database. The lock-order canary gains the new ExternalWork.apply/3 ambiguity, whose callee locks the Session row first and never reads ma_turn.
|
Real signatures (none of which the annotation summary showed):
Root cause. Three production behaviour changes and two fixture/snapshot consequences, all from the external-files increment:
Why the two test-side changes are the correct expectations. The lock-order canary's new Verification (JDK 21.0.12.1, Maven 3.10.0,
Still CI-owned: the whole |
|
The repair is now pushed as The five affected classes now report 217 tests, 0 failures, 0 errors, 0 skipped. That does not turn the wider local run green: its missing Core build artifacts and platform-specific failures remain recorded in the preceding repair report. Additional local real-stack verification is in progress on an isolated copy of the repair: a real Spring/H2 public API and the actual Managed WebShell component, not a mocked HTTP backend. The ordinary Session-close UI is a nearby control, not proof of LOST-worker drain, MySQL behavior, or native stop safety. The final capture report will state those limits explicitly. A separate reviewer has now been assigned the exact |
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
No blocking issues. LGTM! ✅
Not explored to full depth (tool budget reached): "agent reverse-audit (round 3)": did not trace RuntimeAdmission.requireStoppedRelease 's ma_session_head claim_generation/claim_lease_until comparison, so the three-way split in retiredHold…; "agent reverse-audit (round 2)": could not determine whether the external provider re-validates state.files / state.snapshots on a raw-file-history bind — requireExternalControl checks on…; chunk 6: did not execute the three new tests — the review worktree has no node_modules/packages/core/dist, so vitest cannot run here; the assertions were verified by rea…; "agent reverse-audit (round 1)": the base-side blob of RuntimeBrokerSupport.java is unreadable in this worktree ( git show <merge-base>:…/RuntimeBrokerSupport.java returns no content), so th…; "agent reverse-audit (round 3)": did not verify the §13 claims about the provisioner's internal original-identity checks, restart-from-saved-identity, redirect rejection and active-socket cance…, and 6 more.
Deferred under the convergence posture (round 27, not a blocker) — recorded, not requested in this round; 2 Critical(s) among them are deferred by their axes — fails-closed on new surface, where no wrong result is certified and the merge base had neither the surface nor the defect — and remain follow-up work recorded in the findings artifact:
packages/managed-agent-server/contracts/src/main/java/com/alibaba/qwen/code/managedagent/contracts/harness/HarnessConnector.java:167 — [review] Critical [fails-closed] [new-surface] The new default is inherited unchanged by SdkHarnessBound…packages/managed-agent-server/runtime-external/src/main/java/com/alibaba/qwen/code/runtimebroker/provisioning/external/ExternalWorkspaceProvisioner.java:169 — [review] Critical [fails-closed] [new-surface] stopDrained is the first *succes…docs/design/2026-10-25-external-hosted-workspace.md:269 — [review] Five of the six source links added in §14 resolve to non-existent paths: they omit the Maven module directory ( server/ , persistence/ , control-plane/ , contracts/ ) tha…docs/design/2026-10-25-external-hosted-workspace.md:269 — [review] The new §14 enumeration of the closed option surface omits **memory** ( memoryStoreId ), which hasHostedExternalFilesExcludedOptions refuses for hosted-workspace-external…docs/design/2026-10-25-external-hosted-workspace.md:291 — [review] The section that declares what remains of the goal is keyed to milestone label "C", which neither language version of the document ever defines — the taxonomy used everywher…packages/cli/src/serve/hosted-harness-session.test.ts:17848 — [review] The new cold-load refusal test's expect(broker).not.toHaveBeenCalled() (line 17852) cannot fail: nothing on the load route calls HostedWorkspaceBroker.control — the …packages/cli/src/serve/hosted-harness-session.ts:4860 — [review] Two of the three refusal clauses in the new external-files admission gate read values that are constants in every production process, so the "negotiated consumer token" the ga…packages/cli/src/serve/hosted-harness-session.ts:5136 — [review] These two contract terms are permanently true whenever they are reached, because open() 's new first guard refuses the very same request shape earlier, so the lifecycle exemp…packages/cli/src/serve/hosted-harness-session.ts:6181 — [review] The definition-side and journal-side clauses of the new external-files open guard — 40+ lines of refusal logic — have no test that fails without them; only the body-side claus…packages/cli/src/serve/hosted-harness-session.ts:7309 — [review] the diff adds four cold-load refusals for the external profile; the two tests added ( refuses an external files saved session with Hook pin|extension config_install on cold lo…packages/cli/src/serve/hosted-harness-session.ts:7309 — [review] The new cold-load refusal for an external-files Session whose unsettled turn ran in plan mode is unreachable: planMode can only enter a turn's durable admission through adm…packages/cli/src/serve/hosted-workspace-tool-turn.ts:2106 — [review] This new 18-condition lane guard is the only thing standing between an external-files Session and every optional lane, and the diff tests exactly one of its conditions ( s…packages/cli/src/serve/hosted-workspace-tool-turn.ts:2354 — [review] The external-files branch advertises the *resident/CSI restricted* read_file declaration (no pages ), while every other non-resident profile advertises HOSTED_PAGED_RE…packages/cli/src/serve/managed-runtime-attestation-worker.test.ts:402 — [review] The new test named keeps publication routes unowned without an external publication asserts only the status, and in this worker two different mechanisms prod…packages/managed-agent-server/adapters/src/main/java/com/alibaba/qwen/code/managedagent/harness/HarnessPoolConnector.java:518 — [review] the "external files" negotiation branch is written twice ( QwenHostedHarnessConnector and this pool va…packages/managed-agent-server/adapters/src/main/java/com/alibaba/qwen/code/managedagent/harness/QwenHostedHarnessConnector.java:520 — [review] the diff adds the same external carve-out around verifyMountForProbe at two delivery sites (lin…packages/managed-agent-server/contracts/src/main/java/com/alibaba/qwen/code/runtimebroker/spi/ExternalStorageRegistry.java:72 — [review] decodeRegistration , the tightened compact constructor (three inline matches("[A-Za-z0-9._-]{1,128}")…packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/ManagedAgentService.java:2021 — [review] A per-row durable read (two SQL queries) is added to the Session-listing path: webShellSessions …packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/SessionLifecycleCoordinator.java:123 — [review] This overload was half-updated for the external profile: the warmer half honours the profil…packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/workspace/runtime/ManagedRuntimeCoordinator.java:58 — [review] ManagedRuntimeCoordinator.resolver(...) has exactly one call site (production, Em…- …and 51 more (see the run report)
中文说明
无阻断问题。LGTM!✅
未探索到全部深度(达到工具调用预算):"agent reverse-audit (round 3)":did not trace RuntimeAdmission.requireStoppedRelease 's ma_session_head claim_generation/claim_lease_until comparison, so the three-way split in retiredHold…;"agent reverse-audit (round 2)":could not determine whether the external provider re-validates state.files / state.snapshots on a raw-file-history bind — requireExternalControl checks on…;chunk 6:did not execute the three new tests — the review worktree has no node_modules/packages/core/dist, so vitest cannot run here; the assertions were verified by rea…;"agent reverse-audit (round 1)":the base-side blob of RuntimeBrokerSupport.java is unreadable in this worktree ( git show <merge-base>:…/RuntimeBrokerSupport.java returns no content), so th…;"agent reverse-audit (round 3)":did not verify the §13 claims about the provisioner's internal original-identity checks, restart-from-saved-identity, redirect rejection and active-socket cance…,另有 6 条。
收敛姿态下延后(第 27 轮,非阻断)——已记录,本轮不要求修改;其中 2 条 Critical 按其失败方向与对照基线延后——fails-closed 且 new-surface:未认证任何错误结果,且 merge base 既无该功能面也无该缺陷——作为后续工作记录在 findings 工件中:共 71 条(原文未翻译,列表见上方英文部分)。
— deepseek-v4.1-flash-1017 via Qwen Code /review (v0.27.2)
Merge refs/heads/upstream-main (0b333d3) into feat/15512-completion (983ae8a). Four files conflicted; the resolution keeps both sides' deltas and records every choice below. 1. managed-schema/V1__managed_schema.sql Pure union, no object dropped from either side. The branch's only schema delta was the EXTERNAL_WORKSPACE receipt namespace; main added RESOURCE_ALLOCATE to the same ck_ma_request_namespace CHECK. The merged CHECK admits both, ordered to match ManagedSchemaContract.ReceiptNamespace (EXTERNAL_STORAGE, EXTERNAL_WORKSPACE, MEMORY, SIDE_QUERY, RESOURCE_ALLOCATE), which ManagedSchemaTest iterates. All main-owned objects kept as-is: ma_journal_pack + ix_ma_journal_pack_* indexes, ck_ma_journal_record_bytes, nullable ma_session_journal_tx.record_bytes, ma_session.preview/preview_revision, ma_user_message_queue.queue_revision, ma_session_head.packed_through_revision. Verified object-by-object against both parents (CREATE TABLE/INDEX sets are a superset of both). 2. RuntimeBrokerService + drain cluster Both sides independently decomposed the same region: main's #16922 facade decomposition (RuntimeDrainCoordinator, RuntimeSessionRelease, top-level BindingRenewal) and the branch's partial RuntimeDrainRelease split. Main's shape is adopted as the skeleton because it is the larger refactor and because main lowered the class-size ceiling to 1930; the branch's 2817 pin may not be restored. RuntimeDrainRelease is folded into RuntimeDrainCoordinator and deleted (its only consumers were the facade and itself). Mechanics: main's versions of the moved methods are pure moves of the merge base, while the branch's carry behaviour, so the branch's semantics are ported into main's file homes: - drainClaimedBinding: isLiveWorkerStopRecoverable gate (a restart-fenced external-workspace LOST binding may stop its live worker), wider stop precondition (receipt | absence | authority | lost), acknowledge-then-stop via stopAcknowledgedRuntime, requireDrainClaim re-read, persisted receipt before releaseRetiredHolders, and the receipt-identity/lease fence before RELEASED. - stopAcknowledgedRuntime: branch's external-workspace arm (drainClaimForIo + acknowledge + stopDrained) plus its private EXTERNAL_WORKSPACE guard; main's observation.matchesRuntime() check kept. - acknowledgeDrainedTools: admits EXTERNAL_WORKSPACE and threads (renewal, authority) so each acknowledge re-reads the drain claim. The branch's second lease-null guard was unreachable behind the combined first guard and is not carried over. - releaseDrainedSessions / releaseRetiredHolders: claim re-read, receipt match, authority-scoped session and per-record re-validation. - drainResourceBindings: external-workspace short-circuit to drainBinding(binding, null, authority). - releaseSavedSession: the loss path stops through stopAcknowledgedRuntime instead of a bare stopDrained. BindingRenewal gains the branch's lostClaim state, isDrainClaimStateValid usage, the stopped-claim guard on persistResourceHandle, and verifyDrainReceiptIdentity. The two statics that BindingRenewal and the coordinator share moved to RuntimeBrokerSupport. supportsDrainedStopKind stays on the facade for EmbeddedRuntimeBroker. Facade-only main changes (isProtocolV3/isPublicationV3 call sites, acknowledgeExecution, getExecution, observeExtensionOwner, releaseSession and finishSessionRelease through RuntimeSessionRelease) are kept as main wrote them. The branch's external-workspace refusal in startExecution (settlePrepared as workspace_tool_unsupported before dispatch) is kept. 3. capability-parity/managed-surface.txt Re-derived with ManagedSurfaceCaptureTest -Dcapability.parity.capture=true; the regenerated inventory carries both main's STORE_RESOURCE_* routes and the branch's EXTERNAL_WORKSPACE_MATERIALIZE route. 4. class-size-ratchet.properties No pin raised; GLOBAL_MAX_LINES stays 2662. RuntimeBrokerService re-pinned to its measured 1928 (main's conflict-side 1930 was the branch's 2817 alternative), AgentSessionPolicies to 791 (branch pinned 803). JdbcRuntimeBindingRepository grew past the global ceiling through the branch's external-ownership delta, so unverifiedWorkspaceHolder moved to JdbcRepositorySupport (pure move, call sites re-qualified in the file's own style). Other pure moves to stay under the ceiling: requireDuration and newScheduler to RuntimeBrokerSupport, selectApprovalMode to its only consumer ExternalWorkspaceSessionPolicies. Verification (JDK 21, offline Maven): 575 tests green across ClassSizeRatchetTest, SessionRowLockOrderTest, ManagedStoreDecompositionTest, ManagedSchemaTest, ManagedSurfaceCaptureTest, RuntimeBrokerServiceTest, RuntimeExternalWorkspaceDrainTest, RuntimeHarnessDrainTest, ManagedUserMessageStoreTest, BrokerRenewalPinningTest, DurableRuntimeRecoveryTest, ManagedAgentDefinitionAdmissionTest, ManagedWorkspaceAdmissionTest, ManagedApprovalChangeTest, SessionCreationCommandContractTest, ExternalWorkspaceMaterializationTest. Both checkstyle goals clean (checkstyle:check and checkstyle:check@runtime-broker-checkstyle). MySQL ITs left to CI.
Sync with
|
| method | branch behaviour kept |
|---|---|
drainClaimedBinding |
isLiveWorkerStopRecoverable gate (a restart-fenced external-workspace LOST binding stops its live worker), wider stop precondition (receipt / absence / authority / lost), acknowledge-then-stop, claim re-read, persisted receipt before releaseRetiredHolders, receipt+lease fence before RELEASED |
stopAcknowledgedRuntime |
external-workspace arm (drainClaimForIo → acknowledge → stopDrained) and its private EXTERNAL_WORKSPACE guard, on top of main's observation.matchesRuntime check |
acknowledgeDrainedTools |
admits EXTERNAL_WORKSPACE; threads (renewal, authority) so each acknowledge re-reads the drain claim |
releaseDrainedSessions, releaseRetiredHolders |
claim re-read, receipt match, authority-scoped session, per-record re-validation |
drainResourceBindings |
external-workspace short-circuit to drainBinding(binding, null, authority) |
releaseSavedSession |
loss path stops through stopAcknowledgedRuntime instead of a bare stopDrained |
startExecution |
external-workspace refusal settles the prepared row as workspace_tool_unsupported before dispatch |
BindingRenewal gains the branch's lostClaim state, isDrainClaimStateValid check, stopped guard on persistResourceHandle, and verifyDrainReceiptIdentity; the two statics shared with the coordinator moved to RuntimeBrokerSupport. supportsDrainedStopKind stays on the facade for EmbeddedRuntimeBroker.
Facade-only main changes are kept as main wrote them (isProtocolV3 / isPublicationV3 call sites, acknowledgeExecution, getExecution, observeExtensionOwner, releaseSession / finishSessionRelease via RuntimeSessionRelease).
One deliberate omission: the branch's acknowledgeDrainedTools had a second lease == null guard that is unreachable behind the combined first guard, so it is not carried over.
3. capability-parity/managed-surface.txt — re-derived
Regenerated with -Dcapability.parity.capture=true; the inventory carries both main's STORE_RESOURCE_ALLOCATE / STORE_RESOURCE_UPLOAD / STORE_RESOURCE_FINALIZE routes and the branch's EXTERNAL_WORKSPACE_MATERIALIZE.
4. class-size-ratchet.properties — no pin raised, GLOBAL_MAX_LINES unchanged (2662)
RuntimeBrokerService: 1930 → 1928 (measured; the conflicted alternative was the branch's stale 2817)AgentSessionPolicies: 803 → 791 (measured)JdbcRuntimeBindingRepositorycrossed the global ceiling through the branch's external-ownership delta, sounverifiedWorkspaceHoldermoved toJdbcRepositorySupport(pure move; call sites re-qualified in the file's own style).- Other pure moves to stay under the ceiling:
requireDurationandnewScheduler→RuntimeBrokerSupport,selectApprovalMode→ its only consumerExternalWorkspaceSessionPolicies.
Verification (JDK 21, offline Maven)
575 tests green: ClassSizeRatchetTest, SessionRowLockOrderTest, ManagedStoreDecompositionTest, ManagedSchemaTest, ManagedSurfaceCaptureTest, RuntimeBrokerServiceTest (199), RuntimeExternalWorkspaceDrainTest, RuntimeHarnessDrainTest (74), ManagedUserMessageStoreTest, BrokerRenewalPinningTest, DurableRuntimeRecoveryTest (38), ManagedAgentDefinitionAdmissionTest, ManagedWorkspaceAdmissionTest, ManagedApprovalChangeTest, SessionCreationCommandContractTest, ExternalWorkspaceMaterializationTest.
Both checkstyle goals clean: checkstyle:check and checkstyle:check@runtime-broker-checkstyle (the latter is what covers the runtimebroker package; it caught an unused import the plain goal did not).
MySQL integration tests are left to CI.
Self-audit
Two passes over the full diff. Automated checks: every file added by either side is present (only RuntimeDrainRelease is gone, by design, folded into the coordinator); every file main deleted is deleted here; every branch-added and main-added line in the drain corpus, the persistence classes touched by the ratchet moves, and the schema objects is accounted for, either present or in its documented new home.
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
[Critical] Blocking finding(s) follow.
Partially reviewed — gaps disclosed.
Unresolved, please confirm:
- [Critical] 35 entries — its blocker text was not read in full at this commit, so it could not be ruled:
- managedagent/ExternalPublicFilesE2E.java (inline thread 4392431887)
- managed/ManagedSessionsPage.tsx (inline thread 4392431905)
- provisioning/ExternalWorkspaceProvisionerTest.java (inline thread 4392432132)
- service/RuntimeBrokerService.java (inline thread 4405339021)
- transport/HttpRuntimeTransport.java (inline thread 4414111951)
- service/RuntimeBindingProvisioning.java (inline thread 4526532305)
- service/RuntimeBindingProvisioning.java (inline thread 4533602282)
- service/RuntimeBrokerService.java (inline thread 4421612452)
- issue-level comment 6446480973
- issue-level comment 6489076840
- issue-level comment 6493720819
- issue-level comment 6513897432
- issue-level comment 6544521343
- issue-level comment 6554238353
- issue-level comment 6556572940
- issue-level comment 6590702510
- issue-level comment 6667659495
- issue-level comment 6691144806
- issue-level comment 6691173678
- issue-level comment 6711331008
- issue-level comment 6722578328
- review 5722448076 by doudouOUC (2026-10-31)
- review 5722448361 by doudouOUC (2026-10-31)
- review 5722448525 by doudouOUC (2026-10-31)
- review 5722448747 by doudouOUC (2026-10-31)
- review 5723038284 by doudouOUC (2026-10-31)
- review 5723039052 by doudouOUC (2026-10-31)
- review 5723039767 by doudouOUC (2026-10-31)
- review 5723040546 by doudouOUC (2026-10-31)
- review 5723043975 by doudouOUC (2026-10-31)
- review 5726673304 by doudouOUC (2026-11-01)
- review 5726673601 by doudouOUC (2026-11-01)
- review 5726674769 by qqqys (2026-11-01)
- review 5728040301 by qqqys (2026-11-01)
- review 5736154462 by qqqys (2026-11-02)
Not reviewed: reverse audit did not converge — rounds 1 and 2 each reported findings and round 3 of the 3-round cap was not run; the 61 Suggestion-level and 4 Critical-level candidates those rounds raised beyond the verified set were not individually verified.
Not explored to full depth (tool budget reached): "agent reverse-audit (round 2)": did not trace how the release-side claim record is constructed (whether it carries provisionSeed / resourceHandle ), so the new external seed/handle equality…; "agent reverse-audit (round 1)": could not resolve whether the external worker's attest admission also requires the storage boot member that ExternalWorkspaceProvisioner.bootDocument adds b…; chunk 34: runtime execution of ExternalWorkspaceProvisionerTest under Maven (not run — the shared review worktree was left unbuilt to avoid writing target/ trees into…; "agent reverse-audit (round 1)": could not verify the new file's "pure delegation" claim against the pre-refactor inline predicates — AgentSessionAdmissions at the merge base 0b333d37db con…; chunk 21: did not verify how an external worker replies to acknowledgeV2 for a row that was cancelled before it ever dispatched (whether it errors and so blocks the sam…, and 4 more.
Deferred under the convergence posture (round 28, not a blocker) — recorded, not requested in this round; 1 Critical(s) among them are deferred by their axes — fails-closed on new surface, where no wrong result is certified and the merge base had neither the surface nor the defect — and remain follow-up work recorded in the findings artifact:
packages/managed-agent-server/runtime-broker/src/main/java/com/alibaba/qwen/code/runtimebroker/service/RuntimeExecutionDispatcher.java (+1 locations) — [review] Critical [fails-closed] [new-surface] the new external-drain guard requires eve…docs/design/2026-10-25-external-hosted-workspace.md (+2 locations) — [review] the new section 14 code links point into a packages/managed-agent-server/src/main/java tree that does not exist, so five of six links 404; the package is multi-…packages/cli/src/serve/hosted-harness-session.ts (+1 locations) — [review] the two capability-granting additions for the external-files profile (the live approval-reader list at 851-856 and the selectable approval-definition list at 610…packages/cli/src/serve/hosted-harness-session.ts (+1 locations) — [review] the cold-load refusal that scans committed domain.committed events for sixteen closed lanes has no test that ever produces a hit, and the test named for the Hook l…packages/cli/src/serve/hosted-harness-session.ts (+1 locations) — [review] the retained H6b comment still asserts "every hosted Session owns its automation funnel", but the line it introduces now skips that funnel for the external-files p…packages/cli/src/serve/managed-runtime-attestation-worker.test.ts (+1 locations) — [review] the "unowned without an external publication" guard is asserted by status code only, and Express's default 404 satisfies it, so the test cannot go r…packages/managed-agent-server/adapters/src/main/java/com/alibaba/qwen/code/managedagent/harness/HarnessPoolConnector.java (+1 locations) — [review] the pool connector's new external-files admission branch ( supportsLifecycle ) and its supp…packages/managed-agent-server/contracts/src/main/java/com/alibaba/qwen/code/runtimebroker/spi/ExternalStorageRegistry.java (+1 locations) — [review] RegisteredExternalStorage re-implements, as an independent copy, what com.alibaba.qwen.c…packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/ManagedAgentService.java (+1 locations) — [review] the WebShell capability surface for the external-files deployment is untested: the branc…packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/workspace/runtime/WorkspaceRuntimeTransport.java (+1 locations) — [review] the transport-level refusals added to the external execute path — and …packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/AgentSessionPolicies.java (+1 locations) — [review] the new eleven-condition later-Turn admission gate for the external-files profile has…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/JdbcManagedUserMessageStore.java (+1 locations) — [review] input() issues a fresh SELECT tool_profile FROM ma_session on every submi…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/JdbcManagedWorkspaceRegistry.java (+1 locations) — [review] the external-workspace eligibility rule has two independent implementations i…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/JdbcWorkspaceExecutionStore.java (+1 locations) — [review] authorizeExternal gates on a hand-copied profile string instead of the expor…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/JdbcWorkspaceExecutionStore.java (+1 locations) — [review] assertHeld runs the external hold check in the acquire shape ( acquiring = t…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/WorkspaceMigrationAdmission.java (+1 locations) — [review] requireExternalPhysicalOpen is the second copy of the same fail-closed "phys…packages/managed-agent-server/runtime-broker/src/main/java/com/alibaba/qwen/code/runtimebroker/service/RuntimeBindingProvisioning.java (+1 locations) — [review] this branch is unreachable — it sits in the PROVISIONING -only path but requir…packages/managed-agent-server/runtime-broker/src/main/java/com/alibaba/qwen/code/runtimebroker/service/RuntimeDrainCoordinator.java (+1 locations) — [review] the active-execution half of the new external guard in the single-argument stopAc…packages/managed-agent-server/runtime-broker/src/main/java/com/alibaba/qwen/code/runtimebroker/service/RuntimeExecutionDispatcher.java (+1 locations) — [review] this adds a third independent copy of the external-workspace file-tool allowlis…packages/managed-agent-server/server/src/main/java/com/alibaba/qwen/code/managedagent/config/ManagedAgentProperties.java (+1 locations) — [review] isExternalWorkspaceFilesConfigured() re-discovers the RuntimeProviderFactory service load…- …and 5 more (see the run report)
中文说明
仅完成部分审查,审查缺口已披露。
未决,请确认:共 35 条(原文未翻译,列表见上方英文部分)。
未审查(原文为英文):reverse audit did not converge — rounds 1 and 2 each reported findings and round 3 of the 3-round cap was not run; the 61 Suggestion-level and 4 Critical-level candidates those rounds raised beyond the verified set were not individually verified.
未探索到全部深度(达到工具调用预算):"agent reverse-audit (round 2)":did not trace how the release-side claim record is constructed (whether it carries provisionSeed / resourceHandle ), so the new external seed/handle equality…;"agent reverse-audit (round 1)":could not resolve whether the external worker's attest admission also requires the storage boot member that ExternalWorkspaceProvisioner.bootDocument adds b…;chunk 34:runtime execution of ExternalWorkspaceProvisionerTest under Maven (not run — the shared review worktree was left unbuilt to avoid writing target/ trees into…;"agent reverse-audit (round 1)":could not verify the new file's "pure delegation" claim against the pre-refactor inline predicates — AgentSessionAdmissions at the merge base 0b333d37db con…;chunk 21:did not verify how an external worker replies to acknowledgeV2 for a row that was cancelled before it ever dispatched (whether it errors and so blocks the sam…,另有 4 条。
收敛姿态下延后(第 28 轮,非阻断)——已记录,本轮不要求修改;其中 1 条 Critical 按其失败方向与对照基线延后——fails-closed 且 new-surface:未认证任何错误结果,且 merge base 既无该功能面也无该缺陷——作为后续工作记录在 findings 工件中:共 25 条(原文未翻译,列表见上方英文部分)。
— deepseek-v4.1-flash-1017 via Qwen Code /review (v0.27.2)
…lved) Also migrate the two branch test files left on the InMemory repositories retired by #16953 to JDBC-on-H2, following the retirement design doc's house pattern (UUID-named H2, fake-clock DataSource shim, deterministic binding ids, claim-aware state injection): - RuntimeExternalWorkspaceDrainTest keeps all 17 scenarios, including the R2-1 witness restartLostLiveWorkerWithoutReceiptStopsForReceiptAndReleases. The fixture now seeds the control-plane rows the JDBC stopped-release guards verify: EXTERNAL storage registration, materialized Workspace, Session root pin, storage-ownership claim, and the lifecycle claim on the harness head; the ensure step uses the real provisioner so the boot identity matches the registration. - EmbeddedRuntimeBrokerTest's registration-drift test swaps to the JDBC repositories on its existing H2 source. No production behavior change beyond the merge resolutions and the import repair they required.
# Conflicts: # packages/cli/src/serve/hosted-harness-session.ts # packages/cli/src/serve/workspace-recovery-session.test.ts # packages/managed-agent-server/contracts/src/main/java/com/alibaba/qwen/code/managedagent/contracts/workspace/WorkspaceToolProfiles.java # packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/AgentSessionCommands.java # packages/managed-agent-server/server/src/main/java/com/alibaba/qwen/code/managedagent/config/runtime/EmbeddedRuntimeBroker.java # packages/managed-agent-server/verification/src/test/resources/capability-parity/managed-surface.txt # packages/managed-agent-server/verification/src/test/resources/class-size-ratchet.properties
Sync with
|
| path | resolution |
|---|---|
packages/cli/src/serve/capability-parity.ts |
union: branch's EXTERNAL_WORKSPACE_MATERIALIZE + main's INTERNAL_CLIENT_FILES_MCP (#16844) |
packages/cli/src/serve/hosted-harness-session.ts |
main's self-paced /loop (#16835) stays unconditional — loop_wakeup is profile-gated (hosted-workspace-shell/3) and the external-files exclusion list does not cover loops; the branch's !externalFiles gate is kept around automations and channels only |
packages/cli/src/serve/hosted-workspace-profiles.test.ts |
union of the branch's closed-options test and main's shell/3 + public-shell-profile tests |
ManagedAgentService.java |
main removed the rename-lease machinery (#17006 sync Session rename): dropped renameLeaseDuration/renameClock/configureRenameDelivery; kept the branch's externalFilesConfiguration gate (re-derived via @Autowired configureExternalFiles from the provisioner kind) alongside main's configureClientFiles |
AgentSessionCommands.java |
kept the branch's TURN_SESSION_PROJECTION_GUARD; added main's hosted-workspace-shell/3 to its profile IN-list |
JdbcRuntimeBindingRepository.java |
took main's RuntimeAdmissionFences extraction (#16936): the branch's local copies of the fence methods were byte-identical to main's extracted engine, so both hunks resolve to main's side; re-qualified the branch's call sites (JdbcExternalWorkspaceOwnership, WorkspaceMigrationAdmission, ExternalWorkspaceMaterializationStore, two test classes) to RuntimeAdmissionFences.*; restored the branch's WorkspaceExecutionProfile import lost in the import-block rewrite |
WorkspaceMigrationMain.java |
main's pack-aware readers (#17047: MaintenanceObjectStores.readPacks, 3-arg bindings ctor) + restored the branch's 4-arg WorkspaceRuntimeProvisioner call the auto-merge had dropped |
capability-parity/managed-surface.txt |
route lines auto-merged to the exact union (235 routes = 229 branch + 234 main − 228 shared, verified by set comparison); digest header re-derived over the sorted route keys per ManagedSurfaceCapture.digest |
lock-contract/sql-owners.txt |
deleted — main retired the whole lock-contract meta-ratchet (#17044); no Java or POM reference remains |
Second merge (6f754be654890) — seven conflicts
| path | resolution |
|---|---|
packages/cli/src/serve/hosted-harness-session.ts (2 sites) |
union: branch's HOSTED_WORKSPACE_EXTERNAL_FILES_PROFILE + main's hosted-workspace-files/4 in both approval-selection profile lists |
packages/cli/src/serve/workspace-recovery-session.test.ts |
union of the branch's external-files entry and main's files/4 entry in the capture it.each |
WorkspaceToolProfiles.java |
kept the branch's external-files ternary in supportsApprovalSelection; added main's FILES_V4 to the else arm |
AgentSessionCommands.java |
kept the branch's TURN_SESSION_PROJECTION_GUARD structure (including the external-files is_plan_enabled=FALSE projection); extended the guard's profile IN-list with main's hosted-workspace-shell/4 and hosted-workspace-files/4 |
EmbeddedRuntimeBroker.java |
union: branch's 5-arg WorkspaceRuntimeResolver construction (external registrations) + main's setBindingRepository terminal-digest hint (#16866) |
capability-parity/managed-surface.txt |
re-captured from the merged SurfaceRegistry enum via -Dcapability.parity.capture=true; route set verified as the exact union (239 = 229 branch + 238 main − 228 shared), digest 89e57b71… |
class-size-ratchet.properties |
RuntimeBrokerService ceiling lowered to the merged file's 1909 lines (main #16866 extracted TerminalHolds/BackgroundProcessAdmission, 1917; branch wiring adds the rest); JdbcRuntimeBindingRepository pin unchanged at 2319 |
The #17088 fixed-interval cron trio (session.crons) stays unconditional like main's self-paced loops: the branch's !externalFiles gate remains around automations and channels only, and cron loop-wakeup is already profile-gated to shell/3+shell/4. Whether external-files Sessions should own cron arming is the same product decision deferred for loops — noted here, not silently changed.
Test migration forced by main #16953 (InMemory retirement)
Main deleted the three InMemory runtime-broker repositories and migrated all its consumers to JDBC-on-H2. Two branch test files still referenced them after the merge:
EmbeddedRuntimeBrokerTest.externalCloseCapabilityContainsRegistrationDriftAndReadFailure— the auto-merge kept the branch's added test but took main's import block; swapped the three InMemory constructions to the JDBC repositories on the test's existing H2 source (the file's ownbroker(...)helper pattern).RuntimeExternalWorkspaceDrainTest— full fixture migration to JDBC-on-H2 following the mechanisms indocs/design/2026-11-11-retire-inmemory-runtime-repositories.md(house H2 pattern, fake-clock DataSource shim, deterministic binding ids, operation-claim-aware state injection). All 17 scenarios preserved, including the R2-1 witnessrestartLostLiveWorkerWithoutReceiptStopsForReceiptAndReleases. No production code changed.
CI attribution (red review-pr on 32c30016)
Run 43052913353 / job 130637805803: the review itself was posted successfully; the job then died writing its log (Failed to write qwen review log. + core dump in the tee pipeline, exit 1). The fallback-comment job succeeded. This is reviewer infrastructure, not PR code; the latest bot review (5863058887, round 28) reports findings: [].
Stale CHANGES_REQUESTED (5736220215, R2-1)
The CR reviewed head eb57393f and refused a LOST external binding with no drain receipt before the drain claim. Fixed by a2301bc7595b ("stop a lost live worker before releasing its rows", ancestor of the current head): isLiveWorkerStopRecoverable now admits exactly that state (LOST, no absence evidence, no receipt, no active executions, external-workspace request) into the drain, which stops the live worker for a receipt, persists it, and only then releases the sessions and the retired storage holder. Re-verified line-by-line in the merged RuntimeDrainCoordinator/RuntimeBrokerSupport; the witness restartLostLiveWorkerWithoutReceiptStopsForReceiptAndReleases fences READY→LOST with an active session row and asserts stop→cleanup→receipt→RELEASED. Dismissing the stale review with this evidence. The CR's secondary note (MySQL lanes skipped) is tier selection, not a failure.
Verification
JDK 21, Maven from packages/managed-agent-server (offline; one online fetch of spring-boot-starter-websocket 3.5.16, new from main #16866):
mvn -pl verification -am test -Dtest='ClassSizeRatchetTest,ManagedSchemaTest,ManagedSurfaceCaptureTest,SurfaceRegistryGateTest,RuntimeExternalWorkspaceDrainTest,ExternalWorkspaceOwnershipTest,WorkspaceLifecycleStoreTest,ExternalWorkspaceMaterializationTest,ManagedAgentSessionCapabilitiesTest,ManagedModelSelectionTest,ManagedUserMessageStoreTest,ManagedWorkspaceAdmissionTest,SessionCreationCommandContractTest,EmbeddedRuntimeBrokerTest'— 354 tests, 0 failures, 0 errors on the pushed head, including the migratedRuntimeExternalWorkspaceDrainTest(17/17) andEmbeddedRuntimeBrokerTest(54/54).checkstyle:checkandcheckstyle:check@runtime-broker-checkstyle— 0 violations across all 15 modules.ManagedSurfaceCaptureTestwith-Dcapability.parity.capture=true— re-captured the inventory; the route set was verified as the exact branch∪main union (239 routes) before committing.- TypeScript: Prettier clean on all 17 PR-touched
.tsfiles; typecheck and unit gates run in CI (no localnode_modulesin this worktree).
Deferred bot items from round 28 remain deferred per the >5-round scope policy; nothing optional was added this round. Scope snapshot vs origin/main (6f754be654890): 98 files +6420/−589 — implementation 65 files +2898/−484 (pre-round head: +2897/−497 against its then-base; production scope unchanged), test 31 files +3364/−66 (the #16953 migration), docs 2 files +158/−39.
中文说明
本轮只做必要的收尾:分两步合并最新 main(先到 c865e86,验证期间 main 又前进了 9 个提交,再合到 6f754be),共解决 16 处冲突——main 的骨架为准,分支语义移植进 main 的文件位置(fence 引擎提取、pack-aware 读取、rename 重构、shell/3 profile、client-files;第二步是 files/4 profile 并集、投影守卫 IN 列表扩展、Web Terminal 的 resolver 接线、ratchet 上限下调)。managed-surface 清单用合并后的枚举重新 capture,路由集合验证为精确并集(239 条);main 已删除的 lock-contract 清单随之删除。#17088 的 fixed-interval cron 与 loops 同样保持无条件,external-files 是否开放 cron 属产品决策,与 loops 一并留作后续,不在本轮擅自扩大门控。
main #16953 退役了 InMemory 仓库,两个分支测试文件按其退役设计文档迁移到 JDBC-on-H2,全部场景保留(含 R2-1 见证测试),不改任何生产代码。
CI 红项 review-pr 属评审基础设施故障(评审已发出,写日志时 tee 管道崩溃),非 PR 代码问题。过期的 CHANGES_REQUESTED(R2-1:无回执 LOST 绑定被提前拒绝)已由 a2301bc 修复并在合并后代码中逐行复核,附证据 dismiss。
本地验证:JDK 21 本地 Maven:14 个聚焦测试类共 354 个用例全绿(含迁移后的 drain 17/17、Embedded 54/54);两个 checkstyle goal 全部 15 个模块 0 违规;surface 清单用合并后枚举重新 capture,路由集合验证为精确并集(239 条)后提交。TS 侧 PR 涉及的 17 个文件 Prettier 全过,typecheck/单测由 CI 覆盖(worktree 无本地 node_modules)。范围快照对 origin/main(6f754be6):98 文件 +6420/−589,其中生产代码 65 文件 +2898/−484,与本轮开始前基本持平(+2897),测试增量来自 #16953 迁移,无功能范围扩张。。TS 侧 Prettier 通过,typecheck/单测由 CI 覆盖。按 >5 轮范围策略,本轮不加任何可选改动,bot 第 28 轮的延期项继续延期。
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
Unresolved, please confirm:
- [Critical] R3-1 (comment 4414111908) — could not establish at this head whether releasing a retired non-holder Session still aborts the cascade
- [Critical] R3-2 (comment 4414111896) — could not establish the queued-message dispatcher's current rejection classification
- [Critical] R16-1 (comment 4503191297) — could not establish whether a lease-less PROVISIONING external binding can provision again
- [Critical] R1-16 (comment 4392432132) — could not read the two named test bodies whole within this round
Not explored to full depth (tool budget reached): "agent reverse-audit (round 2)": §13's wire-level claims (colon escaping of publication:* routes, the exact stop headers, the 64 KiB envelope, redirect rejection) were not re-verified against…; "agent reverse-audit (round 3)": did not confirm that the CLI's external-files lane reserves its file-tool executions as v2 (no runtimeProtocol , no publication grant) — I verified the referen…; chunk 23: cross-language check that the worker's ManagedContextProtocol.ATTEST_PATH attestation echoes the context-only boot (the test's attestationResponse(ManagedCon…; chunk 33: I did not execute the new tests (a verification Maven run); the pass/fail questions above were settled by reading the transport, parser and value-coercion sou…; "agent reverse-audit (round 3)": could not execute RuntimeExternalWorkspaceDrainTest — compiling or mvn -ing in this shared worktree is forbidden by the brief — so its greenness is inferred …, and 3 more.
Deferred under the convergence posture (round 29, not a blocker) — recorded, not requested in this round; 3 Critical(s) among them are deferred by their axes — fails-closed on new surface, where no wrong result is certified and the merge base had neither the surface nor the defect — and remain follow-up work recorded in the findings artifact:
packages/cli/src/serve/hosted-workspace-tool-turn.ts:2337 — [review] Critical [fails-closed] [new-surface] the external-files lane guard omits clientFiles and the profile's declarations() returns before clientFilesDeclarations(), so a regis…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/ExternalWorkspaceSessionPolicies.java:30 — [review] Critical [fails-closed] [new-surface] the blanket catch converts a retryable registra…packages/managed-agent-server/runtime-broker/src/main/java/com/alibaba/qwen/code/runtimebroker/service/RuntimeBrokerSupport.java:453 — [review] Critical [fails-closed] [new-surface] the LOST-recovery exemption excludes a receipt-backed LOST…packages/managed-agent-server/server/src/main/java/com/alibaba/qwen/code/managedagent/api/ExternalStorageRegistrationController.java:114 — [review] Extracting the operator gate into requireOperator silently renames the 403 code of the **p…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/AgentSessionPolicies.java:697 — [review] requireExternalTurnAllowed issues the same ma_request_receipt read twice per Turn — creatio…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/JdbcWorkspaceExecutionStore.java:135 — [review] The new external gate issues the same ma_storage read twice per authorize() call — an…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/JdbcManagedWorkspaceRegistry.java:310 — [review] The diff replaces the single summary(ResultSet) mapper that all read paths shared with…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/JdbcWorkspaceExecutionStore.java:657 — [review] The new helper re-implements the "no active execution" predicate a fourth time instead of…docs/design/2026-10-25-external-hosted-workspace.md:269 — [review] All five newly added source links in §14 point at paths that do not exist in this repository; the packages/managed-agent-server/<module>/ segment is missing from every one…packages/managed-agent-server/runtime-broker/src/main/java/com/alibaba/qwen/code/runtimebroker/service/RuntimeDrainCoordinator.java — [review] Every execution row of an external-workspace drain re-runs the harness-cleanup DB fence — N+2 ide…packages/managed-agent-server/server/src/main/java/com/alibaba/qwen/code/managedagent/config/ManagedAgentProperties.java:541 — [review] isExternalWorkspaceFilesConfigured() builds a RuntimeProviderRegistry — whose constructor fully iter…docs/design/2026-10-25-external-hosted-workspace.zh-CN.md:245 — [review] Every Java source link added by §14 is dead — the new milestone paragraph's "see the code" pointers resolve to paths that do not exist in the tree (the English twin, …packages/managed-agent-server/verification/src/test/java/com/alibaba/qwen/code/managedagent/session/ManagedAgentSessionCapabilitiesTest.java:128 — [review] The two capability assertions that are supposed to pin "unproven eligibility adverti…packages/managed-agent-server/verification/src/test/java/com/alibaba/qwen/code/managedagent/workspace/runtime/WorkspaceRuntimeTransportTest.java:467 — [review] externalFileAuxiliaryControlsPreserveOriginalHolderAndRejectOtherOperations (l…packages/managed-agent-server/verification/src/test/java/com/alibaba/qwen/code/runtimebroker/RuntimeExternalWorkspaceDrainTest.java:291 — [review] The fixture claims the operation and fences the binding to LOST but never releases the clai…packages/managed-agent-server/verification/src/test/resources/class-size-ratchet.properties:36 — [review] The new pin for AgentSessionPolicies sits 12 lines above the class's actual size, so the ratchet admits growth the pin convention sa…packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/ManagedAgentService.java:1958 — [review] The new external-profile shape predicate does two SQL reads per evaluation, and it is evaluated pe…packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/SessionLifecycleCoordinator.java:127 — [review] This overload's only caller passes a hardcoded FILES profile, so the added EXTERNAL_FILES …packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/JdbcWorkspaceExecutionStore.java:632 — [review] hasHolder 's only two callers both exclude external bindings before the call, so the bra…packages/managed-agent-server/server/src/main/java/com/alibaba/qwen/code/managedagent/config/runtime/EmbeddedRuntimeBroker.java:390 — [review] The new String -profile override that gates external-files close/create capability has no test; …- …and 4 more (see the run report)
Mechanism health: this round did not close cleanly, so it withholds the incremental anchor — and the round it recovered had no anchor this round could use either — none at all, one with no certifier, one certified by an identity other than the one this round runs under, or one this round's fetch refused or resolved to the head — so the next review re-reads the whole diff unless recovery grafts an earlier own anchor that the round running it can use onto the complete work list this round leaves behind, and keeps doing so until a round's marker carries an anchor again or a graft lands that the round running it can use. (Stated, not acted on — this changes nothing about what the round posts.)
中文说明
未决,请确认:共 4 条(原文未翻译,列表见上方英文部分)。
未探索到全部深度(达到工具调用预算):"agent reverse-audit (round 2)":§13's wire-level claims (colon escaping of publication:* routes, the exact stop headers, the 64 KiB envelope, redirect rejection) were not re-verified against…;"agent reverse-audit (round 3)":did not confirm that the CLI's external-files lane reserves its file-tool executions as v2 (no runtimeProtocol , no publication grant) — I verified the referen…;chunk 23:cross-language check that the worker's ManagedContextProtocol.ATTEST_PATH attestation echoes the context-only boot (the test's attestationResponse(ManagedCon…;chunk 33:I did not execute the new tests (a verification Maven run); the pass/fail questions above were settled by reading the transport, parser and value-coercion sou…;"agent reverse-audit (round 3)":could not execute RuntimeExternalWorkspaceDrainTest — compiling or mvn -ing in this shared worktree is forbidden by the brief — so its greenness is inferred …,另有 3 条。
收敛姿态下延后(第 29 轮,非阻断)——已记录,本轮不要求修改;其中 3 条 Critical 按其失败方向与对照基线延后——fails-closed 且 new-surface:未认证任何错误结果,且 merge base 既无该功能面也无该缺陷——作为后续工作记录在 findings 工件中:共 24 条(原文未翻译,列表见上方英文部分)。
机制健康:本轮未能干净收尾,因而扣留了增量锚点,而它恢复到的那一轮也没有留下本轮可用的锚点——要么完全没有、要么没有认证者、要么由本轮运行身份之外的身份认证、要么被本轮的获取拒绝或解析为头提交——因此下一次评审将重读整个 diff,除非恢复流程把本轮能使用的更早自有锚点嫁接到本轮留下的完整工作清单上;并会一直如此,直到某一轮的标记重新带上锚点,或落地的嫁接能被运行该轮的评审使用。(仅陈述,不据此行动——这不改变本轮发布的任何内容。)
— deepseek-v4.1-flash-1017 via Qwen Code /review (v0.27.2)
…dmission gaps creationPin now refuses memoryStoreId, mirroring the CLI closed-option list (R29-1): the public-API create lane committed external-files Sessions whose memory binding the hosted lane refuses on attach, so the Session could never take a turn. The CLI lane was closed in the previous round; this closes the persistence seam every create entry point shares. changeSessionApproval reads external eligibility through externalFilesAllowedOrRefuse, so an undecodable registration answers the permanent 409 on the approval-change lane as it already does on create and turn (R10-2 residual, flagged by wenshao in rounds 12/13). The registry keeps its documented retryable 503 (design 12: the Broker keeps the placement adoptable); the admission seam owns the permanent refusal. Witnesses: externalFilesCreationRefusesMemoryStoreBinding (refusal plus an admissible control) and malformedExternalRegistrationIsANonRetryableApprovalChangeRefusal. Both are mutation-verified: reverting either fix reds exactly its witness while the other twelve cases stay green.
Round 30 — two admission-gap fixes (
|
| Finding | Disposition | Evidence at 850a1bca5eaa |
|---|---|---|
| R3-1 — retired non-holder aborts the cascade | Fixed (comment 6527601465; re-verified at ae9584f5 in 6542452337; mutation-killed in wenshao's matrix, 6544521343) |
The stopped-release path in JdbcExternalWorkspaceOwnership early-returns a retired non-holder after clearing its membership instead of throwing; target and global membership checks intact. ExternalWorkspaceOwnershipTest 13/13 and the drain retired-cleanup scenario green in this round's run. |
| R3-2 — refused queued message wedges the queue | Delivered in ad689fcfa540 (scope ledger) |
Queue submit and edit refuse non-text input for the external-files profile before persisting, so no permanently refused queue head. ManagedUserMessageStoreTest 18/18 green this round. |
| R16-1 — lease-less PROVISIONING cannot provision again | Fixed in ccbab32127ebc (comment 6717474475); wenshao adjudicated the production semantics (6722578328) |
A lease-less PROVISIONING external binding with only a persisted handle resumes through provisionBinding (ensure + provision); ExternalRuntimeProvisioner.reconcile accepts the null previous lease and observes the provider. RuntimeExternalWorkspaceDrainTest 17/17 green this round, after the #16953 JDBC migration. |
| R1-16 — the two named tests cannot red their regressions | Disposition ce48757e (closeout 6461321124 and the thread reply) |
drainRefusesIncompleteAndChangedOriginalsBeforeNetworkOrProviderCalls now asserts exact permanent 409/resource_conflict/non-retryable, so a later network 503 cannot satisfy it; externalProfileRequiresExactNegotiationButSavedCloseSurvivesFilesDisablement feeds advertised /2 against requested /1 for both admission and saved lifecycle, rejecting the near miss. Both classes run locally at this head: ExternalWorkspaceProvisionerTest 30/30, QwenHostedHarnessConnectorTest 159/159. |
Verification
- 16-class focused set at
850a1bca5eaa: 368 tests, 0 failures, 0 errors;checkstyle:check+checkstyle:check@runtime-broker-checkstyle, 0 violations across all 15 modules (JDK 21, Maven). - Mutation matrix above; R1-16 classes 30/30 + 159/159.
- CI at the previous head
f0735c44c1ed6finished 28 success / 50 skipped / 0 failed (including Managed Agent fast tier and review-pr); the new push re-runs it.
Scope
Production +2 lines across the two named seams; tests +101 lines (the two witnesses); no new surface, no optional work. Snapshot vs origin/main (6f754be654890): 98 files +6523/−589 — implementation 65 files +2900/−484, test 31 files +3465/−66, docs 2 files +158/−39. substantiveRounds 18 → 19 (production behavior changed).
中文说明
第 30 轮,范围修正模式:只修本轮贴出的两条 Critical,24 条 deferred 按收敛姿态与 >5 轮策略继续延后。两条 thread 已回复并 resolve。
R29-1:creationPin 补上 memoryStoreId 拒绝——这是所有创建入口共享的持久化缝隙(公共 API → createWorkspaceSession → AgentSessionAdmissions),此前只关了 CLI 通道,公共 API 仍能提交一个 hosted 通道永远拒绝 attach、永远无法 turn 的 external-files Session。witness 带可准入对照。
R29-2/R10-2 残留:registry 层的可重试 503 是设计 §12 的明文契约(读不完整 → 保持 placement 可收养;严格解码器分不清损坏与更新版本的文档),永久拒绝归准入缝隙所有。真正绕过缝隙的是 changeSessionApproval——wenshao 在第 12/13 轮和评论 6711331008 三次点名的残留——本轮按他给的方向接入 externalFilesAllowedOrRefuse,PR 描述里"解码失败永久 409"的主张至此在创建/turn/审批变更三条准入通道全部成立。执行路径保留 fail-closed throwing、列表 capability 保留独立 catch,均为设计内行为。
变异矩阵:同时回退两处一行修复,恰好两个新 witness 变红、其余 12 例保持绿;恢复后 14/14。
四条"未决请确认"全部给出闭环证据:R3-1(非 holder 早退,wenshao 变异矩阵杀过)、R3-2(ad689fcf 交付,入队前拒绝非文本)、R16-1(ccbab321 修复,wenshao 裁定过生产语义)、R1-16(ce48757e 强化断言,两个被点名的测试类本轮本地 30/30 + 159/159 全绿)。
验证:16 类聚焦 368 用例全绿,双 checkstyle goal 全模块 0 违规。范围:生产 +2 行、测试 +101 行,无新功能面;substantiveRounds 18→19。
Both Criticals posted by this review are fixed in 850a1bc and their threads are replied and resolved: R29-1 (memoryStoreId at the shared create seam, with an admissible-control witness) and R29-2 (the approval-change lane now routes through the permanent-refusal seam; the registry's retryable 503 stays per design §12). Both witnesses are mutation-verified — reverting the two one-line fixes reds exactly the two new cases while the other twelve stay green. The four "could not establish" items (R3-1, R3-2, R16-1, R1-16) are confirmed closed with commit and witness evidence, including local runs of the two R1-16 test classes at this head (30/30 + 159/159). The 24 deferred items remain deferred under the review's own convergence posture. Focused verification at this head: 368 tests, 0 failures; both checkstyle goals, 0 violations. Full evidence: comment 6871554415.
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed.
Not reviewed: reverse audit — stopped at the round cap (3 rounds) without convergence; the audit was still reporting new findings in its final round.
Not explored to full depth (tool budget reached): "agent reverse-audit (round 1)": full trace of how RuntimeBrokerHttpServer maps a non- RuntimeBrokerException from stopDrained to a status/code — I stopped at WorkspaceRuntimeProvisioner.…; "agent reverse-audit (round 3)": base-side extraction-fidelity diff — git show <merge-base>:packages/…/persistence/…/JdbcWorkspaceExecutionStore.java returned no such file at 6f754be65 , so …; "agent reverse-audit (round 3)": did not enumerate all ~20 lifecycleProtocol(...) call sites to confirm the EXTERNAL_FILES 0→1 flip ( SessionLifecycleService.usesLifecycleProtocol , AgentL…; "agent reverse-audit (round 1)": could not establish whether WorkspaceRuntimeResolver.verifyInstallable 's authority.verifyMountForProbe(...) call (which now reaches WorkspaceStorageKindGua….
Deferred under the convergence posture (round 30, not a blocker) — recorded, not requested in this round; 1 Critical(s) among them are deferred by their axes — fails-closed on new surface, where no wrong result is certified and the merge base had neither the surface nor the defect — and remain follow-up work recorded in the findings artifact:
packages/managed-agent-server/contracts/src/main/java/com/alibaba/qwen/code/managedagent/contracts/harness/HarnessConnector.java:184 — [review] Critical [fails-closed] [new-surface] The new supportsSavedLifecycle(String) capability is not…docs/design/2026-10-25-external-hosted-workspace.md:269 — [review] Five of the six source links newly added in design section 14 point at repository paths that do not existdocs/design/2026-10-25-external-hosted-workspace.zh-CN.md:245 — [review] All five links added to the Chinese design section 14 resolve to paths that do not existpackages/cli/src/serve/hosted-harness-session.ts:6360 — [review] The new 16-domain journal scan on external cold load is never the deciding conjunct in its only testpackages/cli/src/serve/hosted-workspace-tool-turn.ts:2317 — [review] The external-files optional-lane guard is a 19-way disjunction witnessed by exactly one lanepackages/cli/src/serve/hosted-workspace-tool-turn.ts:2323 — [review] The no-optional-lanes gate omits clientFiles , a lane the external profile silently dropspackages/cli/src/serve/hosted-workspace-tool-turn.ts:2624 — [review] The external-files profile is the only non-resident, non-CSI profile that declares the *unpaged* read_file , so it loses the pages parameter while every other code path…packages/managed-agent-server/adapters/src/main/java/com/alibaba/qwen/code/managedagent/harness/HarnessPoolConnector.java:546 — [review] The HarnessPoolConnector external-files lifecycle override has no test, while its sibling connector d…packages/managed-agent-server/adapters/src/main/java/com/alibaba/qwen/code/managedagent/harness/QwenHostedHarnessConnector.java:522 — [review] The new external-profile mount-verification bypass has no test — no existing probe test ever sets…packages/managed-agent-server/contracts/src/main/java/com/alibaba/qwen/code/runtimebroker/spi/ExternalStorageRegistry.java:66 — [review] String.matches compiles a fresh Pattern on every call, and the added validation uses it per field: …packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/ManagedAgentService.java:339 — [review] ManagedAgentService.queryWebShellSessionOptions has no test at any levelpackages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/ManagedAgentService.java:1941 — [review] Session-page render issues a JDBC read per row (twice) for the external profilepackages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/SessionLifecycleCoordinator.java:126 — [review] supportsWorkspaceLifecycle(String) now branches on EXTERNAL_FILES , but its only caller …packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/workspace/runtime/WorkspaceRuntimeResolver.java:130 — [review] The external branch asks the store isExternal(...) and then calls authority.autho…packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/workspace/runtime/WorkspaceRuntimeTransport.java:214 — [review] ownership.requireExternalExecution(...) sits in the shared prologue of execute()…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/AgentSessionCommands.java:642 — [review] The turn-policy projection is re-implemented in SQL, duplicating the Java profile/plan predicate…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/AgentSessionPolicies.java:700 — [review] The plan-mode conjunct in requireExternalTurnAllowed re-reads the row this transaction already…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/ExternalStorageRegistrationStore.java:203 — [review] states() selects EXTERNAL registrations by ma_storage.tenant_id + ma_storage.st…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/ExternalStorageRegistrationStore.java:267 — [review] RegistrationState.current is a constant, so the state.current() eligibility conj…packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/JdbcManagedUserMessageStore.java:283 — [review] A second read of the session row per user-message submit/edit, when the row is already lo…- …and 39 more (see the run report)
Mechanism health: this round did not close cleanly, so it withholds the incremental anchor — and the round it recovered had no anchor this round could use either — none at all, one with no certifier, one certified by an identity other than the one this round runs under, or one this round's fetch refused or resolved to the head — so the next review re-reads the whole diff unless recovery grafts an earlier own anchor that the round running it can use onto the complete work list this round leaves behind, and keeps doing so until a round's marker carries an anchor again or a graft lands that the round running it can use. (Stated, not acted on — this changes nothing about what the round posts.)
中文说明
仅完成部分审查,审查缺口已披露。
未审查(原文为英文):reverse audit — stopped at the round cap (3 rounds) without convergence; the audit was still reporting new findings in its final round.
未探索到全部深度(达到工具调用预算):"agent reverse-audit (round 1)":full trace of how RuntimeBrokerHttpServer maps a non- RuntimeBrokerException from stopDrained to a status/code — I stopped at WorkspaceRuntimeProvisioner.…;"agent reverse-audit (round 3)":base-side extraction-fidelity diff — git show <merge-base>:packages/…/persistence/…/JdbcWorkspaceExecutionStore.java returned no such file at 6f754be65 , so …;"agent reverse-audit (round 3)":did not enumerate all ~20 lifecycleProtocol(...) call sites to confirm the EXTERNAL_FILES 0→1 flip ( SessionLifecycleService.usesLifecycleProtocol , AgentL…;"agent reverse-audit (round 1)":could not establish whether WorkspaceRuntimeResolver.verifyInstallable 's authority.verifyMountForProbe(...) call (which now reaches WorkspaceStorageKindGua…。
收敛姿态下延后(第 30 轮,非阻断)——已记录,本轮不要求修改;其中 1 条 Critical 按其失败方向与对照基线延后——fails-closed 且 new-surface:未认证任何错误结果,且 merge base 既无该功能面也无该缺陷——作为后续工作记录在 findings 工件中:共 59 条(原文未翻译,列表见上方英文部分)。
机制健康:本轮未能干净收尾,因而扣留了增量锚点,而它恢复到的那一轮也没有留下本轮可用的锚点——要么完全没有、要么没有认证者、要么由本轮运行身份之外的身份认证、要么被本轮的获取拒绝或解析为头提交——因此下一次评审将重读整个 diff,除非恢复流程把本轮能使用的更早自有锚点嫁接到本轮留下的完整工作清单上;并会一直如此,直到某一轮的标记重新带上锚点,或落地的嫁接能被运行该轮的评审使用。(仅陈述,不据此行动——这不改变本轮发布的任何内容。)
— deepseek-v4.1-flash-1017 via Qwen Code /review (v0.27.2)
|
Local verification (merge-reference) — module-level external-workspace surface I ran both arms myself on this machine with the same commands (JDK 21.0.13+9, Maven 3.9.9, no product code touched, both worktrees detached):
Two things the default selection did not run at the after arm, so I selected them explicitly (same revision, same JDK/Maven):
Before side is a compile-level refusal, not a behavioural one. CI at this head: 34 check names / 100 check runs, every name terminal green — 0 failing, 0 live, 0 cancelled without a successful successor. Note Boundary (why this is PARTIAL, not PASS). Raw logs: 中文版(完整)本地 merge-reference 验证:外部工作区模块级行为 两臂都由我在本机串行执行,命令完全一致(JDK 21.0.13+9、Maven 3.9.9,未改动产品代码,均用 detached worktree):
after 臂上有两类用例没有被默认选择跑到,我按同一 revision 显式补跑:
before 侧的差异体现在编译层:该测试类在 merge-base 上根本不存在;把分支版本放进干净的 CI:当前 head 上 34 个检查名 / 100 次运行,全部终态通过,0 失败、0 在跑、0 个「取消且无成功后继」。但 边界(结论为 PARTIAL 而非 PASS): |
doudouOUC
left a comment
There was a problem hiding this comment.
评审结论:需修改后通过(不 approve)
- 基线:head
850a1bca5eaa5653af0d5f6612b1b16cc5ae1209,base(merge-base)6f754be6548903e545e6ff0ed43a34927fe3bfb9;98 个文件 +6523/−589。 - 历史评审:58 条 review thread 均已 resolved,无遗留 CHANGES_REQUESTED。
- CI:当前 head 必需检查(Classify PR / Lint & Static / Test ubuntu Node 22 / Integration Tests no-AK No Sandbox / Serve A-B / SDK Java fast / web-shell E2E / TUI parity)通过;Managed Agent full、MySQL、hosted-fault 任务为 skipped。
- 结论依据:发现 1 个阻塞项(生产装配缺失导致 saved close 语义失效),其余为文档与闭合面一致性问题。
阻塞项
1. SdkHarnessBoundary 未转发 supportsSavedLifecycle(String),生产环境 external Session 在关闭 workspace files 后无法 close/delete
- 位置:
packages/managed-agent-server/adapters/src/main/java/com/alibaba/qwen/code/managedagent/harness/SdkHarnessBoundary.java:230-243
该边界只转发了isWorkspaceFilesAvailable()、supportsLifecycle()、supportsLifecycle(String),没有覆盖supportsSavedLifecycle(String),因此继承packages/managed-agent-server/contracts/src/main/java/com/alibaba/qwen/code/managedagent/contracts/harness/HarnessConnector.java:184-186的默认实现return supportsLifecycle(profile);。 - 生产装配证据:
packages/managed-agent-server/server/src/main/java/com/alibaba/qwen/code/managedagent/config/HarnessConfiguration.java:76与:91显示两条生产HarnessConnectorbean 路径都返回new SdkHarnessBoundary(...),因此ManagedAgentService/SessionLifecycleCoordinator注入到的就是该边界。 - 本 PR 期望的新语义在
packages/managed-agent-server/adapters/src/main/java/com/alibaba/qwen/code/managedagent/harness/QwenHostedHarnessConnector.java:326:supportsSavedLifecycle(profile)只要求 lifecycle protocol 1 +EXTERNAL_FILESfeature,不要求 files 当前可用,目的正是“files 被禁用后仍能关闭已保存的 Session”。 - 受影响调用链(均以注入的 boundary 为
harness):packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/ManagedAgentService.java:200、:1638(hasLifecycle/closable对 external 使用supportsSavedLifecycle)packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/SessionLifecycleCoordinator.java:134、:771packages/managed-agent-server/control-plane/src/main/java/com/alibaba/qwen/code/managedagent/session/SessionLifecycleService.java:166(据此计算supported)packages/managed-agent-server/persistence/src/main/java/com/alibaba/qwen/code/managedagent/persistence/AgentLifecycleOperations.java:389:!supported直接抛workspaceExecutionUnavailable()(409)
- 触发条件:external Session 已创建后,运维将
workspaceFilesEnabled置为 false(或 Harness 报告 workspace files 暂不可用),再对该 ACTIVE Session 执行 close/delete。AgentLifecycleOperations.java:389的二段豁免(admitsLegacyClose,ExternalWorkspaceSessionPolicies.java:76)只在supported=true时才可能生效;由于 boundary 返回 false,close/delete 被 409 拒绝,worker 与 SQL physical holder 无法退役,只能恢复配置后才能清理。 - 与测试的矛盾:
packages/managed-agent-server/verification/src/test/java/.../QwenHostedHarnessConnectorTest.java中externalProfileRequiresExactNegotiationButSavedCloseSurvivesFilesDisablement仅包装裸QwenHostedHarnessConnector断言为 true;HostedGateTestSupportTest虽然用SdkHarnessBoundary包装,但没有覆盖supportsSavedLifecycle的转发,因此生产路径的回归未被任何测试捕获。 - 修复方向:
- 在
SdkHarnessBoundary增加与相邻方法一致的转发:@Override public boolean supportsSavedLifecycle(String profile) { return call(() -> delegate.supportsSavedLifecycle(profile)); }
- 增加一个以
SdkHarnessBoundary包装 connector 的测试:先协商 external profile,再关闭 workspace files,断言supportsSavedLifecycle(EXTERNAL_FILES)仍为 true、supportsLifecycle(EXTERNAL_FILES)为 false,并覆盖 close 准入不再 409 的路径。 - 顺带检查 boundary 是否还有其他新增/既有 default 方法未转发(本次只发现这一处)。
- 在
建议项(非阻塞)
-
设计文档 §14 的 5 个源码链接不可达
docs/design/2026-10-25-external-hosted-workspace.md:269、:275与docs/design/2026-10-25-external-hosted-workspace.zh-CN.md:245、:251。ManagedAgentProperties/ManagedWorkspaceRegistry/SessionLifecycleCoordinator/WorkspaceLifecycleStore/JdbcExternalWorkspaceOwnership的链接都缺少server/、control-plane/、persistence/、runtime-broker/等模块路径(实际路径见packages/managed-agent-server/server/...、control-plane/...、persistence/...)。建议改为可点击的准确相对路径。
-
设计文档与 drain 回包实现不一致
- 英文
docs/design/2026-10-25-external-hosted-workspace.md:255/ 中文:231声称“非空 channels/receipts 不产生 receipt”。 - 实现
packages/managed-agent-server/runtime-http/src/main/java/com/alibaba/qwen/code/runtimebroker/adapter/HttpRuntimeTransport.java:571-583明确接受并逐条校验非空receipts;测试externalDrainAcceptsPublicationReceiptsButRejectsMalformedEntries也把合法 receipts 当作成功用例。请同步文档措辞(仅非空channels/undrained 保持可重试拒绝),避免后续误读。
- 英文
-
client-files 注册面在 external profile 上未闭合
packages/cli/src/serve/hosted-harness-session.ts:9658的 register 只拒绝foregroundOnly || !toolProfile;external profile 具有toolProfile,因此允许注册。- 但
packages/cli/src/serve/hosted-workspace-tool-turn.ts:2625-2629的 external 分支直接返回[...HOSTED_WORKSPACE_FILE_TOOLS, HOSTED_GLOB_TOOL],从不调用clientFilesDeclarations(),注册的 relay 工具永远不会被声明/派发。结果是面板显示 connected,但模型拿不到任何 client-files 工具,与该文件:2660附近“注册必须传到模型,否则面板会谎报 connected”的注释语义冲突。 - 建议在 register 阶段对 external profile 返回
hosted_client_files_profile_unsupported(与foregroundOnly同路径),或在声明分支显式拒绝并给出原因;二者选一即可,但不要保留“可注册、永不生效”的状态。
-
验证覆盖说明
- head 上
Managed Agent full / MySQL / hosted-fault任务为 skipped,本 PR 的 external SQL ownership、drain receipt 与 lifecycle 变更主要由单元/集成测试覆盖。合并前建议确认 full-tier(ExternalPublicFilesE2E所在 PR)与 MySQL 任务已实际运行,作为 SQL holder/退役路径的端到端证据。
- head 上
安全审查结论
未发现阻塞性安全问题:无硬编码密钥/Token;SQL 使用参数化占位符;external 工具仅白名单 read_file/write_file/edit/glob;路径校验(UUID、绝对路径、段名、长度)严格;drain 回包有大小上限与严格 JSON 解析;审批模式与 planMode/skills/MCP/hooks 等闭合选项处理一致;外部存储注册与物化在事务与锁内完成。建议项 1–3 属于可维护性与一致性,不构成安全阻塞。
说明:本评审为 comment 类型,不包含 approve;阻塞项修复并补充 boundary 级测试后可再次提交复审。
qqqys
left a comment
There was a problem hiding this comment.
Reviewed at head 850a1bca5eaa5653af0d5f6612b1b16cc5ae1209 (base 6f754be6).
Approve. This PR accumulated thirteen CHANGES_REQUESTED reviews across thirty rounds, all anchored to superseded heads — none at this one, and reviewDecision reads REVIEW_REQUIRED. The five most recent of them (rounds 22, 23, 24, 25, 26) filed six Criticals between them, and round 30 at this head posted zero findings while deferring one Critical under its convergence posture. That silence is meaningful only because the earlier rounds demonstrably re-posted whatever still stood — R23-2 was carried into round 25 annotated "(still stands)" — so I treated round 30 as a closure signal to verify, not to trust. I re-derived all six historical Criticals against this head, and separately verified the deferred one, including its "new surface" claim, which is the part most likely to be wrong. All are closed or non-blocking. CI is fully settled with no failures.
The six historical Criticals at this head
R23-2 / R24-1 — class-size ratchet and the Checkstyle brace collapse. Closed, and the ratchet was not raised. class-size-ratchet.properties:66 reads RuntimeBindingProvisioning=1309 and the class at this head is exactly 1309 lines. Both values are unchanged from the merge base, where the ceiling was also 1309 and the class also 1309 — so the round-23 complaint that "the ceilings are raised again by this diff" and round 25's "1314 lines, above its 1310" describe intermediate heads. The author shrank the class back under its original ceiling instead of lifting it, which is the fix the ratchet exists to force. SDK Java (fast) / ubuntu-latest / Java 21 runs Checkstyle and the verification module and is green.
R23-1 — lenient Jackson decode of registration_json. Closed. ExternalWorkspaceMaterializationStore.java:74-82 now decodes through the shared strict decoder, with the hazard named in the comment:
// The shared strict decoder is the one every other reader of this
// column uses; a lenient scalar coercion here would commit an
// ACTIVE Workspace that every later consumer permanently refuses.
registration = ExternalStorageRegistry.decodeRegistration(registrations.getFirst());wrapped in catch (RuntimeException unreadable) { throw conflict("external_workspace_conflict"); }. The class's remaining private ObjectMapper is used only for decode(prior.resultJson(), Receipt.class) — this store's own idempotency receipt, not the shared column — so the strict/lenient split is on the right boundary.
R26-1 — memoryStoreId was the one lane the external-files admission gate did not refuse. Closed. 'memoryStoreId' is now a member of the excluded-key list in hasHostedExternalFilesExcludedOptions (hosted-workspace-profiles.ts:146), alongside agentDefinition, sessionSkillsRef, hookCatalog, mcpServers, publicChildModelRoute, lineage and captureBytes, so an external-files session carrying a memory store is refused at admission rather than persisted by one profile and unreadable by another.
R22-1 — lock-contract sql-owners.txt inventory out of step with the tree's SQL literals. This is an arithmetic fixture asserted by a test in the verification module; SDK Java (fast) / ubuntu-latest / Java 21 executes that module and is green at this head, so the inventory and the literals agree. I am resting this one on that lane rather than on a hand re-derivation of the inventory.
The deferred Critical, checked rather than accepted
Round 30 deferred HarnessConnector.java:184 — Critical [fails-closed] [new-surface] The new supportsSavedLifecycle(String) capability…. The deferral's axis makes two factual claims, and my notes say to test the merge-base one because it is sometimes simply false. Here it is true: git grep -c supportsSavedLifecycle at base 6f754be6 returns nothing — the method does not exist there, and the callers used plain harness.supportsLifecycle(session.toolProfile()) (base ManagedAgentService.java:191, :1620).
The fails-closed half also holds, on three checks:
- The interface default is
supportsSavedLifecycle(profile) → supportsLifecycle(profile), so any connector that does not override it behaves exactly as it did before this PR. - Both overrides terminate and fail closed.
QwenHostedHarnessConnector:326returns the capability conjunction insidetry { … } catch (DaemonException | IllegalStateException unavailable) { return false; };HarnessPoolConnector:556returnscontract != null && contract.lifecycle() == 1 && contract.features().contains(EXTERNAL_FILES). Neither re-enterssupportsLifecyclefor theEXTERNAL_FILESbranch, so there is no mutual recursion withsupportsLifecycle's ownEXTERNAL_FILESarm, which does callsupportsSavedLifecycle. - The one implementor that overrides
supportsLifecycle(String)without overridingsupportsSavedLifecycleisSdkHarnessBoundary, a decorator: its override iscall(() -> delegate.supportsLifecycle(profile))(:240-242), so the inherited default resolves to the delegate'ssupportsLifecycle, not back into itself. ForEXTERNAL_FILESthat evaluates toisWorkspaceFilesAvailable() && delegate.supportsSavedLifecycle(EF)— the conjunction the caller wanted, plus one stricter term. Equivalent-or-stricter, never more permissive.UnavailableHarnessConnectoroverrides neither and inheritsfalse.
The residual worth recording as follow-up rather than as a blocker: because the boundary forwards to supportsLifecycle rather than to supportsSavedLifecycle, the two capabilities are only equivalent while supportsLifecycle(EXTERNAL_FILES) keeps ANDing in the saved-lifecycle check. If that composition ever changes, the decorator would silently diverge from the direct connectors. An explicit override forwarding to delegate.supportsSavedLifecycle(profile) would remove the coupling. QwenHostedHarnessConnectorTest:928/937/938 pins the true/false/false profile behaviour.
The shared-prologue deferral is self-gating
Round 30 also deferred that ownership.requireExternalExecution(...) "sits in the shared prologue of execute()". Read at head, the guard gates itself:
public void requireExternalExecution(ContextBinding binding) {
if (isExternal(binding) && (externalAdmission == null
|| !externalAdmission.externalFilesAllowed(binding))) {
throw unavailable();
}
}(JdbcWorkspaceExecutionStore.java:127-132). For a resident or CSI binding isExternal is false and the method is a no-op, so the four call sites in WorkspaceRuntimeTransport (:144, :214, :521, :700) and the one in ManagedRuntimeCoordinator:122 cannot refuse an existing profile. For an external binding it fails closed in both directions, including when the @Autowired(required = false) admission bean is unwired — an unassembled optional dependency refuses the new capability rather than permitting it. WorkspaceRuntimeTransportTest:374 verifies the call and ExternalWorkspaceMaterializationTest:324 the throw.
The new trust surface
Because this feature lets a managed agent execute in a customer-provided workspace, I read the two largest new classes for tenant scoping rather than sampling. Both are defensive in the same shape: narrow FOR UPDATE selects, then an independent Java-side identity re-check that throws on any mismatch.
JdbcExternalWorkspaceOwnership locks ma_storage by alias_key and ma_storage_owner by storage_key, then re-verifies tenant_id and storage_id against the binding and throws unavailable() on divergence (:51-93); savedContext scopes in SQL and re-checks tenant and workspace (:170-186); the workspace query joins ma_workspace_access on tenant and workspace with a.actor_id = COALESCE(s.owner_actor_key, s.creator_actor_key), a.role IN ('OPERATOR','OWNER') and w.state = 'ACTIVE' (:197-201); held and claim both take FOR UPDATE. WorkspaceAttachmentAuthorizer scopes every query with WHERE tenant_id = ? AND session_id = ?, joins ma_turn, ma_workspace and ma_workspace_access on tenant_id, re-checks session.tenantId().equals(row.getString("tenant_id")) in a structural predicate (:116), requires parent_session_id IS NULL for the execution actor (:220-225), and routes every failure to unavailable() / unavailablePendingGrant() — no permissive default anywhere. I found no path where a tenant or workspace mismatch is tolerated.
Scope of what I read, stated plainly
The PR is 98 files, +6523/−589: 31 test files, 3 docs and 64 production files carrying roughly 2,900 changed production lines. I verified all six historical Criticals, the deferred Critical, the self-gating guard, and the two largest new authorization classes, and enumerated the production file list by module size. I did not line-by-line read every one of the 64 production files — JdbcWorkspaceExecutionStore (+175/−179), JdbcManagedWorkspaceRegistry (+167/−39), HttpRuntimeTransport (+149/−3), RuntimeDrainCoordinator (+108/−33) and ExternalWorkspaceProvisioner (+130/−9) were read only where a deferred or historical finding pointed into them.
Round 30 also disclosed that it did not converge — it hit its three-round cap with the reverse audit still producing findings, withheld its incremental anchor, and left four traces unexplored, among them the full enumeration of the ~20 lifecycleProtocol(...) call sites behind the EXTERNAL_FILES 0→1 flip and whether WorkspaceRuntimeResolver.verifyInstallable's verifyMountForProbe(...) reaches WorkspaceStorageKindGuard. Those are unconfirmed, not cleared, and I am not representing them as reviewed. Roughly 58 further [review]-graded items were deferred, including the five broken source links in design section 14 of both language versions, the unpaged read_file on the external-files profile losing its pages parameter, and a per-row JDBC read in session-page rendering. None is graded Critical and none blocks under this channel's scope, but the design-doc links and the pages parameter are the two I would fix before the next slice.
CI
Settled and clean: 28 pass, 0 fail, 0 pending, 41 skipping. Green includes SDK Java (fast) / ubuntu-latest / Java 21 (Checkstyle, the class-size ratchet and the lock-contract fixture), SDK Java (fast) / Real daemon E2E / Java 11, Flyway migration version uniqueness, Test (ubuntu-latest, Node 22.x), both Linux unit tests shards, both Integration Tests (no-AK) shards, both web-shell E2E Smoke shards, Lint & Static, Build unit-test tree, Managed Agent fast tier and the TUI parity and no-flicker gates.
The skips are the whole full tier — Runtime Broker and Managed Agent MySQL, Hosted process fault gates, Hosted failover E2E, the EventTransport broker and multi-node gates, and the Windows/macOS legs. managed-agent-gate.yml selects the full tier only on an OWNER/MEMBER/COLLABORATOR approval of this head, so for a feature whose core is new MySQL-backed ownership, materialization and registration stores, none of the MySQL-backed paths have executed in CI at this head. That is the one gap I would close before merge rather than after: approve to start the full tier, then read the MySQL and hosted-fault legs.
…y, close client-files registration on external profiles - Add the missing supportsSavedLifecycle(String) forward in SdkHarnessBoundary so the production wiring no longer falls back to the interface default (which degrades to supportsLifecycle). Without it an external Session whose workspace files were disabled after creation could not close/delete because AgentLifecycleOperations rejected the operation with 409. - Pin the forwarding with a boundary-level test in HarnessSdkValuesTest. - Close the client-files registration gap on hosted-workspace-external-files/1: the external branch never declares relay tools, so the register route now returns hosted_client_files_profile_unsupported instead of leaving a connected-but-useless registration. - Fix §14 design doc links to include the correct module paths (server/, control-plane/, contracts/, persistence/) and correct the drain-response description to match the implementation: non-empty receipts are accepted and validated, not rejected. Review thread: #15684 (review) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
qqqys
left a comment
There was a problem hiding this comment.
Re-reviewed at head ee1ea45e56baca141ef40596fcc6f85471fae782 (base 6f754be6). My approval of 850a1bca5 was dismissed by this push; that dismissal is a stale-head artifact, not a finding.
Approve. One commit, five files, +32/−12. It closes the one follow-up I named in my previous review and one item round 30 had deferred, and it touches none of the files where I verified the six historical Criticals — so those verifications carry forward unchanged. No new blocking defect. No review or comment was filed between my approval and this head, so there is no later finding to reconcile.
What the delta changes
SdkHarnessBoundary now forwards the saved-lifecycle capability explicitly (:244-247):
@Override
public boolean supportsSavedLifecycle(String profile) {
return call(() -> delegate.supportsSavedLifecycle(profile));
}Previously the boundary inherited the interface default, so supportsSavedLifecycle resolved to delegate.supportsLifecycle(profile). That was equivalent-or-stricter only while supportsLifecycle(EXTERNAL_FILES) kept ANDing in the saved-lifecycle check — a coupling between two methods in two other classes, invisible at the decorator. Forwarding directly removes it. The override uses the same call(...) wrapper as its sibling supportsLifecycle(String) at :240-242, so the boundary's failure mapping is unchanged, and the default's fail-closed behaviour for every other implementor is untouched.
The added test discriminates in the direction that matters: boundaryForwardsSavedLifecycleCapability is a @ParameterizedTest over {false, true} that asserts both the returned value and verify(delegate).supportsSavedLifecycle("hosted-workspace-external-files/1"). A boundary that delegated to supportsLifecycle instead would fail the verify even though the boolean could still match.
The client-files registration gate now refuses the external-files profile (hosted-harness-session.ts:9658-9663). HOSTED_WORKSPACE_EXTERNAL_FILES_PROFILE joins foregroundOnly and !toolProfile as a condition answering 409 hosted_client_files_profile_unsupported. This closes round 30's deferral that the no-optional-lanes gate omitted clientFiles, a lane the external profile drops: without it, registering a relay client held a connection for tools no Turn would hand out while the panel reported connected.
Three checks on that change. The constant is imported at :393 and already used at sixteen other sites in the file, so it resolves. The edit only adds a refusal — unregister is still admitted in every state because the action !== 'register' check precedes it, so an already-registered client can still detach rather than being stranded by the new gate. And no test asserts a successful client-files registration for an external-files session: grepping the head's serve tests for client-files combined with the external profile returns nothing, while the two existing assertions on this code (hosted-harness-session.test.ts:44516, :44567) cover the pre-existing conditions and are unaffected.
Both design docs correct the six section-14 source links that round 30 reported as pointing at nonexistent paths. I verified all six targets exist at this head — server/.../config/ManagedAgentProperties.java, contracts/.../repository/ManagedWorkspaceRegistry.java, control-plane/.../session/SessionLifecycleCoordinator.java, contracts/.../repository/WorkspaceLifecycleStore.java, persistence/.../runtimebroker/persistence/JdbcExternalWorkspaceOwnership.java and packages/cli/src/serve/hosted-workspace-profiles.ts — in both the English and Chinese files. The drain-evidence bullet is also corrected: receipts is no longer documented as necessarily empty, each receipt must carry channelId and a same-shape manifest reference, and non-empty channels on an undrained reply stay retryable rather than yielding no receipt.
Carried forward
The delta touches two production files, one test and two docs. None of the sites I verified last round is among them, so these stand as previously established: RuntimeBindingProvisioning at exactly 1309 lines against an unchanged 1309 ceiling; ExternalWorkspaceMaterializationStore decoding registration_json through the shared strict decodeRegistration; memoryStoreId present in hasHostedExternalFilesExcludedOptions; requireExternalExecution self-gating on isExternal(binding) so it is a no-op for resident and CSI bindings; and the tenant-scoped, fail-closed shape of JdbcExternalWorkspaceOwnership and WorkspaceAttachmentAuthorizer. HarnessConnector's default and both connector overrides are unchanged, so the recursion and fail-closed analysis from the previous review still describes this head.
The remaining round-30 deferrals this commit does not address are still open and still non-blocking under this channel's scope — among them the unpaged read_file on the external-files profile losing its pages parameter, the per-row JDBC read in session-page rendering, the 19-way optional-lane disjunction witnessed by one lane, and the 16-domain journal scan that is never the deciding conjunct in its only test. Round 30 also disclosed it hit its round cap without converging and left four traces unexplored. I am not representing any of that as reviewed.
CI
9 pass, 9 pending, 0 fail at this head. Pending includes SDK Java (fast) / ubuntu-latest / Java 21 — the lane that runs the new HarnessSdkValuesTest case — plus Lint & Static, Build unit-test tree, both Managed loop legs, Serve A/B and TUI parity. So the new Java override and the new TS gate condition have no executed witness yet; the previous head was fully green at 28 pass / 0 fail, and this delta is five files, but I could not observe either change run. I did not wait on the lanes.
The full tier stays skipped as before — Runtime Broker and Managed Agent MySQL, Hosted process fault gates, Hosted failover E2E and the EventTransport gates only run on an OWNER/MEMBER/COLLABORATOR approval of this head, so the MySQL-backed ownership, materialization and registration paths still have no CI execution. That remains the gap I would close before merge rather than after.
doudouOUC
left a comment
There was a problem hiding this comment.
评审结论:通过(APPROVE)
- 基线:head
ee1ea45e56baca141ef40596fcc6f85471fae782,base6f754be6548903e545e6ff0ed43a34927fe3bfb9;100 个文件 +6549/−595。相对上一轮评审的850a1bca只有 1 个提交、5 个文件(+32/−12)。 - 历史评审:58 条 review thread 全部 resolved,无未解决线程;旧提交上的 CHANGES_REQUESTED 已不构成当前 head 的阻塞(当前 reviewDecision=REVIEW_REQUIRED)。
- CI:必需门禁 Lint & Static、Classify PR、Test (ubuntu-latest, Node 22.x)、Integration Tests (no-AK, No Sandbox) 全部通过;Build unit-test tree、Linux unit tests (2 shards)、Managed loop、TUI parity、Serve A/B、Build and verify reference distribution、SDK Java Flyway 与 Real daemon E2E 也通过。
SDK Java (fast) / ubuntu-latest(含新增 HarnessSdkValuesTest 与 Managed Agent H2 suite)与 web-shell E2E 在本评审提交时仍在运行(非必需门禁)。Runtime Broker and Managed Agent MySQL、Hosted process fault gates、Hosted failover E2E为 skipped(fast tier 选择,见建议 2)。
上轮阻塞项(已修复)
1. SdkHarnessBoundary 未转发 supportsSavedLifecycle(String),生产装配下 files 禁用后 close/delete 会被 409 拒绝
- 已在
packages/managed-agent-server/adapters/src/main/java/com/alibaba/qwen/code/managedagent/harness/SdkHarnessBoundary.java:244-247增加与相邻方法一致的转发:return call(() -> delegate.supportsSavedLifecycle(profile));。 - 生产装配
packages/managed-agent-server/server/src/main/java/com/alibaba/qwen/code/managedagent/config/HarnessConfiguration.java:76与:91的两条 Connector bean 都由该边界包装,因此ManagedAgentService.java:200/:1638、SessionLifecycleCoordinator.java:134/:771、SessionLifecycleService.java:166现在能拿到QwenHostedHarnessConnector.java:326-337的 saved-lifecycle 结果;该实现只要求 lifecycle protocol 1 +EXTERNAL_FILESfeature,不依赖 files 当前可用。files 被禁用后的 close/delete 不再因supported=false被拒绝。 - 回归覆盖:
packages/managed-agent-server/verification/src/test/java/com/alibaba/qwen/code/managedagent/harness/HarnessSdkValuesTest.java:51-59新增 boundary 级转发断言(true/false 两分支);QwenHostedHarnessConnectorTest.java:913-943已覆盖 files 禁用后supportsSavedLifecycle=true、supportsLifecycle=false的 connector 语义,两者组合覆盖生产边界。
上轮建议项(已修复)
- 设计文档链接已修正:
docs/design/2026-10-25-external-hosted-workspace.md:269/:275、docs/design/2026-10-25-external-hosted-workspace.zh-CN.md:245/:251的 5 个链接已补全server/、contracts/、control-plane/、persistence/模块路径,已逐一确认目标文件存在。 - drain 回包文档已与实现对齐:
docs/design/2026-10-25-external-hosted-workspace.md:255/zh-CN.md:231现在描述 receipts 会被接受并逐条校验(channelId + 同形状 manifest),unknown/undrained 不产生 receipt,undrained 的非空 channels 保持可重试;与packages/managed-agent-server/runtime-http/src/main/java/com/alibaba/qwen/code/runtimebroker/adapter/HttpRuntimeTransport.java:561-583一致。 - client-files 注册面已闭合:
packages/cli/src/serve/hosted-harness-session.ts:9652-9663对 external profile 返回409 hosted_client_files_profile_unsupported,unregister 仍照常放行;与packages/cli/src/serve/hosted-workspace-tool-turn.ts:2624-2629external 分支不调用clientFilesDeclarations()的事实一致。
建议项(非阻塞)
- 新增的 external profile 拒绝分支缺少专用测试。
packages/cli/src/serve/hosted-harness-session.test.ts:44483-44585只覆盖 foregroundOnly 与 memory-only;建议补一个 external profile 的 register → 409 + unregister → 200 用例,防止后续改动删除该门禁。 Managed Agent full / MySQL / hosted-fault在本轮仍为 skipped;合并前建议确认真实 MySQL/full-tier 已覆盖 SQL physical holder 退役路径(这是上一轮遗留的验证建议,与本次增量无关)。
安全审查结论
本次增量只包含文档、boundary 能力转发、client-files 注册准入收紧与测试:未新增凭据、路由、SQL 或输入解析。对全量 diff 的密钥模式、Map.of(..., null)、拼接 SQL 扫描均无命中。结合上一轮全量扫描,未发现阻塞性安全问题(无硬编码密钥;SQL 参数化;external 工具白名单;路径与 drain 回包严格校验;闭合选项一致)。
总体评价
上轮唯一阻塞项与 3 条建议均已在 ee1ea45e 修复,修复方式与建议一致,未引入新的 Critical。结论:通过。
|
Released in v0.28.0. |
What this PR does
Builds the external Workspace execution slice on top of the materialization prerequisite in #15654. The branch now includes live
hosted-workspace-external-files/1admission, bounded and single-query Workspace discovery, authoritative registration checks, stable lifecycle refusal classification, and receipt-backed release for external Runtime bindings. The separate materialization operation still creates metadata only; it does not allocate storage or start a worker.This revision closes the remaining review gaps in that execution slice: registration decode failures, including field-type failures, now resolve to a permanent
409 workspace_unavailable; a malformed registration disables only its own Workspace during batch discovery; saved-provider shutdown is classified as retryable503; attachment actor lookup fails closed on zero, multiple, or null rows; and external lifecycle authorization preserves the exact permanent fence response.Why it's needed
#15512 needs a durable link from registered external storage to a Workspace that can be discovered and used safely. A Session must not become executable through a partially wired path, and one corrupt storage row must not hide every healthy Workspace on the page. The same branch also needs terminal close and recovery paths to distinguish permanent identity failures from provider availability failures.
Reviewer Test Plan
How to verify
On an isolated fresh catalog, register external storage using the loopback operator credential, materialize its alias with an owner, and verify that only the owner can discover it. Exercise Session creation after the external-files gates and a Harness lifecycle capability are available. Confirm that prompts can run, file tools remain within the external profile, and close/recovery uses the receipt-backed ownership transition without destroying a shared placement.
For the query and failure paths, corrupt one registration and confirm only that Workspace loses Session-creation eligibility while another Workspace remains visible. Confirm that an admission attempt against the corrupted Workspace returns
409 workspace_unavailablewithretryable=false. Shut down the saved external provider during drain-capability checks and confirm a retryable503. Submit a non-current lifecycle authority to the external attachment path and confirm409 workspace_lifecycle_claim_fencedwithretryable=false.Evidence (Before & After)
Before this revision, a field-type error while decoding an opaque-persisted registration could escape as a mapper failure, batch discovery could fail as a whole when one row was malformed, and a shut-down saved provider was conflated with a permanent binding conflict. The candidate maps these cases explicitly, uses one registration batch read rather than per-row JDBC work inside a mapper, and keeps external lifecycle fences non-retryable.
Earlier evidence in this stack covered materialization, registration replay, and isolated MySQL validation. The newest commit was checked statically and through the repository's CI gates; no local test, build, or typecheck was run under the requested execution policy.
Tested on
git diff --check; no heavy local executionRisk & Scope
workspace_lifecycle_claim_fencedremains permanent. Do not reinterpret a stale or non-current authority as a transient outage.Design: English · 简体中文.
Linked Issues
Part of #15512. Related prerequisite: #15654. The Resident shared-worker increment is stacked in #16023 and must not merge before this PR.