|
88 | 88 |
|
89 | 89 | ## Phase 4: Implementation |
90 | 90 |
|
91 | | -1. **Write failing test** (if TDD mode or test framework available): |
92 | | - ```bash |
93 | | - # Test must fail, proving the bug exists |
94 | | - <FLOWCTL> guard --layer <affected-layer> |
95 | | - ``` |
| 91 | +### Prove-It Pattern (mandatory for bug fixes) |
96 | 92 |
|
97 | | -2. **Implement single fix** — address root cause, ONE change, no "while I'm here" improvements. |
98 | | - **No bundling:** Do NOT fix multiple things at once. If you're tempted to "also fix this other thing", STOP — commit the single fix first, verify, then address the next issue separately. |
| 93 | +1. **Write reproduction test** — a test that demonstrates the bug (MUST FAIL) |
| 94 | +2. **Confirm RED** — run the test, verify it actually fails. If it passes, your test doesn't reproduce the bug |
| 95 | +3. **Fix root cause** — implement the fix (not a workaround) |
| 96 | +4. **Confirm GREEN** — run the test, verify it now passes |
| 97 | +5. **Run full suite** — check for regressions: `<FLOWCTL> guard` |
99 | 98 |
|
100 | | -3. **Verify fix:** |
101 | | - ```bash |
102 | | - <FLOWCTL> guard |
103 | | - ``` |
| 99 | +**If the test passes on step 2, your test is wrong.** Go back to Phase 1 and refine your understanding of the bug. |
| 100 | + |
| 101 | +### Fix Discipline |
| 102 | + |
| 103 | +- **Implement single fix** — address root cause, ONE change, no "while I'm here" improvements. |
| 104 | + **No bundling:** Do NOT fix multiple things at once. If you're tempted to "also fix this other thing", STOP — commit the single fix first, verify, then address the next issue separately. |
104 | 105 |
|
105 | 106 | 4. **If fix doesn't work — failure escalation:** |
106 | 107 |
|
|
148 | 149 | | "Need more context" | You have tools. Search first, ask only what's truly unavailable | |
149 | 150 | | "Suggest handling manually" | This is your bug. Own it. Exhaust all options first | |
150 | 151 | | Same logic, different parameters | Tweaking parameters is NOT a different approach. Change the method. | |
| 152 | +| "Bug is too simple for a test" | Simple bugs regress. The test takes 2 minutes. The re-diagnosis takes 2 hours. | |
151 | 153 |
|
152 | 154 | ## Quick Reference |
153 | 155 |
|
|
157 | 159 | | 1.5 RP Investigate | context_builder(question) with symptoms + hypotheses | Cross-file context gathered (or skipped if no RP) | |
158 | 160 | | 2. Pattern | Find working examples, compare differences | Identified the delta | |
159 | 161 | | 3. Hypothesis | Form theory, test ONE variable | Confirmed or new hypothesis | |
160 | | -| 4. Implement | Write test, fix root cause, verify | Bug resolved, guards pass | |
| 162 | +| 4. Implement | Prove-It: RED test → fix root cause → GREEN test → full suite | Bug resolved, guards pass | |
161 | 163 |
|
162 | 164 | ## After Fix |
163 | 165 |
|
|
0 commit comments