Documentation
¶
Overview ¶
Package analyzer implements the context analysis engine. It traverses the dependency graph, scores candidates, and produces a ranked context bundle per ADR-0007 and ADR-0009.
Index ¶
Constants ¶
const (
// SchemaVersion is the current output schema version for analysis bundles.
SchemaVersion = "3.2"
)
Schema and threshold constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
Analyzer orchestrates graph traversal, scoring, categorization, and explanation.
func (*Analyzer) Analyze ¶
func (a *Analyzer) Analyze(filePath string) (*model.AnalysisOutput, error)
Analyze produces a context bundle for the given file path. The filePath must be repo-relative and present in the index.
func (*Analyzer) AnalyzeMulti ¶
func (a *Analyzer) AnalyzeMulti(filePaths []string) (*model.AnalysisOutput, error)
AnalyzeMulti produces a merged context bundle for multiple files. It calls Analyze() for each file and merges the results: deduped must_read, combined likely_modify, tests, related, and conservative blast_radius.
type Caps ¶
type Caps struct {
MaxMustRead int // default 10
MaxRelated int // default 10
MaxLikelyModify int // default 15
MaxTests int // default 5
Mode string // workflow mode: plan, implement, review (adjusts defaults)
TokenBudget int // target token budget (overrides caps to fit)
}
Caps controls the maximum number of entries in each output section. Zero values use defaults.
type Config ¶
type Config struct {
RepoConfig *config.Config
StableThreshold int // Files with indegree >= this are marked stable. 0 = use adaptive default.
OmitExternal bool // When true, omit external dependencies from output.
Caps Caps // Output section caps. Zero values use defaults.
Signatures bool // When true, include code signatures for must_read symbols.
RepoRoot string // Repository root path (required for signatures to read files).
}
Config configures the analyzer.
type MustReadEntryRef ¶
MustReadEntryRef holds references to a MustReadEntry's fields for enrichment.