From 711e102d877f6c6dd4463e13a493bd632a43fb38 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 4 Jun 2026 11:50:19 +0800 Subject: [PATCH] feat(web): add Code Review Codex handoff board --- .../web/src/app/[locale]/code-review/page.tsx | 166 ++++++++++++++++++ .../security-mirror-progress-guard.py | 18 ++ 2 files changed, 184 insertions(+) diff --git a/apps/web/src/app/[locale]/code-review/page.tsx b/apps/web/src/app/[locale]/code-review/page.tsx index be17c1ad..26df0539 100644 --- a/apps/web/src/app/[locale]/code-review/page.tsx +++ b/apps/web/src/app/[locale]/code-review/page.tsx @@ -4,11 +4,16 @@ import { AppLayout } from '@/components/layout' import { IwoooSReadOnlyBridge } from '@/components/security/iwooos-read-only-bridge' import { Activity, + ArrowRight, Bot, CheckCircle2, + ClipboardList, + Code2, ExternalLink, + FileCheck2, GitBranch, Gauge, + LockKeyhole, SearchCheck, ShieldCheck, } from 'lucide-react' @@ -33,6 +38,71 @@ const agentStateLabel: Record = { standby: '待命', } +const codexHandoffLanes = [ + { + icon: Code2, + title: '可交給 Codex 起草', + metric: '4 類', + detail: '前端體驗、測試補洞、文件同步、低風險重構。', + guard: '只建立草稿修正與驗證清單。', + className: 'border-emerald-500/30 bg-emerald-500/10 text-emerald-100', + iconClassName: 'text-emerald-300', + }, + { + icon: FileCheck2, + title: '需人工批准後接手', + metric: '3 類', + detail: '高風險程式路徑、部署流程、跨專案設定。', + guard: '先有人控範圍、回滾條件與證據。', + className: 'border-amber-500/30 bg-amber-500/10 text-amber-100', + iconClassName: 'text-amber-300', + }, + { + icon: LockKeyhole, + title: '禁止自動轉工作', + metric: '5 條', + detail: 'Kali 主機變更、掃描、正式推版、主要來源切換、執行期閘門。', + guard: '維持 Gate 0 與獨立人工批准。', + className: 'border-rose-500/30 bg-rose-500/10 text-rose-100', + iconClassName: 'text-rose-300', + }, +] + +const codexCandidateWork = [ + { + id: 'CR-CX-01', + track: '前端體驗', + finding: '版面密度、手機寬度、文字層級', + handoff: 'Codex 起草 UI 修正與截圖證據', + gate: '人工確認 scope', + state: '候選', + }, + { + id: 'CR-CX-02', + track: '守門測試', + finding: 'IwoooS 邊界、禁用動作、進度口徑', + handoff: '補 guard / smoke test', + gate: '不得碰 runtime', + state: '候選', + }, + { + id: 'CR-CX-03', + track: '繁中紀錄', + finding: '部署證據、LOGBOOK、跨 Session 同步', + handoff: '整理已驗證事實', + gate: '不寫未驗證結論', + state: '候選', + }, + { + id: 'CR-CX-04', + track: '禁止轉派', + finding: 'Kali 更新、掃描、GitHub primary、正式部署', + handoff: '維持人工閘門', + gate: '獨立批准', + state: '封鎖', + }, +] + export default function CodeReviewPage({ params }: { params: { locale: string } }) { const evidenceHref = `/${params.locale}/awooop/runs` @@ -62,6 +132,102 @@ export default function CodeReviewPage({ params }: { params: { locale: string } +
+
+
+
+ + Code Review → Codex +
+

審查後 Coding 工作橋接

+

+ 審查結論先變成可追溯的 Codex 工作草稿;真正修改、推版、主機操作與來源切換仍留在人工閘門後面。 +

+
+
+
+ codex_handoff_mode=read_only_candidate +
+
+ codex_auto_coding_enabled=false +
+
+ runtime_execution_authorized=false +
+
+ production_deploy_authorized=false +
+
+
+ +
+ {codexHandoffLanes.map((lane, index) => { + const Icon = lane.icon + return ( +
+
+ + {lane.metric} +
+
{lane.title}
+

{lane.detail}

+
{lane.guard}
+ {index < codexHandoffLanes.length - 1 ? ( + + ) : null} +
+ ) + })} +
+
+ +
+
+
+
Codex 工作候選佇列
+
+ 草稿、待批、封鎖分流;不是自動執行佇列。 +
+
+
+ action_buttons_allowed=false +
+
+
+ {codexCandidateWork.map((item) => ( +
+ {item.id} + {item.track} + {item.finding} + {item.handoff} + {item.gate} + + {item.state} + +
+ ))} +
+
+
diff --git a/scripts/security/security-mirror-progress-guard.py b/scripts/security/security-mirror-progress-guard.py index a08297ad..4009046c 100755 --- a/scripts/security/security-mirror-progress-guard.py +++ b/scripts/security/security-mirror-progress-guard.py @@ -8297,6 +8297,24 @@ def validate(root: Path) -> None: source_text, '', ) + for text in [ + 'data-testid="code-review-codex-handoff-board"', + 'data-testid="code-review-codex-candidate-work"', + "審查後 Coding 工作橋接", + "Codex 工作草稿", + "可交給 Codex 起草", + "需人工批准後接手", + "禁止自動轉工作", + "codex_handoff_mode=read_only_candidate", + "codex_auto_coding_enabled=false", + "runtime_execution_authorized=false", + "production_deploy_authorized=false", + "action_buttons_allowed=false", + "CR-CX-04", + "Kali 更新、掃描、GitHub primary、正式部署", + "維持人工閘門", + ]: + assert_text_contains("code_review_page.codex_handoff_read_only", code_review_page, text) assert_text_contains("iwooos_page.surface_connection_board", iwooos_projection_page, "surfaceConnectionStatuses") assert_text_contains("iwooos_page.surface_connection_testid", iwooos_projection_page, 'data-testid="iwooos-surface-connection-board"') assert_text_contains("iwooos_page.surface_connection_embedded", iwooos_projection_page, "embeddedBridge")