generated from coulomb/repo-seed
Add llm-assisted discovery extraction
This commit is contained in:
@@ -20,6 +20,7 @@ from .discovery import (
|
||||
short_fingerprint,
|
||||
source_fingerprint,
|
||||
)
|
||||
from .llm_extraction import LLMExtractionConfig, augment_snapshot_with_llm
|
||||
from .loader import declaration_files, load_yaml
|
||||
|
||||
|
||||
@@ -86,6 +87,8 @@ class ScanOptions:
|
||||
profile: str = "deterministic"
|
||||
deterministic_only: bool = True
|
||||
llm_enabled: bool = False
|
||||
llm_config: LLMExtractionConfig | None = None
|
||||
llm_adapter: object | None = None
|
||||
|
||||
|
||||
class CandidateAccumulator:
|
||||
@@ -287,7 +290,7 @@ def scan_repo(options: ScanOptions | Path, **overrides: object) -> dict[str, obj
|
||||
profile=normalize_identity_part(options.profile),
|
||||
fingerprint=short_fingerprint({"commit": commit, "path": str(repo_path)}),
|
||||
)
|
||||
return {
|
||||
snapshot = {
|
||||
"apiVersion": "railiance.fabric/v1alpha1",
|
||||
"kind": "FabricDiscoverySnapshot",
|
||||
"generated_at": now,
|
||||
@@ -316,6 +319,13 @@ def scan_repo(options: ScanOptions | Path, **overrides: object) -> dict[str, obj
|
||||
"retirement_policy": "missing candidates retire only inside their replacement scope",
|
||||
},
|
||||
}
|
||||
if options.llm_enabled:
|
||||
return augment_snapshot_with_llm(
|
||||
snapshot,
|
||||
config=options.llm_config,
|
||||
adapter=options.llm_adapter,
|
||||
)
|
||||
return snapshot
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
Reference in New Issue
Block a user