plansnapshot

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: 17 Imported by: 0

Documentation

Overview

Package plansnapshot validates caller-owned immutable planning inputs.

Index

Constants

View Source
const MaxBytes = 512 << 10
View Source
const Schema = "corvint-planning-snapshot/0"

Variables

View Source
var ErrInvalid = errors.New("unsupported-planning-snapshot")

Functions

func PathDigest

func PathDigest(paths []string) string

Types

type Receipt

type Receipt struct {
	Schema string   `json:"schema"`
	Commit string   `json:"commitRevision"`
	Tree   string   `json:"treeRevision"`
	Base   string   `json:"baseRevision"`
	Paths  []string `json:"changedPaths"`
	Digest string   `json:"changedPathsSha256"`
}

Receipt binds the complete committed diff and all source/configuration bytes. Overlay inputs are deliberately absent: unknown members fail closed.

func Decode

func Decode(raw []byte) (Receipt, error)

func ReadFile

func ReadFile(name string) (Receipt, error)

func (Receipt) Materialize

func (receipt Receipt) Materialize(ctx context.Context, root string) (string, func(), error)

Materialize copies exact blobs to private scratch; no checkout, filters, archive attributes, live files, symlinks or submodules can change the inputs.

func (Receipt) Scope

func (receipt Receipt) Scope() map[string]any

Scope distinguishes authoritative immutable inputs from advisory selection.

func (Receipt) Valid

func (receipt Receipt) Valid() bool

func (Receipt) Validate

func (receipt Receipt) Validate(ctx context.Context, root string) error

Jump to

Keyboard shortcuts

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