Ability naming builds on INTENT.md

This commit is contained in:
2026-05-03 00:47:51 +02:00
parent 6c4b0e6dcb
commit ea74722283
4 changed files with 261 additions and 11 deletions

View File

@@ -135,6 +135,53 @@ def test_candidate_generator_extracts_intended_capability_blocks_from_intent_chu
assert [ref.path for ref in intent_capability.source_refs] == ["INTENT.md"]
def test_candidate_generator_prefers_intent_over_derived_scope_for_ability_name():
repository = Repository(
id=1,
name="LLMConnect",
url="/tmp/llm-connect",
description=None,
branch="main",
status="analyzed",
)
facts = [
fact(
1,
"intent",
"INTENT",
"INTENT.md",
metadata={"source_role": "intent_summary"},
),
fact(
2,
"documentation",
"SCOPE",
"SCOPE.md",
metadata={"source_role": "derived_scope"},
),
]
chunks = [
chunk(
1,
"documentation",
"SCOPE.md",
"# SCOPE\n\nA stale first paragraph copied from another repository.",
),
chunk(
2,
"intent",
"INTENT.md",
"# INTENT\n\nProvide a provider-agnostic LLM connector.",
),
]
chunks[0].metadata["source_role"] = "derived_scope"
chunks[1].metadata["source_role"] = "intent_summary"
graph = CandidateGraphGenerator().generate(repository, facts, chunks)
assert graph[0].name == "Provide A Provider-agnostic LLM Connector"
def test_candidate_generator_enriches_descriptions_from_content_chunks():
repository = Repository(
id=1,