Pārlūkot izejas kodu

docs: plan benchmark report auditability fixes

Problem: Task 3 review found missing model/tool latency aggregates, concurrent pair races, and runner-level failures absent from reports.

Risk: Cross-process reservations must clean stale-free lock files without deleting another writer's reports.
zhenyu.hu 2 nedēļas atpakaļ
vecāks
revīzija
8bbfa76105

+ 29 - 0
docs/plans/todo-52.6-benchmark-report-auditability.md

@@ -0,0 +1,29 @@
+# Todo 52.6 Benchmark Report Auditability Plan
+
+**Status:** in_progress
+
+## Goal
+
+Make benchmark reports complete and self-explanatory even under concurrent writers or orchestration-level failures.
+
+## Scope
+
+- Aggregate successful model-call elapsed samples and tool handler latency samples with p50/p95 and low-sample warnings.
+- Reserve each output basename using an exclusive lock/reservation file before choosing paths, so concurrent processes cannot publish mixed JSON/Markdown pairs.
+- Add redacted runner/system errors to the report model; count a catastrophic runner failure in overall attempted/failed values even when no case result exists.
+- Emit low-confidence warnings for zero as well as 1–19 successful samples.
+- Redact first, then truncate errors to at most 2048 UTF-8 bytes without producing invalid text.
+
+## Files
+
+- Modify: `src/agent_lab/infrastructure/benchmark_reporting.py`
+- Modify: `src/agent_lab/presentation/benchmark_cli.py`
+- Modify: `tests/test_benchmark_reporting.py`
+- Modify: `tests/test_benchmark_cli.py`
+
+## Verification
+
+- `uv run pytest tests/test_benchmark_reporting.py tests/test_benchmark_cli.py -q`
+- concurrent writer stress test
+- `uv run pytest`
+- `git diff --check`

+ 1 - 0
docs/plans/todos.md

@@ -106,3 +106,4 @@
 | 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 | done | `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 | done | `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. |
+| 52.6 | in_progress | `docs/plans/todo-52.6-benchmark-report-auditability.md` | Complete report latency coverage, concurrent pair reservation, runner-level error auditability, and byte-bounded errors. | Reports aggregate model/tool latency, concurrent writers cannot mix pairs, catastrophic runner errors appear in report totals/details, zero samples warn, and errors stay within 2 KiB UTF-8. |