manifest

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package manifest reads and writes the .awf/awf.lock and detects drift between rendered output and its sources.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedLiveSource = errors.New("unsupported live source")

ErrUnsupportedLiveSource identifies authority that cannot be dispatched by a live operation.

Functions

func Hash

func Hash(b []byte) string

Hash returns the stable content address used by the lock and attestation.

func LoadSchemaOptional added in v0.40.0

func LoadSchemaOptional(path string) (int, bool, error)

LoadSchemaOptional reads only the schema stamp. Migration classification uses it before deciding whether current authority decoding is permitted.

func NormalizeSemver added in v0.22.0

func NormalizeSemver(s string) (string, bool)

func ValidateLive added in v0.40.0

func ValidateLive(l *Lock, floor, current int) error

ValidateLive accepts only authority a user-invoked operation may dispatch on.

func WriteFileAtomic added in v0.11.0

func WriteFileAtomic(path string, data []byte) error

WriteFileAtomic writes data through a same-directory temporary file and rename, so a failed write never leaves a truncated destination.

func WriteFileAtomicMode added in v0.30.0

func WriteFileAtomicMode(path string, data []byte, mode os.FileMode) error

WriteFileAtomicMode is WriteFileAtomic with an explicit final mode, used when a restored file's recorded permissions must survive the replacement. touches-state: config/migrations-and-locks:lock-atomic-save - atomic temp-file+rename write site; proof in manifest_test.go

Types

type AuthorityState added in v0.22.0

type AuthorityState uint8

AuthorityState identifies the sole supported permanent lock authority.

const AuthorityPermanent AuthorityState = 1

type Drift

type Drift struct{ Path, Kind, Detail string }

type Entry

type Entry struct {
	TemplateID   string `json:"templateId"`
	TemplateHash string `json:"templateHash"`
	ConfigHash   string `json:"configHash"`
	OutputHash   string `json:"outputHash"`
	// RegenChecked marks an entry whose drift is checked by regeneration rather
	// than by the frozen OutputHash: generated indexes and navigation plus
	// in-place-editable files. Omitted when false so a plain entry's
	// serialization is unchanged.
	RegenChecked bool `json:"regenChecked,omitempty"`
}

type LiveSourceError added in v0.40.0

type LiveSourceError struct{ Schema, Floor, Current int }

LiveSourceError carries live compatibility facts without recovery presentation.

func (*LiveSourceError) Error added in v0.40.0

func (e *LiveSourceError) Error() string

func (*LiveSourceError) Is added in v0.40.0

func (e *LiveSourceError) Is(target error) bool

type Lock

type Lock struct {
	AWFVersion             string           `json:"awfVersion"`
	SchemaVersion          int              `json:"schemaVersion"`
	Files                  map[string]Entry `json:"files"`
	InitializedWithVersion string           `json:"initializedWithVersion,omitempty"`
}

func Load

func Load(path string) (*Lock, error)

func LoadLive added in v0.40.0

func LoadLive(path string, floor, current int) (*Lock, error)

LoadLive reads a lock only after its schema stamp passes the live-source boundary, so unsupported bytes never reach current authority interpretation.

func LoadLiveOptional added in v0.40.0

func LoadLiveOptional(path string, floor, current int) (*Lock, bool, error)

LoadLiveOptional is the optional-file form of LoadLive.

func LoadOptional added in v0.11.0

func LoadOptional(path string) (*Lock, bool, error)

func Parse added in v0.22.0

func Parse(b []byte) (*Lock, error)

Parse rejects retired routing keys at every schema. Historical decoding is owned by audit rather than the live manifest model.

func ParseLive added in v0.40.0

func ParseLive(b []byte, floor, current int) (*Lock, error)

func (*Lock) AuthorityState added in v0.22.0

func (l *Lock) AuthorityState() (AuthorityState, error)

AuthorityState validates permanent lock authority. Older adopters may omit initialization provenance and remain valid permanent authority.

func (*Lock) Clone added in v0.40.0

func (l *Lock) Clone() *Lock

Clone returns a fully independent lock projection.

func (*Lock) Marshal added in v0.18.0

func (l *Lock) Marshal() ([]byte, error)

func (*Lock) Save

func (l *Lock) Save(path string) error

type PartialAuthorityError added in v0.40.0

type PartialAuthorityError struct{ Config, Lock bool }

PartialAuthorityError identifies an incomplete control pair without prescribing recovery.

func (*PartialAuthorityError) Error added in v0.40.0

func (e *PartialAuthorityError) Error() string

Jump to

Keyboard shortcuts

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