# AI use cases for Swe Sweep (facebookresearch/swe-sweep)

Repo: [facebookresearch/swe-sweep](https://github.com/facebookresearch/swe-sweep) | Use cases: 3 | Page: https://dedupedai.com/use-cases/facebookresearch-swe-sweep/

SWE-sweep is a Python benchmark harness where an agent must find and fix as many bugs as it can in a real repository, with no hints about bug type or location.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Score one agent patch on a SWE-sweep task: https://dedupedai.com/use-cases/facebookresearch-swe-sweep/score-one-patch-on-a-swe-sweep-task/
- Summarize graded trials by task and in total: https://dedupedai.com/use-cases/facebookresearch-swe-sweep/summarize-graded-harbor-trials/
- Check the harness tests before editing it: https://dedupedai.com/use-cases/facebookresearch-swe-sweep/run-the-repo-tests-before-changing-the-harness/

## How to score one agent patch on a SWE-sweep task with Swe Sweep

Repo: [facebookresearch/swe-sweep](https://github.com/facebookresearch/swe-sweep) | Difficulty: Intermediate | Time: 60 minutes | Basis: From the README

Run a unified diff against one benchmark task and get graded Harbor results.

**Who it is for:** An ML engineer or agent builder who has a model's patch for a bug-fixing task and needs a graded score.

**The problem:** Checking whether a model's patch fixes the hidden bugs in a real repository requires running the right task with the right harness.

**The outcome:** A graded Harbor trial for the task, with results written under the jobs/ directory.

### Steps

1. `git clone https://github.com/facebookresearch/swe-sweep.git`
2. `cd swe-sweep`
3. `uv sync`
4. `sweep infra doctor`
5. `uv run harbor run --path tasks/pandora-bench__dateutil --agent swesweep.patch_agent:PatchAgent --agent-kwarg "patch_path=$(realpath /path/to/model.patch)" --jobs-dir jobs --n-concurrent 1 --yes` (inferred, check the README)

### Prompt to paste into your agent

```text
Using the repo at facebookresearch/swe-sweep, run the Harbor command for the task tasks/<task-name> with the patch at <path-to-model.patch> as the patch_path, writing output to jobs/. Report the directory where results were written and whether the trial completed without errors.
```

### Caveat

Harbor 0.23 does not support the separate verifier environments these tasks use, so the project pins a Harbor source revision until Harbor 0.24 is released.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/facebookresearch-swe-sweep/score-one-patch-on-a-swe-sweep-task/

## How to summarize graded trials by task and in total with Swe Sweep

Repo: [facebookresearch/swe-sweep](https://github.com/facebookresearch/swe-sweep) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Turn a folder of graded Harbor trials into per-task and JSON score summaries.

**Who it is for:** A researcher or team lead comparing several agents' graded runs across SWE-sweep tasks.

**The problem:** Reading raw graded trial folders one by one makes it hard to compare runs or report the benchmark score.

**The outcome:** A per-task breakdown or a JSON summary of bugs resolved across the graded trials.

### Steps

1. `git clone https://github.com/facebookresearch/swe-sweep.git`
2. `cd swe-sweep`
3. `uv sync`
4. `sweep info path/to/graded-solutions --per-task`
5. `sweep info path/to/graded-solutions --json`

### Prompt to paste into your agent

```text
In the facebookresearch/swe-sweep repo, run `sweep info <path-to-graded-trials> --json` and save the output. Verify that the reported total equals the number of bugs solved across tasks divided by the total number of bugs.
```

### Caveat

The final score is a micro-average of bugs resolved, which is equivalent to a weighted average of individual task scores, so per-task averages will not match the headline number directly.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/facebookresearch-swe-sweep/summarize-graded-harbor-trials/

## How to check the harness tests before editing it with Swe Sweep

Repo: [facebookresearch/swe-sweep](https://github.com/facebookresearch/swe-sweep) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Run the repo's test suite and lint hooks to get a clean baseline before changes.

**Who it is for:** A developer or coding agent about to modify the SWE-sweep harness or its evaluation code.

**The problem:** Changes to the evaluation code can silently shift scores, so a clean baseline is needed first.

**The outcome:** A passing test suite and lint run on the unchanged repo, giving a baseline for later edits.

### Steps

1. `git clone https://github.com/facebookresearch/swe-sweep.git`
2. `cd swe-sweep`
3. `uv sync --extra test`
4. `uv run pytest`
5. `uvx pre-commit run --all-files`

### Prompt to paste into your agent

```text
In the facebookresearch/swe-sweep repo, run `uv sync --extra test` then `uv run pytest` and report the pass and fail counts. Confirm that `uvx pre-commit run --all-files` passes before making any edits to <file-to-change>.
```

### Caveat

The README says CI tests on Python 3.12 and 3.13, so a baseline on other Python versions may not match the project's own checks.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/facebookresearch-swe-sweep/run-the-repo-tests-before-changing-the-harness/
