analyzerexec

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 18 Imported by: 0

Documentation

Overview

Package analyzerexec launches one digest-pinned staged native analyzer. It accepts no command string, PATH lookup, inherited environment, repository working directory, network API, or retry policy.

Index

Constants

View Source
const MaxExecutableBytes = 64 << 20

Variables

This section is empty.

Functions

func InvocationBindingSHA256

func InvocationBindingSHA256(request []byte, host, target NativePlatform) string

func Is

func Is(err error, want Failure) bool

Types

type CleanupError

type CleanupError string

CleanupError retains only the operation class. Raw platform errors and staging paths are deliberately never returned to Core receipts.

const (
	CleanupErrorNone   CleanupError = "NONE"
	CleanupErrorClose  CleanupError = "CLOSE"
	CleanupErrorRemove CleanupError = "REMOVE"
)

type CleanupObservation

type CleanupObservation string

CleanupObservation distinguishes an observed zero-duration cleanup from a path which never launched and therefore has no cleanup measurement.

const (
	CleanupNotRun   CleanupObservation = "NOT_RUN"
	CleanupObserved CleanupObservation = "OBSERVED"
	CleanupFailed   CleanupObservation = "FAILED"
	// CleanupRejected records that Core rejected a malformed started-backend
	// observation. It is receipt-only: this state itself proves a process did
	// start and is not a valid backend cleanup observation.
	CleanupRejected CleanupObservation = "REJECTED"
)

type Error

type Error struct{ Failure Failure }

func (*Error) Error

func (e *Error) Error() string

type Failure

type Failure string
const (
	IdentityUnsafe Failure = "identity-unsafe"
	DigestMismatch Failure = "digest-mismatch"
	Race           Failure = "race"
	Unsupported    Failure = "unsupported"
	Limit          Failure = "limit"
	Timeout        Failure = "timeout"
	Cancelled      Failure = "cancelled"
	Process        Failure = "process"
)

type NativePlatform

type NativePlatform struct {
	OS           string
	Architecture string
	ABI          string
}

NativePlatform is the executable-header tuple required by a contained native launch. It deliberately names the native object format ABI rather than a caller-selected compatibility label.

func ActualHostPlatform

func ActualHostPlatform() (NativePlatform, error)

func NativeExecutablePlatform

func NativeExecutablePlatform(file *os.File) (NativePlatform, error)

NativeExecutablePlatform parses a retained descriptor, never a mutable pathname. A valid magic number alone is intentionally insufficient.

type Plan

type Plan struct {
	// Artifact is the owner-private containing release artifact. Its bytes are
	// independently pinned to the registry's ArtifactDigest.
	Artifact               string
	ExpectedArtifactSHA256 string
	// Executable is the staged native executable. Its bytes are independently
	// pinned to the selected release's HostBinaryDigest.
	Executable               string
	ExpectedExecutableSHA256 string
	// Host is the signed release tuple for the executable. Target is the
	// separately resolved compilation-unit tuple carried by the request. The
	// runner validates both as closed tuples and never infers either from the
	// other.
	Host   NativePlatform
	Target NativePlatform
	// InvocationBindingSHA256 binds the exact request bytes to both tuples so
	// no adapter can substitute a target between Core resolution and launch.
	InvocationBindingSHA256 string
	// RepositoryRoot and StagingParent are Core-owned roots. Neither originates
	// in an analyzer request, lock, profile, or the ambient environment.
	RepositoryRoot string
	StagingParent  string
	Request        []byte
	Timeout        time.Duration
	MaxStdoutBytes int
	MaxStderrBytes int
	MemoryBytes    uint64
	MaxChildren    uint64
}

type Result

type Result struct {
	Stdout       []byte
	Stderr       []byte
	Started      bool
	Completed    bool
	Elapsed      time.Duration
	Cleanup      time.Duration
	CleanupState CleanupObservation
	Termination  Termination
	CleanupError CleanupError
}

func Run

func Run(ctx context.Context, plan Plan) (result Result, err error)

func (Result) ValidCleanupObservation

func (r Result) ValidCleanupObservation() bool

type Termination

type Termination string

Termination is a closed, path- and error-free account of the launched process. It is carried into Core's canonical terminal receipt.

const (
	TerminationNotRun    Termination = "NOT_RUN"
	TerminationExited    Termination = "EXITED"
	TerminationTimedOut  Termination = "TIMED_OUT"
	TerminationCancelled Termination = "CANCELLED"
	TerminationFailed    Termination = "FAILED"
)

Jump to

Keyboard shortcuts

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