grove

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package grove is the public, in-process Go API for the Grove code knowledge graph. Prism, Fuse, and Relay import this package and call it directly — there is no HTTP server, no port, no shared-secret token, no auto-start.

Index data lives in <repoRoot>/.grove/grove.db. SQLite WAL mode handles concurrent readers; only one writer at a time per database file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// RepoRoot is the absolute path to the repository whose .grove/ directory
	// holds the index. Required.
	RepoRoot string
}

Config controls how Engine opens a repository's Grove index.

type Edge

type Edge = core.Edge

Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.

type EdgeType

type EdgeType = core.EdgeType

Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine is the embedded Grove API consumed by Prism, Fuse, and Relay. Methods are safe for concurrent use.

func Open

func Open(ctx context.Context, cfg Config) (*Engine, error)

Open initialises the on-disk store, runs migrations, and rebuilds the in-memory graph from whatever symbols are already persisted.

func (*Engine) Close

func (e *Engine) Close() error

Close releases the underlying SQLite handle.

func (*Engine) Deps

func (e *Engine) Deps(ctx context.Context, filePath string) ([]Edge, error)

Deps returns the outgoing dependency edges for filePath.

func (*Engine) ICR

func (e *Engine) ICR(ctx context.Context, intent string) IsolatedChangeRegion

ICR computes the Isolated Change Region for a given intent.

func (*Engine) Impact

func (e *Engine) Impact(ctx context.Context, query string, maxDepth int) ([]Symbol, error)

Impact returns the blast radius for a symbol/file query.

func (*Engine) Index

func (e *Engine) Index(ctx context.Context, dir string) (IndexResult, error)

Index walks dir (defaults to RepoRoot), parses changed files via delta SHA, updates the persistent store, and refreshes the in-memory graph.

func (*Engine) Query

func (e *Engine) Query(ctx context.Context, intent string, limit int) ([]Symbol, error)

Query resolves a natural-language intent into ranked symbols by blending TF-IDF semantic search with substring keyword matches.

func (*Engine) Root

func (e *Engine) Root() string

Root returns the repository root the engine is attached to.

func (*Engine) Semantic

func (e *Engine) Semantic(ctx context.Context, query string, limit int) ([]Scored, error)

Semantic returns TF-IDF-ranked symbols with cosine-similarity scores.

func (*Engine) Status

func (e *Engine) Status(ctx context.Context) (Status, error)

Status reports the current persisted index summary.

func (*Engine) Symbols

func (e *Engine) Symbols(ctx context.Context, query string, limit int) ([]Symbol, error)

Symbols returns symbols whose name/qualified-name matches query (substring).

func (*Engine) Tests

func (e *Engine) Tests(ctx context.Context, query string) ([]Symbol, error)

Tests returns the test symbols that cover the given symbol/file query.

type IndexResult

type IndexResult = core.IndexResult

Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.

type IsolatedChangeRegion

type IsolatedChangeRegion = core.IsolatedChangeRegion

Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.

type Scored

type Scored = struct {
	Symbol *core.SymbolRecord
	Score  float64
}

Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.

type Status

type Status = core.Status

Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.

type Symbol

type Symbol = core.SymbolRecord

Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.

Jump to

Keyboard shortcuts

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