mix crosswake.bump_template_version (crosswake v0.2.0)

View Source

Maintainer task: increments the integer @template_version in lib/mix/tasks/crosswake.gen.shell.ex AND recomputes and rewrites @checked_in_hash in test/crosswake/proof/phase134_template_version_drift_test.exs.

Run this whenever any .eex shell template changes. Both edits happen atomically in a single invocation — never bump the integer without rewriting the hash, or vice versa (D-05, pitfall 7).

Usage

mix crosswake.bump_template_version

No arguments are accepted.

How it works

  1. Reads lib/mix/tasks/crosswake.gen.shell.ex, finds the @template_version N line, and replaces it with @template_version N+1.
  2. Recomputes the SHA-256 over the sorted .eex template glob — exactly the same algorithm as live_template_hash/0 in the drift test (priv/templates/crosswake/shell/**/*.eex, sorted, concatenated, SHA-256, lowercase hex) so the hash matches byte-for-byte.
  3. Reads test/crosswake/proof/phase134_template_version_drift_test.exs, finds the @checked_in_hash "..." literal on its own line, and replaces the quoted value with the new hash.