improved scanner

This commit is contained in:
2026-05-02 00:42:58 +02:00
parent 204a94c42c
commit 56bc86b2df
7 changed files with 162 additions and 9 deletions

View File

@@ -358,6 +358,10 @@ class DeterministicScanner:
source_role = self._source_role(relative)
if source_role == "agent_guidance":
continue
utility_relationship = self._provider_utility_relationship(
source_role,
relative,
)
for needle, provider in LLM_PROVIDER_HINTS.items():
if not self._has_provider_signal(lower_text, needle):
continue
@@ -372,6 +376,7 @@ class DeterministicScanner:
metadata={
"source": "provider_hint",
"source_role": source_role,
"utility_relationship": utility_relationship,
},
),
)
@@ -389,6 +394,7 @@ class DeterministicScanner:
metadata={
"source": "environment_variable",
"source_role": source_role,
"utility_relationship": "configure",
},
),
)
@@ -412,6 +418,7 @@ class DeterministicScanner:
metadata={
"source": "provider_registry_hint",
"source_role": source_role,
"utility_relationship": utility_relationship,
},
),
)
@@ -429,11 +436,30 @@ class DeterministicScanner:
metadata={
"source": "fallback_hint",
"source_role": source_role,
"utility_relationship": utility_relationship,
},
),
)
return facts
def _provider_utility_relationship(
self,
source_role: str,
relative_path: str,
) -> str:
if source_role == "implementation_source":
lower = relative_path.lower()
if "adapter" in lower or "provider" in lower:
return "adapter"
return "owned"
if source_role == "configuration":
return "configure"
if source_role == "dependency_declaration":
return "dependency"
if source_role in {"ci_tooling", "agent_guidance"}:
return "tooling"
return "mention"
def _source_role(self, relative_path: str) -> str:
lower = relative_path.lower()
parts = lower.split("/")