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 libtime.Duration, projectRoot string, n notifier.Notifier, projectName string, currentDateTimeGetter libtime.CurrentDateTimeGetter, runner subproc.Runner, ) 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. currentDateTimeGetter provides the current time for cache expiry checks. runner is the subprocess runner used to execute the preflight command.