MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / build_fix_prompt

Function build_fix_prompt

core/tdd.py:68–79  ·  view source on GitHub ↗

Build a targeted prompt for fixing failing tests.

(source_path, source_code, test_path, failures, iteration)

Source from the content-addressed store, hash-verified

66 return None
67
68def build_fix_prompt(source_path, source_code, test_path, failures, iteration):
69 """Build a targeted prompt for fixing failing tests."""
70 failure_text = ''
71 for name, error in failures[:3]: # max 3 failures to stay in context
72 failure_text += f'\nFAILED: {name}\n{error[:300]}\n'
73 return (
74 f'Fix {Path(source_path).name} so the failing tests pass.\n\n'
75 f'Failing tests:{failure_text}\n'
76 f'Current {Path(source_path).name}:\n```python\n{source_code}\n```\n\n'
77 f'Rewrite {Path(source_path).name} to fix ONLY the failing tests. '
78 f'Do not break passing tests. Use write_file.'
79 )
80
81def build_generate_prompt(source_path, test_path, test_code):
82 """Build prompt to write initial implementation from tests."""

Callers 1

run_tdd_loopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected