manifest

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: AGPL-3.0 Imports: 9 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

This section is empty.

Functions

func Hash

func Hash(b []byte) string

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

func NormalizeSemver added in v0.22.0

func NormalizeSemver(s string) (string, bool)

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 distinguishes the frozen bridge input from ordinary locks.

const (
	AuthorityBridge AuthorityState = iota + 1
	AuthorityPermanent
)

type BridgeAttestation added in v0.18.0

type BridgeAttestation struct {
	Version         int    `json:"version"`
	PreparedHead    string `json:"preparedHead"`
	TreeDigest      string `json:"treeDigest"`
	ADRFormatV1From int    `json:"adrFormatV1From"`
	LegacyADRGaps   []int  `json:"legacyADRGaps"`
}

BridgeAttestation preserves version-1 bridge bytes as frozen compatibility input. Its historical routing payload is never promoted into a Lock.

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 Lock

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

func Load

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

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 accepts retired routing keys only in schema 30 and earlier, where it discards them. Schema 31 seals their retirement by refusing their presence.

func (*Lock) AuthorityState added in v0.22.0

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

AuthorityState validates the one still-active immutable lock value. Historical routing fields are compatibility input only and are discarded by Parse.

func (*Lock) Marshal added in v0.18.0

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

func (*Lock) Save

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

Jump to

Keyboard shortcuts

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