Documentation
¶
Overview ¶
Package grove is Fuse's adapter to the in-process Grove engine. The previous HTTP client + auto-spawn of `grove serve` is gone: Fuse now links against `grove/pkg/grove` and opens the on-disk index directly. Public types (Client, Edge, ImpactNode, SymbolRecord, EnsureRunning) are preserved so the rest of Fuse compiles unchanged.
Index ¶
- func EnsureRunning(ctx context.Context, baseURL, binary, root string, timeout time.Duration) error
- type Client
- func (c *Client) Close()
- func (c *Client) Deps(ctx context.Context, filePath string) ([]Edge, error)
- func (c *Client) DriftForMergedFile(ctx context.Context, snap GraphSnapshot, relPath string, merged []byte) (Drift, error)
- func (c *Client) DriftSince(ctx context.Context, snap GraphSnapshot) (Drift, error)
- func (c *Client) EnsureIndexed(ctx context.Context) error
- func (c *Client) Health(ctx context.Context) error
- func (c *Client) Impact(ctx context.Context, query string, maxDepth int) ([]ImpactNode, error)
- func (c *Client) Index(ctx context.Context, dir string) error
- func (c *Client) Snapshot(ctx context.Context) (GraphSnapshot, error)
- func (c *Client) Symbols(ctx context.Context, query string, limit int) ([]SymbolRecord, error)
- func (c *Client) WithTokenFromDir(dir string) *Client
- type Drift
- type DriftSymbol
- type Edge
- type GraphSnapshot
- type ImpactNode
- type SymbolRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureRunning ¶
EnsureRunning is a no-op in the embedded model — Grove is in-process. Kept for API compatibility; baseURL/binary/timeout are ignored. root is required so we know which repository's .grove/ to attach to.
Types ¶
type Client ¶
Client wraps an embedded Grove engine. BaseURL/Token are accepted for API compatibility but unused.
func (*Client) DriftForMergedFile ¶ added in v0.6.0
func (c *Client) DriftForMergedFile(ctx context.Context, snap GraphSnapshot, relPath string, merged []byte) (Drift, error)
DriftForMergedFile computes the structural delta a merge produces for one file, from the merged bytes alone. This is the merge-driver path: git only writes the driver's output to the worktree after the driver exits, so the post-merge state is never on disk while we run — Grove parses the merged content in memory instead.
func (*Client) DriftSince ¶ added in v0.6.0
DriftSince reindexes (delta — unchanged files are skipped) and returns the structural delta against a snapshot taken before the merge. Use after the working tree actually contains the merged result (e.g. post-merge hooks).
func (*Client) EnsureIndexed ¶ added in v0.5.0
EnsureIndexed makes the embedded index usable for blast-radius queries. On a fresh clone the engine opens with zero symbols and every Impact/Deps call silently returns nothing, so an empty index triggers a full build (bounded by ctx). A populated index gets a best-effort delta refresh so the graph reflects the current working tree; refresh errors are swallowed because stale impact data is better than failing the merge.
func (*Client) Snapshot ¶ added in v0.6.0
func (c *Client) Snapshot(ctx context.Context) (GraphSnapshot, error)
Snapshot captures the current graph for later drift computation. Call it before writing merged content; the index reflects the pre-merge working tree because EnsureIndexed runs when the client is constructed.
func (*Client) WithTokenFromDir ¶
WithTokenFromDir records the project root so Fuse can open the engine at <dir>/.grove/grove.db on first use. No token is read (none exists).
type Drift ¶ added in v0.6.0
type Drift struct {
Added []DriftSymbol `json:"added,omitempty"`
Removed []DriftSymbol `json:"removed,omitempty"`
Changed []DriftSymbol `json:"changed,omitempty"`
Renamed []DriftSymbol `json:"renamed,omitempty"`
Breaking []DriftSymbol `json:"breaking,omitempty"`
}
Drift is the structural delta of the code graph across a merge, matched by stable symbol identity (file path + qualified name + kind) — line shifts and content-hash churn do not register. This is the evidence the stale-context loop delivers: which symbols changed under everyone's feet, and which of those changes break the exported surface.
type DriftSymbol ¶ added in v0.6.0
type DriftSymbol struct {
FilePath string `json:"filePath"`
QualifiedName string `json:"qualifiedName"`
Kind string `json:"kind"`
Change string `json:"change"` // added | removed | signature | body | renamed
Exported bool `json:"exported"`
OldSignature string `json:"oldSignature,omitempty"`
NewSignature string `json:"newSignature,omitempty"`
// RenamedFrom carries the previous qualified name (and file, when it
// moved) for change == "renamed".
RenamedFrom string `json:"renamedFrom,omitempty"`
}
DriftSymbol is one symbol-level entry in a graph drift report.
type Edge ¶
type Edge struct {
From string `json:"from"`
To string `json:"to"`
Type string `json:"type"`
Confidence float64 `json:"confidence"`
}
Edge mirrors the engine edge shape Fuse consumes.
type GraphSnapshot ¶ added in v0.6.0
GraphSnapshot is an opaque capture of the Grove code graph, taken before a merge so the structural delta can be computed afterwards.
type ImpactNode ¶
type ImpactNode struct {
ID string `json:"id"`
FilePath string `json:"filePath"`
Name string `json:"name"`
}
ImpactNode is one entry in the blast-radius response.