# Run controlled reruns

Reruns always create a new run; they never mutate historical evidence.

For a sandbox-backed suite, each shard attempt asks the configured template pool
for a healthy idle instance first, so pre-warmed capacity is reused when it is
available; otherwise the pool provisions one. The instance that ran the previous
attempt is not reused: customer test code has executed on it, so release uses the
terminate policy instead of returning that dirty host to the idle pool. A
redelivered launch within the same attempt adopts its existing action by launch
key and does not start a duplicate sandbox.

Repeat the prior selection and stream progress:

```bash
cofactor external-run rerun <run-id>
```

Override one or both filters:

```text
--spec <path>
--grep <provider-title-regex>
```

Clear the previous selection and run the configured suite scope:

```text
--clear-selection
```

Re-run one area, or only what did not pass (failed, flaky and skipped tests),
each in the area that ran it:

```bash
cofactor external-run rerun <run-id> --area <label|index>
cofactor external-run rerun <run-id> --failed
cofactor external-run rerun <run-id> --failed --area <label|index>
```

`--failed` needs a finished run. Tests in an area turned off since are left out.

A plain `rerun <run-id>` of a run limited to some areas re-runs every area.
`--area` re-runs the whole area and drops the earlier title filter.

Use a focused rerun to test a hypothesis, not to make the original failure
disappear. Record the new run ID, exact selection, revision, and whether the
behavior reproduced. `--no-stream` is available for automation that only needs
the newly created run record.
