Documentation
¶
Index ¶
- func Run(ctx context.Context, c *Components) error
- type AutoIndexer
- type Components
- type Config
- type FileGetter
- type GraphAuditLogger
- func (a *GraphAuditLogger) AddObservations(observations []coregraph.Observation) ([]coregraph.Observation, error)
- func (a *GraphAuditLogger) CreateEntities(entities []coregraph.Entity) ([]coregraph.Entity, error)
- func (a *GraphAuditLogger) CreateRelations(relations []coregraph.Relation) ([]coregraph.Relation, error)
- func (a *GraphAuditLogger) DeleteEntities(entityNames []string) error
- func (a *GraphAuditLogger) DeleteObservations(deletions []coregraph.Observation) error
- func (a *GraphAuditLogger) DeleteRelations(relations []coregraph.Relation) error
- func (a *GraphAuditLogger) EntityCount() (int64, error)
- func (a *GraphAuditLogger) EntityTypeCounts() (map[string]int64, error)
- func (a *GraphAuditLogger) FindPath(from, to string, maxDepth int) ([]coregraph.PathEdge, error)
- func (a *GraphAuditLogger) GetIntegrationMap(ctx context.Context, service string, depth int) (coregraph.IntegrationMap, error)
- func (a *GraphAuditLogger) ListEntities(entityType string) (coregraph.KnowledgeGraph, error)
- func (a *GraphAuditLogger) ListRelations(relationType, fromEntity string) ([]coregraph.Relation, error)
- func (a *GraphAuditLogger) OpenNodes(names []string) (coregraph.KnowledgeGraph, error)
- func (a *GraphAuditLogger) OpenNodesFiltered(names []string, includeArchived bool) (coregraph.KnowledgeGraph, error)
- func (a *GraphAuditLogger) ReadGraph() (coregraph.KnowledgeGraph, error)
- func (a *GraphAuditLogger) SearchNodes(query string) (coregraph.KnowledgeGraph, error)
- func (a *GraphAuditLogger) SearchNodesFiltered(query string, includeArchived bool) (coregraph.KnowledgeGraph, error)
- func (a *GraphAuditLogger) TraverseGraph(entity, relationType, direction string, maxDepth int) ([]coregraph.TraverseNode, []coregraph.TraverseEdge, error)
- func (a *GraphAuditLogger) UpdateEntity(oldName, newName, newType string) error
- type GraphWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AutoIndexer ¶
type AutoIndexer struct {
// contains filtered or unexported fields
}
AutoIndexer automatically populates the knowledge graph from manifest files and optionally refreshes the content cache after each scan.
func New ¶
func New(sc FileGetter, graph GraphWriter, cache corecontent.ContentRepository, registry *parser.ParserRegistry) *AutoIndexer
New creates an AutoIndexer. cache may be nil if SCAN_CONTENT is disabled.
func (*AutoIndexer) Run ¶
func (ai *AutoIndexer) Run(ctx context.Context, repos []corescan.RepoInfo)
Run is the OnScanComplete callback. It:
- Refreshes the content cache for all indexed files (if enabled).
- Runs all registered parsers and upserts entities/relations into the graph.
- Soft-deletes entities from repos no longer in the scan.
type Components ¶
type Components struct {
DB *gorm.DB
Scanner *ghinfra.Scanner
Graph *GraphAuditLogger
AuditStore coreaudit.AuditStore
ContentCache corecontent.ContentRepository
SemanticSrv adaptermcp.SemanticSearch
ToolMetrics *adaptermcp.ToolMetrics
DocMetrics *adaptermcp.DocMetrics
MCPServer *mcp.Server
Indexer *AutoIndexer
Cfg Config
}
Components holds all wired application dependencies.
type Config ¶
type Config struct {
GitHubToken string
GitHubOrg string
ScanInterval time.Duration
TargetFiles []string
ScanDirs []string
InfraDirs []string
ExtraRepos []string
RepoTopics []string
RepoRegex *regexp.Regexp
HTTPAddr string
DatabaseURL string
ScanContent bool
GraphReadOnly bool
MaxContentSize int
AgentID string
WebhookSecret string
BearerToken string
EmbedConfig embeddings.Config
}
Config holds all runtime configuration read from environment variables.
func LoadConfig ¶
LoadConfig reads and validates all environment variables.
type FileGetter ¶
type FileGetter interface {
GetFileContent(ctx context.Context, repo, path string) (string, error)
}
FileGetter fetches the raw content of an indexed documentation file.
type GraphAuditLogger ¶
type GraphAuditLogger struct {
// contains filtered or unexported fields
}
func NewGraphAuditLogger ¶
func NewGraphAuditLogger(inner coregraph.GraphService, agentFn func() string, store coreaudit.AuditStore) *GraphAuditLogger
func (*GraphAuditLogger) AddObservations ¶
func (a *GraphAuditLogger) AddObservations(observations []coregraph.Observation) ([]coregraph.Observation, error)
func (*GraphAuditLogger) CreateEntities ¶
func (*GraphAuditLogger) CreateRelations ¶
func (*GraphAuditLogger) DeleteEntities ¶
func (a *GraphAuditLogger) DeleteEntities(entityNames []string) error
func (*GraphAuditLogger) DeleteObservations ¶
func (a *GraphAuditLogger) DeleteObservations(deletions []coregraph.Observation) error
func (*GraphAuditLogger) DeleteRelations ¶
func (a *GraphAuditLogger) DeleteRelations(relations []coregraph.Relation) error
func (*GraphAuditLogger) EntityCount ¶
func (a *GraphAuditLogger) EntityCount() (int64, error)
func (*GraphAuditLogger) EntityTypeCounts ¶
func (a *GraphAuditLogger) EntityTypeCounts() (map[string]int64, error)
func (*GraphAuditLogger) GetIntegrationMap ¶
func (a *GraphAuditLogger) GetIntegrationMap(ctx context.Context, service string, depth int) (coregraph.IntegrationMap, error)
func (*GraphAuditLogger) ListEntities ¶
func (a *GraphAuditLogger) ListEntities(entityType string) (coregraph.KnowledgeGraph, error)
func (*GraphAuditLogger) ListRelations ¶
func (a *GraphAuditLogger) ListRelations(relationType, fromEntity string) ([]coregraph.Relation, error)
func (*GraphAuditLogger) OpenNodes ¶
func (a *GraphAuditLogger) OpenNodes(names []string) (coregraph.KnowledgeGraph, error)
func (*GraphAuditLogger) OpenNodesFiltered ¶
func (a *GraphAuditLogger) OpenNodesFiltered(names []string, includeArchived bool) (coregraph.KnowledgeGraph, error)
func (*GraphAuditLogger) ReadGraph ¶
func (a *GraphAuditLogger) ReadGraph() (coregraph.KnowledgeGraph, error)
func (*GraphAuditLogger) SearchNodes ¶
func (a *GraphAuditLogger) SearchNodes(query string) (coregraph.KnowledgeGraph, error)
func (*GraphAuditLogger) SearchNodesFiltered ¶
func (a *GraphAuditLogger) SearchNodesFiltered(query string, includeArchived bool) (coregraph.KnowledgeGraph, error)
func (*GraphAuditLogger) TraverseGraph ¶
func (a *GraphAuditLogger) TraverseGraph(entity, relationType, direction string, maxDepth int) ([]coregraph.TraverseNode, []coregraph.TraverseEdge, error)
func (*GraphAuditLogger) UpdateEntity ¶
func (a *GraphAuditLogger) UpdateEntity(oldName, newName, newType string) error
type GraphWriter ¶
type GraphWriter interface {
CreateEntities([]coregraph.Entity) ([]coregraph.Entity, error)
CreateRelations([]coregraph.Relation) ([]coregraph.Relation, error)
AddObservations([]coregraph.Observation) ([]coregraph.Observation, error)
SearchNodes(query string) (coregraph.KnowledgeGraph, error)
EntityCount() (int64, error)
}
GraphWriter writes entities and relations to the knowledge graph.
Click to show internal directories.
Click to hide internal directories.