fix(state): the "rename it" tip led into the error it was fixing
All checks were successful
Check / eval (push) Successful in 3m51s

Verifying Bernardo's #107 upgrade path (legacy theme-state.json checkout →
new code) turned up a footgun in state-read.nix's own help text. It said:

  • Still on theme-state.json? Rename it to state.json (…)

On a git flake only tracked files exist, so a hand-rename leaves state.json
untracked and therefore invisible — producing exactly the "state file is
missing" error the tip hangs off. Point at the menu write (which stages the
rename via git add --intent-to-add + git rm), name `git add state.json` for
the manual path, and add a bullet for "file is on disk but eval says
missing", which is otherwise a genuinely confusing dead end.

Message verified by rendering the real failure, not by reading the source.

The rename itself is safe and needs no code change: with identical content,
theme-state.json and state.json produce byte-identical derivations (HM
2yqqy8h…, system 9qp9l3g…), so it cannot change what boots. Legacy eval,
the migration write, and re-eval on a dirty/intent-to-add tree all pass.
#133 filed: no check pins the compat shim, so it can rot before we drop it.
This commit is contained in:
2026-07-15 17:41:21 +01:00
parent c05988c6d1
commit 9a280b2e18
3 changed files with 42 additions and 3 deletions

View File

@@ -19,6 +19,29 @@ Template:
---
## 2026-07-15 — #107 upgrade path proven; state-read tip fixed
- **Task:** Bernardo feared rebuilding on the state.json rename ("what if it
doesn't boot"). Verify the real upgrade path from a legacy checkout.
- **Did:** Built a scratch downstream box shaped like his (~/.nomarchy: git
checkout, `theme-state.json`, input → local repo) and drove the whole path.
**The reassurance: the built derivations are byte-identical across the
rename** — HM `2yqqy8h…` and system `9qp9l3g…` from `theme-state.json` and
from `state.json` with identical content. The filename picks the read path
only; it cannot change the closure, so it cannot affect boot. Fixed the
footgun in `modules/state-read.nix`: the tip said "rename it to state.json",
which on a git flake yields an *untracked* (invisible) file and the very
"state file is missing" error the tip is attached to — now it points at the
menu write and names `git add state.json`.
- **Verified:** **V1 (strong)** — real eval of both `homeConfigurations` and
`nixosConfigurations` on the legacy name; migration write (content diff:
only the key I set, no drift); re-eval clean while dirty/intent-to-add via
both `.#` and `git+file://`; untracked-state failure is fail-closed at eval
with the new message (rendered, not assumed). No VM: identical drvPaths are
stronger evidence than booting the same closure twice.
- **Pending:** no permanent check asserts mkFlake accepts the legacy name —
the compat shim could rot silently before it's dropped. Filed #133.
- **Next suggestion:** #133, or #131 label call `[human]`.
## 2026-07-15 — V2 the menu IA (#105/#111/#110), no code change
- **Task:** close the V2 gap on 856a9d1 — it shipped at "V0 menu-back; HM
gen builds" for a user-visible menu restructure.