conformance

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package conformance links public requirement claims to discoverable Go tests and records their executable outcomes. It never runs physical hardware tests.

Index

Constants

View Source
const Module = "github.com/open-ships/n2k"

Variables

This section is empty.

Functions

func Record

func Record(results []RequirementResult, event Event)

Record retains top-level outcomes and any skipped descendants. A passed parent cannot disguise skipped branches of its claimed evidence.

func Summarize

func Summarize(results []RequirementResult) error

func Validate

func Validate(index Index) error

Types

type Catalog

type Catalog map[string][]string

func Discover

func Discover(ctx context.Context, directory string, index Index) (Catalog, error)

Discover uses compiled go test -list output, not source-text matching. Listing does not execute any test, including the optional hardware and soak entries.

type Event

type Event struct {
	Action  string  `json:"Action"`
	Package string  `json:"Package"`
	Test    string  `json:"Test"`
	Output  string  `json:"Output"`
	Elapsed float64 `json:"Elapsed"`
}

type Evidence

type Evidence struct {
	Package string `json:"package"`
	Pattern string `json:"pattern"`
	Kind    string `json:"kind"`
}

type EvidenceResult

type EvidenceResult struct {
	Evidence
	Status string      `json:"status"`
	Tests  []Execution `json:"tests,omitempty"`
}

type Execution

type Execution struct {
	Test           string   `json:"test"`
	Status         string   `json:"status"`
	ElapsedSeconds float64  `json:"elapsedSeconds"`
	Skipped        []string `json:"skippedSubtests,omitempty"`
}

type Index

type Index struct {
	SchemaVersion int           `json:"schemaVersion"`
	Requirements  []Requirement `json:"requirements"`
}

type Report

type Report struct {
	SchemaVersion      int                 `json:"schemaVersion"`
	CreatedAt          time.Time           `json:"createdAt"`
	Commit             string              `json:"commit"`
	WorkingTreeDirty   bool                `json:"workingTreeDirty"`
	GoVersion          string              `json:"goVersion"`
	RequirementsSHA256 string              `json:"requirementsSHA256"`
	Status             string              `json:"status"`
	Requirements       []RequirementResult `json:"requirements"`
	Errors             []string            `json:"errors,omitempty"`
}

func Run

func Run(ctx context.Context, directory string, index Index, artifact io.Writer) (Report, error)

Run executes only the exact software tests resolved from the index and streams the unmodified go test -json events to artifact. Hardware and soak entries stay explicitly not-run, regardless of environment configuration.

type Requirement

type Requirement struct {
	ID       string     `json:"id"`
	Category string     `json:"category"`
	Behavior string     `json:"behavior"`
	Evidence []Evidence `json:"evidence"`
}

type RequirementResult

type RequirementResult struct {
	ID       string           `json:"id"`
	Status   string           `json:"status"`
	Evidence []EvidenceResult `json:"evidence"`
}

func Resolve

func Resolve(index Index, catalog Catalog) ([]RequirementResult, error)

Resolve fails every unmatched reference, including optional evidence, and prevents broad software patterns from selecting hardware or soak tests.

Jump to

Keyboard shortcuts

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