Versions in this module Expand all Collapse all v0 v0.1.0 Jun 20, 2026 Changes in this version + const DefaultContextLimitBytes + const DefaultContextPackBudgetBytes + const DefaultMaxIndexFileBytes + const DefaultMaxKnowledgeContentBytes + const DefaultProjectConfigTOML + const MaxContextPackBudgetBytes + const MinContextPackBudgetBytes + var DBPath string + func AddFeedback(db *sql.DB, userInput, botResponse string) (bool, error) + func AddKnowledge(db *sql.DB, language, topic, content string) error + func AddKnowledgeContent(db *sql.DB, language, topic, path string, content []byte, maxContentBytes int, ...) (int, error) + func AddKnowledgeEntry(db *sql.DB, entry KnowledgeEntry) (bool, error) + func CalculateQND(comp Compressor, prompt string, content string) float64 + func CalculateQNDWithPromptSize(comp Compressor, prompt string, content string, promptCompressedSize int) float64 + func CanCheckCompilation(filename string) bool + func CheckCompilation(code string, filename string) (bool, bool) + func DBFilePath(dir string) string + func DetectLanguage(prompt string) string + func DetectNegativeFeedback(input string) string + func ExpandQueryForPackMode(query, mode string) string + func IndexDirectory(db *sql.DB, root string, filter LanguageFilter) (int, error) + func IndexDirectoryWithOptions(db *sql.DB, root string, filter LanguageFilter, options IndexOptions) (int, error) + func IndexFileWithOptions(db *sql.DB, root, path string, filter LanguageFilter, options IndexOptions) (int, error) + func IndexFilesWithOptions(db *sql.DB, root string, paths []string, filter LanguageFilter, ...) (int, error) + func InitDB(dir string) (*sql.DB, error) + func LanguageFromPath(path string) string + func LoadSnapZipIgnore(root string) ([]string, error) + func NormalizeLanguage(value string) string + func ProjectConfigPath(root string) string + func RenderContextPack(pack ContextPack) string + func RenderDependencyGraph(graph DependencyGraph) string + func RenderImportContext(context ImportContext) string + func RenderRepoMap(repoMap RepoMap) string + func RenderSearchResult(result SearchResult) string + func RenderSymbolContext(context SymbolContext) string + func ReplaceImportsForFile(db *sql.DB, language, path string, content []byte) error + func ReplaceSymbolReferencesForFile(db *sql.DB, language, path string, content []byte) error + func ReplaceSymbolsForFile(db *sql.DB, language, path string, content []byte) error + func ResetDB(dir string) error + func ResolveImportTargets(db *sql.DB) error + func VerifyCompilation(code string, filename string) bool + func WriteDefaultProjectConfig(root string, force bool) (string, bool, error) + type AffectedFile struct + Confidence float64 + Language string + Path string + Reasons []string + type AffectedReport struct + InputPaths []string + Related []AffectedFile + Tests []AffectedFile + func FindAffectedTests(db *sql.DB, paths []string, limit int) (AffectedReport, error) + type BCAConfig struct + MaxIterations int + PriorWeight float64 + Temperature float64 + type BCAOptimizer struct + func NewBCAOptimizer(cfg BCAConfig, dictBytes []byte, vocab []string) (*BCAOptimizer, error) + func (o *BCAOptimizer) CompressDraft(draft []byte) int + func (o *BCAOptimizer) Mutate(draft []byte, r *rand.Rand) []byte + func (o *BCAOptimizer) Optimize(seedCode string, filename string) string + func (o *BCAOptimizer) PriorScore(draft []byte) float64 + type Compressor interface + Compress func(data []byte) int + Name func() string + type ContextBundle struct + Data []byte + FileCount int + Vocabulary []string + func LoadContextDirectory(root string, filter LanguageFilter, maxBytes int) (ContextBundle, error) + type ContextPack struct + BudgetBytes int + ExpandedQuery string + Feedback []Feedback + Mode string + Quality ContextQuality + Query string + Receipts []ContextReceipt + Snippets []Snippet + Truncated bool + UsedBytes int + func BuildContextPack(db *sql.DB, comp Compressor, query string, limit int, budgetBytes int, ...) (ContextPack, error) + func BuildContextPackWithMode(db *sql.DB, comp Compressor, query, mode string, limit int, budgetBytes int, ...) (ContextPack, error) + func BuildRepairContextPack(db *sql.DB, comp Compressor, failureOutput, extraQuery, mode string, limit int, ...) (ContextPack, error) + type ContextQuality struct + Grade string + Metrics ContextQualityMetrics + Score float64 + Strengths []string + Summary string + Warnings []string + func ScoreContextPack(pack ContextPack) ContextQuality + type ContextQualityMetrics struct + BudgetUtilization float64 + DefinitionCount int + DependencySnippetCount int + DuplicatePathCount int + EvidenceCount int + EvidenceDensity float64 + FeedbackCount int + ReceiptCount int + ReceiptCoverage float64 + ReferenceCount int + SnippetCount int + SourceSnippetCount int + TestSnippetCount int + Truncated bool + UniquePathCount int + UniquePathRatio float64 + type ContextReceipt struct + Confidence float64 + EndLine int + Evidence []string + Language string + Path string + Rank int + Reasons []string + Score float64 + StartLine int + Topic string + type DatabaseStats struct + FeedbackRows int + ImportRows int + KnowledgeRows int + Languages []LanguageStat + SymbolReferenceRows int + SymbolRows int + func GetDatabaseStats(db *sql.DB) (DatabaseStats, error) + type DependencyGraph struct + ImportedBy []ImportReference + Imports []ImportReference + Language string + Path string + func BuildDependencyGraph(db *sql.DB, path string, limit int) (DependencyGraph, error) + type FailureAnalysis struct + FileRefs []FailureFileRef + Identifiers []string + Query string + Symbols []string + func AnalyzeFailureOutput(output, extra string) FailureAnalysis + type FailureFileRef struct + Function string + Line int + Path string + type Feedback struct + BotResponse string + CreatedAt string + ID int + Sentiment string + UserInput string + func RetrieveNegativeFeedback(db *sql.DB, limit int) ([]Feedback, error) + type ImportContext struct + Imports []ImportReference + Query string + func BuildImportContext(db *sql.DB, query string, limit int) (ImportContext, error) + type ImportReference struct + Alias string + Context string + ID int + ImportPath string + Language string + Line int + Path string + TargetPath string + func ExtractImports(language, path, content string) []ImportReference + func SearchImports(db *sql.DB, query string, limit int) ([]ImportReference, error) + type IndexOptions struct + IgnorePatterns []string + MaxContentBytes int + MaxFileBytes int64 + SkipDirs map[string]bool + SkipFiles map[string]bool + func DefaultIndexOptions() IndexOptions + type KnowledgeEntry struct + Content string + ContentHash string + EndLine int + Language string + Path string + SourceMTime int64 + StartLine int + Topic string + type LanguageFilter struct + func NewLanguageFilter(input string) LanguageFilter + func (f LanguageFilter) Description() string + func (f LanguageFilter) Matches(language string) bool + type LanguageStat struct + Count int + Language string + type ProjectConfig struct + Found bool + Path string + Validation ProjectValidationConfig + func LoadProjectConfig(root string) (ProjectConfig, error) + func ParseProjectConfig(content string) (ProjectConfig, error) + type ProjectValidationConfig struct + Command string + Commands map[string]string + type RepoMap struct + Files []RepoMapFile + func BuildRepoMap(db *sql.DB, limit int) (RepoMap, error) + type RepoMapFile struct + Language string + Path string + Symbols []Symbol + func RelatedFiles(db *sql.DB, path string, limit int) ([]RepoMapFile, error) + type SearchResult struct + ExpandedQuery string + Feedback []Feedback + Mode string + Query string + Receipts []ContextReceipt + Snippets []Snippet + func SearchMemory(db *sql.DB, comp Compressor, query string, limit int, feedbackLimit int) (SearchResult, error) + func SearchMemoryWithMode(db *sql.DB, comp Compressor, query, mode string, limit int, feedbackLimit int) (SearchResult, error) + type Snippet struct + Content string + ContentHash string + EndLine int + ID int + Language string + Path string + Score float64 + SourceMTime int64 + StartLine int + Topic string + func RetrieveSimilarSnippets(db *sql.DB, comp Compressor, prompt string, limit int) ([]Snippet, error) + type SuggestedValidationCommand struct + Command string + Confidence float64 + Reason string + func ConfiguredValidationCommands(config ProjectConfig, report AffectedReport) []SuggestedValidationCommand + func MergeValidationCommands(groups ...[]SuggestedValidationCommand) []SuggestedValidationCommand + func SuggestValidationCommands(report AffectedReport) []SuggestedValidationCommand + type Symbol struct + ID int + Kind string + Language string + Line int + Name string + Path string + Signature string + func ExtractSymbols(language, path, content string) []Symbol + func SearchSymbols(db *sql.DB, query string, limit int) ([]Symbol, error) + type SymbolContext struct + Definitions []Symbol + Query string + References []SymbolReference + func BuildSymbolContext(db *sql.DB, query string, limit int) (SymbolContext, error) + type SymbolReference struct + Context string + ID int + Language string + Line int + Name string + Path string + func ExtractSymbolReferences(language, path, content string) []SymbolReference + func SearchSymbolReferences(db *sql.DB, query string, limit int) ([]SymbolReference, error) + type ValidationPlan struct + Affected AffectedReport + InputPaths []string + SuggestedCommands []SuggestedValidationCommand + func BuildValidationPlan(db *sql.DB, paths []string, limit int) (ValidationPlan, error) + type ZlibCompressor struct + func (zc ZlibCompressor) Compress(data []byte) int + func (zc ZlibCompressor) Name() string + type ZstdCompressor struct + func NewZstdCompressor(level zstd.EncoderLevel) (*ZstdCompressor, error) + func (zc *ZstdCompressor) Compress(data []byte) int + func (zc *ZstdCompressor) Name() string