generated from coulomb/repo-seed
deterministic input/output hints for interface capabilities
This commit is contained in:
@@ -55,6 +55,8 @@ def test_candidate_generator_builds_review_seed_from_observed_facts():
|
||||
interface_capability = ability.capabilities[0]
|
||||
assert interface_capability.name == "Expose Repository Interface"
|
||||
assert interface_capability.confidence == 0.75
|
||||
assert interface_capability.inputs == ["HTTP request"]
|
||||
assert interface_capability.outputs == ["HTTP response"]
|
||||
assert interface_capability.features[0].type == "API"
|
||||
assert interface_capability.features[0].name == "POST /classify"
|
||||
assert interface_capability.features[0].location == "app.py"
|
||||
@@ -180,5 +182,29 @@ def test_candidate_generator_names_cli_features_from_nearby_function():
|
||||
graph = CandidateGraphGenerator().generate(repository, facts, chunks)
|
||||
|
||||
feature = graph[0].capabilities[0].features[0]
|
||||
capability = graph[0].capabilities[0]
|
||||
assert feature.type == "CLI"
|
||||
assert feature.name == "CLI command import_repositories"
|
||||
assert capability.inputs == ["CLI arguments"]
|
||||
assert capability.outputs == ["command output"]
|
||||
|
||||
|
||||
def test_candidate_generator_uses_generic_io_for_unknown_interfaces():
|
||||
repository = Repository(
|
||||
id=1,
|
||||
name="UnknownInterface",
|
||||
url="/tmp/unknown-interface",
|
||||
description=None,
|
||||
branch="main",
|
||||
status="analyzed",
|
||||
)
|
||||
facts = [
|
||||
fact(1, "documentation", "README", "README.md"),
|
||||
fact(2, "interface", "possible surface", "src/plugin.py"),
|
||||
]
|
||||
|
||||
graph = CandidateGraphGenerator().generate(repository, facts)
|
||||
|
||||
capability = graph[0].capabilities[0]
|
||||
assert capability.inputs == ["caller input"]
|
||||
assert capability.outputs == ["callable interface result"]
|
||||
|
||||
Reference in New Issue
Block a user