config

package
v0.0.0-...-6320ad3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Port                        int    `yaml:"port"`
	CodeGraph                   bool   `yaml:"codegraph"`
	WorkDir                     string `yaml:"workdir,omitempty"`
	GCThreshold                 int64  `yaml:"gc_threshold,omitempty"`
	NumFileThreads              int    `yaml:"num_file_threads,omitempty"`
	MaxConcurrentFileProcessing int    `yaml:"max_concurrent_file_processing,omitempty"`
	DebugHTTP                   bool   `yaml:"debug_http,omitempty"` // Log full request/response bodies
	LogLevel                    string `yaml:"log_level,omitempty"`  // debug, info, warn, error (default: info)
}

type BloomFilterConfig

type BloomFilterConfig struct {
	Enabled           bool    `yaml:"enabled"`
	StorageDir        string  `yaml:"storage_dir"`
	ExpectedItems     uint    `yaml:"expected_items"`
	FalsePositiveRate float64 `yaml:"false_positive_rate"`
}

type ChunkingConfig

type ChunkingConfig struct {
	MinConditionalLines int `yaml:"min_conditional_lines"`
	MinLoopLines        int `yaml:"min_loop_lines"`
}

type ChurnWeights

type ChurnWeights struct {
	LinesChanged float64 `yaml:"lines_changed"` // Default: 0.5
	CommitCount  float64 `yaml:"commit_count"`  // Default: 0.3
	AuthorCount  float64 `yaml:"author_count"`  // Default: 0.2
}

ChurnWeights holds the weights for churn score calculation

type CodeGraphConfig

type CodeGraphConfig struct {
	EnableBatchWrites bool `yaml:"enable_batch_writes"`
	BatchSize         int  `yaml:"batch_size"` // Number of nodes/relations to batch before writing
	PrintParseTree    bool `yaml:"print_parse_tree"`
}

type Config

type Config struct {
	Source          SourceConfig          `yaml:"source"`
	Neo4j           Neo4jConfig           `yaml:"neo4j"`
	Qdrant          QdrantConfig          `yaml:"qdrant"`
	Chunking        ChunkingConfig        `yaml:"chunking"`
	Ollama          OllamaConfig          `yaml:"ollama"`
	BloomFilter     BloomFilterConfig     `yaml:"bloom_filter"`
	IndexBuilding   IndexBuildingConfig   `yaml:"index_building"`
	MySQL           MySQLConfig           `yaml:"mysql"`
	CodeGraph       CodeGraphConfig       `yaml:"code_graph"`
	GitAnalysis     GitAnalysisConfig     `yaml:"git_analysis"`
	GitChurn        GitChurnConfig        `yaml:"git_churn"`
	Summary         SummaryConfig         `yaml:"summary"`
	LanguageServers LanguageServersConfig `yaml:"language_servers"`
	App             App                   `yaml:"app"`
}

func LoadConfig

func LoadConfig(appConfigPath string, sourceConfigPath string) (*Config, error)

func (*Config) GetRepository

func (c *Config) GetRepository(name string) (*Repository, error)

type GitAnalysisConfig

type GitAnalysisConfig struct {
	Enabled         bool            `yaml:"enabled"`
	Mode            GitAnalysisMode `yaml:"mode"`             // "ondemand" or "precompute"
	LookbackCommits int             `yaml:"lookback_commits"` // How many commits to analyze (default: 1000)
}

type GitAnalysisMode

type GitAnalysisMode string

GitAnalysisMode defines how git analysis is performed

const (
	GitAnalysisModeOnDemand   GitAnalysisMode = "ondemand"
	GitAnalysisModePrecompute GitAnalysisMode = "precompute"
)

type GitChurnConfig

type GitChurnConfig struct {
	// Enabled enables git churn analysis
	Enabled bool `yaml:"enabled"`

	// TimeWindowDays is the lookback period in days (default: 180)
	TimeWindowDays int `yaml:"time_window_days"`

	// EnableFileLevel enables file-level churn metrics (default: true)
	EnableFileLevel bool `yaml:"enable_file_level"`

	// EnableFunctionLevel enables function-level churn metrics (default: true)
	EnableFunctionLevel bool `yaml:"enable_function_level"`

	// Weights for churn score calculation
	Weights ChurnWeights `yaml:"weights"`

	// ExcludePatterns are glob patterns for files to exclude (e.g., "vendor/**", "**/*_test.go")
	ExcludePatterns []string `yaml:"exclude_patterns"`

	// ExcludeAuthors are author names to exclude (e.g., "dependabot[bot]")
	ExcludeAuthors []string `yaml:"exclude_authors"`

	// ExcludeMerges excludes merge commits from analysis (default: true)
	ExcludeMerges bool `yaml:"exclude_merges"`

	// MaxConcurrency is the maximum number of concurrent file processors (default: 4)
	MaxConcurrency int `yaml:"max_concurrency"`

	// FunctionChurnThreshold is the percentile threshold for function-level analysis
	// Only files in the top N% by churn will get function-level analysis (default: 10)
	FunctionChurnThreshold float64 `yaml:"function_churn_threshold"`
}

GitChurnConfig holds configuration for git churn analysis

func (*GitChurnConfig) GetDefaults

func (c *GitChurnConfig) GetDefaults() GitChurnConfig

GetDefaults returns GitChurnConfig with default values applied Note: TimeWindowDays = 0 means "all history" (no time limit)

type IndexBuildingConfig

type IndexBuildingConfig struct {
	EnableCodeGraph  bool `yaml:"enable_code_graph"`
	EnableEmbeddings bool `yaml:"enable_embeddings"`
	EnableSummary    bool `yaml:"enable_summary"`
}

type LanguageServersConfig

type LanguageServersConfig map[string]string

LanguageServersConfig holds paths to language server executables Keys are language names (e.g., "go", "python", "csharp"), values are paths to LSP executables

func (LanguageServersConfig) GetLSPPath

func (lsc LanguageServersConfig) GetLSPPath(language string) string

GetLSPPath returns the path to the language server for the given language Returns empty string if no LSP is configured for the language

type MySQLConfig

type MySQLConfig struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Database string `yaml:"database"`
}

type Neo4jConfig

type Neo4jConfig struct {
	URI      string `yaml:"uri"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type OllamaConfig

type OllamaConfig struct {
	URL       string `yaml:"url"`
	APIKey    string `yaml:"apikey"`
	Model     string `yaml:"model"`
	Dimension int    `yaml:"dimension"`
}

type QdrantConfig

type QdrantConfig struct {
	Host   string `yaml:"host"`
	Port   int    `yaml:"port"`
	APIKey string `yaml:"apikey"`
}

type Repository

type Repository struct {
	Name               string `yaml:"name"`
	Path               string `yaml:"path"`
	Test               string `yaml:"test,omitempty"`
	Language           string `yaml:"language"`
	Disabled           bool   `yaml:"disabled,omitempty"`
	SkipOtherLanguages bool   `yaml:"skip_other_languages,omitempty"`
}

type SourceConfig

type SourceConfig struct {
	Repositories []Repository `yaml:"repositories"`
}

type SummaryConfig

type SummaryConfig struct {
	LLMProvider  string `yaml:"llm_provider"`   // ollama, claude, openai
	LLMModel     string `yaml:"llm_model"`      // Model name (e.g., llama3.2, claude-3-5-haiku-20241022)
	PromptsFile  string `yaml:"prompts_file"`   // Path to prompts YAML config
	WorkerCount  int    `yaml:"worker_count"`   // Parallel workers for summarization
	BatchSize    int    `yaml:"batch_size"`     // Batch size for DB writes
	SkipIfExists bool   `yaml:"skip_if_exists"` // Skip if summary exists and context unchanged

	// Provider-specific
	OllamaURL     string `yaml:"ollama_url"`      // Ollama API URL
	ClaudeAPIKey  string `yaml:"claude_api_key"`  // Or use ANTHROPIC_API_KEY env var
	OpenAIAPIKey  string `yaml:"openai_api_key"`  // Or use OPENAI_API_KEY env var
	OpenAIBaseURL string `yaml:"openai_base_url"` // For API-compatible services
}

SummaryConfig holds configuration for hierarchical code summarization

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL