Documentation
¶
Overview ¶
Package reconcile provides full-stack drift detection and repair for writ deployments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
// RelTarget is the relative path from target root (e.g., .bashrc)
RelTarget string
// Source is the absolute path to the source file
Source string
// Target is the absolute path to the target file
Target string
// State is the current status
State State
// Project is the project this belongs to
Project string
// Action that was/should be performed
Action string
// Message provides additional context (e.g., "points to wrong file")
Message string
// SourceChecksum is the expected source checksum (from receipt)
SourceChecksum string
// TargetChecksum is the expected target checksum (from receipt)
TargetChecksum string
}
Entry represents the status of a single file.
type Report ¶
type Report struct {
// TargetRoot is the deployment target (e.g., $HOME)
TargetRoot string
// SourceRoot is the environment layer path
SourceRoot string
// Projects checked
Projects []string
// Entries are the individual file statuses
Entries []Entry
// FromReceipt indicates status was computed from a receipt
FromReceipt bool
// ReceiptPath is the path to the receipt used (if any)
ReceiptPath string
}
Report contains the full status report.
func FromBuildResult ¶
func FromBuildResult(br *tree.BuildResult) *Report
FromBuildResult generates status by checking entries in a build result.
func ScanTarget ¶
ScanTarget scans the target directory for writ-managed symlinks. This works without a receipt by looking for symlinks that point into sourceRoot.
type State ¶
type State int
State represents the status of a deployed file.
const ( // StateLinked means the symlink exists and points to the correct source. StateLinked State = iota // StateConflict means a file exists at the target but isn't our symlink. StateConflict // StateMissing means the source file exists but target symlink is missing. StateMissing // StateOrphan means the symlink points to a nonexistent file. StateOrphan // StateCopied means the file was copied (template/secret) and matches expected. StateCopied // StateStale means the source template/secret has changed since deployment. StateStale // StateModified means the target file was edited after deployment. StateModified // StateDriftConflict means both source and target changed since deployment. StateDriftConflict )
Click to show internal directories.
Click to hide internal directories.