zhimin-z commited on
Commit ·
92ff2c2
1
Parent(s): 973e5a6
Update README and code comments to include review statistics alongside PR and commit metrics
Browse files7 unmodified lines891011121314151617181920212223242526273 unmodified lines3132333435361 unmodified line38394041424344452 unmodified lines48495051525354555617 unmodified lines7475767778797 unmodified linesapp_file: app.pyhf_oauth: truepinned: falseshort_description: Track GitHub PR statistics for SWE assistants---# SWE Assistant PR & Commit LeaderboardSWE-PR ranks software engineering assistants by their real-world GitHub pull request and commit performance.No benchmarks. No sandboxes. Just real code that got merged and commits that got pushed.## Why This ExistsMost AI assistant benchmarks use synthetic tasks and simulated environments. This leaderboard measures real-world performance: did the PR get merged? How many commits are being created? How active is the assistant across different projects? Is the assistant improving?If an assistant can consistently get pull requests accepted and create commits across different projects, that tells you something no benchmark can.## What We Track3 unmodified lines- **Assistant**: Display name of the assistant- **Website**: Link to the assistant's homepage or documentation- **Total PRs**: Pull requests the assistant has opened- **Total Commits**: Commits created by the assistant- **Merged PRs**: PRs that got merged (not just closed)- **Acceptance Rate**: Percentage of concluded PRs that got merged1 unmodified line**Monthly Trends**- PR acceptance rate trends (line plots)- PR volume over time (bar charts)- Commit volume over time (bar charts)We focus on 180 days to highlight current capabilities and active assistants.## How It Works2 unmodified linesWe mine GitHub activity from [GHArchive](https://www.gharchive.org/), tracking:- PRs opened by the assistant (`PullRequestEvent`)- Commits created by the assistant (`PushEvent`)**Regular Updates**Leaderboard refreshes weekly (Monday at 00:00 UTC).**Community Submissions**Anyone can submit an assistant. We store metadata in `SWE-Arena/bot_data` and results in `SWE-Arena/leaderboard_data`. All submissions are validated via GitHub API.17 unmodified lines- Repository-based analysis- Extended PR metrics (review round-trips, conversation depth, files changed)- Extended commit metrics (commit frequency patterns, code churn)- Merge time tracking- Contribution patterns (bugs, features, docs)7 unmodified lines891011121314151617181920212223242526273 unmodified lines313233343536371 unmodified line394041424344454647482 unmodified lines515253545556575859606117 unmodified lines79808182838485867 unmodified linesapp_file: app.pyhf_oauth: truepinned: falseshort_description: Track GitHub PR, review & commit stats for SWE agents---# SWE Assistant PR, Review & Commit LeaderboardSWE-PR ranks software engineering assistants by their real-world GitHub pull request, review, and commit performance.No benchmarks. No sandboxes. Just real PRs that got merged, reviews that shaped code, and commits that got pushed.## Why This ExistsMost AI assistant benchmarks use synthetic tasks and simulated environments. This leaderboard measures real-world performance: did the PR get merged? Are the reviews valuable? How many commits are being created? How active is the assistant across different projects? Is the assistant improving?If an assistant can consistently get pull requests accepted, provide valuable reviews, and create commits across different projects, that tells you something no benchmark can.## What We Track3 unmodified lines- **Assistant**: Display name of the assistant- **Website**: Link to the assistant's homepage or documentation- **Total PRs**: Pull requests the assistant has opened- **Total Reviews**: PR reviews the assistant has made- **Total Commits**: Commits created by the assistant- **Merged PRs**: PRs that got merged (not just closed)- **Acceptance Rate**: Percentage of concluded PRs that got merged1 unmodified line**Monthly Trends**- PR acceptance rate trends (line plots)- PR volume over time (bar charts)- Review volume over time (bar charts)- Commit volume over time (bar charts)We focus on 180 days to highlight current capabilities and active assistants.## How It Works2 unmodified linesWe mine GitHub activity from [GHArchive](https://www.gharchive.org/), tracking:- PRs opened by the assistant (`PullRequestEvent`)- Commits created by the assistant (`PushEvent`)- PR reviews by the assistant (`PullRequestReviewEvent`)- PR review comments by the assistant (`PullRequestReviewCommentEvent`)**Regular Updates**Leaderboard refreshes daily**Community Submissions**Anyone can submit an assistant. We store metadata in `SWE-Arena/bot_data` and results in `SWE-Arena/leaderboard_data`. All submissions are validated via GitHub API.17 unmodified lines- Repository-based analysis- Extended PR metrics (review round-trips, conversation depth, files changed)- Extended commit metrics (commit frequency patterns, code churn)- Extended review metrics (response time, depth, message quality)- Review sentiment and pattern analysis (security, code quality, architecture)- Merge time tracking- Contribution patterns (bugs, features, docs)
280 unmodified lines281282283284285286287331 unmodified lines61962062162262362462514 unmodified lines64064164264364464564664764864965065165265365426 unmodified lines681682683684685686687688689690691692693280 unmodified linesEach assistant gets a unique color for both their line and bars.Args:type: Type of metrics to display - "pr", "commit", or "review" (default: "pr")top_n: Number of top assistants to show (default: 5)"""# Determine metrics key and field names based on type331 unmodified lines# GRADIO APPLICATION# =============================================================================print(f"\nStarting SWE Assistant PR, Commit & Review Leaderboard")print(f" Data source: {LEADERBOARD_REPO}")print(f" Reload frequency: Daily at 12:00 AM UTC\n")14 unmodified linesprint(f"{'='*80}\n")# Create Gradio interfacewith gr.Blocks(title="SWE Assistant PR, Commit & Review Leaderboard") as app:gr.Markdown("# SWE Assistant PR, Commit & Review Leaderboard")gr.Markdown(f"Track and compare GitHub pull request, commit, and review statistics for SWE assistants")with gr.Tabs():# Leaderboard Tabwith gr.Tab("Leaderboard"):gr.Markdown("*Statistics are based on assistant PR, commit, and review activity tracked by the system*")leaderboard_table = Leaderboard(value=pd.DataFrame(columns=[col[0] for col in LEADERBOARD_COLUMNS]), # Empty initiallydatatype=LEADERBOARD_COLUMNS,26 unmodified linesgr.Markdown("*PR volume and acceptance rate over time*")pr_monthly_metrics_plot = gr.Plot()with gr.Column():gr.Markdown("*Commit volume over time*")commit_monthly_metrics_plot = gr.Plot()with gr.Column():gr.Markdown("*Review volume over time*")review_monthly_metrics_plot = gr.Plot()# Load monthly metrics when app startsapp.load(280 unmodified lines281282283284285286287331 unmodified lines61962062162262362462514 unmodified lines64064164264364464564664764864965065165265365426 unmodified lines681682683684685686687688689690691692693694280 unmodified linesEach assistant gets a unique color for both their line and bars.Args:type: Type of metrics to display - "pr", "review", or "commit" (default: "pr")top_n: Number of top assistants to show (default: 5)"""# Determine metrics key and field names based on type331 unmodified lines# GRADIO APPLICATION# =============================================================================print(f"\nStarting SWE Assistant PR, Review & Commit Leaderboard")print(f" Data source: {LEADERBOARD_REPO}")print(f" Reload frequency: Daily at 12:00 AM UTC\n")14 unmodified linesprint(f"{'='*80}\n")# Create Gradio interfacewith gr.Blocks(title="SWE Assistant PR, Review & Commit Leaderboard") as app:gr.Markdown("# SWE Assistant PR, Review & Commit Leaderboard")gr.Markdown(f"Track and compare GitHub pull request, review, and commit statistics for SWE assistants")with gr.Tabs():# Leaderboard Tabwith gr.Tab("Leaderboard"):gr.Markdown("*Statistics are based on assistant PR, review, and commit activity tracked by the system*")leaderboard_table = Leaderboard(value=pd.DataFrame(columns=[col[0] for col in LEADERBOARD_COLUMNS]), # Empty initiallydatatype=LEADERBOARD_COLUMNS,26 unmodified linesgr.Markdown("*PR volume and acceptance rate over time*")pr_monthly_metrics_plot = gr.Plot()with gr.Column():gr.Markdown("*Review volume over time*")review_monthly_metrics_plot = gr.Plot()with gr.Column():gr.Markdown("*Commit volume over time*")commit_monthly_metrics_plot = gr.Plot()# Load monthly metrics when app startsapp.load(
298 unmodified lines29930030130230330430547 unmodified lines35335435535635735835946 unmodified lines40640740840941041141295 unmodified lines5085095105115125135146 unmodified lines521522523524525526527528529268 unmodified lines7987998008018028038042 unmodified lines80780880981081181281373 unmodified lines88788888989089189289323 unmodified lines917918919920921922923298 unmodified linesdef fetch_all_metadata_streaming(conn, identifiers, start_date, end_date):"""UNIFIED QUERY: Fetch commit, PR, and review metadata using streaming batch processing.Single query per batch retrieves all event types and post-processes in Python:- PushEvent (commits)- PullRequestEvent (authored PRs)47 unmodified lines# Build file patterns SQL for THIS BATCHfile_patterns_sql = '[' + ', '.join([f"'{fp}'" for fp in file_patterns]) + ']'# UNIFIED QUERY: Fetch commits, PRs, and reviews in a single passunified_query = f"""SELECTtype,46 unmodified linestry:all_results = conn.execute(unified_query).fetchall()# Post-process results to separate commits, PRs, and reviews# Row: (type, actor_login, commit_sha, pr_url, action, pr_author,# pr_created_at, pr_merged_at, pr_closed_at, comment_user_login, created_at)95 unmodified linesbatch_reviews += 1total_reviews += 1print(f"✓ {batch_commits} commits, {batch_prs} PRs, {batch_reviews} reviews found")except Exception as e:print(f"\n ✗ Batch {batch_num} error: {str(e)}")6 unmodified linesagents_with_commits = sum(1 for commits in commits_by_agent.values() if commits)agents_with_prs = sum(1 for prs in prs_by_agent.values() if prs)agents_with_reviews = sum(1 for reviews in reviews_by_agent.values() if reviews)print(f"\n ✓ Complete: {total_commits} commits for {agents_with_commits}/{len(identifiers)} assistants")print(f" ✓ Complete: {total_prs} PRs for {agents_with_prs}/{len(identifiers)} assistants")print(f" ✓ Complete: {total_reviews} reviews for {agents_with_reviews}/{len(identifiers)} assistants")return {'commits': dict(commits_by_agent),268 unmodified linesdef construct_leaderboard_from_metadata(commit_metadata_dict, pr_metadata_dict, review_metadata_dict, assistants):"""Construct leaderboard from in-memory commit, PR, and review metadata.Args:commit_metadata_dict: Dictionary mapping assistant ID to list of commit metadata2 unmodified linesassistants: List of assistant metadataReturns:Dictionary with leaderboard data including commit, PR, and review statistics"""if not assistants:print("Error: No assistants found")73 unmodified linesdef mine_all_agents():"""Mine commit, PR, and review metadata for all assistants using STREAMING batch processing.Downloads GHArchive data, then uses BATCH-based DuckDB queries."""print(f"\n[1/4] Downloading GHArchive data...")23 unmodified linesprint(f"Failed to initialize DuckDB connection: {str(e)}")returnprint(f"\n[3/4] Mining commit, PR, and review metadata ({len(identifiers)} assistants, {LEADERBOARD_TIME_FRAME_DAYS} days)...")try:results = fetch_all_metadata_streaming(298 unmodified lines29930030130230330430547 unmodified lines35335435535635735835946 unmodified lines40640740840941041141295 unmodified lines5085095105115125135146 unmodified lines521522523524525526527528529268 unmodified lines7987998008018028038042 unmodified lines80780880981081181281373 unmodified lines88788888989089189289323 unmodified lines917918919920921922923298 unmodified linesdef fetch_all_metadata_streaming(conn, identifiers, start_date, end_date):"""UNIFIED QUERY: Fetch PR, review, and commit metadata using streaming batch processing.Single query per batch retrieves all event types and post-processes in Python:- PushEvent (commits)- PullRequestEvent (authored PRs)47 unmodified lines# Build file patterns SQL for THIS BATCHfile_patterns_sql = '[' + ', '.join([f"'{fp}'" for fp in file_patterns]) + ']'# UNIFIED QUERY: Fetch PRs, reviews, and commits in a single passunified_query = f"""SELECTtype,46 unmodified linestry:all_results = conn.execute(unified_query).fetchall()# Post-process results to separate PRs, reviews, and commits# Row: (type, actor_login, commit_sha, pr_url, action, pr_author,# pr_created_at, pr_merged_at, pr_closed_at, comment_user_login, created_at)95 unmodified linesbatch_reviews += 1total_reviews += 1print(f"✓ {batch_prs} PRs, {batch_reviews} reviews, {batch_commits} commits found")except Exception as e:print(f"\n ✗ Batch {batch_num} error: {str(e)}")6 unmodified linesagents_with_commits = sum(1 for commits in commits_by_agent.values() if commits)agents_with_prs = sum(1 for prs in prs_by_agent.values() if prs)agents_with_reviews = sum(1 for reviews in reviews_by_agent.values() if reviews)print(f"\n ✓ Complete: {total_prs} PRs for {agents_with_prs}/{len(identifiers)} assistants")print(f" ✓ Complete: {total_reviews} reviews for {agents_with_reviews}/{len(identifiers)} assistants")print(f" ✓ Complete: {total_commits} commits for {agents_with_commits}/{len(identifiers)} assistants")return {'commits': dict(commits_by_agent),268 unmodified linesdef construct_leaderboard_from_metadata(commit_metadata_dict, pr_metadata_dict, review_metadata_dict, assistants):"""Construct leaderboard from in-memory PR, review, and commit metadata.Args:commit_metadata_dict: Dictionary mapping assistant ID to list of commit metadata2 unmodified linesassistants: List of assistant metadataReturns:Dictionary with leaderboard data including PR, review, and commit statistics"""if not assistants:print("Error: No assistants found")73 unmodified linesdef mine_all_agents():"""Mine PR, review, and commit metadata for all assistants using STREAMING batch processing.Downloads GHArchive data, then uses BATCH-based DuckDB queries."""print(f"\n[1/4] Downloading GHArchive data...")23 unmodified linesprint(f"Failed to initialize DuckDB connection: {str(e)}")returnprint(f"\n[3/4] Mining PR, review, and commit metadata ({len(identifiers)} assistants, {LEADERBOARD_TIME_FRAME_DAYS} days)...")try:results = fetch_all_metadata_streaming(
README.md+14-7
app.py+10-9
msr.py+10-10