Skip to content

Add minimality A/B benchmark harness (closes #312)#334

Merged
azalio merged 1 commit into
mainfrom
claude/compassionate-cerf-5tugql
Jul 5, 2026
Merged

Add minimality A/B benchmark harness (closes #312)#334
azalio merged 1 commit into
mainfrom
claude/compassionate-cerf-5tugql

Conversation

@azalio

@azalio azalio commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds src/mapify_cli/minimality_eval.py — a deterministic A/B benchmark harness that proves MAP minimality is active and isolated without live model calls or external services.
  • Adds tests/test_minimality_eval.py — 28 tests covering all acceptance criteria (VC1–VC14).

What the harness does

  1. Contamination isolation — builds the MAP_Minimality_Doctrine context block for each arm and asserts:

    • minimality: off arm → doctrine tag absent (hard FAIL on contamination)
    • minimality: lite/full/ultra arm → doctrine tag present (hard FAIL on contamination)
  2. Fixture corpus (three tasks, no external services):

    • OVER_BUILD_TRAP — stdlib/native reuse should win; treatment uses urllib.parse.quote, baseline hand-rolls encoding. Verifies treatment produces fewer LOC.
    • SAFETY_GUARD — path-traversal guard must survive in both arms (PermissionError, startswith, realpath required). Hard FAIL if any pattern is dropped.
    • IRREDUCIBLE — both arms produce a minimal pytest fixture. LOC swing warns (not fails) since no bloat exists to cut.
  3. Metrics split — report separates code-size/cost (loc, LOC delta) from correctness/safety (missing_patterns, contaminated).

  4. Report persistence — JSON written to .map/eval-runs/minimality/<iso_timestamp>.json.

Usage

python -m mapify_cli.minimality_eval           # off vs lite
python -m mapify_cli.minimality_eval --full    # off vs lite vs full
python -m mapify_cli.minimality_eval --show    # also print JSON to stdout
python -m mapify_cli.minimality_eval --out DIR # custom output directory

Test plan

  • uv run pytest tests/test_minimality_eval.py -v — 28 passed
  • uv run ruff check src/mapify_cli/minimality_eval.py tests/test_minimality_eval.py — all checks passed
  • uv run python -m pyright src/mapify_cli/minimality_eval.py tests/test_minimality_eval.py — 0 errors
  • uv run make check — 3370 passed, 4 skipped

Closes #312


Generated by Claude Code

Implements a deterministic, no-network eval harness that proves MAP
minimality is active and isolated without live model calls:

- build_doctrine_block() mirrors _minimality_doctrine_block() from
  map_step_runner so each arm's context can be verified independently.
- Three fixture tasks: OVER_BUILD_TRAP (stdlib reuse), SAFETY_GUARD
  (path-traversal invariant must survive), IRREDUCIBLE (convergence
  expected; warns not fails on LOC swing).
- Contamination check: off arm context must lack <MAP_Minimality_Doctrine>;
  lite/full/ultra arms must have it — hard FAIL on mismatch.
- Safety check: required_patterns must appear in both arm outputs — hard
  FAIL when a pattern is dropped.
- LOC delta: warns (not fails) when treatment adds lines vs baseline.
- Report persisted as JSON to .map/eval-runs/minimality/<timestamp>.json.
- 28 tests (VC1–VC14); ruff + pyright clean; make check green (3370 tests).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HZ3wHDow49xBGUwWFPH2mD
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@azalio, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0a02195f-c335-4727-8484-5ef7ae82d15d

📥 Commits

Reviewing files that changed from the base of the PR and between 5bf92dc and 96c3233.

📒 Files selected for processing (2)
  • src/mapify_cli/minimality_eval.py
  • tests/test_minimality_eval.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/compassionate-cerf-5tugql

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@azalio azalio merged commit f13a5f7 into main Jul 5, 2026
7 checks passed
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.

[Ponytail] Add agentic benchmark proving MAP minimality is active and safe

2 participants