waste

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FillerDetector

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

func NewFillerDetector

func NewFillerDetector() *FillerDetector

func (*FillerDetector) Detect

func (d *FillerDetector) Detect(input string) []WasteFinding

type OutputUtilizationTracker

type OutputUtilizationTracker struct {
}

func NewOutputUtilizationTracker

func NewOutputUtilizationTracker() *OutputUtilizationTracker

func (*OutputUtilizationTracker) Track

func (t *OutputUtilizationTracker) Track(inputTokens int, outputTokens int) WasteFinding

type RedundantInstructionDetector

type RedundantInstructionDetector struct{}

func NewRedundantInstructionDetector

func NewRedundantInstructionDetector() *RedundantInstructionDetector

func (*RedundantInstructionDetector) Detect

type WasteAnalyzer

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

func NewWasteAnalyzer

func NewWasteAnalyzer() *WasteAnalyzer

func (*WasteAnalyzer) Analyze

func (a *WasteAnalyzer) Analyze(input string) *WasteReport

type WasteFinding

type WasteFinding struct {
	Type        WasteType `json:"type"`
	Description string    `json:"description"`
	Lines       []int     `json:"lines,omitempty"`
	Savings     int       `json:"estimated_savings_tokens"`
}

type WasteRecord

type WasteRecord struct {
	ID           int64     `json:"id"`
	Command      string    `json:"command"`
	TotalTokens  int       `json:"total_tokens"`
	WasteTokens  int       `json:"waste_tokens"`
	WasteScore   float64   `json:"waste_score"`
	FindingCount int       `json:"finding_count"`
	CreatedAt    time.Time `json:"created_at"`
}

type WasteReport

type WasteReport struct {
	TotalTokens     int            `json:"total_tokens"`
	WasteTokens     int            `json:"waste_tokens"`
	WasteScore      float64        `json:"waste_score"`
	Findings        []WasteFinding `json:"findings"`
	Recommendations []string       `json:"recommendations"`
}

type WasteScoreCalculator

type WasteScoreCalculator struct{}

func NewWasteScoreCalculator

func NewWasteScoreCalculator() *WasteScoreCalculator

func (*WasteScoreCalculator) Calculate

func (c *WasteScoreCalculator) Calculate(totalTokens int, findings []WasteFinding) float64

type WasteStore

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

func NewWasteStore

func NewWasteStore(db *sql.DB) *WasteStore

func (*WasteStore) GetAverageScore

func (s *WasteStore) GetAverageScore(days int) (float64, error)

func (*WasteStore) GetTrend

func (s *WasteStore) GetTrend(days int) ([]WasteRecord, error)

func (*WasteStore) Init

func (s *WasteStore) Init() error

func (*WasteStore) Record

func (s *WasteStore) Record(command string, report *WasteReport) error

type WasteType

type WasteType string
const (
	WasteWhitespace WasteType = "whitespace_bloat"
	WasteFiller     WasteType = "filler"
	WasteRedundant  WasteType = "redundant_instructions"
	WasteOutput     WasteType = "output_underutilization"
)

type WhitespaceBloatDetector

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

func NewWhitespaceBloatDetector

func NewWhitespaceBloatDetector() *WhitespaceBloatDetector

func (*WhitespaceBloatDetector) Detect

func (d *WhitespaceBloatDetector) Detect(input string) []WasteFinding

Jump to

Keyboard shortcuts

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