()
| 301 | } |
| 302 | |
| 303 | enterRefactor() { |
| 304 | if (this.disabled) return { ok: true, phase: 'idle', message: 'TDD gating disabled.' }; |
| 305 | if (this._phase !== PHASES.GREEN) { |
| 306 | return { ok: false, phase: this._phase, message: `enterRefactor called but phase is "${this._phase}", expected "green".` }; |
| 307 | } |
| 308 | |
| 309 | this._phase = PHASES.REFACTOR; |
| 310 | this._save(); |
| 311 | |
| 312 | return { |
| 313 | ok: true, |
| 314 | phase: PHASES.REFACTOR, |
| 315 | message: 'REFACTOR: make structural improvements only. Run full suite to verify no regressions.', |
| 316 | }; |
| 317 | } |
| 318 | |
| 319 | completeCycle(testResult) { |
| 320 | if (this.disabled) return { ok: true, phase: 'idle', message: 'TDD gating disabled.' }; |
no test coverage detected