Repository navigation
fix(web): improve run evaluation progress and writeback - #1254
Robert0622 wants to merge 2 commits into
Conversation
crispinhu27
left a comment
There was a problem hiding this comment.
自动化 CR(head d8143b1ea8c3ff0b9b9d8e3c72491322ffadcfe2,base main 4d39fc16):初审,结论 REQUEST_CHANGES。
已确认的问题(2 条,都会让 CI 必需检查 core / platform-required 失败,详见行内评论):
- [P1]
selectRun新调用了stopRunEvalStream(),但web/run_queue_test.js的沙箱没有提供它,TestRunQueueInteraction报 ReferenceError。 - [P1] 评测面板新加的「准入线」文案命中
TestRequirementDirectCreateUI的禁用词检查。
两条在 head 上都能稳定复现,base 4d39fc16 上同样的命令全部通过。本地按行内评论里的修复方向临时改过之后,go test ./web 整包通过(改动没有推送)。
已执行的验证
go build ./...和go vet ./internal/httpapi ./internal/runeval ./web:通过。go test ./internal/httpapi ./internal/runeval -run 'RunEval|Eval':通过,包括新加的stage和回放到done就结束的断言。go test ./web:head 上只挂上面 2 条,base 全部通过。node --test webtest/tests/run-evaluation.test.mjs runs-actions.test.mjs runs-detail.test.mjs:head 15/15,base 12/12。- 代码核对:前端
runEvalRecommendation判断能否回写的条件、预览的正文来源(text→set.text→set.instructionsDelta)、targetId 的回退规则,都和服务端applyOneRecommendation、recommendationText一致。删掉的 CSS 类没有发现其他地方还在用。
这次没做的验证:没有接真实模型跑一次完整评测,也没在真实浏览器里端到端确认评测面板渲染和回写。修复以后复审时补上。
| function selectRun(id,keepPages=false){ | ||
| if(!id)return; | ||
| if(state.selectedRun!==id)stopPreviewPoll(); | ||
| if(state.selectedRun!==id){stopPreviewPoll();stopRunEvalStream()} |
There was a problem hiding this comment.
[P1] selectRun 新增 stopRunEvalStream() 后,TestRunQueueInteraction 失败,CI core / platform-required 变红
触发条件:go test ./web。web/run_queue_test.js:87 在 vm 沙箱里单独加载 selectRun,上下文只提供了 stopPreviewPoll 等依赖,没有 stopRunEvalStream。
预期 / 实际:base 上这个用例通过;本 PR 的 head 上 selectRun('r') 直接抛出异常:
--- FAIL: TestRunQueueInteraction
run_queue_test.go:16: run queue interaction: exit status 1
ReferenceError: stopRunEvalStream is not defined
at Object.selectRun (evalmachine.<anonymous>:3:48)
复现(head d8143b1e,Go 1.26.11,已先跑 scripts/build-chatbot.sh 的 chatbot 构建):
go test ./web -count=1 -run 'TestRunQueueInteraction'
head 上 FAIL,base 4d39fc16 上 ok。CI 的 core job 也是同一个报错(run 45139803606)。
修复方向:在 web/run_queue_test.js 中 showRunDetail/selectRun 用例的 context 里加上 stopRunEvalStream:()=>{}。我在本地临时这样改过(和下一条一起改),go test ./web 整包通过。
| content=runEvalReportHTML(run,rec,dims); | ||
| }else{ | ||
| content=`<section class="run-eval-panel"> | ||
| <div class="run-eval-panel-head"><h4>评分维度</h4><span class="run-eval-meta"><span>准入线</span> <b>${escapeHTML(policy.threshold||70)}/100</b></span></div> |
There was a problem hiding this comment.
[P1] 评测面板新增的「准入线」文案命中 TestRequirementDirectCreateUI 的禁用词检查,CI core / platform-required 变红
触发条件:go test ./web。web/syntax_test.go:1103 会把整个 app bundle(readAppBundle(),包含 web/app/runs.js)当作需求编辑器代码检查,要求里面不能出现 准入线(这是需求编辑器以前去掉的旧文案)。本 PR 在这里和第 1470 行的评测结论卡片里都新加了 <span>准入线</span>。
预期 / 实际:base 上这个用例通过;head 上:
--- FAIL: TestRequirementDirectCreateUI
syntax_test.go:1107: requirement composer must not keep "准入线"
复现(head d8143b1e):
go test ./web -count=1 -run 'TestRequirementDirectCreateUI'
head 上 FAIL,base 4d39fc16 上 ok。CI core job 报的也是这一条。
修复方向:二选一。一是把评测面板里的文案换成别的词,比如「达标线」,同时改 i18n-en.js 里对应的 key。我在本地把两处换成「达标线」,再加上上一条的测试桩,go test ./web 整包通过。二是如果要保留「准入线」,就把 syntax_test.go 的禁用词检查收窄到需求编辑器自己的源码(如 composer.js),不要扫整个 bundle。
What changed
Scope
Compatibility
The Platform UI uses existing evaluation records. The evaluation stream's
thoughtevents carry astagefield and readable progress text. Historical recommendations with missing writeback content appear as advisory.Validation
node --test --test-concurrency=2 webtest/tests/run-evaluation.test.mjs webtest/tests/runs-actions.test.mjs webtest/tests/runs-detail.test.mjsgo test ./internal/runeval -count=1and targeted./internal/httpapiand./webchecks for evaluation, asset loading, and UI controls.python3 scripts/check-public.pySafety