loopx icon indicating copy to clipboard operation
loopx copied to clipboard

[Task][RFC]: Qualify the integrated benchmark study upload and dashboard contract

Open huangruiteng opened this issue 2 months ago • 3 comments

Outcome / 目标

验收 benchmark study 上传、回读与看板完整链路。One task tracks this RFC's delivery; keep implementation PRs and milestone evidence here instead of creating a parallel task tree.

Canonical design: RFC. Roadmap: S11/S12, under #4574. Design acceptance is distinct from implementation, live qualification and promotion.

Current boundary

Source audit: main at ce3862e33 (2026-09-28). This is source/PR inspection, not a new test or live-qualification claim.

The contract/reducers, local upload CLI and read-only dashboard already exist; #3878 binds case insights to terminal runs. Treat this as integrated acceptance and current-checkpoint reconciliation, not a new dashboard or uploader.

Work remaining

  • Map RFC acceptance to the shipped CLI → local upload/readback → derived campaign/arm/case/run views and close any evidenced integration gaps.
  • Reconcile the RFC delivery checkpoint with that evidence. If every v0 criterion is already satisfied, close with evidence rather than inventing features.

Ownership and ongoing work

Reuse #3243 and existing benchmark-toolkit owners. PR #4439 is a separate evaluation program, not work to duplicate here. External sink transport requires its own existing authorization and lifecycle.

Contribution route: available for a bounded proposal/PR within this RFC. Name the intended milestone and exact files in a claim comment so simultaneous contributors do not duplicate work.

Acceptance

  • [ ] Simple and factorized synthetic studies round-trip without losing countability, metric, effort, fidelity or provenance; denominators and provisional status remain visible.
  • [ ] Replay/supersession, duplicate manifests, invalid identity, unknown record kind and forbidden evidence fail or reconcile according to the existing contract.
  • [ ] Exercise the installed/source CLI and actual dashboard; no new scoring, real benchmark jobs, remote upload or leaderboard submission.
  • [ ] Reconcile the RFC's current delivery checkpoint and this issue with the integrated revision, commands, passed/failed/untested evidence and remaining gates. Close the accepted scope only; no claim that a merged PR alone completes the RFC.

Starting points and delivery boundary

Base: latest main. Reuse the existing typed owner and provider boundaries. Include affected CLI/frontend/Lark companions; verify real entrypoints and backend where changed. Preserve existing first-screen review and maintainer merge gates. Public artifacts contain only synthetic/public-safe evidence, no private operational state. This task does not authorize provider promotion, benchmark launches, release/deployment or unrelated protected effects.

huangruiteng avatar Sep 27 '26 17:09 huangruiteng

Claiming the criterion-4 slice of §7 (the PR 2: Read-only dashboard row in §6) on this task.

Measured on main at 6643f3670, source/PR inspection only — no new test run yet:

  • apps/presentation/dashboard/public/benchmark-study.example.json:32 shows "runtime_classification_counts": { "running_qualified": 2, "terminal_qualified": 4 }, but terminal_qualified is not a member of BenchmarkRuntimeClassification (loopx/capabilities/benchmark_toolkit/runtime_observation.py:26-36), and the projection builds those keys directly from observed classifications (loopx/capabilities/benchmark_toolkit/study_projection.py:1304-1311).
  • The same fixture claims "factorial_contrast_count": 1 at :29-30 while "factorial_contrasts": [] at :88, although the reducer defines that count as len(board["factorial_contrasts"]) (study_projection.py:1341).
  • grep over tests/ and examples/ finds no case that uploads record_kind="runtime_observation" through build_benchmark_upload_envelope, so one of the five kinds in study_projection.py:47-53 never reaches the projection the page renders from (apps/presentation/dashboard/src/views/benchmark-study-page.tsx:154-156, default source ${BASE_URL}benchmark-study.example.json at :293).

What I intend to change, exact files:

  1. tests/capabilities/test_benchmark_study_projection.py — one new case that uploads a manifest, a board row, a case insight, a runtime observation and a behavior finding through the existing envelope/simulate path, then asserts the campaign block's classification keys are real BenchmarkRuntimeClassification values and that factorial_contrast_count == len(factorial_contrasts).
  2. apps/presentation/dashboard/public/benchmark-study.example.json — regenerate from that reducer output so every number the default dashboard shows is derivable, plus the matching apps/presentation/dashboard/smoke/benchmark-study-contract-smoke.ts expectation and the loopx/web/chat/bundle-manifest.json digest if the smoke requires it.

No schema change, no scoring decision, no transport. One open question I will raise instead of deciding for you: if the current fixture values are intentional illustrative data rather than a defect, say so and I will stop before replacing them; my default is to make the shipped default payload consistent with what the reducer can emit.

karenchuu avatar Sep 28 '26 11:09 karenchuu

Acceptance mapping done against 6643f3670, and one slice delivered: PR #5255 (test(benchmark): pin the runtime-observation path into the study campaign block).

Per §7, item by item — what I could point at in the shipped tree:

§7 item Evidence on main today
one manifest for simple and factorized studies study_projection.py:194-262 types arms as factor assignments; test_benchmark_study_projection.py:305-310 normalizes 2-arm, 4-arm and 5-arm designs
board rows round-trip without losing meaning test_benchmark_study_projection.py:326-335 asserts envelope output equals the row exactly
reducers expose campaign/arm/case/run with denominators, no new scoring study_projection.py:1329-1360, authority block :1361-1371; tests at :639, :870-883
dashboard renders native partial/binary/guardrail/effort/runtime-health, no benchmark-specific core fields page renders roles at benchmark-study-page.tsx:107-109, :145-158, :177-186; no benchmark names inside the reducer. Coverage was missing for the runtime-health half, and the default payload has the defect below
invalid identity / unknown record kind / silent terminal rewrite / forbidden evidence fail closed study_projection.py:502-506, :579-583, :694-709; :497-498 with :478; :737-748 via preview_benchmark_experiment_board_upsert and experiment_board.py:24-30; :424 with :66-70, :382-402 — tests at :338-356, :395-437, :460-501, :504-515, :518-587
external transport optional, provider-owned, separately authorized study_projection.py:770-776 (execute: bool = False) and the receipt marks external_write_performed: false; benchmark_study.py:108-116 needs explicit --store and --execute; no network client in the toolkit

Two things came out of the mapping. I deliberately did not decide the second one:

  1. Delivered in #5255. No case on main uploaded record_kind="runtime_observation", although study_projection.py:47-53 accepts it and :1304-1311 derives the campaign's runtime-health counts from it. The new case uploads three observations through the same envelope builder the CLI uses and pins the derived counts. Three mutations of the product — dropping that record kind, hardcoding a contrast count, dropping the classification aggregation — all leave the existing 20 cases green and all fail the new one.

  2. Yours to call. apps/presentation/dashboard/public/benchmark-study.example.json, which is the dashboard's default payload, carries two values this reducer cannot produce:

    • :32 lists "terminal_qualified": 4, and terminal_qualified is not a member of BenchmarkRuntimeClassification (runtime_observation.py:30-36);
    • :29 claims factorial_contrast_count: 1 while :88 is "factorial_contrasts": [], although the count is defined as len(board["factorial_contrasts"]) (study_projection.py:1341).

    Repairing it changes user-visible numbers on the study page and needs a re-hashed entry in loopx/web/chat/bundle-manifest.json, and GH-C101 keeps the dashboard surface with you, so I am asking instead of submitting: are those intentional illustrative values, or should I send the regenerated payload as a follow-up?

One note for the fourth checkbox: the RFC has no delivery-checkpoint section to reconcile — its status line is a bare Accepted, and there is no docs/architecture/rfcs/ledger/benchmark-study-upload-dashboard-v0/ directory — so the table above answers it directly rather than through a doc edit.

karenchuu avatar Sep 28 '26 11:09 karenchuu

Picking up the two default-payload inconsistencies @karenchuu flagged above, which are still present on main at 811c1a1f6:

  • apps/presentation/dashboard/public/benchmark-study.example.json:32: runtime_classification_counts has terminal_qualified, which is not a BenchmarkRuntimeClassification member.
  • :29 says factorial_contrast_count: 1, but :88 is "factorial_contrasts": [], and the reducer defines that count as the list's length.

Plan, one small PR:

  1. Make the example payload one the projection can actually produce: a real classification key, and contrast counts that match the factorial_contrasts list.
  2. Add a check (dashboard smoke or a Python test over the example file) that enforces the projection's invariants on the shipped example: classification keys are enum members, and factorial_contrast_count == len(factorial_contrasts). That keeps the example from drifting again.
  3. Attach before/after screenshots of the study page.

If the current values are meant to be illustrative, please say so and I'll drop this.

Duang777 avatar Nov 29 '26 08:11 Duang777