Skip to content

fix(setup): rc4 field-validation batch — direnv commits, prune, scripts - #860

Merged
c-vigo merged 2 commits into
release/0.4.0from
bugfix/859-rc4-field-validation-fixes
Jul 5, 2026
Merged

c-vigo merged 2 commits into
release/0.4.0from
bugfix/859-rc4-field-validation-fixes

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

Fix batch for the six upstream defects surfaced by the 0.4.0-rc4 field validation (#859; findings comments there cover five repos, two orgs, both delivery modes):

# Finding Fix
1 direnv mode cannot commit (guard demands the container) .githooks/* accept IN_NIX_SHELL as sanctioned
2 .githooks/* #!/bin/bash unusable on NixOS hosts #!/usr/bin/env bash
9 lifecycle scripts regressed ${BASH_SOURCE[0]:-$0} → unbound variable when piped fallback restored in all four scripts
12 --mode devcontainer prune deleted consumers' own flake.nix/.envrc (hyrr, talys) prune only removes stub files the scaffold created (mirrors #738)
13 installer's final just sync fails on old-generation preserved justfile.project non-fatal with a MIGRATION.md pointer
3/10/11 typos ignores [files] extend-exclude for staged files → garbage findings on binary artifacts in three repos entry: typos --force-exclude (repo + scaffold via manifest sync)

Plus the field-validated "Upgrading an existing 0.3.x consumer" checklist in docs/MIGRATION.md (prek recipe migration, recipe renames, typos config shadowing, artifact excludes, name re-derivation).

Remaining findings (7 CodeQL onboarding, 8 name re-derivation, 14 fresh-adoption clobber, 4 autofix-vs-artifacts defaults) are documented in MIGRATION.md and/or tracked for the next cycle in #854 — they are design-level, not rc5-blocking.

Verification

  • TDD: 6 new bats tests RED (confirmed) → GREEN; the prune guard is proven by a functional host-run of init-workspace.sh with pre-existing flake.nix/.envrc surviving --mode devcontainer; suite 62/62.
  • Existing prune test updated to the new guarded behavior (message/shape change).
  • just precommit (full suite, all files): green, exit 0.
  • Local pytest: 63 passed; 3 failures are the known stale-local-:dev-image class (image-content tests; CI builds the image from this branch, where they run for real).

Requires rc5 (image bakes assets/), then targeted re-verification per #859's exit criteria.

Refs: #859

c-vigo added 2 commits July 5, 2026 15:12
RED (6 failing bats tests, confirmed locally): env-based githook
shebangs, nix-dev-shell-aware commit guard, BASH_SOURCE pipe-safety
fallback in lifecycle scripts, prune keeping pre-existing
flake.nix/.envrc, tolerant final just-sync, and typos --force-exclude
in both hook configs. All surfaced by the 0.4.0-rc4 field validation.

Refs: #859
Six fixes surfaced by the 0.4.0-rc4 field validation across five real
consumer repos (full findings on the tracking issue):

- .githooks/*: env-based shebangs (NixOS hosts have no /bin/bash) and
  accept IN_NIX_SHELL as sanctioned -- direnv mode could not commit.
- Lifecycle scripts: restore the ${BASH_SOURCE[0]:-$0} pipe-safety
  fallback (0.3.x regression caught by a consumer's regression tests).
- init-workspace prune: never delete a pre-existing flake.nix/.envrc in
  devcontainer mode (two repos lost their own nix-direnv setup).
- init-workspace final just sync: non-fatal when the preserved
  old-generation justfile.project lacks the sync recipe.
- typos hook (repo + scaffold): --force-exclude so consumer
  [files] extend-exclude applies to staged files.
- MIGRATION.md: field-validated 0.3.x upgrade checklist.

Verified: 6 new bats tests RED -> GREEN (62/62 suite green), including
a functional host-run of init-workspace.sh proving the prune guard;
full pre-commit suite green. The 3 local pytest failures are the known
stale-local-image class (image-content tests; CI builds fresh).

Refs: #859
@c-vigo
c-vigo merged commit 45ac556 into release/0.4.0 Jul 5, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/859-rc4-field-validation-fixes branch July 5, 2026 13:33
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