Add minimality A/B benchmark harness (closes #312)#334
Conversation
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
|
Warning Review limit reached
Next review available in: 11 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
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.tests/test_minimality_eval.py— 28 tests covering all acceptance criteria (VC1–VC14).What the harness does
Contamination isolation — builds the
MAP_Minimality_Doctrinecontext block for each arm and asserts:minimality: offarm → doctrine tag absent (hard FAIL on contamination)minimality: lite/full/ultraarm → doctrine tag present (hard FAIL on contamination)Fixture corpus (three tasks, no external services):
OVER_BUILD_TRAP— stdlib/native reuse should win; treatment usesurllib.parse.quote, baseline hand-rolls encoding. Verifies treatment produces fewer LOC.SAFETY_GUARD— path-traversal guard must survive in both arms (PermissionError,startswith,realpathrequired). 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.Metrics split — report separates code-size/cost (
loc, LOC delta) from correctness/safety (missing_patterns,contaminated).Report persistence — JSON written to
.map/eval-runs/minimality/<iso_timestamp>.json.Usage
Test plan
uv run pytest tests/test_minimality_eval.py -v— 28 passeduv run ruff check src/mapify_cli/minimality_eval.py tests/test_minimality_eval.py— all checks passeduv run python -m pyright src/mapify_cli/minimality_eval.py tests/test_minimality_eval.py— 0 errorsuv run make check— 3370 passed, 4 skippedCloses #312
Generated by Claude Code