Documentation
¶
Overview ¶
Package gate implements the deterministic, local PR quality gate shared by qmax-code's CLI and interactive console.
Index ¶
Constants ¶
const ( DefaultBase = "origin/main" DefaultTimeout = 10 * time.Minute )
Variables ¶
var ( ErrTimedOut = errors.New("command timed out") )
Functions ¶
func DisplayPath ¶
DisplayPath quotes paths so unusual filenames cannot inject terminal lines.
func WriteCLIUsage ¶
WriteCLIUsage prints only non-sensitive static command help.
Types ¶
type CLIOptions ¶
type CLIOptions struct {
Base string
}
CLIOptions are the stable arguments for the gate subcommand.
func ParseCLIArgs ¶
func ParseCLIArgs(args []string, errorOutput io.Writer) (CLIOptions, error)
ParseCLIArgs parses qmax-code gate arguments without touching global flags.
type Check ¶
type Check struct {
Name string
Command string
Status CheckStatus
Duration time.Duration
Evidence string
}
Check records one command without retaining unbounded command output.
type CheckStatus ¶
type CheckStatus string
CheckStatus describes the result of one deterministic check.
const ( CheckPass CheckStatus = "PASS" CheckFail CheckStatus = "FAIL" CheckIncomplete CheckStatus = "INCOMPLETE" )
type ExecRunner ¶
type ExecRunner struct{}
ExecRunner runs commands directly, never through a shell.
type Options ¶
type Options struct {
Base string
Dir string
Timeout time.Duration
Runner Runner
OnProgress func(string)
}
Options controls local gate execution.
type Result ¶
type Result struct {
Base string
MergeBase string
Head string
Files []string
// FilesTruncated indicates that Files contains only the complete paths that
// fit inside the bounded command-output budget.
FilesTruncated bool
Checks []Check
Verdict Verdict
Incomplete string
}
Result is shared by all gate presentation surfaces.