fullverification

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fullverification discovers the project-wide build and test entrypoints that form the session-end machine verification floor.

Index

Constants

View Source
const (
	DeclaredBuildSource = "--verify-build"
	DeclaredTestSource  = "--verify-test"
)

The sources a declared entrypoint carries, spelled as the flags a person typed, so every line that reports the command says where it came from.

Variables

This section is empty.

Functions

func ActivationPreamble

func ActivationPreamble(workspace, workdir string) string

ActivationPreamble is the shell lines that put the virtual environment for a command run in workdir first on PATH, the way its activate script does, and "" when there is none (ProjectVenv).

func ProjectVenv

func ProjectVenv(workspace, workdir string) string

ProjectVenv is the Python virtual environment for a command run in workdir (relative to workspace, "" for the workspace itself): one in workdir, else one at the top of the workspace. A folder is one when it holds pyvenv.cfg and bin/python, a link to the interpreter it was made from, followed. "" when there is none.

Types

type Declared

type Declared struct {
	Build string
	Test  string
}

Declared is the build and test commands a person named on the command line. An empty field leaves that kind to discovery.

type Entrypoint

type Entrypoint struct {
	Kind    EntrypointKind `json:"kind"`
	Command string         `json:"command"`
	Workdir string         `json:"workdir,omitempty"`
	Source  string         `json:"source"`
}

func (Entrypoint) IsDeclared

func (entrypoint Entrypoint) IsDeclared() bool

IsDeclared reports whether an entrypoint came from the command line rather than from discovery.

type EntrypointKind

type EntrypointKind string
const (
	KindBuild EntrypointKind = "build"
	KindTest  EntrypointKind = "test"
)

type Plan

type Plan struct {
	Entrypoints []Entrypoint `json:"entrypoints"`
	// BuildExpected reports whether this project is required to have a
	// build/typecheck step. True for any accountable workspace — including one
	// whose ecosystem we do not recognize — so the gate stays fail-closed; a
	// plain Python package is the one case we can positively identify as
	// having nothing to compile.
	BuildExpected bool `json:"buildExpected"`
	// TestExpected reports whether this project is required to have a test
	// step. True for any accountable workspace: unlike a build, no ecosystem
	// is exempt from having tests. Both flags are false only for a workspace
	// that is not accountable at all (see accountableWorkspace).
	TestExpected bool `json:"testExpected"`
}

func Discover

func Discover(workspace string) Plan

Discover prefers CI, then repository instructions, declared scripts/manifests, and finally ecosystem defaults. Each kind gets one project-wide entrypoint.

func (Plan) Declare

func (plan Plan) Declare(declared Declared) Plan

Declare returns the plan with each command the person named in place of whatever discovery chose for that kind. A declared kind is expected, so the floor holds the run to it exactly as it would a discovered one.

Jump to

Keyboard shortcuts

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