Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
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.