conformance

package
v0.0.7-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package conformance exposes the checked-in, language-neutral resolve/read verification corpus. The corpus is immutable protocol test data; producing runtime evidence remains the responsibility of the deterministic generator.

Index

Constants

View Source
const (
	// ResolveReadV1 and ResolveReadV2 are independent conformance-corpus
	// versions, not replacements for the resolve/read wire profile identifiers.
	ResolveReadV1      = "malt.resolve-read.conformance/v1"
	ResolveReadV2      = "malt.resolve-read.conformance/v2"
	ResolveReadCurrent = ResolveReadV2

	OperationResolve = "resolve"
	OperationRead    = "read"

	BackendNone = "none"
	BackendKZG  = "kzg"
	BackendIPA  = "ipa"
)

Variables

This section is empty.

Functions

func Accepted

func Accepted(ctx context.Context, verifier Verifier, vector Vector) bool

Accepted evaluates one vector through the same strict DTO decoders used by transport adapters. Any decode, shape, binding, or cryptographic error is a portable rejection; diagnostic error text is intentionally ignored.

func Bytes

func Bytes() ([]byte, error)

Bytes returns a detached copy of the current checked-in corpus bytes.

func BytesVersion

func BytesVersion(version string) ([]byte, error)

BytesVersion returns a detached copy of one supported checked-in corpus.

func Schema

func Schema(name string) ([]byte, error)

Schema returns a detached copy of one current conformance schema.

func SchemaVersion

func SchemaVersion(version, name string) ([]byte, error)

SchemaVersion returns a detached schema for one supported corpus version.

Types

type Corpus

type Corpus struct {
	SchemaVersion string   `json:"schema_version"`
	Vectors       []Vector `json:"vectors"`
}

Corpus is the stable, ordered envelope shared by every verifier adapter.

func Load

func Load() (Corpus, error)

Load returns and validates the current conformance corpus.

func LoadVersion

func LoadVersion(version string) (Corpus, error)

LoadVersion returns and validates one explicitly supported corpus version.

func (Corpus) Validate

func (c Corpus) Validate() error

Validate checks corpus-level invariants that JSON Schema alone cannot make convenient for small consumers, including stable ID uniqueness.

type Expected

type Expected struct {
	Valid bool `json:"valid"`
}

Expected records the portable outcome. Error strings are deliberately not conformance data because they are implementation-specific diagnostics.

func (*Expected) UnmarshalJSON

func (e *Expected) UnmarshalJSON(data []byte) error

UnmarshalJSON makes expected.valid required while retaining a convenient bool-facing API for corpus consumers.

type Vector

type Vector struct {
	ID           string          `json:"id"`
	Operation    string          `json:"operation"`
	Backend      string          `json:"backend"`
	Category     string          `json:"category"`
	Verification json.RawMessage `json:"verification"`
	Expected     Expected        `json:"expected"`
}

Vector binds one exact serialized verification input to an accept/reject expectation. Verification remains raw so malformed field encodings can be tested without weakening the corpus envelope decoder.

func (Vector) Validate

func (v Vector) Validate() error

Validate checks the stable envelope without interpreting the operation DTO.

type Verifier

type Verifier interface {
	VerifyResolve(context.Context, protocol.ResolveVerification) error
	VerifyRead(context.Context, protocol.ReadVerification) error
}

Verifier is the portable resolve/read verification surface exercised by the corpus. sdk/verifier.Verifier satisfies this interface.

Jump to

Keyboard shortcuts

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