tier

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package tier defines the 3-level analysis capability tiers and detects which tier is available based on the active backends.

Tiers:

  • Basic (1): tree-sitter only — name-based symbol resolution
  • Enhanced (2): tree-sitter + go/types — precise type-aware analysis
  • Full (3): tree-sitter + go/types + VTA call graph — full call precision

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backends

type Backends struct {
	GoTypes bool
	SCIP    bool
	VTA     bool
	Graph   bool
	LLM     bool
}

Backends describes which analysis backends are available.

type DegradationWarning

type DegradationWarning struct {
	Code          string `json:"code"          xml:"code"`
	Message       string `json:"message"       xml:"message"`
	CapabilityPct int    `json:"capability_pct" xml:"capability_pct"`
}

DegradationWarning describes a capability reduction relative to Full tier.

type Detector

type Detector struct {
	// contains filtered or unexported fields
}

Detector determines the current analysis tier and associated warnings from a set of available backends.

func NewDetector

func NewDetector(b Backends) *Detector

NewDetector creates a Detector for the given backend availability and pre-computes the tier and any degradation warnings.

func (*Detector) Current

func (d *Detector) Current() Tier

Current returns the detected analysis tier.

func (*Detector) ProvenanceFor

func (d *Detector) ProvenanceFor(used ...string) Provenance

ProvenanceFor builds a Provenance record listing the active backends alongside any caller-supplied names (e.g. tool names, pass names).

func (*Detector) Warnings

func (d *Detector) Warnings() []DegradationWarning

Warnings returns any capability degradation warnings for the current tier. Returns nil (not an empty slice) when the tier is Full.

type Provenance

type Provenance struct {
	Tier     string   `json:"tier"     xml:"tier"`
	Backends []string `json:"backends" xml:"backends"`
}

Provenance records which tier and backends were used for a given analysis.

type Tier

type Tier int

Tier represents the analysis capability level.

const (
	// Basic uses tree-sitter only (name-based resolution).
	Basic Tier = 1
	// Enhanced adds go/types for precise type analysis.
	Enhanced Tier = 2
	// Full adds VTA call graph on top of Enhanced.
	Full Tier = 3
)

func (Tier) String

func (t Tier) String() string

String returns a human-readable tier name.

Jump to

Keyboard shortcuts

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