feat: v0.2.0 sprint — ground truth eval, crossover/mutation, checkpointing, similarity guards, dataset loader, CLI commands, extended test coverage
Aggregates all v0.2.0 sprint work (GARAA-30 through GARAA-40) and fixes 2 integration tests that broke when the codebase went async (DSPyLLMAdapter and full pipeline tests now properly await coroutines). 277 tests pass (260 unit + 17 integration). Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -91,3 +91,27 @@ def mock_proposer_port() -> AsyncMock:
|
||||
text="You are a very helpful assistant. Answer the question precisely."
|
||||
)
|
||||
return port
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_crossover_port() -> AsyncMock:
|
||||
"""Mock CrossoverPort that combines two parent prompts."""
|
||||
port = AsyncMock()
|
||||
|
||||
async def _crossover(parent_a: Prompt, parent_b: Prompt, task_description: str) -> Prompt:
|
||||
return Prompt(text=f"{parent_a.text} Also, {parent_b.text.lower()}")
|
||||
|
||||
port.crossover = AsyncMock(side_effect=_crossover)
|
||||
return port
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_mutation_port() -> AsyncMock:
|
||||
"""Mock MutationPort that paraphrases a prompt."""
|
||||
port = AsyncMock()
|
||||
|
||||
async def _mutate(prompt: Prompt, task_description: str, mutation_type: str = "paraphrase") -> Prompt:
|
||||
return Prompt(text=f"[{mutation_type}] {prompt.text}")
|
||||
|
||||
port.mutate = AsyncMock(side_effect=_mutate)
|
||||
return port
|
||||
|
||||
Reference in New Issue
Block a user