preflightconditions

package
v0.151.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPreflightFailed = stderrors.New("preflight baseline broken — dark-factory exiting")

ErrPreflightFailed is the canonical sentinel for the preflight-baseline-broken case. When returned by ShouldSkip, the caller must terminate dark-factory — it does not skip a cycle.

Functions

This section is empty.

Types

type Conditions

type Conditions interface {
	// ShouldSkip runs all pre-execution skip checks.
	// Returns (true, nil) for transient conditions (git lock, dirty files) — caller skips this cycle.
	// Returns (false, ErrPreflightFailed) when the preflight baseline is broken — caller must terminate.
	ShouldSkip(ctx context.Context) (skip bool, err error)
}

Conditions runs all pre-execution skip checks in order: baseline preflight, git index lock, dirty-file threshold. Returns ErrPreflightFailed for the baseline-broken case, which causes the caller to terminate dark-factory rather than skip a cycle.

func NewConditions

func NewConditions(
	preflightChecker preflight.Checker,
	gitLockChecker GitLockChecker,
	dirtyFileChecker DirtyFileChecker,
	dirtyFileThreshold int,
) Conditions

NewConditions creates a Conditions implementation. nil arguments disable the respective check.

type DirtyFileChecker

type DirtyFileChecker interface {
	CountDirtyFiles(ctx context.Context) (int, error)
}

DirtyFileChecker counts dirty files in a git working tree.

type GitLockChecker

type GitLockChecker interface {
	Exists() bool
}

GitLockChecker checks whether .git/index.lock exists in the working tree.

Jump to

Keyboard shortcuts

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