preflight

package
v0.137.0 Latest Latest
Warning

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

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

Documentation

Overview

Package preflight provides the baseline check that runs before each prompt execution. It verifies that the project's CI command passes on the clean main-branch tree, caching results per git commit SHA to avoid redundant container runs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	// Check returns true when the baseline is green and the prompt may proceed.
	// Returns false when the baseline is broken or preflight is disabled (empty command).
	// Docker execution errors and non-zero exit codes are both treated as "broken baseline":
	// they are logged and cause false to be returned, never propagated as Go errors.
	Check(ctx context.Context) (bool, error)
}

Checker verifies the project baseline before each prompt execution.

func NewChecker

func NewChecker(
	command string,
	interval time.Duration,
	projectRoot string,
	n notifier.Notifier,
	projectName string,
) Checker

NewChecker creates a new preflight Checker. command is the shell command to run (empty string disables preflight). interval is how long a cached green result is valid (0 disables caching). projectRoot is the absolute path of the project directory. n is used to notify humans when the baseline is broken. projectName is the project identifier used in notifications.

Jump to

Keyboard shortcuts

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