generated from coulomb/repo-seed
Fix rerun assessment and candidate extraction
This commit is contained in:
@@ -135,6 +135,85 @@ 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_preserves_unicode_and_normalizes_analysis_names():
|
||||
repository = Repository(
|
||||
id=1,
|
||||
name="VergabeTeilnahme",
|
||||
url="/tmp/vergabe-teilnahme",
|
||||
description=None,
|
||||
branch="main",
|
||||
status="analyzed",
|
||||
)
|
||||
facts = [
|
||||
fact(
|
||||
1,
|
||||
"intent",
|
||||
"INTENT",
|
||||
"INTENT.md",
|
||||
metadata={"source_role": "intent_summary"},
|
||||
)
|
||||
]
|
||||
chunks = [
|
||||
chunk(
|
||||
1,
|
||||
"intent",
|
||||
"INTENT.md",
|
||||
"# INTENT\n\n"
|
||||
"Vollständiger Implementierungsplan in 12 Ralph-Loop-Workplans.\n\n"
|
||||
"## Intended Capabilities\n\n"
|
||||
"- Analysis of impact risk and dependency chains.\n",
|
||||
)
|
||||
]
|
||||
|
||||
graph = CandidateGraphGenerator().generate(repository, facts, chunks)
|
||||
|
||||
assert graph[0].name == "Vollständiger Implementierungsplan In 12 Ralph-Loop-Workplans"
|
||||
assert graph[0].capabilities[0].name == "Analyze Impact Risk And Dependency Chains"
|
||||
|
||||
|
||||
def test_candidate_generator_extracts_primary_outcome_subsections_from_intent():
|
||||
repository = Repository(
|
||||
id=1,
|
||||
name="HelixForge",
|
||||
url="/tmp/helix-forge",
|
||||
description=None,
|
||||
branch="main",
|
||||
status="analyzed",
|
||||
)
|
||||
facts = [
|
||||
fact(
|
||||
1,
|
||||
"intent",
|
||||
"INTENT",
|
||||
"INTENT.md",
|
||||
metadata={"source_role": "intent_summary"},
|
||||
)
|
||||
]
|
||||
chunks = [
|
||||
chunk(
|
||||
1,
|
||||
"intent",
|
||||
"INTENT.md",
|
||||
"# INTENT\n\n"
|
||||
"HelixForge turns intent into structure.\n\n"
|
||||
"## 4\\. Primary outcomes\n\n"
|
||||
"### 4.1 Capability discovery\n\n"
|
||||
"Clarify scope and ownership.\n\n"
|
||||
"### 4.2 Capability validation\n\n"
|
||||
"Validate architecture descriptions structurally and semantically.\n\n"
|
||||
"## Architectural foundation\n\n"
|
||||
"This section should not become a capability.\n",
|
||||
)
|
||||
]
|
||||
|
||||
graph = CandidateGraphGenerator().generate(repository, facts, chunks)
|
||||
|
||||
capability_names = {capability.name for capability in graph[0].capabilities}
|
||||
assert "Support Capability Discovery" in capability_names
|
||||
assert "Validate Capabilities" in capability_names
|
||||
assert "Architectural Foundation" not in capability_names
|
||||
|
||||
|
||||
def test_candidate_generator_prefers_intent_over_derived_scope_for_ability_name():
|
||||
repository = Repository(
|
||||
id=1,
|
||||
@@ -238,7 +317,7 @@ def test_candidate_generator_extracts_current_capabilities_from_scope_blocks():
|
||||
"scope",
|
||||
"SCOPE.md",
|
||||
"# SCOPE\n\n## One-liner\n"
|
||||
"S5 Workloads and Experience layer of the Railiance OAS Stack.\n\n"
|
||||
"S5 Workloads and Experience layer of the Railiance OAS Stack -- owns applications.\n\n"
|
||||
"## Provided Capabilities\n\n"
|
||||
"```capability\n"
|
||||
"type: infrastructure\n"
|
||||
@@ -255,6 +334,7 @@ def test_candidate_generator_extracts_current_capabilities_from_scope_blocks():
|
||||
|
||||
ability = graph[0]
|
||||
assert ability.name == "S5 Workloads And Experience Layer Of The Railiance OAS Stack"
|
||||
assert ability.name == "S5 Workloads And Experience Layer Of The Railiance OAS Stack"
|
||||
capability = ability.capabilities[0]
|
||||
assert capability.name == "Application workload deployment"
|
||||
assert capability.primary_class == "infrastructure"
|
||||
|
||||
Reference in New Issue
Block a user