Skip to main content

Module manifest

Module manifest 

Source
Expand description

Deployment manifest — record of what krypt has written to disk.

The manifest is a versioned JSON document persisted at ${XDG_STATE}/krypt/manifest.json. It records, for every file the engine has deployed, the source path, destination path, and a SHA-256 hash of both. The hash of the destination at deploy time is later used to detect drift — edits made to a deployed file outside the repo.

§Schema

{
  "version": 1,
  "krypt_version": "0.0.2",
  "deployed_at": 1715896800,
  "repo_path": "/home/x/.config/krypt/repo",
  "repo_commit": null,
  "entries": [
    { "src": ".gitconfig", "dst": "/home/x/.gitconfig",
      "kind": "link", "hash_src": "sha256:...", "hash_dst": "sha256:...",
      "deployed_at": 1715896800 }
  ]
}

§Versioning

The top-level version field is checked on load. A future bump (say, v2 adding new fields) will land alongside a migration step here.

§Atomicity

Manifest::save writes to a sibling tmp file and renames, mirroring crate::copy’s deploy strategy. A torn write can’t corrupt the existing manifest on disk.

Structs§

DriftRecord
One row in a drift report.
Manifest
A complete deploy record.
ManifestEntry
Per-file deploy record.

Enums§

DriftStatus
Why a manifest entry looks different from disk.
ManifestError
Errors loading, saving, or comparing a manifest.

Constants§

SCHEMA_VERSION
Current manifest schema version.

Functions§

detect_drift
Walk every entry in the manifest, hashing the current destination and classifying drift. Read errors (e.g. permission denied) are treated as Drifted with current_hash = None — better to surface than swallow.
hash_file
Compute the SHA-256 of a file as sha256:<hex>.