Help us shape the future of Go! Take the 2026 Go Developer Survey

context

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ManifestVersion = "context-manifest/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Authority added in v1.1.0

type Authority struct {
	AllowedWritePaths []string `json:"allowedWritePaths"`
	DeniedWritePaths  []string `json:"deniedWritePaths"`
	OperationClass    string   `json:"operationClass"`
	Verify            string   `json:"verify"`
	Assurance         string   `json:"assurance"`
}

type Lane added in v1.1.0

type Lane string
const (
	LaneRequiredInput          Lane = "required_input"
	LaneOptionalExistingOutput Lane = "optional_existing_output"
	LaneProspectiveOutput      Lane = "prospective_output"

	// RequiredInputSchemaMismatch records the stage-2 contract gap explicitly:
	// task rows have no required-input field. Callers must pass that lane
	// separately; task.Files is write scope and is never treated as input.
	RequiredInputSchemaMismatch = "stage-2 tasks have no required-input field; pass required inputs explicitly"
)

type Manifest added in v0.3.0

type Manifest struct {
	Version       string         `json:"version"`
	Root          string         `json:"root"`
	Change        string         `json:"change"`
	Task          string         `json:"task"`
	Role          string         `json:"role"`
	StateRevision uint64         `json:"stateRevision"`
	ApprovalHash  string         `json:"approvalHash"`
	Frontier      []string       `json:"frontier"`
	FrontierHash  string         `json:"frontierHash"`
	Items         []ManifestItem `json:"items"`
	Omissions     []Omission     `json:"omissions"`
	RequiredBytes int            `json:"requiredBytes"`
	OptionalBytes int            `json:"optionalBytes"`
	Authority     Authority      `json:"authority"`
	ManifestHash  string         `json:"manifestHash"`
}

func BuildManifest added in v0.3.0

func BuildManifest(snapshot core.ReadinessSnapshot, taskID string, requiredInputs []SourceRef, budgetBytes int) (Manifest, error)

type ManifestError added in v1.1.0

type ManifestError struct {
	Code   string
	Owner  string
	Reason string
	Next   string
}

func (*ManifestError) Error added in v1.1.0

func (e *ManifestError) Error() string

type ManifestItem added in v1.1.0

type ManifestItem struct {
	Kind     string        `json:"kind"`
	Path     string        `json:"path"`
	Lane     Lane          `json:"lane"`
	Selector string        `json:"selector,omitempty"`
	Location plan.Location `json:"location"`
	Digest   string        `json:"digest,omitempty"`
	Content  string        `json:"content,omitempty"`
}

type Omission added in v0.4.0

type Omission struct {
	Path   string `json:"path"`
	Digest string `json:"digest,omitempty"`
	Reason string `json:"reason"`
}

type ResolveError added in v0.4.0

type ResolveError struct {
	Code   string
	Path   string
	Owner  string
	Reason string
	Next   string
}

func (*ResolveError) Error added in v0.4.0

func (e *ResolveError) Error() string

type ResolvedSource added in v1.1.0

type ResolvedSource struct {
	Path     string
	Lane     Lane
	Selector string
	Location plan.Location
	Digest   string
	Content  []byte
}

func ResolveContextLanes added in v1.1.0

func ResolveContextLanes(root string, requiredInputs, declaredOutputs []SourceRef) ([]ResolvedSource, error)

ResolveContextLanes resolves explicit required read inputs and declared write outputs. It returns no partial result on any refusal.

type SourceRef added in v1.1.0

type SourceRef struct {
	Path     string
	Location plan.Location
}

Jump to

Keyboard shortcuts

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