generated from coulomb/repo-seed
one time bootstrap path
This commit is contained in:
@@ -108,6 +108,51 @@ def test_candidate_generator_enriches_descriptions_from_content_chunks():
|
||||
assert '@app.post("/classify")' in graph[0].capabilities[0].description
|
||||
|
||||
|
||||
def test_candidate_generator_prefers_intent_over_derived_scope_chunks():
|
||||
repository = Repository(
|
||||
id=1,
|
||||
name="KeyCape",
|
||||
url="/tmp/key-cape",
|
||||
description=None,
|
||||
branch="main",
|
||||
status="analyzed",
|
||||
)
|
||||
facts = [
|
||||
fact(1, "intent", "INTENT", "INTENT.md"),
|
||||
fact(2, "scope", "SCOPE", "SCOPE.md"),
|
||||
fact(3, "documentation", "README", "README.md"),
|
||||
]
|
||||
chunks = [
|
||||
chunk(
|
||||
1,
|
||||
"scope",
|
||||
"SCOPE.md",
|
||||
"# SCOPE\nAlready provides deployed IAM runtime behavior.",
|
||||
end_line=2,
|
||||
),
|
||||
chunk(
|
||||
2,
|
||||
"intent",
|
||||
"INTENT.md",
|
||||
"# INTENT\nDesign a lightweight IAM profile implementation.",
|
||||
end_line=2,
|
||||
),
|
||||
chunk(
|
||||
3,
|
||||
"documentation",
|
||||
"README.md",
|
||||
"# KeyCape\nREADME fallback should not beat intent.",
|
||||
end_line=2,
|
||||
),
|
||||
]
|
||||
|
||||
graph = CandidateGraphGenerator().generate(repository, facts, chunks)
|
||||
|
||||
assert graph[0].name == "Design A Lightweight IAM Profile Implementation"
|
||||
assert "INTENT. Design a lightweight IAM profile implementation" in graph[0].description
|
||||
assert graph[0].source_refs[0].path == "INTENT.md"
|
||||
|
||||
|
||||
def test_candidate_confidence_scoring_stays_conservative_for_weak_facts():
|
||||
repository = Repository(
|
||||
id=1,
|
||||
|
||||
Reference in New Issue
Block a user