Module: routes/testFix

AI-powered test auto-fix from failure context. Mounted at /api/v1 (INF-005).

Endpoints

Method Path Description
POST /api/v1/tests/:testId/fix Stream an AI-generated fix for a failing test (SSE)
POST /api/v1/tests/:testId/apply-fix Apply the fixed code to the test record
Source:

Methods

(inner) buildFixSystemPrompt() → {string}

Build the system prompt for the test-fix AI call. Uses tier-aware prompt rules (MNT-009) — local models get compact rules.

Source:
Returns:

The system prompt.

Type
string

(inner) buildUserPrompt()

Build the user prompt with test code + failure context.

Source:

(inner) computeDiffSummary()

Compute a simple line-based diff summary between two code strings. Returns a compact string showing added/removed lines.

Source: