MCPcopy
hub / github.com/Doorman11991/smallcode / completeCycle

Method completeCycle

src/session/tdd_state.js:319–336  ·  view source on GitHub ↗
(testResult)

Source from the content-addressed store, hash-verified

317 }
318
319 completeCycle(testResult) {
320 if (this.disabled) return { ok: true, phase: 'idle', message: 'TDD gating disabled.' };
321 if (this._phase !== PHASES.REFACTOR) {
322 return { ok: false, phase: this._phase, message: `completeCycle called but phase is "${this._phase}", expected "refactor".` };
323 }
324
325 const hasRegressions = testResult && (testResult.failed > 0 || testResult.errors > 0);
326 if (hasRegressions) {
327 const names = (testResult.failures || []).slice(0, 3).map(f => f.name).join(', ');
328 return {
329 ok: false,
330 phase: PHASES.REFACTOR,
331 message: `Regression: ${testResult.failed} failing test(s)${names ? ': ' + names : ''}. Fix before completing the cycle.`,
332 };
333 }
334
335 return this._finishCycle('refactor', testResult);
336 }
337
338 skipRefactor() {
339 if (this.disabled) return { ok: true, phase: 'idle', message: 'TDD gating disabled.' };

Callers 4

tdd_state.test.jsFile · 0.80
processTestResultMethod · 0.80
_executeToolMethod · 0.80
executeToolFunction · 0.80

Calls 1

_finishCycleMethod · 0.95

Tested by

no test coverage detected