Skip to content

feat: support scoped benchmark repo roots - #517

Merged
mohanagy merged 4 commits into
nextfrom
issue-514-scoped-benchmark-roots
Jun 7, 2026
Merged

mohanagy merged 4 commits into
nextfrom
issue-514-scoped-benchmark-roots

Conversation

@mohanagy

@mohanagy mohanagy commented Jun 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add safe relative graphRoot support for benchmark suite repo rows
  • generate graphs, install Madar, warm up, and run measured compare from scoped roots for configured monorepo rows
  • reset unsafe repo-local agent config at both the copied parent workspace and scoped graph root
  • configure scoped roots for Documenso, Novu, and Twenty and document the reproducible rerun behavior

Verification

  • npm run typecheck
  • npm run build
  • CI=1 npm run test:run

Benchmarks

  • Isolated public rerun dry-run confirmed the scoped rows are wired.
  • Live isolated reruns could not produce claimable receipts in this local environment because the isolated Claude config is not authenticated (Claude returned Not logged in · Please run /login). Invalid not-measured receipt folders were removed and are not included in this PR.

Summary by CodeRabbit

  • New Features

    • Per-repo scoped graph roots now supported; three benchmarks configured with scoped paths.
    • Isolation launcher seeds a persistent runtime profile and enforces isolated authentication before suite runs.
  • Documentation

    • Clarified scoped-root execution, reproducibility rules, repo pinning, skip-vs-measured semantics, and updated claims/evidence statuses (some receipts remain supplemental; Twenty noted as a pre-runner-scoped compare receipt).
  • Tests

    • Added/updated tests covering scoped repos and isolation auth behavior.

Add safe relative graphRoot support to benchmark suite repos so large public monorepo rows can generate, install, warm up, and compare from scoped graph roots instead of oversized repo roots.

Also reset unsafe repo-local agent config at both the copied parent workspace and scoped root to preserve benchmark isolation for scoped runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e1e377ef-4472-4fc1-a71b-acd23cd7538c

📥 Commits

Reviewing files that changed from the base of the PR and between d65f0e4 and b6c9af6.

📒 Files selected for processing (1)
  • tests/unit/benchmark-suite-isolation-docs.test.ts

📝 Walkthrough

Walkthrough

Adds optional per-repo graphRoot, validates and normalizes it, uses it to resolve scoped workspace roots during preparation and trial execution, updates repos/docs metadata, changes the isolation launcher to use a runtime profile with auth checks, and adds unit tests for both features.

Changes

Scoped Graph Root Support & Isolation runtime profile

Layer / File(s) Summary
graphRoot path validation and import updates
src/infrastructure/benchmark/suite.ts
Import isAbsolute and add normalizeBenchmarkSuiteGraphRoot to validate/normalize graphRoot as a safe relative path.
BenchmarkSuiteRepo interface and manifest loading
src/infrastructure/benchmark/suite.ts
Propagate normalized graphRoot into normalized repo objects; accept graphRoot from manifests for path and git sources.
Workspace preparation with scoped root resolution
src/infrastructure/benchmark/suite.ts
prepareBenchmarkWorkspace accepts graphRoot, resolves/verifies the graph workspace root, conditionally resets workspace config, installs and runs generation from that root.
Integration into repo preparation and trial execution
src/infrastructure/benchmark/suite.ts
Pass repo.graphRoot into legacy and SPI prepare/generation paths and for per-trial cold-run graph path computation.
Configuration metadata and documentation updates
docs/benchmarks/suite/repos.json, docs/benchmarks/suite/README.md, docs/benchmarks/suite/methodology.md, docs/claims-and-evidence.md
Add graphRoot entries for documenso (packages), twenty (packages/twenty-server/src/modules), and novu (apps); document scoped-root behavior and update evidence/status text and README isolation notes.
Isolation launcher: runtime profile and auth checks
docs/benchmarks/suite/isolation/run-isolated.sh
Introduce RUNTIME_PROFILE_ROOT, seed runtime profile from checked-in template, add claude auth status helpers, require authenticated isolated profile (fail fast with explicit CLAUDE_CONFIG_DIR=... claude auth login instruction), and derive Cursor/Claude paths from the runtime profile.
Unit test coverage for scoped graph roots
tests/unit/benchmark-suite.test.ts
Add dirname import; update manifest assertions to expect graphRoot; add runBenchmarkSuite test asserting scoped workspace provisioning, generateGraph usage, compare graph paths, and execTemplate wrapping.
Unit tests for isolation launcher behavior
tests/unit/benchmark-suite-isolation-docs.test.ts
Add fs imports; extend launcher assertions; add two skipped-on-Windows tests mocking claude/node to validate auth-failure messaging, ensure node not invoked, and clean up temp artifacts.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • mohanagy/madar#334: Related updates to claims-and-evidence and benchmark suite policy framing.

Poem

A rabbit hops through monorepo lands so wide,
Scoped graphRoot snugly tucked by my side,
I seed a runtime profile in a tiny lair,
Tell Claude to log in — the command’s right there,
Benchmarks hum along — the rabbit winks, “All clear!” 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: support scoped benchmark repo roots' accurately and concisely describes the main change: adding support for scoped graphRoot values in benchmark suite repositories.
Description check ✅ Passed The PR description includes a clear summary of changes, comprehensive verification steps (typecheck, build, test:run), and notes about benchmarking attempts, though the Testing checklist section is not explicitly formatted.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-514-scoped-benchmark-roots

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

Move runtime Claude/Cursor state out of the tracked isolation fixture, fail fast when the isolated benchmark profile is not authenticated, and print the exact runtime-profile login command required for measured runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/unit/benchmark-suite-isolation-docs.test.ts`:
- Around line 123-126: The subprocess env blocks currently spread process.env
(using env: { ...process.env, PATH: `${binDir}:${process.env.PATH ?? ''}` }) and
therefore inherit HOME/XDG state; modify each of these spawn env objects to set
a temp-scoped profile root by creating a temporary directory (e.g., via
fs.mkdtempSync(os.tmpdir() + '/madar-') or similar) and adding
MADAR_BENCH_ISOLATION_PROFILE_ROOT: tempDir into the env spread so the
subprocesses use that temp path instead of the user’s
~/.local/state/madar/benchmark-isolation; ensure you create and clean up the
temp dir in the test (or let the test harness manage it) and update all three
locations that build the env (the blocks that reference binDir and
process.env.PATH).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d96a99e-4f65-4130-bee7-cc7fdf8f1519

📥 Commits

Reviewing files that changed from the base of the PR and between 28d8dbf and 47abd5b.

📒 Files selected for processing (4)
  • docs/benchmarks/suite/README.md
  • docs/benchmarks/suite/isolation/run-isolated.sh
  • docs/benchmarks/suite/methodology.md
  • tests/unit/benchmark-suite-isolation-docs.test.ts
✅ Files skipped from review due to trivial changes (1)
  • docs/benchmarks/suite/README.md

mohanagy and others added 2 commits June 8, 2026 01:18
Allow the isolation launcher tests to override the CLI path so CI can exercise the auth-preflight branches without depending on a prebuilt dist tree.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mohanagy
mohanagy merged commit 00acdb3 into next Jun 7, 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.

1 participant