generated from coulomb/repo-seed
Improved generator.py
This commit is contained in:
@@ -403,3 +403,58 @@ def test_candidate_generator_does_not_promote_llm_provider_mentions_to_capabilit
|
||||
for capability in graph[0].capabilities
|
||||
if capability.name == "Route LLM Requests Across Providers"
|
||||
] == []
|
||||
|
||||
|
||||
def test_candidate_generator_excludes_mention_only_providers_from_promoted_capability():
|
||||
repository = Repository(
|
||||
id=1,
|
||||
name="MixedSignals",
|
||||
url="/tmp/mixed-signals",
|
||||
description=None,
|
||||
branch="main",
|
||||
status="analyzed",
|
||||
)
|
||||
facts = [
|
||||
fact(1, "documentation", "README", "README.md"),
|
||||
fact(
|
||||
2,
|
||||
"llm_provider",
|
||||
"OpenRouter",
|
||||
"src/providers.py",
|
||||
"openrouter",
|
||||
{"source_role": "implementation_source", "utility_relationship": "adapter"},
|
||||
),
|
||||
fact(
|
||||
3,
|
||||
"llm_provider",
|
||||
"Claude",
|
||||
"README.md",
|
||||
"claude",
|
||||
{"source_role": "product_documentation", "utility_relationship": "mention"},
|
||||
),
|
||||
fact(
|
||||
4,
|
||||
"provider_registry",
|
||||
"LLM provider registry",
|
||||
"src/providers.py",
|
||||
metadata={"source_role": "implementation_source", "utility_relationship": "adapter"},
|
||||
),
|
||||
]
|
||||
|
||||
graph = CandidateGraphGenerator().generate(repository, facts)
|
||||
|
||||
capability = next(
|
||||
capability
|
||||
for capability in graph[0].capabilities
|
||||
if capability.name == "Route LLM Requests Across Providers"
|
||||
)
|
||||
assert "OpenRouter" in capability.description
|
||||
assert "Claude" not in capability.description
|
||||
assert {feature.name for feature in capability.features} == {
|
||||
"Use OpenRouter Models",
|
||||
"Maintain LLM Provider Registry",
|
||||
}
|
||||
assert [ref.path for ref in capability.source_refs] == [
|
||||
"src/providers.py",
|
||||
"src/providers.py",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user