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

@@ -121,6 +121,18 @@ size, or truncation. Either fix the guest (fontconfig + icon cache in the
test node) or document the gap in docs/TESTING.md §5 so the next agent does test node) or document the gap in docs/TESTING.md §5 so the next agent does
not chase it — right now nothing warns them. not chase it — right now nothing warns them.
### 133. No check pins the #107 legacy-name compat shim
`lib.mkFlake`, doctor and lifecycle all still accept `theme-state.json`, and
`nomarchy-state-sync` migrates it on write — but nothing in `checks.*`
evaluates a checkout that has *only* the legacy name, so the shim can rot
silently while every check stays green. It is load-bearing until every
existing machine has taken one menu write. Add a cheap eval check: a fixture
dir with `theme-state.json` only → `mkFlake` resolves it; plus the write-side
migration (state.json created + git-staged, legacy `git rm`'d). Proven by
hand 2026-07-15 (drvPaths identical across the rename) — this just keeps it
proven. Delete together with the shim + the `nomarchy-theme-sync` alias.
### 120. A netinstall ISO, next to the fat offline one ### 120. A netinstall ISO, next to the fat offline one
Bernardo 2026-07-14, after seeing the measured size: **keep the current ISO Bernardo 2026-07-14, after seeing the measured size: **keep the current ISO

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 ## 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 - **Task:** close the V2 gap on 856a9d1 — it shipped at "V0 menu-back; HM
gen builds" for a user-visible menu restructure. gen builds" for a user-visible menu restructure.

View File

@@ -28,8 +28,12 @@ let
Field-level schema (colors, ui, border, ): Field-level schema (colors, ui, border, ):
nomarchy-state-sync validate nomarchy-state-sync validate
Eval-time field checks live in modules/home/theme.nix. Eval-time field checks live in modules/home/theme.nix.
Still on theme-state.json? Rename it to state.json (or just run Still on theme-state.json? Easiest is any menu write /
any menu write / `nomarchy-state-sync set` it migrates).''; `nomarchy-state-sync set` it migrates and stages the rename
for you. Renaming by hand needs `git add state.json` too.
File IS on disk but eval still says missing? On a git flake only
*tracked* files exist an untracked state.json is invisible:
git add state.json'';
missingMsg = '' missingMsg = ''
@@ -37,7 +41,7 @@ let
${pathStr} ${pathStr}
This file is required (appearance + menu settings). Add state.json to This file is required (appearance + menu settings). Add state.json to
your flake checkout so evaluation stays pure. your flake checkout git-tracked so evaluation stays pure.
${tip}''; ${tip}'';
emptyMsg = '' emptyMsg = ''