types

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASTCall

type ASTCall struct {
	CallerName string `json:"caller_name" validate:"required"`
	CalleeName string `json:"callee_name" validate:"required"`
	CalleePath string `json:"callee_path"` // Optional: absolute path to the callee file
	LinkType   string `json:"link_type"`   // call, implements, emits, etc.
	Path       string `json:"path" validate:"required"`
	Line       int    `json:"line" validate:"required,gte=1"`
}

type ASTPointer

type ASTPointer struct {
	Type           string           `json:"type" validate:"required,oneof=function class method variable interface method_spec"`
	Name           string           `json:"name" validate:"required"`
	PackagePath    string           `json:"package_path"`
	ReceiverType   string           `json:"receiver_type"`
	Signature      string           `json:"signature,omitempty"`
	Doc            string           `json:"doc"`
	Range          Range            `json:"range" validate:"required"`
	StartLine      int              `json:"start_line" validate:"required,gte=1"`
	StartCol       int              `json:"start_col" validate:"required,gte=1"`
	EndLine        int              `json:"end_line" validate:"required,gtfield=StartLine"`
	Hash           string           `json:"hash" validate:"required,len=64"`
	StructuralHash string           `json:"structural_hash,omitempty" validate:"omitempty,len=64"`
	LogicHash      string           `json:"logic_hash,omitempty" validate:"omitempty,len=64"`
	Metrics        *SemanticMetrics `json:"metrics,omitempty"`
}

type ASTPos

type ASTPos struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

ASTPos represents a line and column position.

type ASTRange

type ASTRange struct {
	Start ASTPos `json:"start"`
	End   ASTPos `json:"end"`
}

ASTRange represents the location of a match in the source code.

type ASTRuleMatch

type ASTRuleMatch struct {
	RuleID   string   `json:"ruleId"`
	File     string   `json:"file"`
	Text     string   `json:"text"`
	Message  string   `json:"message"`
	Severity string   `json:"severity"`
	Range    ASTRange `json:"range"`
}

ASTRuleMatch represents a single violation found by ast-grep.

func (ASTRuleMatch) String

func (m ASTRuleMatch) String() string

type CompactionResult

type CompactionResult struct {
	AnchorPath string `json:"anchor_path"`
	Timestamp  string `json:"timestamp"`
	Message    string `json:"message"`
}

type DataFlow

type DataFlow struct {
	Source string `json:"source" validate:"required"`
	Sink   string `json:"sink" validate:"required"`
	Type   string `json:"type" validate:"required"` // assignment, argument, return
	Path   string `json:"path" validate:"required"`
	Line   int    `json:"line" validate:"required,gte=1"`
}

type Dependency

type Dependency struct {
	Name    string `json:"name" validate:"required"`
	Version string `json:"version" validate:"required"`
	Type    string `json:"type" validate:"required,oneof=golang npm"`
	Project string `json:"project" validate:"required"` // Path to the manifest file
	Direct  bool   `json:"direct"`
}

type EditCost added in v1.4.0

type EditCost struct {
	Files   int    `json:"files"`
	Cascade int    `json:"cascade"`
	Tokens  int    `json:"tokens"`
	Risk    string `json:"risk"` // low, medium, high
}

type FileContextResult added in v1.4.0

type FileContextResult struct {
	File             string   `json:"file"`
	LOC              int      `json:"loc"`
	Symbols          int      `json:"symbols"`
	DirectDependents []string `json:"direct_dependents"`
	TransitiveImpact int      `json:"transitive_impact"`
	ChurnScore       float64  `json:"churn_score"`
	EditCost         EditCost `json:"edit_cost"`
	TestHints        []string `json:"test_hints"`
	Verdict          string   `json:"verdict"` // safe, caution, danger
}

type HealResult

type HealResult struct {
	Status     string            `json:"status"`
	FixedCode  string            `json:"fixed_code"`
	TestOutput string            `json:"test_output"`
	Metadata   map[string]string `json:"metadata"`
}

type HybridSearchResult

type HybridSearchResult struct {
	Symbols  []Symbol        `json:"symbols"`
	Insights []MemoryInsight `json:"insights"`
}

type ImpactEntity

type ImpactEntity struct {
	Symbol    string      `json:"symbol"`
	File      string      `json:"file"`
	Distance  int         `json:"distance"`
	RiskScore float64     `json:"risk_score"`
	LinkType  string      `json:"link_type"`
	Body      string      `json:"body,omitempty"`
	Metrics   RiskMetrics `json:"metrics"`
}

type ImpactResult

type ImpactResult struct {
	Target    ImpactEntity   `json:"target"`
	Callers   []ImpactEntity `json:"callers"`
	Mermaid   string         `json:"mermaid"`
	RiskLevel string         `json:"risk_level"` // Low, Medium, High, Critical
	Breakdown string         `json:"breakdown,omitempty"`
}

type MemoryInsight

type MemoryInsight struct {
	ID            string   `json:"id"`
	Type          string   `json:"type"`
	Title         string   `json:"title"`
	Learned       string   `json:"learned"`
	Why           string   `json:"why"`
	LinkedSymbols []string `json:"linked_symbols,omitempty"`
}

type Range

type Range struct {
	Start int `json:"start" validate:"gte=0"`
	End   int `json:"end" validate:"gtfield=Start"`
}

type RiskMetrics

type RiskMetrics struct {
	Centrality         float64 `json:"centrality"`
	BlastRadius        float64 `json:"blast_radius"`
	PublicExport       bool    `json:"public_export"`
	HistoricalBugfixes int     `json:"historical_bugfixes"`
}

type RuleViolationReport

type RuleViolationReport struct {
	FilePath   string
	Violations []ASTRuleMatch
}

RuleViolationReport is a collection of matches for a specific file.

type SemanticMetrics

type SemanticMetrics struct {
	CyclomaticComplexity int  `json:"cyclomatic_complexity"`
	CognitiveComplexity  int  `json:"cognitive_complexity"`
	IsAsync              bool `json:"is_async"`
	HasErrorHandling     bool `json:"has_error_handling"`
	HasExceptions        bool `json:"has_exceptions"`
}

type StructuralRule

type StructuralRule struct {
	Pattern string `json:"pattern"`
	Inside  string `json:"inside,omitempty"`
	Has     string `json:"has,omitempty"`
}

StructuralRule encapsulates a structural search pattern and relational constraints.

type Symbol

type Symbol struct {
	Name           string           `json:"name"`
	Type           string           `json:"type"`
	PackagePath    string           `json:"package_path"`  // Fully qualified package path
	ReceiverType   string           `json:"receiver_type"` // pointer, value, or empty
	Signature      string           `json:"signature,omitempty"`
	Doc            string           `json:"doc"`
	Path           string           `json:"path"`
	StartLine      int              `json:"start_line"`
	EndLine        int              `json:"end_line"`
	LinkedInsights []string         `json:"linked_insights,omitempty"`
	Metrics        *SemanticMetrics `json:"metrics,omitempty"`
	ChurnScore     float64          `json:"churn_score,omitempty"`
}

type TestEvent

type TestEvent struct {
	Time    string  `json:"Time"`
	Action  string  `json:"Action" validate:"required,oneof=run pause cont pass fail skip output bench"`
	Package string  `json:"Package"`
	Test    string  `json:"Test"`
	Output  string  `json:"Output"`
	Elapsed float64 `json:"Elapsed" validate:"gte=0"`
}

type TestResult

type TestResult struct {
	TestName     string `json:"test_name" validate:"required"`
	Status       string `json:"status" validate:"required,oneof=pass fail skip"`
	ErrorMessage string `json:"error_message,omitempty"`
	StackTrace   string `json:"stack_trace,omitempty"`
	TargetSymbol string `json:"target_symbol,omitempty"`
	DurationMS   int64  `json:"duration_ms" validate:"gte=0"`
	Project      string `json:"project,omitempty"`
}

type TestTarget

type TestTarget struct {
	Name string `json:"name"`
	File string `json:"file"`
}

Jump to

Keyboard shortcuts

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