feat(eval): build SWE-bench-style eval instances from PR-linked captures (ALL-2451)#757
Closed
simonrosenberg wants to merge 1 commit into
Closed
feat(eval): build SWE-bench-style eval instances from PR-linked captures (ALL-2451)#757simonrosenberg wants to merge 1 commit into
simonrosenberg wants to merge 1 commit into
Conversation
…res (ALL-2451) When an OpenHands Cloud conversation produces a PR, we want to replay it as an eval: the initial repo state (repo + base_commit), the task (problem_statement), and the resulting change (patch). This adds the deterministic data-shaping kernel that turns a PR-linked capture into a dataset row in the exact shape the SWE-bench harness already consumes (instance_id/repo/base_commit/problem_statement), writable as JSONL and loadable via get_dataset. - benchmarks/utils/pr_snapshot.py: PRSnapshot model, build_swebench_instance, pr_snapshot_from_github_json (GraphQL `gh pr view --json` and REST shapes; explicit base_commit override since a PR base can advance), write_instances_jsonl. - benchmarks/scripts/pr_to_eval_instance.py: CLI for the PR-merge capture job to emit/append an instance from a GitHub PR payload. - Tests cover field mapping, both GitHub JSON shapes, base-commit override, and a JSONL roundtrip through get_dataset. The PR-merge trigger + clone/delta-storage Kubernetes job is the remaining infra piece (needs a deploy/automation home); this is what that job calls per instance. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
Closing — re-homing ALL-2451. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When an OpenHands Cloud conversation produces a pull request, we'd like to replay it as an evaluation instance. An eval needs the initial repo state the agent started from (
repo+base_commit), the task (problem_statement), and the resulting change (patch). This is the data-shaping kernel of ALL-2451 — it turns a PR-linked capture into a dataset row in the exact shape the SWE-bench harness already consumes, so captured conversations become replayable evals. It pairs with the workspace-archive work (software-agent-sdk#3867, runtime-api#623, OpenHands#14953) that captures the final git delta.What
benchmarks/utils/pr_snapshot.py:PRSnapshot— a PR-linked capture (repo, pr_number, base_commit, title/body, head_commit, optional patch).build_swebench_instance()— emits a row with the fieldsswebench/run_infer.pyreads (instance_id,repo,base_commit,problem_statement) pluspatchand provenance. JSON-serialisable;instance_idfollows theowner__repo-<n>convention.pr_snapshot_from_github_json()— accepts both thegh pr view --json(GraphQL) and REST PR shapes; derivesowner/repofrom the URL when absent; supports an explicitbase_commitoverride (a PR's base ref can advance after the conversation started).write_instances_jsonl()— writes rows to a.jsonldataset.benchmarks/scripts/pr_to_eval_instance.py— CLI the PR-merge capture job calls to emit/append one instance from a PR payload.Scope / follow-up
This is the deterministic kernel. The PR-merge trigger + clone/delta-storage Kubernetes job (ALL-2451's "trigger a job when a PR goes MERGED/CLOSED; update the delta, not the whole repo") is the remaining infra piece and needs a deploy/automation home + product decisions on the dataset destination — out of scope for this PR. This is what that job calls per instance.
How to Test
Covers field mapping (with/without body), both GitHub JSON shapes,
owner/repoderived from the URL, the explicit base-commit override, and a JSONL roundtrip throughget_dataset.ruff check/formatclean.