Skip to content

feat: expand benchmark suite targets - #508

Merged
mohanagy merged 2 commits into
mainfrom
chore/github-link-and-benchmarks
Jun 7, 2026
Merged

mohanagy merged 2 commits into
mainfrom
chore/github-link-and-benchmarks

Conversation

@mohanagy

@mohanagy mohanagy commented Jun 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • fix the benchmark GitHub Pages npm links to use the canonical scoped package URL
  • add ready git-backed benchmark suite rows and repo-specific prompts for Documenso, Formbricks, Dub, Twenty, Cal.diy, and Novu
  • provision normalized benchmark workspaces so suite prep failures become skipped cells instead of aborting the whole run

Test Plan

  • npm run typecheck
  • npm run build
  • npm run test:run

Summary by CodeRabbit

  • Documentation
    • Updated public NPM links to the scoped package and expanded benchmark docs, methodology, and README to list new repo targets and clarified execution/status rules.
  • New Features
    • Added support for git-backed benchmark targets and richer repo manifest sources; suite now prepares and verifies installs per-repo before running.
  • Tests
    • Expanded and hardened tests to cover docs, suite manifests, isolation/environment capture, git-backed repos, and install/preparation behaviors.

Fix benchmark Pages npm links, add git-backed public benchmark rows, and harden suite workspace preparation for public repos.

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: a51b3faa-a987-45df-9418-88196fa37425

📥 Commits

Reviewing files that changed from the base of the PR and between e71aa80 and f3ee497.

📒 Files selected for processing (4)
  • docs/benchmarks/suite/methodology.md
  • docs/benchmarks/suite/repos.json
  • src/infrastructure/benchmark/suite.ts
  • tests/unit/benchmark-suite.test.ts
✅ Files skipped from review due to trivial changes (1)
  • docs/benchmarks/suite/methodology.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/benchmarks/suite/repos.json
  • src/infrastructure/benchmark/suite.ts

📝 Walkthrough

Walkthrough

The PR extends the benchmark suite to support git-backed repos via a structured source field, materializes per-run source roots (copy or git clone), provisions/verifies Madar installs in prepared workspaces, updates manifests/docs/tests for six new public repos, and canonicalizes benchmark HTML npm links to @lubab/madar.

Changes

Benchmark Suite Git Repos and Workspace Provisioning

Layer / File(s) Summary
npm Package Rebranding to @lubab/madar
docs/benchmarks/**/index.html, tests/unit/benchmark-docs.test.ts
All NPM package links across benchmark pages were changed from unscoped madar to scoped @lubab/madar. A new test recursively enforces scoped-link presence and absence of the unscoped URL.
Benchmark Repos and Tasks Expansion
docs/benchmarks/suite/repos.json, docs/benchmarks/suite/tasks.json, tests/unit/benchmark-suite.test.ts
Six git-backed repositories (documenso, formbricks, dub, twenty, cal-diy, novu) were added with git source metadata (url + ref). Task prompt entries (explain-runtime, implement, review, impact) were expanded to include these repos.
Isolation Environment and Benchmark Docs Updates
docs/benchmarks/suite/isolation/environment.json, docs/benchmarks/suite/README.md, docs/benchmarks/suite/methodology.md, tests/unit/benchmark-suite-docs.test.ts, tests/unit/benchmark-suite-isolation-docs.test.ts
Isolation environment now pins a Claude hash and activates a user prompt hook. Docs/methodology list the new git-backed repos, require pinned source.ref, and describe cloning/copying to temp workspaces, normalizing repo Claude/MCP config, provisioning Madar installs, and treating prep failures as skipped; tests validate docs content and capture of the prepared environment.
Repo Source Types and Validation
src/infrastructure/benchmark/suite.ts
Introduced BenchmarkSuiteRepoPathSource and BenchmarkSuiteRepoGitSource and a BenchmarkSuiteRepoSource union; BenchmarkSuiteRepo now prefers source (legacy path retained optional).
Manifest Loading and Repo Normalization
src/infrastructure/benchmark/suite.ts
loadBenchmarkSuiteRepos now validates required fields, normalizes repo.source (and legacy repo.path) into a canonical form, trims/omits empty git refs, and fills default metadata when missing.
Workspace Materialization and Madar Provisioning
src/infrastructure/benchmark/suite.ts
Added helpers to materialize sources into a per-run sourceRoot (copy for path, git clone with SHA-aware fetch when needed), reset workspace config, run claudeInstall, and verify via install inspection helpers.
Benchmark Suite Execution with Materialized Repos
src/infrastructure/benchmark/suite.ts
runBenchmarkSuite materializes each repo once into a scratch sourceRoot, prepares legacy/SPI workspaces from that root, marks per-repo preparation failures as skipped with formatted reasons, reuses materialized roots for trials, and updates skipped-cell labeling to “skipped during preparation”.
Test Helpers and Workspace Provisioning Coverage
tests/unit/benchmark-suite.test.ts
Test fixtures now support repos without verified installs, add git initialization helpers, and include tests that provision suite-managed installs, clone git-backed repos, normalize repo-local configs during provisioning, and assert per-repo skipped recording while continuing other rows.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • mohanagy/madar#343: Related changes around Madar install verification and skip-reporting in the benchmark suite.
  • mohanagy/madar#483: Related updates to benchmark suite docs/tests and adding ready-wire repo/task coverage.

Poem

🐰 I hop through repos, clone and mend,

materialize roots and then extend,
I pin the refs and make installs sing,
swap links to @lubab/madar, snug as spring,
the suite is ready — hop, provision, blend.

🚥 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 clearly summarizes the main change: expanding the benchmark suite with additional target repositories (Documenso, Formbricks, Dub, Twenty, Cal.diy, Novu).
Description check ✅ Passed The PR description covers the key changes, includes a test plan with all required checks, but lacks detailed explanations matching the template's Summary section structure.
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 chore/github-link-and-benchmarks

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

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/infrastructure/benchmark/suite.ts (1)

762-763: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Skip-count text now mislabels non-install preparation failures.

Skipped cells include clone/materialization failures, but the rendered summary still says “skipped for install,” which is misleading for triage.

📝 Suggested wording update
-    `- cells_skipped_for_install: ${summary.cells_skipped_for_install}`,
+    `- cells_skipped_for_install: ${summary.cells_skipped_for_install} (any preparation failure)`,
...
-    cellSummaryParts.push(`${skippedCount} skipped for install`)
+    cellSummaryParts.push(`${skippedCount} skipped during preparation`)

Also applies to: 1140-1142

🤖 Prompt for 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.

In `@src/infrastructure/benchmark/suite.ts` around lines 762 - 763, The summary
text mislabels skipped cells as "skipped for install" even when skips are due to
non-install preparation failures (clone/materialize); update the template
strings that reference summary.cells_skipped_for_install to use a generic,
accurate label such as "cells skipped during preparation
(install/clone/materialize): ${summary.cells_skipped_for_install}" and similarly
adjust the other occurrence that prints summary.cells_skipped_for_env_drift so
both summaries reflect preparation/installation vs env-drift distinctions;
search for uses of summary.cells_skipped_for_install and
summary.cells_skipped_for_env_drift and replace the misleading wording in those
template literals.
🧹 Nitpick comments (1)
tests/unit/benchmark-suite-isolation-docs.test.ts (1)

16-23: ⚡ Quick win

Align project_claude_md_hash test typing with the pinned environment contract.

The parsed environment type still declares project_claude_md_hash: null even though the pinned JSON now stores a SHA string. Keeping it as null weakens type-checking for this contract test.

Proposed diff
   const environment = JSON.parse(readFileSync(resolve('docs/benchmarks/suite/isolation/environment.json'), 'utf8')) as {
@@
-    project_claude_md_hash: null
+    project_claude_md_hash: string
🤖 Prompt for 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.

In `@tests/unit/benchmark-suite-isolation-docs.test.ts` around lines 16 - 23, The
test's parsed environment object currently types project_claude_md_hash as null
which no longer matches the pinned JSON (it now contains a SHA string); update
the inline type for the const environment in
tests/unit/benchmark-suite-isolation-docs.test.ts so that project_claude_md_hash
is typed as string (or string | null if it can be absent), ensuring the
declaration around the environment const and its shape (isolation_required,
mcp_servers_active, skills_loaded, plugins_active, user_claude_md_hash,
project_claude_md_hash, parent_claude_md_hashes) reflects the actual JSON
contract.
🤖 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 `@docs/benchmarks/suite/repos.json`:
- Around line 58-145: The manifest uses moving branch refs (source.ref) for
git-backed entries (e.g., ids "documenso", "formbricks", "dub", "twenty",
"cal-diy", "novu"); update each entry's source.ref to an immutable revision
(commit SHA or release tag) instead of "main" or "next" to ensure reproducible
benchmarks—locate the source.ref fields in those repo objects and replace with
the chosen immutable identifiers (or adopt release tags) for each repository.

In `@src/infrastructure/benchmark/suite.ts`:
- Around line 444-454: The current cloneBenchmarkSuiteRepo uses git clone
--branch with source.ref which fails for raw commit SHAs; change the flow to
always clone without passing --branch (keep --depth 1 and --single-branch), then
if source.ref is provided run a separate fetch+detached-checkout against the
repo in targetRoot: use git -C <targetRoot> fetch --depth 1 origin <source.ref>
(or refspec) and then git -C <targetRoot> checkout --detach FETCH_HEAD (or
checkout --detach <fetched-ref>) so commit SHAs are pinned deterministically;
implement these calls using execFileSync in the same function
(cloneBenchmarkSuiteRepo) and handle errors similarly to the existing
execFileSync usage.

---

Outside diff comments:
In `@src/infrastructure/benchmark/suite.ts`:
- Around line 762-763: The summary text mislabels skipped cells as "skipped for
install" even when skips are due to non-install preparation failures
(clone/materialize); update the template strings that reference
summary.cells_skipped_for_install to use a generic, accurate label such as
"cells skipped during preparation (install/clone/materialize):
${summary.cells_skipped_for_install}" and similarly adjust the other occurrence
that prints summary.cells_skipped_for_env_drift so both summaries reflect
preparation/installation vs env-drift distinctions; search for uses of
summary.cells_skipped_for_install and summary.cells_skipped_for_env_drift and
replace the misleading wording in those template literals.

---

Nitpick comments:
In `@tests/unit/benchmark-suite-isolation-docs.test.ts`:
- Around line 16-23: The test's parsed environment object currently types
project_claude_md_hash as null which no longer matches the pinned JSON (it now
contains a SHA string); update the inline type for the const environment in
tests/unit/benchmark-suite-isolation-docs.test.ts so that project_claude_md_hash
is typed as string (or string | null if it can be absent), ensuring the
declaration around the environment const and its shape (isolation_required,
mcp_servers_active, skills_loaded, plugins_active, user_claude_md_hash,
project_claude_md_hash, parent_claude_md_hashes) reflects the actual JSON
contract.
🪄 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: 533823c0-0370-41dc-9113-2f23e45896e4

📥 Commits

Reviewing files that changed from the base of the PR and between 4f20bc4 and e71aa80.

📒 Files selected for processing (13)
  • docs/benchmarks/2026-04-30-govalidate/index.html
  • docs/benchmarks/2026-05-02-govalidate-pr-review/index.html
  • docs/benchmarks/index.html
  • docs/benchmarks/suite/README.md
  • docs/benchmarks/suite/isolation/environment.json
  • docs/benchmarks/suite/methodology.md
  • docs/benchmarks/suite/repos.json
  • docs/benchmarks/suite/tasks.json
  • src/infrastructure/benchmark/suite.ts
  • tests/unit/benchmark-docs.test.ts
  • tests/unit/benchmark-suite-docs.test.ts
  • tests/unit/benchmark-suite-isolation-docs.test.ts
  • tests/unit/benchmark-suite.test.ts

Comment thread docs/benchmarks/suite/repos.json Resolved
Comment thread src/infrastructure/benchmark/suite.ts Resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mohanagy

mohanagy commented Jun 7, 2026

Copy link
Copy Markdown
Owner Author

Also updated the suite summary wording to report skipped cells as "skipped during preparation" because those skips now cover broader repo-preparation failures, not just install failures.

@mohanagy
mohanagy merged commit 7438787 into main 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