Skip to content

fix: keep the dev-shell toolchain in lockstep with consumer adoption - #1272

Merged
c-vigo merged 5 commits into
devfrom
bugfix/1263-flake-lock-version-skew
Jul 25, 2026
Merged

c-vigo merged 5 commits into
devfrom
bugfix/1263-flake-lock-version-skew

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Closes #1263

Problem

Consumer adoption advances the .vig-os DEVKIT_VERSION pin (image + scaffold) but never touches the consumer's flake.lock, which governs the direnv dev shell. A floating vigos input stays wherever the last nix flake update vigos saw it, so every direnv consumer's shell silently runs the previous release's toolchain — live symptom: org-config's 1.4.0 setup-labels ignored the #1254 taxonomy extension and planned to delete the repo's own labels one release after the protecting feature shipped. The existing #1093 scaffold warning deliberately covers pinned (?ref=) inputs only.

Fix (three coordinated layers, per the spike on #1263)

  1. mkProjectShell shell-entry version-skew guard (flake.nix) — the shellHook bakes the flake's own release version (the devkit repo-root .vig-os at the locked input rev, read purely at eval) and compares it against the workspace .vig-os pin on every shell entry, warning with the nix flake update vigos remedy until the lock advances. Silent for matching versions, prerelease (-rc*) pins (release-train lanes bump to rc tags a floating update cannot reach — rc content lives on the release branch), and bare consumers without a manifest. Warn-only, never fails the shell. This is the authoritative detector: it is the one place both halves of the skew are visible without network access.
  2. Host-side lock advance on upgrade (install.sh) — a --force upgrade of a direnv/both consumer with a floating input and an existing flake.lock now runs nix flake update vigos after the scaffold, host-side (a direnv consumer has nix by definition; the scaffold container must not write the lock — network dependence + ownership hazards, install.sh --docker: chown scaffold output before the host-side git phase #1235/install.sh --docker ownership repair breaks scaffold under rootless-podman docker shim #1248). Non-fatal when nix is missing or the update fails: the manual step is printed. Pinned inputs and fresh scaffolds (no lock yet) are untouched.
  3. Docs — docs/MIGRATION.md now describes the two coupled delivery channels in the Updating checklist and corrects the lockstep section's claim that a floating input "needs no manual bump — it is exempt" (it skews via flake.lock). The [BUG] Bumping DEVKIT_VERSION without the matching vigos flake pin ships the #1053 JSONC banner without its check-json exclude — every commit fails, no warning #1093 comment in init-workspace.sh gets the same correction. Changelog entry under Unreleased.

Verification

  • tests/test_flake_version_guard.py (new, nix-gated like the other flake suites): warns on a mismatched final pin (both versions + remedy in stderr), silent on matching pin / -rc* pin / no manifest — 4/4 green, plus test_flake_devshell.py + test_flake_hooks.py parity suites green (53 passed, 1 skipped).
  • tests/bats/install.bats (+6, TDD): floating+lock+--force invokes nix flake update vigos --flake <dir>; pinned input, missing lock, fresh install, and devcontainer mode all skip; a failing update stays non-fatal and prints the manual step — full file 109/109 green against stub docker/nix.
  • prek run --all-files green on the final tree.

Note for the release train: the shell-side guard is itself flake-delivered, so existing consumers first see it after their next lock advance — which the upgrade path in this PR now performs for them.

@c-vigo
c-vigo merged commit ead2372 into dev Jul 25, 2026
15 checks passed
@c-vigo
c-vigo deleted the bugfix/1263-flake-lock-version-skew branch July 25, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant