Skip to content

[v0.5.0] benchmark runner — add reproducible CLI and artifact layout #72

Closed

Description

@ayhammouda

Context

Parent: #63. Methodology: docs/benchmarks/PUBLIC-BENCHMARK-METHODOLOGY.md.

This is an agent-ready plumbing issue. The runner should make the benchmark reproducible from the shell without deciding the corpus or claiming results.

Goal

Add a reproducible benchmark runner CLI that loads a corpus and competitor manifest, executes configured benchmark cells, and writes raw artifacts in a stable layout.

Acceptance criteria

  • A tool failure, timeout, or MCP protocol crash on an individual query is explicitly recorded as an error and scored as 0.0 for correctness; the denominator remains exactly 50 for every eligible tool/model cell.
  • A benchmark CLI exists, for example uv run python -m benchmarks run --corpus docs/benchmarks/corpus.yml --manifest docs/benchmarks/competitors.yml --out docs/benchmarks/results/<run-id>/.
  • The CLI writes raw artifacts: transcripts, token records, latency records, scoring placeholders, competitor manifest snapshot, environment metadata, repo commit SHA, and run summary.
  • The runner supports a dry-run mode that validates corpus/manifest and emits planned benchmark cells without calling external providers.
  • The runner can execute at least the no-MCP baseline adapter through a fake/mock provider in tests.
  • Tests cover artifact paths, metadata capture, dry-run behavior, duplicate/missing corpus IDs, and failure recording for a competitor cell.
  • No README benchmark claims are added.

Scope boundaries

In scope:

  • Benchmark runner package/module.
  • CLI argument parsing.
  • Artifact schema/layout.
  • Dry-run and fake-provider tests.

Out of scope:

  • Real OpenAI/Google API calls.
  • Competitor-specific MCP adapters beyond interfaces/stubs.
  • Correctness scoring automation.
  • README result table.

Forbidden-territory reminder

Do not modify MCP tool names, parameters, return shapes, schema.sql, .github/workflows/, pyproject.toml project metadata, .planning/POSITIONING.md, the README hero section, LICENSE, SECURITY.md, or existing tests by weakening/deleting assertions.

Validation commands

uv run ruff check src/ tests/
uv run pyright src/
uv run pytest --tb=short -q
uv run python-docs-mcp-server doctor

Run any new benchmark-runner tests directly as well.

PR template

Use Refs #63, not Closes #63.

The PR must include:

  • Summary of artifact layout.
  • Dry-run command output.
  • Test output.
  • Confirmation that no external provider calls were made.

Recovery

If a stable artifact layout requires a methodology change, stop and comment on #63 before implementing.

Effort estimate

4-6 hours.

Activity

  1. added
    enhancementNew feature or request
    agent-readyIssue passed AGENT-EXECUTION-PIPELINE.md §10 pre-flight; scoped for an autonomous agent
    on Jun 8, 2026
  2. added this to the v0.5.0 milestone on Jul 8, 2026
  3. ayhammouda commented on Jul 8, 2026

    @ayhammouda
    OwnerAuthor

    Merge-readiness pass complete for PR #75.

    • Merged current main into agent/72-benchmark-runner-cli (no rebase, no force-push — 19 commits had landed on main since this PR opened, including mcp 1.27.2 → 1.28.1). Merge was clean, no conflicts.
    • Fixed the four verified findings from the merge-readiness review (each in its own commit on the branch):
      1. Made the repo_commit metadata test environment-independent by monkeypatching the git subprocess call (fixes CodeRabbit's only open review thread, tests/benchmarks/test_runner.py:92), without relaxing the assertion.
      2. run_benchmark now refuses to write into a non-empty --out directory (BenchmarkValidationError, exit 2), preventing orphaned per-cell JSON artifacts from a prior/shrunk run from leaking into a rerun.
      3. _load_yaml_mapping now catches yaml.YAMLError and re-raises as BenchmarkValidationError, so malformed corpus/manifest YAML takes the CLI's established exit-2 validation path instead of crashing with a raw traceback.
      4. Corpus/manifest snapshots are now byte-for-byte copies of the input files instead of a yaml.safe_dump re-serialization, preserving byte-provenance for issue [v0.5.0] benchmark reporting — generate raw report and README-safe summary #74's future corpus hash check.
    • Re-ran the full validation gate against the merged branch — all green: ruff check src/ tests/, ruff check benchmarks/, pyright src/, pyright benchmarks/, pytest --tb=short -q (319 passed), pytest tests/benchmarks -q (12 passed), python-docs-mcp-server doctor (all checks passed). Full output is in the PR body.
    • Updated the PR body with a dated "Merge-readiness pass — 2026-07-08" section covering the fixes, the "why this approach" rationale for finding 2, the CodeRabbit triage, and the full gate output. The existing "Why this triggered supervisor review" section and the supervisor-review label are untouched — the diff is still well over the 500-line trigger.

    PR #75 is validation-green against current main and awaits the maintainer's merge decision. No merge was performed and none was requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyIssue passed AGENT-EXECUTION-PIPELINE.md §10 pre-flight; scoped for an autonomous agentenhancementNew feature or requestpriority:P2Medium priority

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions