Coevolution extension

This commit is contained in:
2026-04-29 01:19:59 +02:00
parent 88afdc09fd
commit 991c34ce52
17 changed files with 764 additions and 4 deletions

View File

@@ -246,3 +246,35 @@ def test_candidate_generator_groups_many_interface_facts_into_behavioral_feature
assert feature.type == "API"
assert feature.location == "src/api.py"
assert len(feature.source_refs) == 3
def test_candidate_generator_maps_llm_provider_facts_to_capability():
repository = Repository(
id=1,
name="LLMConnect",
url="/tmp/llm-connect",
description=None,
branch="main",
status="analyzed",
)
facts = [
fact(1, "documentation", "README", "README.md"),
fact(2, "llm_provider", "OpenRouter", "providers.py", "openrouter"),
fact(3, "llm_provider", "Claude", "providers.py", "claude"),
fact(4, "credential_config", "OpenRouter API key", ".env.example", "OPENROUTER_API_KEY"),
fact(5, "provider_registry", "LLM provider registry", "providers.py"),
fact(6, "fallback_policy", "LLM provider fallback policy", "providers.py"),
]
graph = CandidateGraphGenerator().generate(repository, facts)
capability = next(
capability
for capability in graph[0].capabilities
if capability.name == "Route LLM Requests Across Providers"
)
feature_names = {feature.name for feature in capability.features}
assert {"Use OpenRouter Models", "Use Claude Models"} <= feature_names
assert "Configure LLM Provider Credentials" in feature_names
assert "Maintain LLM Provider Registry" in feature_names
assert "Apply LLM Provider Fallback Policy" in feature_names