Documentation
¶
Index ¶
- type BatchItem
- type Call
- type CriticalSymbol
- type DBTX
- type DiagnosticStore
- type FileIndex
- type Flow
- type GetCallersParams
- type Queries
- func (q *Queries) ClearSymbols(ctx context.Context, path string) error
- func (q *Queries) GetCallees(ctx context.Context, callerName string) ([]Call, error)
- func (q *Queries) GetCallers(ctx context.Context, arg GetCallersParams) ([]Call, error)
- func (q *Queries) SaveCall(ctx context.Context, arg SaveCallParams) error
- func (q *Queries) SaveFileIndex(ctx context.Context, arg SaveFileIndexParams) error
- func (q *Queries) SaveSymbol(ctx context.Context, arg SaveSymbolParams) error
- func (q *Queries) SearchSymbols(ctx context.Context, arg SearchSymbolsParams) ([]Symbol, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type SaveCallParams
- type SaveFileIndexParams
- type SaveSymbolParams
- type SearchSymbolsParams
- type ShardManager
- type SovereignDelta
- type Store
- type StructuralGraph
- type Symbol
- type SymbolRegistry
- type SyncEngine
- type TransactionManager
- type UsageRecord
- type Violation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CriticalSymbol ¶
type DiagnosticStore ¶
type DiagnosticStore interface {
GetAllFailedTests(ctx context.Context) iter.Seq2[types.TestResult, error]
SaveTestResult(ctx context.Context, res *types.TestResult) error
GetHealthReport(ctx context.Context, symbol string, failuresOnly bool) iter.Seq2[types.TestResult, error]
ClearTestResults(ctx context.Context) error
SaveViolation(ctx context.Context, v *types.ASTRuleMatch) error
GetViolationsByFile(ctx context.Context, path string) ([]Violation, error)
}
type GetCallersParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) ClearSymbols ¶
func (*Queries) GetCallees ¶
func (*Queries) GetCallers ¶
func (*Queries) SaveCall ¶
func (q *Queries) SaveCall(ctx context.Context, arg SaveCallParams) error
func (*Queries) SaveFileIndex ¶
func (q *Queries) SaveFileIndex(ctx context.Context, arg SaveFileIndexParams) error
func (*Queries) SaveSymbol ¶
func (q *Queries) SaveSymbol(ctx context.Context, arg SaveSymbolParams) error
func (*Queries) SearchSymbols ¶
type SaveCallParams ¶
type SaveFileIndexParams ¶
type SaveSymbolParams ¶
type SaveSymbolParams struct {
Name string `json:"name"`
Type string `json:"type"`
PackagePath string `json:"package_path"`
ReceiverType string `json:"receiver_type"`
Signature string `json:"signature"`
Doc string `json:"doc"`
Path string `json:"path"`
StartByte int `json:"start_byte"`
EndByte int `json:"end_byte"`
StartLine int `json:"start_line"`
StartCol int `json:"start_col"`
EndLine int `json:"end_line"`
StructuralHash string `json:"structural_hash"`
Indegree int `json:"indegree"`
Relevance float64 `json:"relevance"`
Pagerank float64 `json:"pagerank"`
ChurnScore float64 `json:"churn_score"`
RuntimeHits int `json:"runtime_hits"`
AiSummary string `json:"ai_summary"`
}
type SearchSymbolsParams ¶
type SearchSymbolsParams struct {
Column1 sql.NullString `json:"column_1"`
Column2 sql.NullString `json:"column_2"`
Limit int64 `json:"limit"`
Offset int64 `json:"offset"`
}
type ShardManager ¶
type ShardManager struct {
// contains filtered or unexported fields
}
ShardManager manages multiple SQLite databases (shards) for large codebases.
func NewShardManager ¶
func NewShardManager(basePath string) *ShardManager
func (*ShardManager) Close ¶
func (m *ShardManager) Close() error
type SovereignDelta ¶
type SovereignDelta struct {
Path string `json:"path"`
Hash string `json:"hash"`
Symbols []Symbol `json:"symbols"`
Calls []Call `json:"calls"`
Flows []Flow `json:"flows"`
}
SovereignDelta represents the index data for a single file, stable for Git.
type Store ¶
type Store interface {
SymbolRegistry
StructuralGraph
DiagnosticStore
SyncEngine
TransactionManager
}
type StructuralGraph ¶
type StructuralGraph interface {
GetAllCalls(ctx context.Context) iter.Seq2[Call, error]
SaveCall(ctx context.Context, call Call) error
GetCallers(ctx context.Context, calleeName string, limit, offset int) ([]Call, error)
GetCallees(ctx context.Context, callerName string) ([]Call, error)
GetCallersRecursive(ctx context.Context, name, path string, maxDepth int) ([]Call, error)
GetAffectedTestsRecursive(ctx context.Context, name, path string) ([]Symbol, error)
ClearCalls(ctx context.Context, path string) error
// Data Flow
SaveFlow(ctx context.Context, flow Flow) error
GetFlows(ctx context.Context, sink string) ([]Flow, error)
ClearFlows(ctx context.Context, path string) error
}
type Symbol ¶
type Symbol struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
PackagePath string `json:"package_path"`
ReceiverType string `json:"receiver_type"`
Signature string `json:"signature"`
Doc string `json:"doc"`
Path string `json:"path"`
StartByte int `json:"start_byte"`
EndByte int `json:"end_byte"`
StartLine int `json:"start_line"`
StartCol int `json:"start_col"`
EndLine int `json:"end_line"`
StructuralHash string `json:"structural_hash"`
Indegree int `json:"indegree"`
Relevance float64 `json:"relevance"`
Pagerank float64 `json:"pagerank"`
ChurnScore float64 `json:"churn_score"`
RuntimeHits int `json:"runtime_hits"`
AiSummary string `json:"ai_summary"`
Metrics *types.SemanticMetrics `json:"metrics,omitempty"`
}
type SymbolRegistry ¶
type SymbolRegistry interface {
GetFileIndex(ctx context.Context, path string) (*FileIndex, error)
SaveFileIndex(ctx context.Context, idx *FileIndex) error
SaveFileIndexBatch(ctx context.Context, items []BatchItem) error
GetDirectoryHash(ctx context.Context, path string) (string, int64, error)
SaveDirectoryHash(ctx context.Context, path string, hash string, mtime int64) error
ClearSymbols(ctx context.Context, path string) error
SaveSymbol(ctx context.Context, sym *Symbol) error
SearchSymbols(ctx context.Context, query string, symType string, limit, offset int) ([]Symbol, error)
GetSymbolsByNameInFile(ctx context.Context, name, path string) ([]Symbol, error)
GetSymbolsByStructuralHash(ctx context.Context, hash string) ([]Symbol, error)
SearchSymbolsWeighted(ctx context.Context, query string, symType string) iter.Seq2[Symbol, error]
GetSymbolsByRange(ctx context.Context, path string, startLine, endLine int) ([]Symbol, error)
GetSymbolsByPathPrefix(ctx context.Context, pathPrefix string) ([]Symbol, error)
GetSymbolsByType(ctx context.Context, symType string) ([]Symbol, error)
GetInterfaces(ctx context.Context) ([]Symbol, error)
GetAllSymbols(ctx context.Context) iter.Seq2[Symbol, error]
UpdateSymbolCentrality(ctx context.Context, name, path string, centrality int) error
UpdateSymbolChurn(ctx context.Context, path string, score float64) error
UpdateSymbolPagerank(ctx context.Context, name, path string, score float64) error
UpdateSymbolRuntimeHits(ctx context.Context, name, path string, hits int) error
RecordSymbolUsage(ctx context.Context, env string, usages []UsageRecord) error
GetStats(ctx context.Context) (int, int, error)
GetAllFilePaths(ctx context.Context) ([]string, error)
DeleteFileIndex(ctx context.Context, path string) error
InsertSemanticVector(ctx context.Context, symbolID int64, embedding []float32) error
SearchSemantic(ctx context.Context, queryEmbedding []float32, limit int) ([]Symbol, error)
SaveDependency(ctx context.Context, dep *types.Dependency) error
GetDependencies(ctx context.Context) ([]types.Dependency, error)
ClearDependencies(ctx context.Context) error
GetUnusedSymbols(ctx context.Context, includeExported bool) ([]Symbol, error)
}
type SyncEngine ¶
type TransactionManager ¶
type UsageRecord ¶
Click to show internal directories.
Click to hide internal directories.