Apply fixes to failed tests based on test result analysis. Parses result files, identifies failures, implements corrections, and re-tests. Use during the develop-test-fix loop when tests fail.
Diagnose test failures and apply targeted fixes.
{
"feature": 1,
"project_root": "string (absolute path)",
"result_file": "string (path to f{N}_{name}_tc{case}_result_{run}.json)",
"failure_analysis": {
"requirement": "req-3",
"expected": "run_command returns stdout and stderr separately",
"actual": "merged string returned",
"location": "tools/run-command.tool.js:42",
"suggested_fix": "Split stdout and stderr. See spec req-3."
}
}
Parse failure details:
result_file pathstatus, error, expected, actuallocation or error messageCategorize failure:
Implement fix:
Add comment noting fix:
// Fixed: f1_ollama-foundation_tc2_result_1.json// Requirement: ...Validate fix:
{
"status": "fixed|environment_error|analysis_error",
"feature": 1,
"test_case": 2,
"result_file": "f1_ollama-foundation_tc2_result_1.json",
"failure_type": "logic_error|api_error|config_error|environment_error",
"files_modified": [
{
"path": "services/ollama.service.js",
"change_summary": "Split stdout/stderr in streamPrompt function",
"lines_changed": "45-62",
"syntax_valid": true
}
],
"fix_explanation": "Separated response into { stdout, stderr } object instead of merged string",
"ready_to_retest": true,
"error": null
}
1. Identify failing assertion
2. Examine expected vs actual
3. Modify function to produce expected result
4. Test function in isolation
1. Check function signature
2. Compare to spec requirement
3. Adjust parameters or return type
4. Update all callers if needed
1. Check config.json structure
2. Add missing keys or fix values
3. Validate type matches spec (number, string, array, object)
4. Reload config and re-test