context

package
v0.2.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

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

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

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

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

type ManifestError

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

func (*ManifestError) Error

func (e *ManifestError) Error() string

type ManifestItem

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

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

type ResolveError

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

func (*ResolveError) Error

func (e *ResolveError) Error() string

type ResolvedSource

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

func ResolveContextLanes

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

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