# `Safe.Version`
[🔗](https://github.com/erlang-solutions/safe-mix-plugin/blob/main/lib/mix/tasks/safe/version.ex#L1)

Version resolution and lock file management for the SAFE binary.

Resolves the SAFE binary version against a semver constraint, reads/writes
the `safe.lock` file (JSON format).

# `compatible?`

Returns true if the version satisfies the `~> 1.5.0` constraint.

# `constraint`

Returns the semver constraint used to resolve SAFE binary versions.

# `plugin_version`

Returns the mix_safe plugin version (compiled from mix.exs at build time).

# `read_lock`

Reads the pinned SAFE version from `<project_dir>/safe.lock`.

Returns `{:ok, version_string}` or `{:error, :not_found}`.

# `resolve_version`

Picks the latest stable version from `versions_map` (a map of version string =>
platform checksums) that satisfies the constraint. Pre-releases are excluded.

# `write_lock`

Writes the pinned SAFE version to `<project_dir>/safe.lock` in JSON format.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
