Files
mnote/design/07-ai/reference/7-37-claudecode-reasonix-worker-evaluation-0524-bug2-v1.md
T
lix-2026 1882db7681 收口 MNote P0 P1 P2 审查尾项
- 归档 OnlyOffice live bridge、Page AI、mindmap、design governance 与相关 bug 条目
- 补齐 MinerU OCR 后端 runtime 合同与 smoke/test 基线
- 收口 ChatOnly/Doubao、ObjectIdentity、Page Aggregate compat 与 runtime owner 文档口径

验证:
- cargo test --manifest-path rust/Cargo.toml -p mnote-web local_ocr -- --test-threads=1
- cargo test --manifest-path rust/Cargo.toml -p mnote-web onlyoffice_bridge -- --test-threads=1
- git diff --check
- git diff --cached --check
- codegraph index . --force && codegraph status .
- codegraph sync . && codegraph status .
2026-06-01 09:29:12 +08:00

142 lines
8.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 7-37 Claude Code / Reasonix Worker 评估协议:0524 Bug2 v1
## 目标
`bugs/0524.md` 第 2 条“本地 Markdown 上传/文件树拖入后误报文件冲突”作为真实任务,评估 Claude Code 与 Reasonix 作为 worker 的可用性:
1. 编码能力:是否能在相同基线下定位根因、做小范围修复、补测试并通过验证。
2. 网页测试能力:是否能在真实浏览器中复现/验收,产出可审计截图、console、network 和结构化结论。
Codex 仍是主控,负责设计、派发、复核、合并和最终验收。
## 公平性约束
- 两个 coding worker 使用从同一 `HEAD` 创建的独立 worktree,不共享当前主工作区未提交改动。
- 两个 coding worker 使用同一份任务书,允许修改范围一致,验收命令一致。
- 两个 browser worker 对同一个主工作区修复结果做只读验证,不允许改源码。
- 评分只基于可复核产物:diff、测试输出、process handoff、截图、console/network,不凭 final 文本。
- 若 worker 卡住、超时、无 handoff、无截图或修改范围失控,按实际情况扣分,不手工补完其证据。
## Coding Worker 任务切片
输入:
- bug`bugs/0524.md` 第 2 条。
- 参考设计:`design/05-editor-mainline/process/5-27-local-markdown-working-copy-conflict-contract-v1.md`
- 允许修改:
- `rust/crates/mnote-web/src/routes/web_shell.rs`
- `rust/crates/mnote-web/src/routes/local_folder_events.rs`
- `scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js`
- 必要时新增/更新同目录小测试
- 禁止修改:无关设计、AGENTS、其它 bugs、git 提交、回滚用户改动。
验收:
- `cargo test --manifest-path rust/Cargo.toml -p mnote-web document_event_filter_rejects_resource_only_changes -- --nocapture`
- `cargo test --manifest-path rust/Cargo.toml -p mnote-web document_shell_renders_local_markdown_with_same_sidebar_surfaces -- --nocapture`
- `cargo fmt --manifest-path rust/Cargo.toml --all --check`
- 若能启动浏览器 smoke,运行 `node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js` 并记录结果。
## Browser Worker 任务切片
输入:
- 被测主工作区当前修复结果。
- 入口:`http://127.0.0.1:3000`
- 登录:`/auth` 的“测试账号快速登录”。
必须验证:
- 打开本地 Markdown 页面,上传附件后,不出现 `mnote-editor-conflict-panel`
- 新建/切换页面后,旧冲突面板不残留到新页面。
- 向文件树文件夹拖入文件后,不出现 `external-change-conflict`
- 真实冲突路径仍可用:dirty 当前 Markdown 后外部修改同一 `.md` 文件,应显示冲突。
必须产出:
- `result.json`
- `process-handoff.md/json`
- 至少一张显示通过或失败状态的截图
- console/network 摘要
- `modified_files` 必须为空
## 评分维度
- `root_cause`:是否找到两个核心根因:document event 越界、冲突 DOM 残留。
- `patch_scope`:是否只改必要文件,未引入架构外补丁。
- `test_quality`:是否补了能失败/能防回归的测试。
- `verification`:是否实际运行命令并记录输出。
- `handoff_quality`:是否有过程证据,而不是只给最终摘要。
- `latency_cost`:完成时间、工具调用量、是否卡住。
- `mislead_risk`:错误假设、过度修改、把无关失败归因到本 bug 的风险。
## 初步观察
- Reasonix 只读分析较快完成,正确指出空 `documentId` 会污染 session,但对新建页时序有部分猜测,需要主控复核。
- Claude Code 修复后本轮可产出 handoff,明确指出冲突面板 DOM 生命周期缺口;耗时更长,但对第二个根因帮助明显。
- 后续需要用隔离 coding 任务和真实 browser 任务继续比较,而不是只比较只读分析。
## 0524 Bug2 本轮实测记录
### 主控基线
- 主控修复覆盖三个切片:
- document event channel 从 `rootUri` 收窄到 `rootUri#documentId`
-`documentId` 的资源事件不再进入正文冲突链路。
- editor view unmount 清理旧 session 冲突面板 DOM。
- 主控验证:
- `cargo test --manifest-path rust/Cargo.toml -p mnote-web document_event_filter_rejects_resource_only_changes -- --nocapture`:通过。
- `cargo test --manifest-path rust/Cargo.toml -p mnote-web document_shell_renders_local_markdown_with_same_sidebar_surfaces -- --nocapture`:通过。
- `cargo fmt --manifest-path rust/Cargo.toml --all --check`:通过。
- `node scripts/task451-local-markdown-conflict-resolution-ui-smoke.js`:通过,真实冲突仍可用。
- `node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js`:上传附件和文件树拖入 no-conflict 断言通过;后续 broken-link 检查失败,属于其它已知路径,不计入本 bug 修复失败。
### Coding Worker 对比
- Reasonix coding
- run id`reasonix-2026-05-24T07-44-15-864Z-6898e686`
- worktree`/mnt/Data1T/mnote-wt-0524b-reasonix-coding`
- 正确抓到空 `documentId` 事件污染正文 session。
- 补了前端 `if (!documentId) return;` 和后端映射测试。
- 漏掉冲突面板 DOM 残留,也没有做 `rootUri#documentId` channel 隔离。
- 自报未跑 Playwright,适合作为“定位主因 + 小补丁”证据,不足以直接合并。
- Claude Code coding
- run id`claudecode-2026-05-24T07-44-15-975Z-e03aaf1f`
- worktree`/mnt/Data1T/mnote-wt-0524b-claudecode-coding`
- 正确抓到空 `documentId` 事件污染。
- 额外抓到冲突面板 DOM 生命周期问题。
- 修复位置是 `releaseDocumentSession`,比主控采用的 `unmountEditorViewBinding` 更晚,仍可能存在切换瞬间残留风险。
- 未做 `rootUri#documentId` channel 隔离,也未补 task479 no-conflict smoke。
- 编码帮助大于 Reasonix,但仍需主控补边界。
### Browser Worker 对比
- Claude Code browser
- run id`claudecode-2026-05-24T07-47-11-262Z-46f574f0`
- artifact`/tmp/mnote-0524-bug2-browser-worker-1779608936242/`
- 产出 `result.json`、截图、console/network。
- 上传附件 no-conflict、文件树拖入 no-conflict、dirty + 外部修改真实冲突均通过。
- `modified_files=[]`
- 该轮可作为较高质量浏览器验收证据。
- Reasonix browser
- run id`reasonix-2026-05-24T07-47-11-249Z-43f061bb`
- artifact`/tmp/mnote-0524-bug2-browser-worker-0524T0800/`
- 产出 `result.json`、截图、console/network。
- 上传附件 no-conflict、文件树拖入 no-conflict 通过。
- runner status 为 `error` / handoff status 为 `failed`,但 `result.json.status=passed`,状态合同不一致。
-`/api/local-folder/events` 500 判断为真实冲突阻塞;主控 `task451` 和 Claude Code browser 已证明真实冲突仍可验证,因此该判断有误导风险。
- 可作为部分 UI 证据,但不能单独作为最终验收。
### 可审计性结论
- Hindsight recall 可召回本轮 Claude Code 与 Reasonix 过程 handoff,但 Reasonix recall 混入了无关项目结果,主控不能只看 recall 摘要。
- Claude Code 的 browser artifact 更适合验收:`result.json`、截图路径、console/network、`modified_files=[]` 之间一致。
- Reasonix 的 browser artifact 可作为辅助证据,但 runner `status=error` 与 artifact `status=passed` 冲突时,必须降级为线索。
- 本轮公平测试说明:worker 能节省主控定位和浏览器操作 token,但不能替代主控做架构边界、diff 取舍和最终验收。
## 当前评分倾向
- 编码能力:Claude Code 略优,能补出 DOM 生命周期根因;Reasonix 更快但更像最小局部补丁。
- 浏览器测试能力:Claude Code 本轮明显优于 Reasonix,证据更完整且能覆盖真实冲突;Reasonix 产物可审计但状态和结论自相矛盾。
- 主控策略:以后可让 Reasonix 做低风险定位/快速 smoke,让 Claude Code 做更完整的 browser artifact;两者结论都必须由 Codex 复核 diff、截图和命令输出。