Skip to content

feat(workbench): run 审查可信 workDir 真实批准/驳回(#1967) - #1983

Merged
DeliciousBuding merged 3 commits into
masterfrom
feat/run-review-apply
Aug 25, 2026
Merged

feat(workbench): run 审查可信 workDir 真实批准/驳回(#1967)#1983
DeliciousBuding merged 3 commits into
masterfrom
feat/run-review-apply

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

run 级审查:可信 workDir 数据合同 + 真实批准/驳回(#1967 剩余部分)

#1975 交付了诚实的只读聚合视图,并明确剩余路径:「先增加可信 run workDir/权威 run diff 数据合同,再接 Desktop apply port」。本 PR 完成该路径:

数据合同(Edge → transcript → 前端)

  • store.Run 新增 WorkDir;process executor 在 run.started 前把执行器真实解析的 workDir(adapter BuildCommand / profile WorkDir)记入 run 证据;RunResponse 仅在有值时携带 workDir。Mock executor 不上报(诚实:mock run 保持只读)。
  • api/events.md 合同:workDir 是 run 级 diff 审查唯一可信 workDir 证据;客户端禁止猜测(当前 composer 目录等),缺失即只读。
  • shared:EvidenceRef.workDir(kind=run)、runEvidence(runId, status, workDir?)、9 个 run 生命周期 mapper 全量透传 payload.workDir、selectRunReview 暴露所选 run 的 workDir(首个非空值获胜,重放事件不可覆盖;legacy 永不携带)。

前端接线(不产生第二套审批状态)

  • ConversationHost:canApplyRunReview = 非 legacy + 可信 workDir + platform.preview.applyAllRunDiffs。满足时 RunReviewOverlay 接 runId(原始 Edge run id,剥离 run- 证据前缀)+ onApplyHunk/onApplyAllHunks(走既有 PreviewPort → Desktop Local Edge POST /v1/runs/:id/apply[-all],Edge 端 validateWorkDirAllowed 仍是硬边界)+ accept/reject-run(面板合同:仅异步 apply 成功后回调,失败精确回滚 hunk 状态)。
  • 三种只读态各配诚实文案:无 workDir(执行器未上报)/ 无 apply port(Web Hub-only)/ legacy(无运行标识)。入口 aria 与标题在可写回态不再谎称「只读」。
  • DiffReviewPanel 全套标签接 i18n(此前部分走硬编码默认值)。

验收对照

验收项 实现 测试
run 级聚合 + 逐 hunk;可整体或逐块批准/驳回 #1975 聚合只读 + 本 PR 整体/逐文件/逐块写回(同一 hunk 状态机,同一 onApplyAllHunks 端口) runReview.test.tsx 12 用例(含 5 新行为用例:批准/驳回带可信 workDir+原始 runId、逐块 apply、无 port 只读、legacy 永不适用)
与既有单卡审批语义一致,不产生第二套审批状态 复用 DiffReviewPanel/PreviewPort 既有合同,零新状态系统 DiffReviewPanel.test.tsx#1975 回滚/时序合同)仍绿
Web Hub-only 不破;行为断言测试;中英一致 Web 无 port → 诚实只读文案;全部行为断言;composer/runReview 新增键中英成对 resources.test.ts 键集/占位符绿;verify-i18n-callsites 本 lane 零新增违规文件

验证证据(本机,串行)

real_tested=false(L0 单元/组件 + visual shell + stubbed E2E;未在真实 Desktop+Edge run 上跑真实 apply 往返,建议远程 dev 服务器做一次 L3 口径验证)

Closes #1967

Co-authored-by: Codex <codex@vectorcontrol.tech>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 596d4202-fef3-44d6-8ab2-c8531de0d516

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

DeliciousBuding and others added 2 commits August 26, 2026 03:39
Co-authored-by: Codex <codex@vectorcontrol.tech>
Co-authored-by: Codex <codex@vectorcontrol.tech>
@DeliciousBuding
DeliciousBuding merged commit a76ef62 into master Aug 25, 2026
44 checks passed
@DeliciousBuding
DeliciousBuding deleted the feat/run-review-apply branch August 25, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(review): run 级聚合审查入口(UX F11)

1 participant