engine

package
v1.322.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateVerdict

func AggregateVerdict(assertions []AssertionResult) validators.Status

func ImageReferenceURLs

func ImageReferenceURLs(value any) []string

ImageReferenceURLs collects every image reference URL inside an evidence value, depth-first, deduplicated and in stable order.

Types

type AssertionResult

type AssertionResult struct {
	ID           string            `json:"id"`
	Validator    string            `json:"validator"`
	Input        string            `json:"input"`
	Status       validators.Status `json:"status"`
	Message      string            `json:"message,omitempty"`
	Details      map[string]any    `json:"details,omitempty"`
	EvidenceKeys []string          `json:"evidence_keys,omitempty"`
}

type Engine

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

func New

func New(registry *validators.Registry) (*Engine, error)

func (*Engine) ExecuteCatalog

func (e *Engine) ExecuteCatalog(
	ctx context.Context,
	cat *catalog.Catalog,
	testIDs []string,
	suite string,
	runtime map[string]any,
	bundle evidence.Bundle,
) (Report, error)

type EvidenceMap

type EvidenceMap map[string]EvidenceRecord

type EvidenceRecord

type EvidenceRecord struct {
	Type       string `json:"type,omitempty"`
	SourceNode string `json:"source_node,omitempty"`
	Path       string `json:"path,omitempty"`
	From       string `json:"from,omitempty"`
	Value      any    `json:"value,omitempty"`
}

type EvidenceResult

type EvidenceResult struct {
	Name       string `json:"name,omitempty"`
	SourceNode string `json:"source_node,omitempty"`
	Path       string `json:"path,omitempty"`
	From       string `json:"from,omitempty"`
	Value      any    `json:"-"`
	Type       string `json:"type,omitempty"`
}

type ExecutedCheck

type ExecutedCheck struct {
	ID           string   `json:"id"`
	Kind         string   `json:"kind"`
	Status       string   `json:"status"`
	Message      string   `json:"message,omitempty"`
	EvidenceKeys []string `json:"evidence_keys,omitempty"`
}

type ExecutedEvidence

type ExecutedEvidence struct {
	Name       string   `json:"name"`
	SourceNode string   `json:"source_node,omitempty"`
	Visual     []string `json:"visual,omitempty"`
}

ExecutedEvidence records which evidence a test consumed. The flat report evidence map keeps only one record per name, so per-test consumers such as the PDF and the webapp sheet must use this list to attach the right scenario's artifacts to each test.

type ExecutedTest

type ExecutedTest struct {
	TestID     string             `json:"test_id"`
	Title      string             `json:"title,omitempty"`
	SourceURL  string             `json:"source_url,omitempty"`
	Status     string             `json:"status"`
	Assertions []ExecutedCheck    `json:"assertions,omitempty"`
	Evidence   []ExecutedEvidence `json:"evidence,omitempty"`
	Outcome    TestOutcome        `json:"outcome"`
}

type FailureReason

type FailureReason struct {
	Scope   string            `json:"scope"`
	ID      string            `json:"id"`
	Status  validators.Status `json:"status"`
	Message string            `json:"message,omitempty"`
}

type Presentation

type Presentation struct {
	Deeplink       string                   `json:"deeplink,omitempty"`
	Screenshots    []PresentationScreenshot `json:"screenshots,omitempty"`
	SummaryFilters []PresentationFilter     `json:"summary_filters,omitempty"`
}

Presentation is the display projection nested inside an FCAF assessment report.

func BuildPresentation

func BuildPresentation(report Report, maestroURLs []string) Presentation

BuildPresentation builds the display projection for an FCAF assessment report.

type PresentationFilter

type PresentationFilter struct {
	Key   string `json:"key"`
	Label string `json:"label"`
	Count int    `json:"count"`
}

PresentationFilter is a non-empty summary count aligned to an executed status.

type PresentationScreenshot

type PresentationScreenshot struct {
	URL     string   `json:"url"`
	Label   string   `json:"label"`
	TestIDs []string `json:"test_ids,omitempty"`
}

PresentationScreenshot identifies an image and the tests that use it as visual evidence.

type Report

type Report struct {
	Suite           string         `json:"suite,omitempty"`
	SelectedTestIDs []string       `json:"selected_test_ids,omitempty"`
	Status          string         `json:"status,omitempty"`
	Tests           []TestResult   `json:"tests,omitempty"`
	ExecutedTests   []ExecutedTest `json:"executed_tests,omitempty"`
	Evidence        EvidenceMap    `json:"evidence,omitempty"`
	Summary         Summary        `json:"summary"`
	Failures        []TestFailure  `json:"failures,omitempty"`
	Presentation    *Presentation  `json:"presentation,omitempty"`
}

func (*Report) AttachPresentation

func (r *Report) AttachPresentation(maestroURLs []string)

AttachPresentation builds and stores the report's display projection.

func (Report) HasNonPassingTests

func (r Report) HasNonPassingTests() bool

func (*Report) PopulateDerivedViews

func (r *Report) PopulateDerivedViews()

func (*Report) PopulateEvidence

func (r *Report) PopulateEvidence()

func (*Report) PopulateExecutedTests

func (r *Report) PopulateExecutedTests()

func (*Report) PopulateFailures

func (r *Report) PopulateFailures()

func (Report) PublicReport

func (r Report) PublicReport() Report

type Summary

type Summary struct {
	Pass          int `json:"pass"`
	Fail          int `json:"fail"`
	Blocked       int `json:"blocked"`
	Skipped       int `json:"skipped"`
	Inconclusive  int `json:"inconclusive"`
	NotApplicable int `json:"not_applicable"`
	Error         int `json:"error"`
}

type TestFailure

type TestFailure struct {
	TestID  string            `json:"test_id"`
	Title   string            `json:"title,omitempty"`
	Status  validators.Status `json:"status"`
	Reasons []FailureReason   `json:"reasons"`
	Message string            `json:"message,omitempty"`
}

type TestOutcome

type TestOutcome struct {
	Status string `json:"status"`
	Reason string `json:"reason,omitempty"`
}

type TestResult

type TestResult struct {
	ID                  string                   `json:"id"`
	Title               string                   `json:"title,omitempty"`
	Status              validators.Status        `json:"status"`
	Suite               dsl.Suite                `json:"suite"`
	Assertions          []AssertionResult        `json:"assertions"`
	NormativeReferences []dsl.NormativeReference `json:"normative_references"`
	Evidence            []EvidenceResult         `json:"evidence,omitempty"`
	Message             string                   `json:"message,omitempty"`
}

Jump to

Keyboard shortcuts

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