"""
Schema-Guided Reasoning (SGR) module for semantic code search.
This module provides structured schemas that guide LLM reasoning
through predefined steps, ensuring consistent and predictable output.
Pipeline:
Step 0: RepoContext - understand repository structure, language, framework
Step 1: QuestionAnalysis - extract concepts from the question
Step 2: TechnicalTerms - map concepts to actual code identifiers
Step 3: SearchPlan - create search actions
Step 4: SearchResultInterpretation - analyze results
Step 5: FinalAnswer - produce response
"""
from .schemas import (
# Step 0: Repository Context
RepoContext,
# Step 1: Question Analysis
QuestionAnalysis,
# Step 2: Technical Terms
TechnicalTerm,
TechnicalTerms,
# Step 3: Search Planning - Typed Actions (NEW - PREFERRED)
BaseSearchAction,
GrepAction,
ReadFileAction,
ListDirAction,
GlobSearchAction,
TypedSearchAction,
TypedSearchPlan,
# Step 3: Search Planning - Legacy (backward compatibility)
SearchAction,
SearchPlan,
# Step 4: Result Interpretation
SearchResultInterpretation,
# Step 5: Final Answer
CodeLocation,
FinalAnswer,
# Full Process
SearchIteration,
CodeSearchProcess,
# Next Action Decision
NextActionDecision,
# Tool Results (improved type hints)
GrepMatch,
GrepResult,
ReadFileResult,
ListDirResult,
GlobSearchResult,
ToolResult,
)
from . import prompts
# Validation and filtering
from .path_validator import PathValidator, PathValidationResult
from .pattern_validator import PatternValidator, PatternValidation
__all__ = [
# Schemas
"RepoContext",
"QuestionAnalysis",
"TechnicalTerm",
"TechnicalTerms",
# Typed Actions (NEW - PREFERRED)
"BaseSearchAction",
"GrepAction",
"ReadFileAction",
"ListDirAction",
"GlobSearchAction",
"TypedSearchAction",
"TypedSearchPlan",
# Legacy Actions (backward compatibility)
"SearchAction",
"SearchPlan",
"SearchResultInterpretation",
"CodeLocation",
"FinalAnswer",
"SearchIteration",
"CodeSearchProcess",
"NextActionDecision",
# Tool Results
"GrepMatch",
"GrepResult",
"ReadFileResult",
"ListDirResult",
"GlobSearchResult",
"ToolResult",
# Prompts module
"prompts",
# Validation and filtering
"PathValidator",
"PathValidationResult",
"PatternValidator",
"PatternValidation",
]