engine

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diagnose

func Diagnose(run *model.Run, rules []Rule) []model.Finding

Diagnose runs rules with causal priority applied and annotates the first-failure finding with BlockedServices when available.

func Evaluate

func Evaluate(ctx *RunContext, rules []Rule) []model.Finding

Evaluate runs all rules over ctx, dedupes, and returns stably ordered findings. Sort order: causal priority (lower first) → confidence (High→Possible) → RuleID → Service.

Types

type Rule

type Rule interface {
	ID() string
	Description() string
	Evaluate(ctx *RunContext) []model.Finding
}

Rule evaluates a recorded run and returns zero or more findings. Rules never touch Docker; they reason only over RunContext.

type RunContext

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

RunContext is a read-only view over a recorded model.Run for diagnosis rules.

func NewRunContext

func NewRunContext(run *model.Run) *RunContext

NewRunContext wraps run for rule evaluation. run may be nil (empty context).

func (*RunContext) EffectiveConfig

func (c *RunContext) EffectiveConfig() *model.EffectiveConfig

EffectiveConfig returns the run's effective config, if any.

func (*RunContext) Events

func (c *RunContext) Events() []model.Event

Events returns all events on the run.

func (*RunContext) EventsForService

func (c *RunContext) EventsForService(name string) []model.Event

EventsForService returns events whose Service field matches name.

func (*RunContext) Invocation

func (c *RunContext) Invocation() *model.Invocation

Invocation returns the run's invocation context, if any.

func (*RunContext) Run

func (c *RunContext) Run() *model.Run

Run returns the underlying run (may be nil).

func (*RunContext) Service

func (c *RunContext) Service(name string) *model.Service

Service returns the first service with the given name, or nil.

func (*RunContext) Services

func (c *RunContext) Services() []*model.Service

Services returns services sorted stably (project, name).

func (*RunContext) SetCausalPriority

func (c *RunContext) SetCausalPriority(priority map[string]int)

SetCausalPriority sets per-service causal ranks used when sorting findings. Lower values surface first. Services absent from the map sort after ranked ones.

Jump to

Keyboard shortcuts

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