Skip to content

fix(web): improve run evaluation progress and writeback - #1254

Open
Robert0622 wants to merge 2 commits into
mainfrom
codex/run-evaluation-experience
Open

Robert0622 wants to merge 2 commits into
mainfrom
codex/run-evaluation-experience

Conversation

@Robert0622

Copy link
Copy Markdown
Collaborator

What changed

  • Show the evaluator's actual queue, trace collection, scoring, and validation stages.
  • Put the verdict, passing threshold, and dimension scores first. Order findings by severity and let readers expand the supporting evidence.
  • Show the target SOP or role and the proposed change before writeback. Report the outcome returned by the server.

Scope

  • Platform core / API / runner

Compatibility

The Platform UI uses existing evaluation records. The evaluation stream's thought events carry a stage field 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.mjs
  • go test ./internal/runeval -count=1 and targeted ./internal/httpapi and ./web checks for evaluation, asset loading, and UI controls.
  • python3 scripts/check-public.py
  • Chromium with fixture data covered progress and report rendering, keyboard preview, cancel and confirm, a server-side writeback error, successful writeback, and the dark layout at 390 px.
  • Full platform suite and live provider execution were not run locally.

Safety

  • The change contains no credentials, private endpoints, production data, or organization-specific infrastructure.
  • User files and unrelated edits were preserved.

@crispinhu27 crispinhu27 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

自动化 CR(head d8143b1ea8c3ff0b9b9d8e3c72491322ffadcfe2,base main 4d39fc16):初审,结论 REQUEST_CHANGES。

已确认的问题(2 条,都会让 CI 必需检查 core / platform-required 失败,详见行内评论):

  1. [P1] selectRun 新调用了 stopRunEvalStream(),但 web/run_queue_test.js 的沙箱没有提供它,TestRunQueueInteraction 报 ReferenceError。
  2. [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 类没有发现其他地方还在用。

这次没做的验证:没有接真实模型跑一次完整评测,也没在真实浏览器里端到端确认评测面板渲染和回写。修复以后复审时补上。

Comment thread web/app/runs.js
function selectRun(id,keepPages=false){
if(!id)return;
if(state.selectedRun!==id)stopPreviewPoll();
if(state.selectedRun!==id){stopPreviewPoll();stopRunEvalStream()}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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 整包通过。

Comment thread web/app/runs.js
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>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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。

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.

2 participants