Documentation
¶
Overview ¶
Package application wires the capability domain analysis to a source of stored call graph records. It reads a module's persisted call graph, selects library-style roots, and produces a capability report; the diff use case does the same for two versions and compares the results with diff-parity honoured.
It holds no analysis logic of its own — classification, witnessing paths and caveating all live in capability/domain — so the use cases stay thin and the soundness rules have a single home.
Index ¶
- Variables
- func AnalyseRecord(rec cgdomain.CallGraphRecord, scope cgdomain.RootScope) capdomain.CapabilityReport
- type AnalyseCapabilitiesUseCase
- func (uc *AnalyseCapabilitiesUseCase) Analyse(ctx context.Context, coord coordinate.ModuleCoordinate, pipelineVersion string, ...) (capdomain.CapabilityReport, error)
- func (uc *AnalyseCapabilitiesUseCase) Diff(ctx context.Context, from, to coordinate.ModuleCoordinate, ...) (fromReport, toReport capdomain.CapabilityReport, diff capdomain.CapabilityDiff, ...)
- type CallGraphSource
- type NoCallGraphError
Constants ¶
This section is empty.
Variables ¶
var ErrNoCallGraph = errors.New("no call graph record")
ErrNoCallGraph is returned when no call graph record exists for the requested module. Capability analysis needs the graph, so this is actionable, not a silent empty result.
It names no remedy. Which invocation re-derives a graph is decided by the coordinate — a published module is analysed, a working tree is ingested — and a use case that guessed printed a placeholder no parser accepts. The coordinate travels on NoCallGraphError so the caller can name the real one.
Functions ¶
func AnalyseRecord ¶
func AnalyseRecord(rec cgdomain.CallGraphRecord, scope cgdomain.RootScope) capdomain.CapabilityReport
AnalyseRecord is the report for a record the caller already holds. Analyse and context's capability section both run it, so the two cannot disagree.
Types ¶
type AnalyseCapabilitiesUseCase ¶
type AnalyseCapabilitiesUseCase struct {
// contains filtered or unexported fields
}
AnalyseCapabilitiesUseCase produces capability reports from stored call graphs.
func NewAnalyseCapabilitiesUseCase ¶
func NewAnalyseCapabilitiesUseCase(source CallGraphSource) *AnalyseCapabilitiesUseCase
NewAnalyseCapabilitiesUseCase constructs the use case.
func (*AnalyseCapabilitiesUseCase) Analyse ¶
func (uc *AnalyseCapabilitiesUseCase) Analyse( ctx context.Context, coord coordinate.ModuleCoordinate, pipelineVersion string, scope cgdomain.RootScope, ) (capdomain.CapabilityReport, error)
Analyse reads the call graph for coord and returns its capability report, rooted at the scope the caller asked for.
func (*AnalyseCapabilitiesUseCase) Diff ¶
func (uc *AnalyseCapabilitiesUseCase) Diff( ctx context.Context, from, to coordinate.ModuleCoordinate, pipelineVersion string, scope cgdomain.RootScope, ) (fromReport, toReport capdomain.CapabilityReport, diff capdomain.CapabilityDiff, err error)
Diff reads the call graphs for two coordinates and returns their per-side reports plus the capability diff between them.
type CallGraphSource ¶
type CallGraphSource interface {
GetCallGraphRecord(ctx context.Context, coord coordinate.ModuleCoordinate, pipelineVersion string) (cgdomain.CallGraphRecord, bool, error)
}
CallGraphSource reads stored call graph records. QueryCallGraphUseCase satisfies it; the capability context depends only on this narrow method.
type NoCallGraphError ¶
type NoCallGraphError struct {
Coord coordinate.ModuleCoordinate
}
NoCallGraphError is the missing-record refusal, carrying the coordinate it is about. A diff reads two coordinates and either may be the absent one, so the remedy has to be built from the side that actually missed.
func (*NoCallGraphError) Error ¶
func (e *NoCallGraphError) Error() string
func (*NoCallGraphError) Unwrap ¶
func (e *NoCallGraphError) Unwrap() error
Unwrap keeps errors.Is(err, ErrNoCallGraph) answering for callers that only need the class.