evidence

package
v0.9.8 Latest Latest
Warning

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

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

Documentation

Overview

Package evidence renders CNCF AI Conformance evidence markdown from CTRF reports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckEntry

type CheckEntry struct {
	// Name is the validator name.
	Name string

	// Status is the check outcome ("passed", "failed", "skipped", "other").
	Status string

	// Message is the error message (from termination log on failure).
	Message string

	// Stdout contains the evidence output lines.
	Stdout []string

	// Duration is the execution time in milliseconds.
	Duration int
}

CheckEntry represents one check result within an evidence entry.

type EvidenceEntry

type EvidenceEntry struct {
	// RequirementID is the CNCF requirement identifier.
	RequirementID string

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

	// Description is a one-paragraph description.
	Description string

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

	// Checks contains the individual check results.
	Checks []CheckEntry

	// Status is the aggregate: "passed" if all pass, "failed" if any fails.
	Status string

	// GeneratedAt is the evidence generation timestamp.
	GeneratedAt time.Time
}

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

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 CTRF reports.

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, report *ctrf.Report) error

Render generates evidence markdown files from a CTRF report. Groups test results by CNCF requirement. Only submission-required checks produce evidence. Skipped tests are excluded.

type RequirementMeta added in v0.9.2

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

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

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

	// File is the output filename for the evidence document (e.g., "dra-support.md").
	File string
}

RequirementMeta maps a validator name to its CNCF conformance requirement.

func GetRequirement added in v0.9.0

func GetRequirement(validatorName string) *RequirementMeta

GetRequirement returns the requirement metadata for a validator name. Returns nil if the validator is not a submission-required conformance check.

Jump to

Keyboard shortcuts

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