execution

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package execution selects closed operation steps, prepares their requirement closure once, and executes prepared actions in deterministic order.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action func(context.Context) error

Action is a prepared operation action; repository checks bind typed output-producing closures as actions.

type Binder

type Binder func([]StepID) ([]BoundAction, error)

Binder creates actions for the selected steps after their requirements are prepared; repository checks use it to freeze prepared typed inputs into closures.

type BoundAction

type BoundAction struct {
	Step StepID
	Run  Action
}

BoundAction associates a selected step with its prepared action; the repository-check binder returns these associations.

type FailurePolicy

type FailurePolicy uint8

FailurePolicy controls whether execution stops after an action failure; repository-check children stop and its aggregate continues.

const (
	// StopOnFailure leaves later actions unattempted after the first action failure.
	StopOnFailure FailurePolicy = iota
	// ContinueOnFailure attempts every selected action despite action failures.
	ContinueOnFailure
)

type Outcome

type Outcome struct {
	Step StepID
	Err  error
}

Outcome records the identity and result of one attempted action; the repository-check adapter uses it for first-error routing.

type Prepared

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

Prepared is a fully prepared and bound execution ready to run; the repository-check adapter runs it after capability readiness.

func Prepare

func Prepare(ctx context.Context, system System, requested []StepID) (*Prepared, error)

Prepare validates a closed system, prepares its selected requirement closure, and binds selected actions for the repository-check adapter or another caller.

func (*Prepared) Run

func (p *Prepared) Run(ctx context.Context, policy FailurePolicy) ([]Outcome, error)

Run executes bound actions under policy and returns outcomes only for attempted actions; the repository-check adapter maps those outcomes to command behavior.

type Requirement

type Requirement struct {
	ID           RequirementID
	Dependencies []RequirementID
	Prepare      func(context.Context) error
}

Requirement declares a capability, its prerequisite capabilities, and its optional preparation; repository checks declare their operation-local capability preparation with it.

type RequirementID

type RequirementID string

RequirementID identifies a caller-declared prerequisite capability; the repository-check consumer uses it for config, Project, report, and index capabilities.

type Step

type Step struct {
	ID           StepID
	Requirements func(context.Context) ([]RequirementID, error)
}

Step declares a selectable operation and its requirements after foundations are ready; repository checks use it for their selectable checks.

type StepID

type StepID string

StepID identifies a caller-declared operation step; the repository-check consumer uses it for drift, state, prose, and memory.

type System

type System struct {
	Requirements []Requirement
	Steps        []Step
	Foundations  []RequirementID
	Bind         Binder
}

System is a closed caller-declared set of requirements, steps, foundations, and action binding; repository checks compose one per operation.

Jump to

Keyboard shortcuts

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