Freeze a Bisect SHA and Public API Before an OSS Patch Review
Description and use
Freezing the bisect SHA and public API snapshot confines the model’s edits to the minimal failing change set, preventing scope creep and ensuring the patch addresses only the intended bug.
Problem
When a model generates a patch for an OSS bug, it often adds unrelated changes—extra files, new public APIs, or style tweaks—causing scope creep and downstream breakage.
Outcome
By freezing the bisect SHA and public API snapshot, the model’s edits are bounded to the minimal failing change set, eliminating scope creep and ensuring the patch addresses only the intended bug.
Workflow
- Clone the repository at the reporter’s tag and run the failing test to confirm the bug.
- Run
git bisectto locate the first bad commit, outputting the SHA toFIRST_BADand the list of allowed files toallowed_files.txt. - Snapshot the public names on the bad tree with
tools/api_snapshot.py, saving toapi.snap.bad. Copyapi.snap.badbesideFIRST_BAD. Createpatch_contract.yamlwith the SHA, allowed files, forbidden changes, required tests, and the snapshot file. Attach the contract to the review prompt and instruct the model to obey it. After the model generates a patch, verify the diff only touches allowed files and the snapshot byte‑for‑byte matchesapi.snap.bad. - Review the patch, ensuring no new public names, modules, or dependency bumps were added.
- Merge the patch if all constraints are satisfied.
Evidence
The first artifact is a git bisect SHA. The second is a snapshot of public names.
Allowed_files comes from the bisect file list. A model does not extend that list.
- Record date: 2026-09-21T12:30:23.742Z