Skip to content

fix(benchmark): keep an arm's recall when a record is read back - #1740

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
Walternater:feat/benchmark-record-recall
Nov 6, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
Walternater:feat/benchmark-record-recall

Conversation

@Walternater

Copy link
Copy Markdown
Collaborator

Problem

#1728 gave a benchmark arm recall: true, and the run wrote it into the record: arms on the record are the plan's arms, and a planned arm carries recall. But BenchmarkRecordSchema.arms has no recall, and a record is read back through that schema — dashboard/benchmarks.ts, dashboard/workflow-runs.ts. Zod strips what the schema does not name, so every reader saw an arm that never had recall, while the file on disk said it did.

That matters for #1564: its first acceptance item is "Both arms run with recall enabled, and the run record shows it". A run that measured recall and one that did not were indistinguishable through every reader, including the dashboard that compares runs.

Change

  • BenchmarkRecordSchema.arms gains recall, so a written record reads back as written.
  • ArmResults carries it, and the results gain a Recall column (on/off) once any arm runs with it — the same shape the Role column has, and absent for suites that never set it.
  • The guides (English and Chinese) say the record keeps it and show the column.

BenchmarkRecord's arms are plan.arms, so the write path needed no change; only the read side did.

Tests

New, in benchmark-table.test.ts:

  • the Recall column names each arm on/off, and an arm without it reads off;
  • no Recall column when no arm runs with recall;
  • a record written with recall parses back equal to what was written.

Each was checked to fail without the change it covers:

Case Without the fix
record read back - "recall": true — the field is stripped
Recall column `expected '

Real CLI (npm run test:e2e -- src/__tests__/e2e/benchmark-recall.test.ts, npm run build first), extending the recall e2e #1728 added:

Test Files  1 passed (1)
     Tests  1 passed (1)
  Duration  17.82s

It now also asserts the written record's arms are [{ name: 'with-recall', recall: true }, { name: 'baseline', recall: undefined }], and that the report the run prints carries | Arm | Tool | Model (source) | Recall | Planned | with with-recall … on and baseline … off.

Unit tests: benchmark-table, benchmark-history, benchmark-suite, dashboard-benchmarks-view — 178 passed. npm run lint, node scripts/check-docs.mjs and tsc --noEmit pass.

The full suite has 26 failures in 8 files (gitlab-*, git-discovery, workflow-pr-providers, dry-run-load-path, env-exec, workflow-commands); none of them reads a benchmark record.

Limitations

  • The dashboard's Recall column appears only where the arms table already is; the compare-by chart does not group arms by recall. Recall is a measurement's control in the suites that use it (docs/guide/benchmarks.md), so two arms that differ only in recall cannot appear in one suite — ARM_DIMENSIONS stays as it is.
  • Records written before this change carry recall in the file but no reader can see it; they were written by feat(benchmark): give an arm a clone that deploys the team's recall #1728, which merged an hour ago.

Fixes the first acceptance item of #1564; the rest (the run record reporting each arm's recall index commit) is untouched.

`Tencent#1728` gave an arm `recall: true` and the run wrote it onto the record's arms,
which are the plan's arms. `BenchmarkRecordSchema.arms` had no `recall`, and a
record is read back through that schema, so zod dropped it: the file on disk
said an arm ran with recall and every reader saw an arm that never had.

The results gain a Recall column (`on`/`off`) once any arm runs with it, the
shape the Role column already has, and the guides say the record keeps it.

Tencent#1564 asks the run record to show recall was on; this is that field.

Co-Authored-By: Claude Code <[email protected]>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

No findings in the specified PR diff.

The PR description satisfies the testing requirement: it records a build followed by a passing representative real-CLI E2E run, plus unit tests and lint/type checks.

Review was read-only; I did not run, build, or install anything from the PR.

@SaulMoro SaulMoro 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.

This was generated by AI during triage.

@Walternater @jeff-r2026 This reviews da434312. BenchmarkRecordSchema.arms now keeps recall (src/benchmark/result.ts:74). A record written by the CLI already has that field on main; only this head still has it after the schema and the dashboard read. The dashboard then shows Recall as on or off. @jeff-r2026 your call on this one: the record schema readers already parse gains a field.

No new flag, default, or exit code. A boolean or a missing recall still parses. A non-boolean value such as "yes" now fails the whole record, where main stripped it and kept the record. The CLI only writes a boolean or omits the key.

What we ran: benchmark run on this head, on the merge-base 603a0aa, and on main df06b5a0. All three write recall: true and exit 0. Parsed with this head's schema, with-recall.recall stays true and the dashboard table includes Recall. Parsed with main's schema, the field is gone and the table has no Recall column.

The CI review (#1740 (comment)) reports no findings and accepts the built-CLI e2e. We agree there is no defect in the diff. That e2e reads benchmark.json as JSON, which already contains recall on main. The strip shows up only after the schema read, which is the run above. CI run 42038692511 is green at this head.

[P3 nit] The new Recall header has no Chinese dashboard string, so a Chinese dashboard shows the English word. The cells stay on and off.

#1564 still owes the measurement runs, the per-arm recall index, and the table on #1552. This change is only the "the run record shows it" half. #1728 remains the write half.

@SaulMoro
SaulMoro requested a review from jeff-r2026 November 5, 2026 17:49

@jeff-r2026 jeff-r2026 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.

Approved: verified on latest main 65b31b9 (tsc, build, 893 related unit tests, benchmark-recall E2E all pass). SaulMoro leaves the record-schema field decision to jeff-r2026; accepted as low risk (CLI only writes a boolean or omits recall).

@jeff-r2026
jeff-r2026 merged commit f327f04 into Tencent:main Nov 6, 2026
18 checks passed
Walternater added a commit to Walternater/teamai-cli that referenced this pull request Nov 6, 2026
Tencent#1740 added the column; SaulMoro's review left it as a [P3 nit]: the header
has no dashboardMessages entry, so a Chinese dashboard shows "Recall" in
English where the other columns of that table are translated.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
SaulMoro pushed a commit that referenced this pull request Nov 6, 2026
#1740 added the column; SaulMoro's review left it as a [P3 nit]: the header
has no dashboardMessages entry, so a Chinese dashboard shows "Recall" in
English where the other columns of that table are translated.

Co-authored-by: Claude Sonnet 5 <[email protected]>
Walternater added a commit to Walternater/teamai-cli that referenced this pull request Nov 6, 2026
…sue in its test

SaulMoro's review of Tencent#1759 asked for both: the Bug Fixes line recent fixes
carry, and the test comment cited Tencent#1740, an unrelated benchmark PR.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.

3 participants