Documentation
¶
Overview ¶
Package grove is Prism's adapter to the in-process Grove engine.
Historically this package was an HTTP client that spoke to a long-running `grove serve` daemon. The embedded-Grove architecture removes the daemon: Prism links against `grove/pkg/grove` directly and opens the on-disk index in the same process. The public surface of Client (NewClient, EnsureRunning, Index, Query…) is preserved so the rest of Prism (ranking, MCP, CLI) is unchanged.
Package grove holds typed mirrors of Grove's result shapes used by the Prism client. They are plain structs sharing Grove's JSON wire tags so the rest of Prism (ranking, MCP, CLI) never touches engine types directly, and records can round-trip back into the engine (see toEngineSymbol).
Index ¶
- type CallSite
- type Client
- func (c *Client) BaseURL() string
- func (c *Client) Deps(ctx context.Context, file string) ([]Edge, error)
- func (c *Client) DiffFile(ctx context.Context, before []SymbolRecord, relPath string) (*FileGraphDiff, error)
- func (c *Client) EnsureRunning(ctx context.Context) error
- func (c *Client) FileSymbols(ctx context.Context, relPath string) ([]SymbolRecord, error)
- func (c *Client) Health(ctx context.Context) error
- func (c *Client) Impact(ctx context.Context, query string, maxDepth int) ([]SymbolRecord, error)
- func (c *Client) Index(ctx context.Context, dir string) (*IndexResult, error)
- func (c *Client) QueryByIntent(ctx context.Context, intent string, limit int) ([]SymbolRecord, error)
- func (c *Client) References(ctx context.Context, name string) (groveeng.ReferenceResult, error)
- func (c *Client) SearchSymbols(ctx context.Context, query string, limit int) ([]SymbolRecord, error)
- func (c *Client) Semantic(ctx context.Context, query string, limit int) ([]SemanticResult, error)
- func (c *Client) Shutdown()
- func (c *Client) Status(ctx context.Context) (*StatusResult, error)
- func (c *Client) Tests(ctx context.Context, query string) ([]SymbolRecord, error)
- func (c *Client) WithTokenFromDir(root string) *Client
- type Edge
- type FileGraphDiff
- type ImpactNode
- type IndexResult
- type SemanticResult
- type SpanInfo
- type StatusResult
- type SymbolChange
- type SymbolRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps an embedded Grove engine. baseURL/groveBin are ignored in the embedded model and retained only so existing call sites keep compiling.
func NewClient ¶
NewClient returns a Client. baseURL and groveBin are accepted for API compatibility but unused — Grove is now embedded in-process.
func (*Client) BaseURL ¶
BaseURL returns an embedded-mode marker so legacy log lines remain readable.
func (*Client) DiffFile ¶ added in v0.7.0
func (c *Client) DiffFile(ctx context.Context, before []SymbolRecord, relPath string) (*FileGraphDiff, error)
DiffFile diffs the symbols delivered earlier (before) against the file's current indexed symbols using Grove's GraphDiff, so renames are paired and breaking changes classified instead of appearing as remove+add churn.
func (*Client) EnsureRunning ¶
EnsureRunning opens the embedded Grove engine if it has not been opened yet. Replaces the old HTTP probe + auto-spawn of `grove serve`.
func (*Client) FileSymbols ¶ added in v0.7.0
FileSymbols returns the symbols currently indexed for one repo-relative file path. Used by file reads and working-set drift checks.
func (*Client) Index ¶
Index indexes dir (defaults to the project root) and returns a result summary in the wire-format shape Prism's callers expect.
func (*Client) QueryByIntent ¶
func (c *Client) QueryByIntent(ctx context.Context, intent string, limit int) ([]SymbolRecord, error)
QueryByIntent resolves an intent string into ranked symbols.
func (*Client) References ¶ added in v0.13.0
References returns code occurrences of a symbol name — the reference layer ("where is X used"), near-complete for types/classes the call graph misses.
func (*Client) SearchSymbols ¶
func (c *Client) SearchSymbols(ctx context.Context, query string, limit int) ([]SymbolRecord, error)
SearchSymbols returns symbols matching query (substring).
func (*Client) Status ¶
func (c *Client) Status(ctx context.Context) (*StatusResult, error)
Status returns the persisted index summary.
func (*Client) WithTokenFromDir ¶
WithTokenFromDir records the repository root so EnsureRunning can open the engine at <root>/.grove/grove.db. The name is kept for compatibility; no shared-secret token is read or sent (none exists in the embedded model).
type Edge ¶
type Edge struct {
From string `json:"from"`
To string `json:"to"`
Type string `json:"type"`
Confidence float64 `json:"confidence"`
}
Edge mirrors grove/internal/core.Edge.
type FileGraphDiff ¶ added in v0.7.0
type FileGraphDiff struct {
Added []SymbolRecord `json:"added"`
Removed []SymbolRecord `json:"removed"`
Changed []SymbolChange `json:"changed"`
Renamed []SymbolChange `json:"renamed,omitempty"`
Breaking []SymbolChange `json:"breakingChanges"`
}
FileGraphDiff mirrors grove's core.GraphDiff scoped to one file: the structural delta between a delivered symbol snapshot and the current index, with renames paired and breaking changes classified.
type ImpactNode ¶
type ImpactNode = SymbolRecord
ImpactNode is one entry returned by Grove's /impact endpoint.
type IndexResult ¶
type IndexResult struct {
Root string `json:"root"`
FilesSeen int `json:"filesSeen"`
FilesUpdated int `json:"filesUpdated"`
FilesSkipped int `json:"filesSkipped"`
FilesPruned int `json:"filesPruned"`
SymbolCount int `json:"symbolCount"`
EdgeCount int `json:"edgeCount"`
}
IndexResult mirrors Grove's /index response.
type SemanticResult ¶
type SemanticResult struct {
Score float64 `json:"score"`
Symbol SymbolRecord `json:"symbol"`
}
SemanticResult mirrors Grove's /semantic response entry.
type StatusResult ¶
type StatusResult struct {
FilesIndexed int `json:"filesIndexed"`
SymbolCount int `json:"symbolCount"`
EdgeCount int `json:"edgeCount"`
}
StatusResult mirrors Grove's /status response.
type SymbolChange ¶ added in v0.7.0
type SymbolChange struct {
Before *SymbolRecord `json:"before,omitempty"`
After *SymbolRecord `json:"after,omitempty"`
SignatureChanged bool `json:"signatureChanged"`
BodyChanged bool `json:"bodyChanged"`
}
SymbolChange mirrors grove's core.SymbolChange: one symbol's before/after pair in a structural diff.
type SymbolRecord ¶
type SymbolRecord struct {
ID string `json:"id"`
FilePath string `json:"filePath"`
BlobSha string `json:"blobSha"`
Language string `json:"language"`
Kind string `json:"kind"`
Name string `json:"name"`
QualifiedName string `json:"qualifiedName"`
Signature string `json:"signature"`
Docstring string `json:"docstring,omitempty"`
Span SpanInfo `json:"span"`
ParentSymbol string `json:"parentSymbol,omitempty"`
Imports []string `json:"imports,omitempty"`
Exports bool `json:"exports"`
RawText string `json:"rawText,omitempty"`
Modifiers []string `json:"modifiers,omitempty"`
TypeParameters []string `json:"typeParameters,omitempty"`
Annotations []string `json:"annotations,omitempty"`
CallSites []CallSite `json:"callSites,omitempty"`
}
SymbolRecord mirrors grove/internal/core.SymbolRecord.