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 ¶
- type CertificationFinding
- type CertificationPolicy
- type CertificationReport
- type Config
- type DiffInput
- type Edge
- type EdgeType
- type Engine
- func (e *Engine) CertifyDiff(ctx context.Context, input DiffInput) (CertificationReport, error)
- func (e *Engine) Close() error
- func (e *Engine) Deps(ctx context.Context, filePath string) ([]Edge, error)
- func (e *Engine) DiffAgainstFileContent(before []Symbol, relPath string, content []byte) (GraphDiff, error)
- func (e *Engine) DiffSince(ctx context.Context, before []Symbol) GraphDiff
- func (e *Engine) FileSymbols(ctx context.Context, relPath string) []Symbol
- func (e *Engine) ICR(ctx context.Context, intent string) IsolatedChangeRegion
- func (e *Engine) Impact(ctx context.Context, query string, maxDepth int) ([]Symbol, error)
- func (e *Engine) Index(ctx context.Context, dir string) (IndexResult, error)
- func (e *Engine) PreviewFileSymbols(relPath string, content []byte) ([]Symbol, error)
- func (e *Engine) Query(ctx context.Context, intent string, limit int) ([]Symbol, error)
- func (e *Engine) Root() string
- func (e *Engine) Semantic(ctx context.Context, query string, limit int) ([]Scored, error)
- func (e *Engine) SnapshotSymbols(ctx context.Context) []Symbol
- func (e *Engine) Status(ctx context.Context) (Status, error)
- func (e *Engine) Symbols(ctx context.Context, query string, limit int) ([]Symbol, error)
- func (e *Engine) Tests(ctx context.Context, query string) ([]Symbol, error)
- func (e *Engine) TestsWithEvidence(ctx context.Context, query string) ([]Symbol, map[string]int, error)
- type EvidenceRef
- type GraphDiff
- type IndexResult
- type IsolatedChangeRegion
- type Scored
- type Status
- type Symbol
- type SymbolChange
- type Verdict
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertificationFinding ¶ added in v0.4.5
type CertificationFinding = core.CertificationFinding
Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.
type CertificationPolicy ¶ added in v0.4.5
type CertificationPolicy = core.CertificationPolicy
Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.
type CertificationReport ¶ added in v0.4.5
type CertificationReport = core.CertificationReport
Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.
type Config ¶
type Config struct {
// RepoRoot is the absolute path to the repository whose .grove/ directory
// holds the index. Required.
RepoRoot string
// NativeAnalyzers overrides native graph enrichment when non-nil.
NativeAnalyzers *bool
// NativeLanguages limits native analyzers to these languages/analyzer names.
NativeLanguages []string
// NativeDisabledLanguages disables these languages/analyzer names.
NativeDisabledLanguages []string
// NativeTimeout bounds each analyzer invocation. Zero uses Grove's default.
NativeTimeout time.Duration
}
Config controls how Engine opens a repository's Grove index.
type DiffInput ¶ added in v0.4.5
Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.
type Edge ¶
Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.
type 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 ¶
Open initialises the on-disk store, runs migrations, and rebuilds the in-memory graph from whatever symbols are already persisted.
func (*Engine) CertifyDiff ¶ added in v0.4.5
CertifyDiff maps a unified diff onto the indexed graph and returns a conservative structural certification report. The report is additive: retrieval, MCP, and Provasign behavior do not change unless callers opt in. Changed files whose indexed content no longer matches the working tree are reported as index_stale and escalate the verdict to manual_review.
func (*Engine) DiffAgainstFileContent ¶ added in v0.6.0
func (e *Engine) DiffAgainstFileContent(before []Symbol, relPath string, content []byte) (GraphDiff, error)
DiffAgainstFileContent diffs a snapshot against itself with one file's symbols replaced by those parsed from content: "what would change structurally if relPath had these bytes?".
func (*Engine) DiffSince ¶ added in v0.6.0
DiffSince diffs a previously captured snapshot against the engine's current graph.
func (*Engine) FileSymbols ¶ added in v0.6.1
FileSymbols returns the symbols currently indexed for one repo-relative file path, ordered by span. Use this instead of SnapshotSymbols when only a handful of files matter (e.g. working-set drift checks).
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) Index ¶
Index walks dir (defaults to RepoRoot), parses changed files via delta SHA, updates the persistent store, and refreshes the in-memory graph.
func (*Engine) PreviewFileSymbols ¶ added in v0.6.0
PreviewFileSymbols parses in-memory content as if it lived at relPath (repo-relative) and returns the symbols Grove would index for it. Combine with Diff to compute the structural delta of content that is not on disk yet — e.g. a git merge driver's result, which git writes to the worktree only after the driver exits.
func (*Engine) Query ¶
Query resolves a natural-language intent into ranked symbols by blending TF-IDF semantic search with substring keyword matches.
func (*Engine) SnapshotSymbols ¶ added in v0.6.0
SnapshotSymbols returns a deep copy of every symbol in the current graph. Capture one before a merge/reindex and pass it to Diff afterwards to get the structural delta.
func (*Engine) Symbols ¶
Symbols returns symbols whose name/qualified-name matches query (substring).
func (*Engine) TestsWithEvidence ¶ added in v0.11.0
func (e *Engine) TestsWithEvidence(ctx context.Context, query string) ([]Symbol, map[string]int, error)
TestsWithEvidence returns the covering tests plus the per-reason counts of edges the traversal policy excluded — the weak evidence Grove chose not to trust. Lets a consumer report "related tests" alongside what was withheld.
type EvidenceRef ¶ added in v0.4.5
type EvidenceRef = core.EvidenceRef
Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.
type GraphDiff ¶ added in v0.6.0
Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.
func Diff ¶ added in v0.6.0
Diff computes the structural delta between two symbol snapshots, matched by stable identity (file path + qualified name + kind) so line shifts and content-SHA churn don't register as changes. This is the primitive behind the stale-context loop: diff the graph across a merge, intersect the changed/breaking symbols with another agent's working set, and you know exactly whose ground shifted.
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 ¶
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.
type SymbolChange ¶ added in v0.6.0
type SymbolChange = core.SymbolChange
Re-exported core types — Prism/Fuse/Relay can use these directly without mirroring shapes.