verify

package
v0.1.0-develop.2026061... Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package verify provides verify-command introspection used by `gocell verify` and by kernel/governance VERIFY-* rules.

A "verify command" is a shell command declared in cell.yaml / slice.yaml verify.{smoke,unit,contract} fields; verify reads those declarations from a parsed ProjectMeta and reports completeness, uniqueness, and reachability.

verify does NOT execute commands — it only inspects the declared strings. Actual execution is `gocell run-journey` and CI's `hack/make-rules/verify.sh`.

Package verify provides metadata-driven verification runners for cells, slices, and journeys. It shells out to "go test" and uses the verify blocks declared in cell.yaml, slice.yaml, and journey YAML files to determine which tests to execute.

Index

Constants

View Source
const (
	PrefixJourney  = "journey"
	PrefixSmoke    = "smoke"
	PrefixUnit     = "unit"
	PrefixContract = "contract"

	ModeAuto   = "auto"
	ModeManual = "manual"
)

Ref prefix and criteria mode constants.

Variables

This section is empty.

Functions

func JourneyRefScope

func JourneyRefScope(ref string) (string, error)

JourneyRefScope returns the journey ID declared inside a journey checkRef.

Types

type Runner

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

Runner executes metadata-driven verification tests.

func NewRunner

func NewRunner(project *metadata.ProjectMeta, root string) *Runner

NewRunner creates a Runner for executing verification tests.

func (*Runner) RunActiveJourneys

func (r *Runner) RunActiveJourneys(ctx context.Context) (*VerifyResult, error)

RunActiveJourneys runs every active journey in the parsed project. A non-nil project with zero active journeys is treated as a fail-fast condition (K-02 (b)): without this guard, RunActiveJourneys would silently pass on a project whose journeys are all stuck at experimental — exactly the failure mode the K-02 closure is meant to detect.

nil project is preserved as a pass path: CLI startup invokes RunActiveJourneys before metadata is parsed in some flows, and "no project loaded" is a different defect class (already surfaced by the caller) from "project loaded, no active journey".

func (*Runner) RunJourney

func (r *Runner) RunJourney(ctx context.Context, journeyID string) (*VerifyResult, error)

RunJourney runs auto-mode pass criteria for a journey and collects manual criteria into ManualPending.

func (*Runner) RunJourneyCheckRef

func (r *Runner) RunJourneyCheckRef(ctx context.Context, j *metadata.JourneyMeta, ref string) (TestResult, []error)

RunJourneyCheckRef executes one journey checkRef using the same resolver as RunJourney. Governance strict mode calls this so promotion gates and runtime verification share the exact same target binding.

func (*Runner) VerifyCell

func (r *Runner) VerifyCell(ctx context.Context, cellID string) (*VerifyResult, error)

VerifyCell runs smoke tests for a cell driven by metadata verify.smoke. If no smoke refs are declared, logs a warning and returns passed.

func (*Runner) VerifySlice

func (r *Runner) VerifySlice(ctx context.Context, sliceKey string) (*VerifyResult, error)

VerifySlice runs tests for a slice driven by metadata verify.unit and verify.contract declarations. If neither is declared, falls back to running all tests in the slice package.

type TestResult

type TestResult struct {
	Name        string
	Passed      bool
	Output      string
	ZeroMatch   bool // true when -run pattern matched no tests
	SkippedOnly bool // true when matched tests all skipped
}

TestResult represents the outcome of a single test target.

type VerifyResult

type VerifyResult struct {
	TargetID      string
	Passed        bool
	Results       []TestResult
	Errors        []error
	ManualPending []string // text of manual criteria not yet verified
}

VerifyResult represents the outcome of verifying a slice, cell, or journey.

Jump to

Keyboard shortcuts

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