generated from coulomb/repo-seed
deterministic input/output hints for interface capabilities
This commit is contained in:
@@ -138,8 +138,8 @@ class CandidateGraphGenerator:
|
||||
return CandidateCapabilityDraft(
|
||||
name="Expose Repository Interface",
|
||||
description=self._interface_description(chunks),
|
||||
inputs=[],
|
||||
outputs=["callable interface"],
|
||||
inputs=self._interface_inputs(interfaces),
|
||||
outputs=self._interface_outputs(interfaces),
|
||||
confidence=self._interface_confidence(
|
||||
interfaces=interfaces,
|
||||
tests=tests,
|
||||
@@ -195,6 +195,28 @@ class CandidateGraphGenerator:
|
||||
return "API"
|
||||
return "interface"
|
||||
|
||||
def _interface_inputs(self, interfaces: list[ObservedFact]) -> list[str]:
|
||||
feature_types = {self._feature_type(fact) for fact in interfaces}
|
||||
inputs: list[str] = []
|
||||
if "API" in feature_types:
|
||||
inputs.append("HTTP request")
|
||||
if "CLI" in feature_types:
|
||||
inputs.append("CLI arguments")
|
||||
if not inputs:
|
||||
inputs.append("caller input")
|
||||
return inputs
|
||||
|
||||
def _interface_outputs(self, interfaces: list[ObservedFact]) -> list[str]:
|
||||
feature_types = {self._feature_type(fact) for fact in interfaces}
|
||||
outputs: list[str] = []
|
||||
if "API" in feature_types:
|
||||
outputs.append("HTTP response")
|
||||
if "CLI" in feature_types:
|
||||
outputs.append("command output")
|
||||
if not outputs:
|
||||
outputs.append("callable interface result")
|
||||
return outputs
|
||||
|
||||
def _feature_name(self, fact: ObservedFact, chunks: list[ContentChunk]) -> str:
|
||||
route_name = self._route_feature_name(fact.value)
|
||||
if route_name:
|
||||
|
||||
Reference in New Issue
Block a user