evidence

package
v0.8.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package evidence renders CNCF AI Conformance evidence markdown from validation results. Evidence includes both structural validation and behavioral test outputs.

Index

Constants

This section is empty.

Variables

View Source
var FeatureDescriptions = map[string]string{
	"dra-support":         "DRA GPU allocation test",
	"gang-scheduling":     "Gang scheduling co-scheduling test",
	"secure-access":       "Secure accelerator access verification",
	"accelerator-metrics": "Accelerator & AI service metrics",
	"inference-gateway":   "Inference API gateway conditions",
	"robust-operator":     "Robust AI operator + webhook test",
	"pod-autoscaling":     "HPA pod autoscaling (scale-up + scale-down)",
	"cluster-autoscaling": "Cluster autoscaling (ASG configuration)",
}

FeatureDescriptions maps feature names to human-readable descriptions.

View Source
var ValidFeatures = []string{
	"dra-support",
	"gang-scheduling",
	"secure-access",
	"accelerator-metrics",
	"inference-gateway",
	"robust-operator",
	"pod-autoscaling",
	"cluster-autoscaling",
}

ValidFeatures lists all supported evidence collection features. These are the user-facing names shown in help text and used with --feature.

Functions

func IsValidFeature added in v0.7.10

func IsValidFeature(name string) bool

IsValidFeature returns true if the name is a valid feature or alias.

func ResolveFeature added in v0.7.10

func ResolveFeature(name string) string

ResolveFeature returns the canonical feature name, resolving aliases.

func ScriptSection added in v0.7.10

func ScriptSection(feature string) string

ScriptSection returns the script section name for a feature.

Types

type CheckEntry

type CheckEntry struct {
	// Name is the check registry name (e.g., "accelerator-metrics").
	Name string

	// Status is the check outcome.
	Status validator.ValidationStatus

	// Reason is the check output/reason text.
	Reason string

	// Duration is how long the check took.
	Duration time.Duration

	// Artifacts contains diagnostic evidence captured during check execution.
	Artifacts []checks.Artifact
}

CheckEntry represents one check result within an evidence entry.

type Collector added in v0.7.10

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

Collector orchestrates behavioral evidence collection by invoking the embedded collect-evidence.sh script against a live Kubernetes cluster.

func NewCollector added in v0.7.10

func NewCollector(outputDir string, opts ...CollectorOption) *Collector

NewCollector creates a new evidence Collector.

func (*Collector) Run added in v0.7.10

func (c *Collector) Run(ctx context.Context) error

Run executes evidence collection for the configured features.

type CollectorOption added in v0.7.10

type CollectorOption func(*Collector)

CollectorOption configures the Collector.

func WithFeatures added in v0.7.10

func WithFeatures(features []string) CollectorOption

WithFeatures sets which features to collect evidence for. If empty, all features are collected.

func WithNoCleanup added in v0.7.10

func WithNoCleanup(noCleanup bool) CollectorOption

WithNoCleanup skips test namespace cleanup after collection.

type EvidenceEntry

type EvidenceEntry struct {
	// RequirementID is the CNCF requirement identifier (e.g., "dra_support").
	RequirementID string

	// Title is the human-readable title for the evidence document.
	Title string

	// Description is a one-paragraph description of what this requirement demonstrates.
	Description string

	// Filename is the output filename (e.g., "dra-support.md").
	Filename string

	// Checks contains the individual check results contributing to this entry.
	Checks []CheckEntry

	// Status is the aggregate status: pass if all checks pass, fail if any fails.
	Status validator.ValidationStatus

	// GeneratedAt is the timestamp when evidence was generated.
	GeneratedAt time.Time
}

EvidenceEntry holds all data needed to render a single evidence document. Multiple checks can contribute to a single entry when they share an EvidenceFile.

type Option

type Option func(*Renderer)

Option configures a Renderer.

func WithOutputDir

func WithOutputDir(dir string) Option

WithOutputDir sets the output directory for evidence files.

type Renderer

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

Renderer generates CNCF conformance evidence documents from validation results.

func New

func New(opts ...Option) *Renderer

New creates a new evidence Renderer with the given options.

func (*Renderer) Render

func (r *Renderer) Render(ctx context.Context, result *validator.ValidationResult) error

Render generates evidence markdown files from a validation result. Only checks with SubmissionRequirement=true produce evidence files. Checks with status "skipped" are excluded from evidence output.

Jump to

Keyboard shortcuts

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