Skip to content

feat(runeval): offline trajectory evaluation scorecard (/runreport) - #2535

Merged
topcheer merged 1 commit into
mainfrom
run-eval-scorecard
Sep 18, 2026
Merged

topcheer merged 1 commit into
mainfrom
run-eval-scorecard

Conversation

@topcheer

Copy link
Copy Markdown
Owner

Offline Trajectory Evaluation(/runreport scorecard)

研究依据(在线调研,sa-86)

  • 方向② agent 评测/自改进:离线 trajectory-level 评测是 2025-2026 agent 评测趋势(区别于在线 detector 与 OTel 遥测)
  • 生产级 agent 工具普遍收敛于"run 结束后离线复盘"模式:从已落盘的 session/trace 提取指标生成 scorecard,不干扰运行时

Gap

ggcode 有 191 个在线 detector 与丰富的运行时遥测,但没有任何离线 run 复盘机制——用户无法量化"这个 session 跑得怎么样"(迭代效率/工具浪费/验证充分度),只能靠印象。

实施(9 文件 +754,commit 88fde5e

新包 internal/runeval(runeval.go 470 行 + 247 行测试)

  • 从 session 存档离线提取指标:turn 数、工具调用分布、失败/重试率、编辑/验证比、token/成本轨迹
  • scorecard 分级输出;确定性统计,零 LLM 调用

TUI 接线:新 /runreport slash 命令(三语 i18n + completion + slash info)

验证

  • go build -tags goolm ./... 通过
  • internal/runeval 测试全绿(0.7s);tui 定向编译/回归通过

交付说明

agent 验证阶段命令僵死(acp 测试进程 S 态挂起,与本包无关),commit 已安全落盘;父级核验构建+定向测试后代为完成 push+PR。

Co-Authored-By: ggcode noreply@ggcode.dev

- internal/runeval: pure, deterministic trajectory analyzer. Walks session
  messages to score tool-loop efficiency: duplicate tool calls (identical
  read-only repeats penalized, stateful writes reported only), superseded
  failed attempts, error rate, LLM overhead share (compaction/strategist/
  verify), wasted token estimate, and actionable findings.
- Wasted-call semantics: a call key's LAST result is the informative one;
  earlier superseded attempts count as wasted when they failed or returned
  byte-identical read-only output. A successful retry of a failed call is
  penalized once (the failed attempt), not twice.
- TUI: /runreport slash command evaluates the live session offline (no LLM
  calls) and prints the scorecard; wired into busy-safe commands, Tab
  completion, and en/zh i18n descriptions.
- docs: document /runreport in docs/guide/slash-commands.md.

Co-Authored-By: ggcode <noreply@ggcode.dev>
@topcheer
topcheer merged commit fff4b84 into main Sep 18, 2026
9 checks passed
topcheer pushed a commit that referenced this pull request Sep 19, 2026
3 PRs this cycle: #2533 memory recall-time conflict arbitration,
#2535 runeval offline scorecard (/runreport), #2542 startup freeze
3-layer + usage probe trigger/URL-matching/key-resolution/render
chain (fetch Cmd-as-Msg drop fix). verify-ci passed (GOFLAGS=-p=1).

Co-Authored-By: ggcode <noreply@ggcode.dev>
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.

1 participant