| id | fix-a-python-bug |
|---|---|
| type | playbook |
| title | Fix a Python Bug with a Regression Test |
| summary | Reproduce the behavior, constrain the cause, make the smallest fix, and prove the regression stays fixed. |
| lang | en-US |
| content_version | 1 |
| status | reviewed |
| reviewed_on | 2026-09-02 |
- Record the observed behavior, expected behavior, smallest input that fails, and affected user path in a task contract.
- Add one test that fails for the reported reason. If it does not fail before the change, it is not yet regression evidence.
- Ask the coding agent to inspect the call path and propose the smallest plausible cause. Do not authorize an unrelated refactor.
- Change only the behavior required by the contract. Preserve public error forms unless the contract explicitly changes them.
- Run the new test, the nearest test suite, then the full deterministic suite.
- Review the diff for widened scope, hidden exception handling, new network or filesystem effects, and missing edge cases.
- Re-run the original user path and record commands and results in the verification template.
Practice the complete loop with the product slug example.