Skip to main content

Module snapshot

Module snapshot 

Source
Expand description

Saved copies: what a destructive step keeps before it changes anything.

A landing that replaces a conflict the operator named saves the bytes it overwrites, and a setup step that removes or replaces forge state saves the state it found. Both go to one directory per run under the state root, snapshots/<repo>/<timestamp>/, or <timestamp>-<n>/ for a second run in the same second, with replaced/<path> for files, forge/<step>.json for forge state, and refs/ for branch bundles. A saved copy is a backup, never run state: no later run reads it to decide anything, and only the operator removes it. It never lives inside a stage, so cleaning a stage never deletes one.

SATISFIES landing:ownership-is-elementary

Structs§

Snapshot
One run’s snapshot directory, claimed when the run first needs it.

Constants§

FORGE_DIR
The directory below one snapshot that holds forge state.
REFS_DIR
The directory below one snapshot that holds branch bundles.
REPLACED_DIR
The directory below one snapshot that holds replaced files.
SNAPSHOTS_DIR
The directory below the state root that holds every snapshot.

Functions§

claim
Claim a directory of this run’s own under runs, named by stamp.
repo_key
The key naming one target below the snapshot base.
timestamp
The current instant as YYYYMMDDTHHMMSSZ, a name every filesystem takes and that sorts by time.