Skip to content

fix(dashboard): make the benchmark study example payload producible - #9583

Open
Duang777 wants to merge 1 commit into
loopx-project:mainfrom
Duang777:codex/benchmark-study-example-consistency-20261129
Open

Duang777 wants to merge 1 commit into
loopx-project:mainfrom
Duang777:codex/benchmark-study-example-consistency-20261129

Conversation

@Duang777

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • Outcome basis / optional anchor: [Task][RFC]: Qualify the integrated benchmark study upload and dashboard contract #5203 (RFC docs/architecture/rfcs/benchmark-study-upload-dashboard-v0.md), the default-payload defect @karenchuu recorded on 2026-09-28.
  • Goal/source and gap: the dashboard's default study payload apps/presentation/dashboard/public/benchmark-study.example.json shows values the projection cannot produce: a terminal_qualified runtime classification (not a BenchmarkRuntimeClassification member), factorial_contrast_count: 1 with an empty factorial_contrasts list, and in_flight_run_count: 2 with no running run (arm run totals summed to 7 against 6 rows).
  • Observable before → after: the study page's Runtime Health reads "2 public-safe runtime observations · running_qualified 2" instead of "6 … · running_qualified 2 · terminal_qualified 4"; the loopx_hint arm shows 1/2 terminal runs. A new test fails on the base file and passes on the head file.
  • Issue/task and intended base: Related to [Task][RFC]: Qualify the integrated benchmark study upload and dashboard contract #5203 (one defect slice; the issue tracks the wider RFC). Base main at 811c1a1f6.

Author Declaration

  • Written by: model_agent (Claude Opus, Anthropic), operated by @Duang777

Implemented against

  • Specification and revision: docs/architecture/rfcs/benchmark-study-upload-dashboard-v0.md §7 at 811c1a1f6, plus the reducer definitions in loopx/capabilities/benchmark_toolkit/study_projection.py.
  • Criteria:
Criterion (spec clause) Disposition Symbol / path Test or command
Classification keys are enum members; sum = runtime_observation_count implemented example JSON test_shipped_dashboard_example_satisfies_projection_invariants
factorial_contrast_count / countable count match the contrast list implemented example JSON same
in_flight_run_count = running runs; arm run_count/terminal/protocol/revision counts match runs implemented example JSON same
Denominators, coverage and matched-pair counts match the runs implemented (already consistent) example JSON same
  • Self-check before submission: values were cross-checked by rebuilding the example's manifest and rows (plus the two running rows and their running-qualified observations) through the real build_benchmark_study_dashboard; campaign, arms, contrasts and cases match the edited file. terminal_pending_reconcile was deliberately not used as the replacement key: it means a terminal result awaiting reconcile, which is false for the four already-completed runs.

Scope And Continuation

Validation

  • Tested revision: 13955dac4
  • Run state: finished
  • Input classes: public_fixture
Check kind Result Public-safe evidence / limitation
unit passed tests/capabilities/test_benchmark_study_projection.py: 28 passed; the new test fails on the base JSON (terminal_qualified extra key).
integration passed npm run smoke:benchmark-study and npm run smoke:benchmark-study-browser in the dashboard app.
static passed npx tsc --noEmit in the dashboard app.
static passed loopx canary premerge --from-git-diff --git-diff-base origin/main: 9/9, 0 failures.
manual passed Headless Playwright screenshots of /benchmarks/study at 1440px against a local Vite server, below.

Frontend / Visual Evidence

  • UI impact: changed
  • Before: before
  • After: after
  • First viewport and preview: full-page captures at 13955dac4 (local Vite dev server, default example payload): before · after. Only the Runtime Health section and the loopx_hint arm counts differ.
  • States and viewports shown: default populated state, desktop 1440px. Layout is unchanged, so mobile was not captured.
  • Source data: public_fixture
  • Attention review: no presentation change; only the fixture's numbers change, removing an impossible classification chip.
  • Craft review: N/A (no component or style change).

Type of Change

  • Bug fix
  • Test update

LoopX Area

  • Public docs or presentation surface (README, protocols, dashboard)

Shared-authority RFC fixture impact

N/A

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths.
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • No paired RFC changed.
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

🤖 Generated with Claude Code

The default benchmark study payload carried values the projection cannot
emit: a runtime classification outside BenchmarkRuntimeClassification, a
factorial contrast count with an empty contrast list, an in-flight count
and arm run totals with no matching running runs, and observation counts
for terminal runs that are never pending reconcile.

Make the payload self-consistent (cross-checked against a throwaway
projection run over the same rows) and pin the invariants with a test that
reads the shipped file.

Related to loopx-project#5203

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: duang777 <duangjl007@gmail.com>

@loopx-agent loopx-agent 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.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

打开 Benchmark Study 默认示例并在 Campaign、Arms、Cases 和 Runs 间核对的读者。 默认示例的手写 campaign 汇总和可见运行记录曾相互矛盾。 隔离上传 8 条合成运行、2 条 runtime observations 和 1 条公开洞察后,实际 CLI 的 campaign、matched contrasts、空 factorial 和两条 running 标识相同。桌面首屏实见 6/8、1/2、3、2。 两个文件 +71/-6。改变默认合成示例及其 invariant 测试。显式外部 dashboardUrl 仍走同一个既有解析器。 验证限于合成公开示例、隔离本地存储及 1200×888 本地 Dashboard。未执行实际 benchmark 或远端 CI。 这组跨视图矛盾在基线已存在,且候选新增测试也通过。候选修好了新增测试覆盖的计数条件,完整可生成性仍未达成。

改动思路 / Approach

使用有效的运行分类、补出两条 running 记录、同步 arm 行数,并移去无证据的 factorial contrast。 CLI 的 study dashboard 投影是展示字段的所有者。Web 页面读取并渲染同一个只读 packet。 两个文件 +71/-6。改变默认合成示例及其 invariant 测试。显式外部 dashboardUrl 仍走同一个既有解析器。

具体改动 / Changes

精确提交 13955dac4fd4690a7b043394f95ef8d585884153,基线 811c1a1f66652d3fc3b9830d467e14b45b7423c1。两个文件 +71/-6。改变默认合成示例及其 invariant 测试。显式外部 dashboardUrl 仍走同一个既有解析器。

  • STUDY-RUNTIME。隔离上传 8 条合成运行、2 条 runtime observations 和 1 条公开洞察后,实际 CLI 的 campaign、matched contrasts、空 factorial 和两条 running 标识相同。桌面首屏实见 6/8、1/2、3、2。 验收契约
  • STUDY-PROJECTION。默认示例 case-api-contract 的 goal_plain 单元选择 run-goal-api,却只有 duration_ms 且 insight=null。同一 packet 的 runs 有 42 steps、120000 tokens 和已脱敏洞察。实际 CLI 从这条 run 生成的 case 单元完整保留两个成本字段和洞察,arm 也计入 42 steps。无输入能让现有 reducer 对同一个选中 run 同时输出示例的这两份结果。 验收契约

关键代码讲解

对主干的风险 / Risks

[P2] 默认示例丢失同一选中 run 的成本和洞察。 默认示例 case-api-contract 的 goal_plain 单元选择 run-goal-api,却只有 duration_ms 且 insight=null。同一 packet 的 runs 有 42 steps、120000 tokens 和已脱敏洞察。实际 CLI 从这条 run 生成的 case 单元完整保留两个成本字段和洞察,arm 也计入 42 steps。无输入能让现有 reducer 对同一个选中 run 同时输出示例的这两份结果。 用现有 study-dashboard CLI 从固定公开输入生成示例,或在新增测试中比较同一选中 run 的 case、arm 和 run 消费值。 示例 case 单元 同一 run CLI 投影

Python 投影套件 28 项通过,Dashboard TypeScript contract smoke 和定向预合并 9 项通过。隔离 JSONL 的原生 CLI 读回重现差异。 这组跨视图矛盾在基线已存在,且候选新增测试也通过。候选修好了新增测试覆盖的计数条件,完整可生成性仍未达成。 验证限于合成公开示例、隔离本地存储及 1200×888 本地 Dashboard。未执行实际 benchmark 或远端 CI。

我的整体评价 / Verdict

REQUEST_CHANGES。 请求修改。计数已修复,默认示例的跨视图投影仍存在矛盾。 用现有 study-dashboard CLI 从固定公开输入生成示例,或在新增测试中比较同一选中 run 的 case、arm 和 run 消费值。 浏览器独立核对 1200×888 首屏,Campaign 显示 6/8 个可计分单元、1/2 个完整案例、3 个配对、2 个运行中任务。 验证限于合成公开示例、隔离本地存储及 1200×888 本地 Dashboard。未执行实际 benchmark 或远端 CI。

English verdict: REQUEST_CHANGES at 13955da. The campaign totals now match the native CLI output. The shipped default packet still disagrees with that reducer across views for run-goal-api: the selected case drops the same run’s effort and redacted insight. Regenerate the example or test cross-view parity.

This branch has not been deployed

No deployments
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