Skip to main content

LOCKFILE_VERSION

Constant LOCKFILE_VERSION 

Source
pub const LOCKFILE_VERSION: u32 = 2;
Expand description

Current lockfile schema version. Bump when the on-disk layout changes in a way an older knack couldn’t safely interpret.

Backward compatibility is one-way: a new knack reading an old lockfile should keep working (with default values for new fields). An old knack reading a new lockfile errors loudly rather than guessing — that’s what Lockfile::ensure_supported_version enforces.

Version history

  • v1: initial layout. name, source, resolved, checksum. Lockfiles with no version field at all are also v1 (the field only became required when v2 landed).
  • v2: adds optional namespace per locked skill so namespaced registries (public:anthropics/pdf) can round-trip through the lockfile without losing the vendor scope. Old v1 entries with no namespace field continue to read fine into v2; new writes emit version = 2 and include the field when scoped.