analysis

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package analysis covers breaking change detection, blast radius lookup, and risk scoring during the merge pipeline.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlastRadius

func BlastRadius(ctx context.Context, g GroveLike, symbol string, maxDepth int) []string

BlastRadius returns the file paths transitively impacted by a symbol per Grove's impact query. Returns nil on Grove failure.

func Dependents

func Dependents(ctx context.Context, g GroveLike, filePath string) []string

Dependents returns the files that depend on filePath per Grove (reverse direction of /deps).

Types

type BreakingChangeAnalyzer

type BreakingChangeAnalyzer struct {
	Grove GroveLike
}

BreakingChangeAnalyzer detects exports removed or signature-changed between base and (ours | theirs), and the downstream files those break.

func (*BreakingChangeAnalyzer) Analyze

func (a *BreakingChangeAnalyzer) Analyze(
	ctx context.Context,
	filePath string,
	base, ours, theirs []core.SymbolData,
) []core.BreakingChange

Analyze returns the breaking changes introduced by ours and theirs relative to base.

removed_export    : symbol exported in base, absent in (ours OR theirs)
signature_changed : exported symbol present on both sides but signature differs
broken_import     : import present in theirs that resolves to a symbol removed by ours (or vice versa)

Severity is escalated by the count of affected files from Grove's impact query.

type GroveLike

type GroveLike interface {
	Impact(ctx context.Context, query string, maxDepth int) ([]grove.ImpactNode, error)
	Deps(ctx context.Context, filePath string) ([]grove.Edge, error)
}

GroveLike is the small subset of the Grove client the analyzer uses. Defined as an interface so tests can plug in a fake without spinning up Grove.

Jump to

Keyboard shortcuts

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