Просмотр исходного кода

docs: plan benchmark visible ttft call count fixes

Problem: Task 2 review found whitespace could fake visible TTFT and extra model/fallback calls could pass semantic evaluation.

Risk: Expected call counts must remain explicit per case as result policies evolve.
zhenyu.hu 2 недель назад
Родитель
Сommit
58ede87cb6

+ 26 - 0
docs/plans/todo-52.4-benchmark-visible-ttft-and-call-counts.md

@@ -0,0 +1,26 @@
+# Todo 52.4 Benchmark Visible TTFT and Call Counts Plan
+
+**Status:** in_progress
+
+## Goal
+
+Prevent benchmark runs from passing with hidden extra model cost or an artificially early visible-response timestamp.
+
+## Scope
+
+- Record call-level and run-level visible TTFT only for a `message_delta` containing non-whitespace content.
+- Add expected ChatAgent call count and expected fallback count to each benchmark case expectation.
+- Compare both persisted ledger counts and timing-wrapper counts against the case expectation.
+- Keep the six current cases at zero fallback; web search expects two ChatAgent calls and all other cases expect one.
+
+## Files
+
+- Modify: `src/agent_lab/application/benchmark.py`
+- Modify: `tests/test_benchmark_config.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

@@ -104,3 +104,4 @@
 | 52.1 | done | `docs/plans/todo-52.1-benchmark-url-control-characters.md` | Reject non-printable/control characters in benchmark target URLs before constructing the HTTP client. | Strict config tests cover NUL, CR/LF, tabs, and other Unicode/control characters while valid HTTP(S) URLs remain accepted. |
 | 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. |