Parcourir la source

docs: plan benchmark ledger identity fixes

Problem: Task 2 quality review found detected events could differ from successful batch/tool ledgers without failing the benchmark.

Risk: Identity checks must preserve stable event order across parallel execution while using logical, deduplicated tool rows.
zhenyu.hu il y a 2 semaines
Parent
commit
f2ebc9932a
2 fichiers modifiés avec 27 ajouts et 0 suppressions
  1. 26 0
      docs/plans/todo-52.5-benchmark-ledger-event-identity.md
  2. 1 0
      docs/plans/todos.md

+ 26 - 0
docs/plans/todo-52.5-benchmark-ledger-event-identity.md

@@ -0,0 +1,26 @@
+# Todo 52.5 Benchmark Ledger Event Identity Plan
+
+**Status:** in_progress
+
+## Goal
+
+Prevent independent benchmark ledgers from agreeing on counts while referring to different events, and keep failed-run attempt counts truthful.
+
+## Scope
+
+- Preserve event names from `event_batch_results` and `tool_execution` usage rows in `BenchmarkRunResult`.
+- Require detected event names, batch-result event names, and tool-metric event names to equal the case's expected ordered event list.
+- Keep normalized status checks paired with the batch event identity.
+- Report ChatAgent/fallback attempt counts from timing records; continue checking timing counts against persisted ledger counts when persistence exists.
+- For pre-ledger failures, retain timing-derived attempt counts instead of `None`/zero.
+
+## Files
+
+- Modify: `src/agent_lab/application/benchmark.py`
+- Modify: `tests/test_benchmark_runner.py`
+
+## Verification
+
+- `uv run pytest tests/test_benchmark_runner.py tests/test_benchmark_config.py -q`
+- `uv run pytest`
+- `git diff --check`

+ 1 - 0
docs/plans/todos.md

@@ -105,3 +105,4 @@
 | 52.2 | done | `docs/plans/todo-52.2-benchmark-url-transport-compatibility.md` | Validate benchmark target hostname/URL compatibility with the production HTTP transport at the config boundary. | Invalid IDNA/port/transport URLs are rejected as config errors while valid Unicode hostnames accepted by the transport remain valid. |
 | 52.3 | done | `docs/plans/todo-52.3-benchmark-case-mode-single-source.md` | Make benchmark case IDs and invocation modes single-source enums shared by config, catalog, runner, and tests. | Adding or removing an enum member cannot leave config literals, exported choices, and catalog keys silently inconsistent. |
 | 52.4 | in_progress | `docs/plans/todo-52.4-benchmark-visible-ttft-and-call-counts.md` | Measure the first non-whitespace visible content and enforce each case's expected ChatAgent/fallback call counts. | Blank deltas cannot reduce visible TTFT; extra or missing model/fallback calls produce semantic failures even when timing and ledger agree. |
+| 52.5 | in_progress | `docs/plans/todo-52.5-benchmark-ledger-event-identity.md` | Cross-check detected, batch-result, and tool-metric event identities and preserve attempted model counts on failed runs. | A successful result from the wrong event cannot pass; failed streams still report started ChatAgent/fallback attempts from timing records. |