Skip to content

Backups before every config edit, /changes history with revert, guarded /nmsh reset - #529

Draft
raiseCatError wants to merge 8 commits into
feature/appearance-simple-20261029from
feature/nmsh-backups-reset-20261029
Draft

raiseCatError wants to merge 8 commits into
feature/appearance-simple-20261029from
feature/nmsh-backups-reset-20261029

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Stacked on #528. NMSh now backs up every configuration file before it changes one. You can browse and revert those changes, and a guarded reset removes only what NMSh added.

  • Journal (src/backups/): before any NMSh write to a config file (host appearance, Kitty/Ghostty shaders, /cursor, Theme Bridge, Starship, tmux, keyboard, status line, Oh My Zsh restore, dotfiles), the previous contents are stored and verified by hash. If the backup cannot be made, the write is refused. Storage is bounded, and reset/restore entries are never pruned silently. NMSh's config.json is checkpointed daily and before every reset or restore.
  • /changes (also /backups and /snapshots): newest first. It shows whether each file is unchanged since, edited since, or missing. A restore shows the exact diff back to the backup. It asks again if you edited the file afterwards, re-checks the files before writing, and backs up the current state first, so the restore can itself be undone. S takes a manual snapshot.
  • /nmsh reset: choose areas (nothing preselected) → see the exact owned lines and skipped areas → see the backup → type reset → Enter. Everything is re-verified before writing, and it reports per-area results plus the undo entry. Plain /reset writes nothing and explains /nmsh reset.
  • Integration (lead): restore and reset reload the verified terminal NMSh runs in (Reload the terminal after NMSh writes host files (Kitty, Ghostty 1.3+) #527). NMSh's own config directory is a trusted root even when XDG_CONFIG_HOME is outside the home folder. Without this, journaled writes there were refused. Ask knows the new commands.

Tests: 1847 of 1848 affected focused tests pass (0 failures; logs in the evidence folder), and tsc is clean. Panel snapshots cover 120x40, 80x24, 60x20 and 40x14, with and without NO_COLOR. Physical terminal validation of restore/reset is still pending.

… reload the terminal, Ask knows /changes and /nmsh reset

An XDG_CONFIG_HOME outside the home made every journaled write of NMSh's own files (theme bridge, /cursor) refuse;
the same symlink, owner and permission checks now apply under NMSh's configuration directory.
…them directly again

Journaling them made Fish's first prompt never arrive with Theme Bridge on (live fish test); they live in NMSh's
configuration directory and are regenerated from settings. Tool configuration files outside it stay journaled.
Restores the original live test fixture.

This branch has not been deployed

No deployments
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