Skip to content

benchmarks: reproducible agent-accuracy comparison benchmark (Phase 1 MVP)#207

Draft
takashi-matsuyama wants to merge 2 commits into
mainfrom
bench/phase1-mvp
Draft

benchmarks: reproducible agent-accuracy comparison benchmark (Phase 1 MVP)#207
takashi-matsuyama wants to merge 2 commits into
mainfrom
bench/phase1-mvp

Conversation

@takashi-matsuyama

Copy link
Copy Markdown
Member

What

Adds a private, never-published benchmarks/ workspace package that measures how an AI agent's accuracy on business questions changes with the database context it is given — generalizing the quickstart's single "4.8x revenue" anecdote into a reproducible, falsifiable measurement.

Design

Same model, same fixture, same prompt template, same tasks; the only independent variable is the context block:

Arm Context
A0 Raw DDL from the system catalogs (no comments, no view definitions)
A1 A0 + verbatim COMMENT text, no interpretation (implemented; runs in Phase 2)
A2 Kozou-compiled context: describe-tool outputs of a real running kozou mcp --http, driven via the MCP Streamable HTTP client
  • The agent never sees data rows; it answers with one SQL statement, which the harness executes in a READ ONLY transaction as the fixture's read-only analyst role and scores against pre-registered ground truths (numeric tasks also record observed/expected ratios, i.e. miss severity).
  • Pre-registered task set (12 tasks: source-of-truth, soft-delete, status-enum, plus two no-trap controls) in benchmarks/tasks/taskset.yaml; every ground truth is verified in CI against the live quickstart fixture.
  • Anti-rigging commitments (pre-registration, all-task reporting, no-trap controls, raw transcripts in results/, null results are results) are documented in benchmarks/README.md, along with intentionally-kept asymmetries raised in adversarial review.

Review

Adversarially reviewed (review-only, design-challenging). Applied: exact row-count check in set scoring (join fan-out), race-safe CREATE ROLE for the shared CI Postgres, container cleanup on early connect failure, failure counts in per-task summary cells. Kept by design (documented in README): tracked results/, A0 view-name visibility, A2 rowCountEstimate, effort=high (the model's API default).

Status

  • Harness + tests (23 tests, incl. ground-truth verification on Postgres 16)
  • Phase 1 measurement run (A0 vs A2, claude-sonnet-5, 5 runs/cell) — results will be committed to this branch before marking ready for review

Test plan

  • pnpm --filter @kozou/benchmarks test (CI-safe, no API calls)
  • pnpm -r typecheck, pnpm run lint, bash scripts/check-english-only.sh all pass locally

🤖 Generated with Claude Code

takashi-matsuyama and others added 2 commits July 8, 2026 22:19
…k (Phase 1 MVP)

Adds a private, never-published benchmarks/ workspace package that measures
how an AI agent's accuracy on business questions changes with the database
context it is given, generalizing the quickstart's 4.8x revenue anecdote
into a reproducible, falsifiable measurement.

- 3-arm design (arm-pluggable): A0 raw DDL from the system catalogs,
  A1 raw COMMENT pass-through (Phase 2), A2 Kozou-compiled context driven
  from a real running `kozou mcp --http` via the MCP Streamable HTTP client.
- Pre-registered task set (12 tasks: source-of-truth, soft-delete,
  status-enum, plus two no-trap controls) with ground truths verified in CI
  against the live quickstart fixture.
- The agent answers with a single SQL statement; the harness executes it in
  a READ ONLY transaction as the fixture's read-only analyst role and scores
  the result, recording observed/expected ratios (miss severity), token
  usage, and full transcripts under results/.
- Phase 1 runs A0 vs A2 on one model (claude-sonnet-5), 5 runs per cell;
  sampling parameters are unavailable on current models, so variance is
  reported across runs instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- string_set scoring now requires the exact row count, so join fan-out
  duplicates no longer score as correct (review MEDIUM)
- the analyst role creation catches duplicate_object instead of
  check-then-create, surviving concurrent fixture loads on the shared CI
  Postgres (review MEDIUM)
- the testcontainer is stopped even when the initial connect fails
  (review LOW)
- per-task summary cells print the failure count next to the mean ratio so
  failure-heavy cells cannot look benign (review LOW)
- README documents the intentionally-kept asymmetries raised by the review
  (tracked results/, A0 view names, A2 rowCountEstimate, effort default,
  scoring semantics)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant