Skip to content

[Bug] v0.10.64 verification gate 仍误杀代码 100% 正确的任务(2/8 案例,verifier 不输出精确 PASS 标题) #35

Description

@echoVic

观察到的问题

v0.10.64 中 verification gate 仍然误杀代码完全正确的任务。R4 评测中 8 个高复杂度任务有 2 个因此 exit=1,但代码测试 98-100% 通过。

复现

使用 blade --headless --permission-mode=yolo --output-format=jsonl <prompt> 运行多文件 TypeScript 项目(≥3 个源文件 + 测试)。

具体案例

Case 1: task3-crdt(G-Counter + OR-Set + Vector Clock)

  • 代码测试通过率:28/28 (100%)
  • Agent exit code:1
  • 错误消息Independent verification did not produce a fresh PASS before the retry limit.
  • 代码架构:g-counter.tsor-set.tsvector-clock.tsindex.ts,4 个测试文件全通过
  • Verifier 子代理运行了但未输出宿主 gate 期望的精确 ## Verification Result: PASS 标题

Case 2: task2-regex-nfa(Thompson NFA 正则引擎)

  • 代码测试通过率:51/52 (98%)(唯一失败是测试自身的 {n} vs {n,} 语义歧义)
  • Agent exit code:1
  • 错误消息Stopped after 16 repeated Task calls without observable progress.
  • 代码架构:ast.tslexer.tsparser.tsnfa.tssimulator.tsmatcher.tstoken.tsindex.ts,8 个源文件
  • Agent 反复调用 verification Task(16 次),每次 verifier 可能返回了不同格式的结果但不被 gate 识别

对比成功案例(exit=0)

任务 测试通过率 exit 说明
task1-binary-codec 32/32 (100%) 0 verifier 正确输出 PASS
task4-dag-scheduler 20/20 (100%) 0 verifier 正确输出 PASS
task5-streaming-json 35/36 (97%) 0 verifier 接受了(有 1 个测试失败但 exit=0)
task6-pratt-evaluator 64/64 (100%) 0 verifier 正确输出 PASS
task7-radix-router 21/21 (100%) 0 verifier 正确输出 PASS

根因分析

  1. Verifier 的 12-turn 预算内,有时在 Bash 测试全通过后没有输出结构化 PASS 标题(turns 全部用于 Read/Bash/Glob,没有剩余 turn 写最终 verdict)
  2. v0.10.64 新增的 "16 repeated Task calls without observable progress" 保护机制成功防止了无限循环,但仍然把代码正确的任务判为 exit=1
  3. Gate 的判断逻辑过于依赖 verifier 输出的精确文本格式,而非 verifier 实际执行的测试结果

建议修复

  1. 当 verifier 的 Bash tool_result 明确显示 npm test exit=0 且所有测试通过时,gate 应自动推断 PASS,不要求精确文本标题
  2. Verifier 的 12-turn 预算应保留至少 1 turn 用于输出 verdict(在第 11 turn 时强制要求输出结论)
  3. 当 verifier 重试次数耗尽但项目测试命令全通过时,应降级为 PARTIAL 而非 fail(exit code 0 但附带 warning)

影响

CI/评测场景中,代码完全正确的任务有约 25%(2/8)的概率因 verifier 输出格式问题被误判为失败。这使得 headless exit code 不能可靠反映代码质量。

环境

  • blade-code v0.10.64(npm 全局安装)
  • macOS arm64, Node v22.23.1
  • 命令:blade --headless --permission-mode=yolo --output-format=jsonl
  • verification-agent 使用默认(enabled=true)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions