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 NormalizeSemver ¶ added in v0.22.0
NormalizeSemver returns s in the single-leading-v form x/mod/semver requires. Lock authority and the CLI version gate share it so historical v-prefixed versions are interpreted identically.
func WriteFileAtomic ¶ added in v0.11.0
WriteFileAtomic writes data to path via a same-directory temp file renamed into place, so a crash can never leave a truncated file at path. Mode is 0o644 (CreateTemp's 0o600 is widened before the rename). On error the temp file is best-effort removed. Rename-only durability - no fsync - per ADR-0076 Decision 1; Go's os.Rename replaces an existing destination on every supported OS including Windows. 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 is the closed lock-authority state machine.
const ( AuthorityBridge AuthorityState = iota + 1 AuthorityPermanent AuthorityPreTracking )
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 records the sealed identity of a current-state upgrade attestation: the format Version, the clean PreparedHead commit it was computed against, the TreeDigest over the post-normalization prepared inputs, the ADRFormatV1From cutoff (highest ADR number plus one), and the sorted absent lower ADR numbers in LegacyADRGaps.
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 (INDEX.md,
// topic and domain docs, the config reference) plus in-place-editable files
// (ADR-0100). 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 seals a completed current-state upgrade attestation. It
// is optional (omitted when absent) so a lock written before the bridge
// tranche parses unchanged with a nil pointer.
BridgeAttestation *BridgeAttestation `json:"bridgeAttestation,omitempty"`
// ADRFormatV1From is the permanent format cutoff (the highest ADR number plus
// one) the final current-state upgrade promotes out of the consumed
// attestation. Every ADR at or above it is current-state-v1; below it is
// legacy. Zero is valid only for bridge or pre-tracking authority.
ADRFormatV1From int `json:"adrFormatV1From,omitempty"`
// ADRFormatV2From is the permanent V2 boundary. It is absent before schema
// 15 and positive at schema 15 and later.
ADRFormatV2From int `json:"adrFormatV2From,omitempty"`
// LegacyADRGaps is the sorted set of absent lower ADR numbers the final
// upgrade promotes alongside the cutoff, closing the migration-time identity
// set so a listed gap can never be backfilled as legacy. It is absent before
// cutover and serialized as an explicit array, including [], after cutover.
LegacyADRGaps []int `json:"legacyAdrGaps,omitempty"`
// InitializedWithVersion records the binary that completed first adoption.
// It is absent for older migrated adopters and immutable once present.
InitializedWithVersion string `json:"initializedWithVersion,omitempty"`
// contains filtered or unexported fields
}
func LoadOptional ¶ added in v0.11.0
LoadOptional is the corrupt-lock policy choke point (ADR-0076 Decision 2): a missing lock reports found=false with no error so callers keep their no-lock semantics; a present-but-unreadable lock is a hard error carrying the one recovery hint.
func (*Lock) AuthorityState ¶ added in v0.22.0
func (l *Lock) AuthorityState() (AuthorityState, error)
AuthorityState validates and classifies the lock's current-state authority.