Skip to content

Add structural-discovery ROI comparison to research-eval (closes #311)#335

Merged
azalio merged 2 commits into
mainfrom
claude/compassionate-cerf-5tugql
Jul 5, 2026
Merged

Add structural-discovery ROI comparison to research-eval (closes #311)#335
azalio merged 2 commits into
mainfrom
claude/compassionate-cerf-5tugql

Conversation

@azalio

@azalio azalio commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements research_eval_compare module: side-by-side A/B comparison of two ResearchEvidence runs (baseline vs treatment), scoring quality (precision/recall/F1) and exploration-cost (location_count, stale_count, overbroad_count, avg_span) metrics independently. Token/LOC reduction cannot mask lower localization quality.
  • Adds mapify research-eval compare CLI command with quality floor, stale-regression, and overbroad-warning flags.
  • 20 fixture-only tests (VC1–VC11), no live model calls.

Files changed

  • src/mapify_cli/research_eval_compare.py — new module: DiscoveryMetrics, ArmScore, CompareReport dataclasses; compare_research_runs() / compare_research_files() public API; default_compare_path(); fixture constants.
  • tests/test_research_eval_compare.py — 20 tests covering hard failures (QUALITY_FLOOR, STALE_REGRESSION), advisory warnings (QUALITY_REGRESSION, OVERBROAD_INCREASE), delta keys, JSON serialization, CLI flags.
  • src/mapify_cli/__init__.py — added mapify research-eval compare Typer command.

Hard failure criteria

  • QUALITY_FLOOR: treatment file-level or line-level F1 below configurable floor → exit 1
  • STALE_REGRESSION: treatment introduces more missing-file paths than baseline → exit 1

Advisory warnings

  • QUALITY_REGRESSION: treatment F1 drops vs baseline (even above floor)
  • OVERBROAD_INCREASE: treatment has more over-broad locations than baseline

Test plan

  • uv run pytest tests/test_research_eval_compare.py -v → 20 passed
  • uv run python -m pyright src/mapify_cli/research_eval_compare.py tests/test_research_eval_compare.py src/mapify_cli/__init__.py → 0 errors
  • make check → 3390 passed, 4 skipped

Closes #311


Generated by Claude Code

claude added 2 commits July 5, 2026 07:12
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
Implements `research_eval_compare` module with side-by-side A/B comparison
of two ResearchEvidence runs (baseline vs treatment), scoring quality metrics
(precision/recall/F1) and exploration-cost metrics (location_count, stale_count,
overbroad_count, avg_span) independently so token/LOC reductions cannot mask
lower localization quality.

- `src/mapify_cli/research_eval_compare.py`: DiscoveryMetrics, ArmScore,
  CompareReport dataclasses; compare_research_runs() / compare_research_files()
  public API; default_compare_path(); FIXTURE_* constants for tests.
  Hard failures: QUALITY_FLOOR (treatment F1 below floor), STALE_REGRESSION
  (new missing-file paths vs baseline). Advisory warnings: QUALITY_REGRESSION,
  OVERBROAD_INCREASE.
- `tests/test_research_eval_compare.py`: 20 fixture-only tests (VC1-VC11),
  no live model calls.
- `src/mapify_cli/__init__.py`: `mapify research-eval compare` CLI command
  with --min-file-f1, --min-line-f1, --max-stale-regression, --out flags;
  exits 0=pass, 1=hard failure, 2=input error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HZ3wHDow49xBGUwWFPH2mD
@azalio azalio merged commit d6091d5 into main Jul 5, 2026
1 check passed
@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: 2 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: 132ba701-1f7e-4187-a7ed-89f6246ce639

📥 Commits

Reviewing files that changed from the base of the PR and between f13a5f7 and b7aec2c.

📒 Files selected for processing (5)
  • src/mapify_cli/__init__.py
  • src/mapify_cli/minimality_eval.py
  • src/mapify_cli/research_eval_compare.py
  • tests/test_minimality_eval.py
  • tests/test_research_eval_compare.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.

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.

[CodeGraph] Add structural-discovery ROI eval for MAP research

2 participants