review

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfidenceBreakdown

type ConfidenceBreakdown struct {
	High   []Finding `json:"high"`
	Medium []Finding `json:"medium"`
	Low    []Finding `json:"low"`
}

ConfidenceBreakdown groups review findings by confidence band.

type Finding

type Finding struct {
	Concern    string             `json:"concern"`
	Severity   contracts.Severity `json:"severity"`
	File       string             `json:"file"`
	Line       int                `json:"line"`
	EndLine    int                `json:"end_line,omitempty"`
	Message    string             `json:"message"`
	Fix        string             `json:"fix,omitempty"`
	Reasoning  string             `json:"reasoning,omitempty"`
	CWE        string             `json:"cwe,omitempty"`
	Confidence float64            `json:"confidence"`
	SASTSource bool               `json:"sast_source,omitempty"`
}

Finding is the neutral review finding contract shared across Hawk and review engines.

type InlineComment

type InlineComment struct {
	Path       string `json:"path"`
	StartLine  int    `json:"start_line"`
	EndLine    int    `json:"end_line,omitempty"`
	Body       string `json:"body"`
	Suggestion string `json:"suggestion,omitempty"`
}

InlineComment is a review finding mapped to a concrete diff position.

type Result

type Result struct {
	Findings            []Finding            `json:"findings"`
	Comments            []InlineComment      `json:"comments"`
	Stats               Stats                `json:"stats"`
	Report              string               `json:"report"`
	FailOn              contracts.Severity   `json:"fail_on"`
	SASTFusion          *SASTFusionResult    `json:"sast_fusion,omitempty"`
	ConfidenceBreakdown *ConfidenceBreakdown `json:"confidence_breakdown,omitempty"`
}

Result is the neutral review result contract.

func (*Result) Failed

func (r *Result) Failed() bool

Failed reports whether any finding meets or exceeds the configured fail threshold.

func (*Result) MaxSeverity

func (r *Result) MaxSeverity() contracts.Severity

MaxSeverity returns the highest severity present in the result.

type SASTFusionResult

type SASTFusionResult struct {
	Confirmed   []Finding `json:"confirmed"`
	Dismissed   []Finding `json:"dismissed"`
	Unaddressed []Finding `json:"unaddressed"`
}

SASTFusionResult tracks how the LLM handled SAST findings during a review. Only populated when SAST-LLM fusion is active (preAnalysis enabled).

type Stats

type Stats struct {
	FilesReviewed       int                        `json:"files_reviewed"`
	HunksAnalyzed       int                        `json:"hunks_analyzed"`
	FindingsTotal       int                        `json:"findings_total"`
	BySeverity          map[contracts.Severity]int `json:"by_severity"`
	ByConcern           map[string]int             `json:"by_concern"`
	TokensUsed          int                        `json:"tokens_used"`
	DurationPerConcern  map[string]time.Duration   `json:"duration_per_concern"`
	AverageConfidence   float64                    `json:"average_confidence"`
	HighConfidenceCount int                        `json:"high_confidence_count"`
	LowConfidenceCount  int                        `json:"low_confidence_count"`
}

Stats captures review execution metrics.

Jump to

Keyboard shortcuts

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