Versions in this module Expand all Collapse all v1 v1.2.1 Jun 14, 2026 v1.2.0 Jun 5, 2026 Changes in this version + var PPool = &parserPool + func GetParser(lang *gotreesitter.Language) *gotreesitter.Parser + func PutParser(lang *gotreesitter.Language, parser *gotreesitter.Parser) type IntelligenceService + AuditArchitecture func(ctx context.Context, targetPath string) ([]types.ASTRuleMatch, error) type TruthEngine + func (e *TruthEngine) AuditArchitecture(ctx context.Context, targetPath string) ([]types.ASTRuleMatch, error) v1.1.0 Jun 4, 2026 Changes in this version + type DiscoveryService interface + FindLogicalTwins func(ctx context.Context, symbolName, path string) ([]types.Symbol, error) + GetNeighborhood func(ctx context.Context, filePath string) (string, error) + HybridSearch func(ctx context.Context, query string, limit, offset int) (*types.HybridSearchResult, error) + type EvolutionService interface + CommitLedger func(ctx context.Context) (string, error) + GetLedgerDiff func(ctx context.Context) (string, error) + GetLedgerSummary func(ctx context.Context) string + Propagate func(ctx context.Context, symbol, transformation string, messenger Messenger) (string, error) + RollbackLedger func(ctx context.Context) (string, error) + StageMutation func(ctx context.Context, filePath, newContent string) error + type HealerService interface + DiagnoseHUD func(ctx context.Context, errorLog string) (*DiagnosticHUD, error) + Fix func(ctx context.Context, errorLog string, messenger Messenger) (string, error) + type IndexerConfig struct + ASTRules *ASTRuleEngine + Analyzer *AnalysisEngine + Logger *slog.Logger + Search *SearchEngine + Semantic *SemanticEngine + Store store.Store + type IndexerPipeline struct + func NewIndexerPipeline(cfg IndexerConfig) *IndexerPipeline + func (ip *IndexerPipeline) Run(ctx context.Context, path string) error + type IndexerService interface + Index func(ctx context.Context, path string) error + type IntelligenceService interface + AnalyzeImpact func(ctx context.Context, symbol, path string, verbose bool, messenger Messenger) (*types.ImpactResult, error) + GetCriticalSymbols func(ctx context.Context, limit int) ([]store.CriticalSymbol, error) + PredictTests func(ctx context.Context, diff string) ([]types.TestTarget, error) + type SDDService interface + GetSDDRoadmap func(ctx context.Context) (*SDDRoadmap, error) + GetSDDTasks func(ctx context.Context) ([]SDDTask, error) + SearchSDDSpecs func(ctx context.Context, query string, limit, offset int) ([]SpecResult, error) type TruthEngine + func (e *TruthEngine) DiagnoseHUD(ctx context.Context, errorLog string) (*DiagnosticHUD, error) v1.0.0 Jun 3, 2026 Changes in this version + const MaxFragmentSize + const MaxParseSize + var BlockedDirs = map[string]bool + var ErrEmptySource = errors.New("source file is empty") + var SupportedExts = map[string]bool + func AnalyzeInterfaceImplementations(prog *ssa.Program) map[string][]string + func AnonymizeNode(node *gotreesitter.Node, source []byte, lang *gotreesitter.Language, ...) string + func ApplyPipeline(ctx context.Context, f *filter.Filter, input string, ...) (string, error) + func BatchLoadPackages(dir string) (map[string]*ParsedPackageData, error) + func EncodeZON(slice interface{}) (string, error) + func EncodeZONImpact(res *types.ImpactResult) string + func EncodeZONLSPHover(hover *lsp.Hover) (string, error) + func EncodeZONLSPLocation(locs []lsp.Location) (string, error) + func EncodeZONNeighborhood(filePath string, imports []string, exports []store.Symbol, calls []store.Call) string + func EncodeZONPredict(tests []types.TestTarget) string + func EncodeZONVerify(diff *ChronosDiff) string + func ExtractImports(ctx context.Context, filePath string) ([]string, error) + func GetLogicHash(node *gotreesitter.Node, source []byte, lang *gotreesitter.Language) string + func GetStructuralHash(node *gotreesitter.Node, source []byte, lang *gotreesitter.Language) string + func ParseFile(ctx context.Context, filePath string, lspMgr *lsp.Manager) ([]types.ASTPointer, []types.ASTCall, []types.DataFlow, error) + func ParseGoMod(ctx context.Context, filePath string) ([]types.Dependency, error) + func ParsePackageJSON(ctx context.Context, filePath string) ([]types.Dependency, error) + func Passthrough(ctx context.Context, command string, args []string) (int, error) + func ReadFragment(ctx context.Context, filePath string, r types.Range) (string, error) + func SSACallGraph(ctx context.Context, dir string) ([]types.ASTCall, error) + func StreamSymbols(ctx context.Context, filePath string) (iter.Seq[types.ASTPointer], iter.Seq[types.ASTCall], iter.Seq[types.DataFlow], ...) + func StreamSymbolsFromAST(ctx context.Context, fset *token.FileSet, astFile *ast.File, ...) (iter.Seq[types.ASTPointer], iter.Seq[types.ASTCall], iter.Seq[types.DataFlow], ...) + func StreamWithTreeSitter(ctx context.Context, filePath string) (iter.Seq[types.ASTPointer], iter.Seq[types.ASTCall], iter.Seq[types.DataFlow], ...) + func StructuralRefactor(ctx context.Context, filePath, pattern, template, ext string) (string, error) + type ASTRuleEngine struct + func NewASTRuleEngine(rulesDir string) *ASTRuleEngine + func (e *ASTRuleEngine) Audit(ctx context.Context, targetPath string) ([]types.ASTRuleMatch, error) + func (e *ASTRuleEngine) GetRules() ([]string, error) + type AnalysisEngine struct + ProjectRoot string + func NewAnalysisEngine(store AnalysisStore) *AnalysisEngine + func (a *AnalysisEngine) BuildTypeUniverse() (map[string]*types.Package, error) + func (a *AnalysisEngine) GetCriticalSymbols(ctx context.Context, limit int) ([]store.CriticalSymbol, error) + func (a *AnalysisEngine) GetNeighborhood(ctx context.Context, filePath string) (string, error) + func (a *AnalysisEngine) ResolveCentrality(ctx context.Context) error + func (a *AnalysisEngine) ResolveInterfaces(ctx context.Context) error + func (a *AnalysisEngine) ResolvePagerank(ctx context.Context, opts ...PagerankOption) error + type AnalysisStore interface + type AnalyzeOption func(*AnalyzeOptions) + func WithSSA(targetPkg, varName string) AnalyzeOption + type AnalyzeOptions struct + SSATargetPkg string + SSAVarName string + UseSSA bool + type BFSPropagationStrategy struct + ImpactEngine ImpactAnalyzer + func NewBFSPropagationStrategy(s GraphStore, ie ImpactAnalyzer) *BFSPropagationStrategy + func (s *BFSPropagationStrategy) Discover(ctx context.Context, startSymbol string, maxDepth int) iter.Seq2[PropagationTask, error] + type BuildValidator struct + func (v *BuildValidator) Validate(ctx context.Context, ledger *Ledger) (ValidationResult, error) + type CentralityValidator struct + func NewCentralityValidator(a *AnalysisEngine) *CentralityValidator + func (v *CentralityValidator) Validate(ctx context.Context, ledger *Ledger) (ValidationResult, error) + type ChronosDiff struct + AddedSymbols []string + MangledSymbols []string + MissingSymbols []string + Unchanged int + type ChronosEngine struct + func NewChronosEngine() *ChronosEngine + func (e *ChronosEngine) CompareSnapshot(ctx context.Context, snapshot *ChronosSnapshot, currentFilePath string) (*ChronosDiff, error) + func (e *ChronosEngine) TakeSnapshot(ctx context.Context, filePath string) (*ChronosSnapshot, error) + type ChronosSnapshot struct + FilePath string + ID string + Symbols map[string]types.ASTPointer + Timestamp time.Time + type ChurnEngine struct + func NewChurnEngine(s ChurnStore) *ChurnEngine + func (e *ChurnEngine) AnalyzeChurn(ctx context.Context, repoPath string, commitLimit int) error + type ChurnStore interface + type CompactionEngine struct + Ledger *Ledger + func NewCompactionEngine(s store.Store, l *Ledger) *CompactionEngine + func (e *CompactionEngine) CompactSession(ctx context.Context, truthKernel string) (*types.CompactionResult, error) + func (e *CompactionEngine) CreateBoundary(ctx context.Context, truthKernel string) (*SovereignBoundary, error) + func (e *CompactionEngine) PruneHistory(toolResults []string) []string + type DiagnosticEngine struct + func NewDiagnosticEngine(s store.DiagnosticStore, a *AnalysisEngine, i *ImpactEngine, h *HealerEngine, ...) *DiagnosticEngine + func (e *DiagnosticEngine) AssessRisk(ctx context.Context, symbol, path string) (*RiskAssessment, error) + func (e *DiagnosticEngine) Diagnose(ctx context.Context, errorLog string) (*DiagnosticReport, error) + func (e *DiagnosticEngine) Heal(ctx context.Context, report *DiagnosticReport, messenger Messenger) (*types.HealResult, error) + type DiagnosticHUD struct + BlastRadius int + FailingSymbol string + LastCommit string + RiskLevel string + RiskScore float64 + SimilarPatternPath string + type DiagnosticProvider interface + AssessRisk func(ctx context.Context, symbol, path string) (*RiskAssessment, error) + Diagnose func(ctx context.Context, errorLog string) (*DiagnosticReport, error) + Heal func(ctx context.Context, report *DiagnosticReport, messenger Messenger) (*types.HealResult, error) + type DiagnosticReport struct + Context string + ErrorLog string + FailingFile string + FailingSymbol string + Insights []string + Line int + Risk *types.ImpactResult + type Enricher struct + func NewEnricher(s EnricherStore, lp LSPProvider) *Enricher + func (e *Enricher) Enrich(ctx context.Context) error + type EnricherStore interface + type GraphStore interface + type HealerEngine struct + DoFixRequest func(ctx context.Context, prompt string) (string, error) + Ledger *Ledger + Search *SearchEngine + func NewHealerEngine(s TransactionalStore, l *lsp.Manager, a *AnalysisEngine, i *ImpactEngine, ...) *HealerEngine + func (e *HealerEngine) DiagnoseHUD(ctx context.Context, errorLog string) (*DiagnosticHUD, error) + func (e *HealerEngine) Fix(ctx context.Context, errorLog string) (*types.HealResult, error) + func (e *HealerEngine) Index(ctx context.Context, path string) error + type HealthEngine struct + func NewHealthEngine(store TestResultStore) *HealthEngine + func (h *HealthEngine) Ingest(ctx context.Context, r io.Reader) error + type HybridSearcher struct + func NewHybridSearcher() (*HybridSearcher, error) + func (s *HybridSearcher) IndexSymbol(id string, data map[string]interface{}) error + func (s *HybridSearcher) SearchBM25(queryStr string, limit int) (*bleve.SearchResult, error) + type ImpactAnalyzer interface + GetDeterministicCallers func(ctx context.Context, symbolName string) ([]store.Call, error) + type ImpactEngine struct + LSPManager *lsp.Manager + func NewImpactEngine(s GraphStore, lm *lsp.Manager, mem memory.MemoryProvider) *ImpactEngine + func (e *ImpactEngine) Analyze(ctx context.Context, symbol string, path string, maxDepth int, ...) (*types.ImpactResult, error) + func (e *ImpactEngine) GetDeterministicCallers(ctx context.Context, symbolName string) ([]store.Call, error) + func (e *ImpactEngine) IdentifyCriticalContext(ctx context.Context, diff string) ([]types.ImpactEntity, error) + func (e *ImpactEngine) PredictTests(ctx context.Context, diff string) ([]types.TestTarget, error) + type LSPProvider interface + GetClient func(ctx context.Context, filePath string) (lsp.LSPClient, error) + type LSPValidator struct + ProjectRoot string + func NewLSPValidator(root string) *LSPValidator + func (v *LSPValidator) Validate(ctx context.Context, ledger *Ledger) (ValidationResult, error) + type LanguageConfig struct + CallQuery *gotreesitter.Query + FlowQuery *gotreesitter.Query + ImportQuery *gotreesitter.Query + Language *gotreesitter.Language + Query *gotreesitter.Query + type Ledger struct + KiLimit int64 + Project string + Staged map[string]Patch + Stats MissionStats + TurnLimit int + func NewLedger() *Ledger + func (l *Ledger) AffectedFiles() []string + func (l *Ledger) CommitStaged(ctx context.Context) error + func (l *Ledger) GetStaged() []Patch + func (l *Ledger) IncrementTurn() + func (l *Ledger) Load() error + func (l *Ledger) Rollback(ctx context.Context) error + func (l *Ledger) Save() error + func (l *Ledger) SetBudget(kiLimit int64, turnLimit int) + func (l *Ledger) SetLedgerPath(path string) + func (l *Ledger) Stage(path string, patch Patch) error + func (l *Ledger) StagedFiles() []string + func (l *Ledger) Summary() string + func (l *Ledger) Unstage(path string) + type LineProvenance struct + Author string + Commit string + EngineeringEra string + Line int + func GetFileProvenance(ctx context.Context, repoPath, filePath string) ([]LineProvenance, error) + type Linker struct + func NewLinker(logger *slog.Logger) *Linker + func (l *Linker) LinkInterfaces(ctx context.Context, repo store.Store, lspMgr *lsp.Manager) error + type LocalFileResolver struct + func (r *LocalFileResolver) ResolveSource(ctx context.Context, file string, line int) (string, error) + type MCPTransformer struct + DoTransform func(ctx context.Context, file, symbol, transformation string) (string, error) + func NewMCPTransformer(s GraphStore, ...) *MCPTransformer + func (t *MCPTransformer) Transform(ctx context.Context, file, symbol, transformation string) (string, error) + type Messenger interface + Ask func(ctx context.Context, systemPrompt string, userPrompt string) (string, error) + type MissionStats struct + FilesCount int + StartTime time.Time + TotalKi int64 + TurnCount int + type PagerankOption func(*PagerankOptions) + func WithTaskSeeds(seeds []string) PagerankOption + type PagerankOptions struct + TaskSeeds []string + type ParsedPackageData struct + File *ast.File + Fset *token.FileSet + Pkg *packages.Package + type Patch struct + Diff string + FilePath string + NewContent string + Original string + type Pipeline struct + Enrich bool + GainLevel int + LSPManager *lsp.Manager + Registry *filter.Registry + TeeConfig tee.Config + Tracker *telemetry.Tracker + UltraCompact bool + Verbose int + func (p *Pipeline) PassiveHealthIngest(ctx context.Context, output string) + func (p *Pipeline) Passthrough(ctx context.Context, command string, args []string) int + func (p *Pipeline) Run(ctx context.Context, command string, args []string) int + func (p *Pipeline) ShadowIndex(ctx context.Context) + type PropagationStrategy interface + Discover func(ctx context.Context, startSymbol string, depth int) iter.Seq2[PropagationTask, error] + type PropagationTask struct + Action string + FilePath string + ImpactedSymbol string + SymbolName string + type Result struct + Duration time.Duration + ExitCode int + Stderr string + Stdout string + func Execute(ctx context.Context, command string, args []string) (*Result, error) + type RippleEngine struct + ImpactEngine ImpactAnalyzer + Strategy PropagationStrategy + Transformer Transformer + Validators []Validator + func NewRippleEngine(s GraphStore, t Transformer, ie ImpactAnalyzer) *RippleEngine + func (e *RippleEngine) Propagate(ctx context.Context, symbolName string, transformation string, maxDepth int) (*Ledger, error) + type RiskAssessment struct + Callers int + Centrality int + Path string + RiskLevel string + RiskScore float64 + Symbol string + type SDDEngine struct + func NewSDDEngine(rootDir string) *SDDEngine + func (e *SDDEngine) ParseRoadmap(ctx context.Context) (*SDDRoadmap, error) + func (e *SDDEngine) ParseTasks(ctx context.Context) ([]SDDTask, error) + func (e *SDDEngine) SearchSpecs(ctx context.Context, query string, limit, offset int) ([]SpecResult, error) + type SDDRoadmap struct + ActiveChanges []string + Phase string + Trajectory []string + type SDDTask struct + Completed bool + Title string + type SearchEngine struct + Bleve *HybridSearcher + func NewSearchEngine(s store.SymbolRegistry, m memory.MemoryProvider) *SearchEngine + func (e *SearchEngine) HybridSearch(ctx context.Context, query string, limit, offset int) (*types.HybridSearchResult, error) + func (e *SearchEngine) IndexSymbol(docID string, data map[string]interface{}) error + type SemanticEngine struct + func (s *SemanticEngine) GenerateEmbedding(ctx context.Context, text string) ([]float32, error) + func (s *SemanticEngine) Init(ctx context.Context, modelPath string) error + type SovereignBoundary struct + Budget MissionStats + ID string + StagingArea map[string]Patch + Timestamp string + TruthKernel string + type SpecResult struct + Content string + Path string + type StructuralMatch struct + Captures map[string]string + Content string + EndLine int + Path string + Range types.Range + StartLine int + func StructuralSearch(ctx context.Context, rootPath, pattern, ext string) ([]StructuralMatch, error) + func StructuralSearchWithRule(ctx context.Context, rootPath string, rule types.StructuralRule, ext string) ([]StructuralMatch, error) + type StructuralTransformer struct + Pattern string + func (t *StructuralTransformer) Transform(ctx context.Context, file, symbol, transformation string) (string, error) + type TestResultStore interface + SaveTestResult func(ctx context.Context, res *types.TestResult) error + type TestValidator struct + SpecificTests []string + func (v *TestValidator) Validate(ctx context.Context, ledger *Ledger) (ValidationResult, error) + type TransactionalStore interface + type Transformer interface + Transform func(ctx context.Context, file string, symbolName string, transformation string) (string, error) + type TruthEngine struct + func NewTruthEngine(store store.Store, opts ...TruthOption) *TruthEngine + func (e *TruthEngine) AnalyzeImpact(ctx context.Context, symbol, path string, verbose bool, messenger Messenger) (*types.ImpactResult, error) + func (e *TruthEngine) CommitLedger(ctx context.Context) (string, error) + func (e *TruthEngine) Compact() *CompactionEngine + func (e *TruthEngine) CompactSession(ctx context.Context, log string) (*types.CompactionResult, error) + func (e *TruthEngine) FindLogicalTwins(ctx context.Context, symbolName, path string) ([]types.Symbol, error) + func (e *TruthEngine) Fix(ctx context.Context, errorLog string, messenger Messenger) (string, error) + func (e *TruthEngine) GetCriticalSymbols(ctx context.Context, limit int) ([]store.CriticalSymbol, error) + func (e *TruthEngine) GetLedgerDiff(ctx context.Context) (string, error) + func (e *TruthEngine) GetLedgerSummary(ctx context.Context) string + func (e *TruthEngine) GetNeighborhood(ctx context.Context, filePath string) (string, error) + func (e *TruthEngine) GetSDDRoadmap(ctx context.Context) (*SDDRoadmap, error) + func (e *TruthEngine) GetSDDTasks(ctx context.Context) ([]SDDTask, error) + func (e *TruthEngine) Healer() *HealerEngine + func (e *TruthEngine) HybridSearch(ctx context.Context, query string, limit, offset int) (*types.HybridSearchResult, error) + func (e *TruthEngine) IdentifyCriticalContext(ctx context.Context, diff string) ([]types.ImpactEntity, error) + func (e *TruthEngine) Index(ctx context.Context, path string) error + func (e *TruthEngine) MemoryProvider() memory.MemoryProvider + func (e *TruthEngine) PredictTests(ctx context.Context, diff string) ([]types.TestTarget, error) + func (e *TruthEngine) Propagate(ctx context.Context, symbol, transformation string, messenger Messenger) (string, error) + func (e *TruthEngine) RollbackLedger(ctx context.Context) (string, error) + func (e *TruthEngine) SearchSDDSpecs(ctx context.Context, query string, limit, offset int) ([]SpecResult, error) + func (e *TruthEngine) SemanticSearch(ctx context.Context, query string, limit int) ([]types.Symbol, error) + func (e *TruthEngine) StageMutation(ctx context.Context, filePath, newContent string) error + type TruthOption func(*TruthEngine) + func WithASTRules(a *ASTRuleEngine) TruthOption + func WithAnalyzer(a *AnalysisEngine) TruthOption + func WithCompact(c *CompactionEngine) TruthOption + func WithDiagnostic(d *DiagnosticEngine) TruthOption + func WithHealer(h *HealerEngine) TruthOption + func WithImpact(i *ImpactEngine) TruthOption + func WithLSP(l *lsp.Manager) TruthOption + func WithLedger(l *Ledger) TruthOption + func WithMemory(m memory.MemoryProvider) TruthOption + func WithMessenger(m Messenger) TruthOption + func WithRipple(r *RippleEngine) TruthOption + func WithSDD(s *SDDEngine) TruthOption + func WithSearch(s *SearchEngine) TruthOption + func WithSemantic(s *SemanticEngine) TruthOption + type ValidationResult struct + Details map[string]any + Message string + Valid bool + type Validator interface + Validate func(ctx context.Context, ledger *Ledger) (ValidationResult, error)