engine

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package engine evaluates a compiled rule set against normalized plan changes and returns ranked findings. It is deliberately dependency-light: the LLM enrichment lives elsewhere, so findings here are complete on their own.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rank

func Rank(severity string) int

Rank returns the numeric severity rank (higher = more severe); unknown severities rank as 0.

Types

type Finding

type Finding struct {
	RuleID   string   `json:"rule_id"`
	Severity string   `json:"severity"`
	Title    string   `json:"title"`
	Address  string   `json:"address"`
	Fix      string   `json:"fix,omitempty"`
	Refs     []string `json:"refs,omitempty"`
	Provider string   `json:"provider,omitempty"`
	Source   string   `json:"source,omitempty"`
}

Finding is one triggered rule against one resource.

func Evaluate

func Evaluate(changes []plan.ResourceChange, set *rules.Set) ([]Finding, error)

Evaluate runs every applicable rule against every change. Findings are sorted by severity (highest first), then by resource address.

Jump to

Keyboard shortcuts

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