Senior SWE-Bench: open-source benchmark that assesses agents as senior engineers
Senior SWE-Bench: Assessing Agents as Senior Engineers
"We treat agents like senior engineers, so why evaluate them like junior engineers?"
Senior SWE-Bench is designed to move beyond basic coding tests, challenging AI agents to operate with the autonomy and intuition of a seasoned software engineer.
🛠️ The Three Pillars of Senior Evaluation
| Pillar | Senior Engineer Behavior | Senior SWE-Bench Implementation |
|---|---|---|
| Feature Dev | Build complex features from ambiguous, natural language requests. | Tasks use realistic, non-over-specified instructions. A validation agent uses expert recipes to create adaptive behavioral tests. |
| Bug Fixing | Solve deep-seated issues requiring runtime investigation. | Tasks are sourced from PRs that required significant debugging. Focus is on investigation (e.g., starting services) rather than just patching. |
| Code Quality | Ship "tasteful" code that adheres to implicit codebase standards. | Scores combine runtime correctness with quality metrics. Verifiers check for |
Evaluation Workflow
📖 Case Study: The BookWorm Metadata Integration
To illustrate the complexity of these tasks, consider the following requirement for the BookWorm system.
🚨 The Problem / Opportunity
Currently, BookWorm relies exclusively on Amazon and ISBNdb. This creates a failure point when metadata is missing or malformed, particularly for books only possessing ISBN-13s. This leads to:
- Failed enrichment for
/api/importor promise items. - Low-quality entries in the Open Library.
- Reduced success rates for international or rare titles.
The Goal: Integrate Google Books as a fallback source to improve data completeness and user trust.
✅ Definition of Success
- BookWorm can successfully fetch and stage metadata via ISBN-13 from Google Books.
- Automated tests verify parsing of:
- Core fields: Title, subtitle, authors, publisher, page count, description, and publish date.
- Edge cases: Missing fields or null authors.
- Null results: Correctly returning no result for zero or multiple matches.
📋 Technical Proposal & Requirements
The implementation requires modifications across several core files:
- Configuration: In
openlibrary/core/imports.py, theSTAGED_SOURCEStuple must be updated to includegoogle_books. - API Integration: The staging URL is defined as:
http://{affiliate_server_url}/isbn/{identifier}?high_priority=true&stage_import=true(Whereaffiliate_server_urlis sourced fromopenlibrary/core/vendors.pyandidentifieris an ISBN-10, ISBN-13, or BASIN).* - Data Persistence:
- In
openlibrary/plugins/importapi/code.py, the functionsupplement_rec_with_import_item_metadatamust extend thesource_recordsfield rather than overwriting it. - In
scripts/affiliate_server.py, a new functionstage_from_google_booksmust useBatch.add_itemsto persist successful API fetches.
- In
- Fallback Logic: The system should trigger the Google Books fallback based on the following logic:
- Safety Constraints: If the Google Books API returns result for a single ISBN, the system must log a warning and staging to prevent data corruption.
- Schema Requirements: Staged metadata must include:
isbn_10,isbn_13,title,subtitle,authors,source_records,publishers,publish_date,number_of_pages, anddescription. - Pipeline Update: In
scripts/promise_batch_imports.py, replace direct Amazon-only logic withstage_bookworm_metadata.
🔌 New Public Interfaces
The following functions are introduced in scripts/affiliate_server.py:
| Function | Inputs | Outputs | Description |
|---|---|---|---|
fetch_google_book | isbn (str) | dict | None | Performs the HTTP request to Google Books API; returns JSON on 200 OK. |
process_google_book | google_book_data (dict) | dict | Parses the raw JSON into the Open Library compatible structure. |
# Example of the expected logic flow in scripts/affiliate_server.py
def stage_from_google_books(isbn):
data = fetch_google_book(isbn)
if data:
processed = process_google_book(data)
Batch.add_items(processed)
return True
return False