generated from coulomb/repo-seed
improved scanner
This commit is contained in:
@@ -103,7 +103,10 @@ class CandidateGraphGenerator:
|
||||
capabilities.append(
|
||||
self._interface_capability(interfaces, tests, examples, docs, chunks)
|
||||
)
|
||||
if llm_providers or provider_registries or fallback_policies:
|
||||
promotable_llm_facts = self._promotable_llm_facts(
|
||||
llm_providers + provider_registries + fallback_policies
|
||||
)
|
||||
if promotable_llm_facts:
|
||||
capabilities.append(
|
||||
self._llm_provider_capability(
|
||||
llm_providers,
|
||||
@@ -269,6 +272,8 @@ class CandidateGraphGenerator:
|
||||
credentials,
|
||||
registries,
|
||||
fallback_policies,
|
||||
) + self._utility_relationship_attributes(
|
||||
providers + credentials + registries + fallback_policies
|
||||
),
|
||||
features=features,
|
||||
evidence=self._evidence(tests, examples, docs),
|
||||
@@ -761,6 +766,37 @@ class CandidateGraphGenerator:
|
||||
def _facts(self, facts: list[ObservedFact], kind: str) -> list[ObservedFact]:
|
||||
return [fact for fact in facts if fact.kind == kind]
|
||||
|
||||
def _promotable_llm_facts(self, facts: list[ObservedFact]) -> list[ObservedFact]:
|
||||
return [
|
||||
fact
|
||||
for fact in facts
|
||||
if self._utility_relationship(fact) in {"owned", "facade", "adapter"}
|
||||
]
|
||||
|
||||
def _utility_relationship(self, fact: ObservedFact) -> str:
|
||||
relationship = fact.metadata.get("utility_relationship")
|
||||
if isinstance(relationship, str) and relationship:
|
||||
return relationship
|
||||
source_role = fact.metadata.get("source_role")
|
||||
if source_role == "implementation_source":
|
||||
lower_path = fact.path.lower()
|
||||
if "adapter" in lower_path or "provider" in lower_path:
|
||||
return "adapter"
|
||||
return "owned"
|
||||
if source_role == "configuration":
|
||||
return "configure"
|
||||
if source_role == "dependency_declaration":
|
||||
return "dependency"
|
||||
if source_role in {"agent_guidance", "ci_tooling"}:
|
||||
return "tooling"
|
||||
if not source_role and fact.path.lower().endswith((".py", ".ts", ".js")):
|
||||
return "owned"
|
||||
return "mention"
|
||||
|
||||
def _utility_relationship_attributes(self, facts: list[ObservedFact]) -> list[str]:
|
||||
relationships = sorted({self._utility_relationship(fact) for fact in facts})
|
||||
return [f"utility-{relationship}" for relationship in relationships]
|
||||
|
||||
def _source_refs(self, facts: list[ObservedFact]) -> list[SourceReference]:
|
||||
return [
|
||||
SourceReference(
|
||||
|
||||
Reference in New Issue
Block a user