bisect ยท diff
git:20260816.a197bdc to git:20260820.35b5e3e
11 added, 8 removed. Audit A to A.
---
name: bisect
description: Pinpoint the first bad commit for a reproducible regression in a safe temporary worktree. Use when HEAD is bad, a known revision is good, and one unattended command distinguishes them; handles flaky endpoints and git-bisect skip exit 125.
---
- # Bisect โ isolate the first bad commit safely
+ # Bisect
## 1. Freeze the criterion
- Confirm the bad endpoint fails and identify a good commit or tag. Use one unattended command whose exit `0` means good, `1โ124` means bad, and `125` means the revision cannot be tested. A missing executable is an infrastructure error, not evidence that a revision is bad.
+ Confirm the bad endpoint fails and name a good commit or tag. One unattended
+ command decides: exit `0` means good, `1โ124` means bad, and `125` means
+ untestable. A missing executable is an infrastructure error.
## 2. Run in a throwaway worktree
- Locate this skill's installed directory, stay in the repository under investigation, and invoke the bundled script by its absolute path:
-
```bash
<this-skill-dir>/scripts/safe-bisect.sh --good <good-rev> --bad <bad-rev> -- <verify-command> [args...]
```
- The script resolves both endpoints, repeats each endpoint twice to catch instability, creates a detached temporary worktree, cleans generated state between revisions, runs `git bisect`, resets it, and removes the worktree on every exit path. Use `--retries N` only when the reproduction needs more endpoint samples.
-
- Do not run it for a nondeterministic symptom. Make the reproduction deterministic first through `/debug`.
+ The helper repeats each endpoint twice, uses a detached temporary worktree,
+ cleans state, resets bisect, and removes the worktree on every exit path. Use
+ `--retries N` only for endpoint samples. Make the reproduction deterministic
+ first through `/debug`.
## 3. Interpret narrowly
- Report the result as the **first bad commit**, not automatically the root cause. Read its diff and relevant callers, then feed that evidence into `/debug` as a hypothesis. Keep the reproduction as a regression test and run the full verification tier after the fix.
+ Report the first bad commit, not automatically the root cause. Read its diff and
+ relevant callers; feed `/debug`, keep the regression test, and run the full
+ verification tier after fixing.