conformance

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package conformance owns reusable black-box suites for workflow compilers, stores, runtimes, waits, step-kind registries, verification, and memoization.

It is extraction-ready test support. Imports are limited to the standard library and explicitly adopted extraction-safe dependencies; Hadron internal packages are forbidden. RunRequired preserves the original suite set; RunComplete preserves the complete pre-compensation family; RunExhaustive is the current exhaustive entry point. Suite entry points and fixture names are stable; semantic assertions expand as their production contracts land.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompensationSuite

func CompensationSuite(t *testing.T, store FixtureStore, factory Factory)

CompensationSuite runs graph-visible durable saga fixtures.

func CompilerSuite

func CompilerSuite(t *testing.T, store FixtureStore, factory Factory)

CompilerSuite runs graph-validation and source-map fixtures.

func ControlFlowSuite

func ControlFlowSuite(t *testing.T, store FixtureStore, factory Factory)

ControlFlowSuite runs graph-native switch, catch, and finally fixtures using the scheduler/runtime factory without widening the extraction Host surface.

func GraphValidationSuite

func GraphValidationSuite(t *testing.T, store FixtureStore, factory Factory)

GraphValidationSuite runs only production graph-validation fixtures. It lets external compiler implementations invoke this contract without also implementing source-map fixture semantics.

func MemoizationSuite

func MemoizationSuite(t *testing.T, store FixtureStore, factory Factory)

MemoizationSuite runs production memo entry, pin binding, expiry, and effect safety fixtures independently of the combined host entry points.

func RunAll deprecated

func RunAll(t *testing.T, store FixtureStore, host Host)

RunAll invokes the original required conformance suite set.

Deprecated: its historical name predates optional verification and memoization families. Use RunRequired for that exact compatibility contract or RunComplete for the complete pre-compensation suite set.

func RunComplete

func RunComplete(t *testing.T, store FixtureStore, host CompleteHost)

RunComplete invokes the source-compatible pre-compensation suite family, including verification and memoization.

func RunExhaustive

func RunExhaustive(t *testing.T, store FixtureStore, host CompensationHost)

RunExhaustive invokes every current suite, including durable compensation.

func RunRequired

func RunRequired(t *testing.T, store FixtureStore, host RequiredHost)

RunRequired invokes the stable required conformance suite set using one application-neutral host.

func SchedulerSuite

func SchedulerSuite(t *testing.T, store FixtureStore, factory Factory)

SchedulerSuite runs ready-queue and scheduling fixtures.

func StateStoreSuite

func StateStoreSuite(t *testing.T, store FixtureStore, factory Factory)

StateStoreSuite runs typed-value persistence fixtures.

func StepKindRegistrySuite

func StepKindRegistrySuite(t *testing.T, store FixtureStore, factory Factory)

StepKindRegistrySuite runs executor-metadata registry fixtures.

func VerificationSuite

func VerificationSuite(t *testing.T, store FixtureStore, factory Factory)

VerificationSuite runs deterministic decision, literal evidence, retry, catch, and fail-closed reviewer fixtures independently of the combined host entry points.

func WaitSuite

func WaitSuite(t *testing.T, store FixtureStore, factory Factory)

WaitSuite runs suspend and resume fixtures.

Types

type CompensationHost

type CompensationHost interface {
	CompleteHost
	CompensationFactory() Factory
}

CompensationHost is the source-compatible exhaustive extension for hosts that implement the durable compensation fixture family. CompleteHost is intentionally unchanged.

type CompleteHost

type CompleteHost interface {
	RequiredHost
	VerificationFactory() Factory
	MemoizationFactory() Factory
}

CompleteHost supplies the complete pre-compensation conformance family. It remains source-compatible for existing hosts; CompensationHost is the exhaustive extension.

type Expectation

type Expectation string

Expectation describes whether a conformance fixture should be accepted or rejected by a runner.

const (
	// ExpectPass marks a fixture that a conforming runner must accept.
	ExpectPass Expectation = "pass"
	// ExpectFail marks a fixture that a conforming runner must reject.
	ExpectFail Expectation = "fail"
)

type Factory

type Factory func() (Runner, error)

Factory creates an isolated runner for one fixture invocation.

type Fixture

type Fixture struct {
	Set         FixtureSet
	Name        string
	Path        string
	Expectation Expectation
	Input       json.RawMessage
}

Fixture is a conformance-only test case. Input remains opaque to the harness so suites do not duplicate production workflow contracts.

type FixtureSet

type FixtureSet string

FixtureSet identifies a stable conformance fixture directory.

const (
	// GraphValidationFixtures contains compiler graph-validation cases.
	GraphValidationFixtures FixtureSet = "graph-validation"
	// SourceMapFixtures contains compiler source-map cases.
	SourceMapFixtures FixtureSet = "source-maps"
	// ValueFixtures contains state-store value cases.
	ValueFixtures FixtureSet = "values"
	// SchedulerFixtures contains scheduler cases.
	SchedulerFixtures FixtureSet = "scheduler"
	// ControlFlowFixtures contains switch, catch, and finally scheduler cases.
	ControlFlowFixtures FixtureSet = "control-flow"
	// WaitFixtures contains wait and resume cases.
	WaitFixtures FixtureSet = "waits"
	// ExecutorMetadataFixtures contains step-kind registry metadata cases.
	ExecutorMetadataFixtures FixtureSet = "executor-metadata"
	// VerificationFixtures contains post-execution verification/evidence cases.
	VerificationFixtures FixtureSet = "verification"
	// MemoizationFixtures contains memo/pin provenance and safety cases.
	MemoizationFixtures FixtureSet = "memoization"
	// CompensationFixtures contains durable saga ordering and recovery cases.
	CompensationFixtures FixtureSet = "compensation"
)

type FixtureStore

type FixtureStore interface {
	Fixtures(set FixtureSet) ([]Fixture, error)
}

FixtureStore loads the fixtures for a stable fixture set. It is test-data storage and is unrelated to the workflow runtime state-store contract.

func EmbeddedFixtures

func EmbeddedFixtures() FixtureStore

EmbeddedFixtures returns the package's stable, extraction-ready fixture store.

type Host deprecated

type Host = RequiredHost

Host is the original required-suite host contract.

Deprecated: use RequiredHost for RunRequired or CompleteHost for RunComplete.

type RequiredHost

type RequiredHost interface {
	CompilerFactory() Factory
	StateStoreFactory() Factory
	SchedulerFactory() Factory
	WaitFactory() Factory
	StepKindRegistryFactory() Factory
}

RequiredHost supplies factories for the stable required conformance suites. These factories are test seams, not production workflow host or runtime contracts.

type Runner

type Runner interface {
	Run(ctx context.Context, fixture Fixture) error
}

Runner executes one opaque conformance fixture through an implementation supplied by a host or adapter.

type RunnerFunc

type RunnerFunc func(ctx context.Context, fixture Fixture) error

RunnerFunc adapts a function to Runner.

func (RunnerFunc) Run

func (f RunnerFunc) Run(ctx context.Context, fixture Fixture) error

Run implements Runner.

Jump to

Keyboard shortcuts

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