Skip to content

Backups: readable history, one entry per reset, scoped settings reset, visible retention (D5–D7) - #536

Draft
raiseCatError wants to merge 2 commits into
fix/backup-integrity-20261029from
fix/backup-ui-reset-20261029
Draft

raiseCatError wants to merge 2 commits into
fix/backup-integrity-20261029from
fix/backup-ui-reset-20261029

Conversation

@raiseCatError

@raiseCatError raiseCatError commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #535 (D2–D4). Fixes D5–D7 from #534 and re-audits retention. Notes: BACKUPS_AND_RESET.md → "History, reset and retention"; QA steps added to QA_CHECKLIST.md.

D5 — vague history. Rows now read HH:MM <application> · <file> [+N more] · <created|changed|removed|checkpoint> · <status>, grouped by local day; details show ~/ paths, local time and "Recorded as: · ". "changed later by NMSh ()" is distinguished from "edited since".

D6 — duplicate reset entries, misleading footer. Cause: applyReset recorded a global checkpoint and one transaction per area with the same before-images. A single-area reset is now one entry; multi-area keeps "Reset checkpoint" plus "Reset stage i/n" entries linked by group (each stage has its own before-images), and a failed or raced run is marked partial/reverted. Steps that only advance say "next: backup", "next: type reset", "restore now", "next: confirm overwrite"; the typed word still gates the write.

D7 — settings reset changed unrelated preferences. Cause: the settings area wrote DEFAULT_PROMPT_CONFIGURATION wholesale (onboarding flags, updateMode: automatic, theme library, unknown fields). Now three areas: preferences / first-run state / update policy, planned together as one exact change, with key: before → after and "Kept: …" lines. Themes, customTheme, welcome presets, agent profiles and unknown fields are never reset; absent kept keys are written as their current effective value; a missing file is "nothing to reset", malformed JSON is refused, repeats are no-ops; undo via /changes is byte-exact (tested).

Retention. Never pruned: unfinished entries, newest per source+file, 20 newest reset/restore/manual. Originals go only when nothing else can, and each loss is recorded and shown as a retention warning. NMSh does not claim permanent recoverability; files changed before the journal existed have no pre-NMSh copy.

Tests: new tests/backupsResetScope.test.ts (9; the original 8 fail on the D2–D4 head, pass here) incl. 260-write burst and a 3-entry cap. Focused backups + Theme Bridge 91/91; 97 consumer files 985/987 (1 skipped; keepAwakeForeground timed out under load and passes alone). tsc and build clean.

Limits: legacy {prompt:{…}} wrappers are reset at the root only. Physical terminal QA NOT RUN.

Exact-head CI: run 40808813420 on 8b9be6f: success. Installed locally as builds/8b9be6f4 (rollback to 1c01d3f tested).

@raiseCatError
raiseCatError force-pushed the fix/backup-ui-reset-20261029 branch from 5247081 to 86f76f6 Compare October 29, 2026 02:33
…, visible retention

- /changes rows name the application, file, action and status, grouped by
  local day; the writer's label moves to the details. A file rewritten by a
  newer NMSh entry reads "changed later by NMSh", not "edited since".
- A single-area reset records one entry (no duplicate checkpoint); a
  multi-area reset keeps a checkpoint plus linked stages, and marks a failed
  run partial. Steps that only advance say so; the typed word still gates.
- Settings reset is scoped: preferences, first-run state and update policy are
  separate areas with key-level before -> after values. Preferences never touch
  onboarding or the update policy (so no surprise automatic updates); themes,
  presets and unknown fields are always kept; repeated resets are no-ops.
- Originals lost to capacity pressure are recorded and shown as a retention
  warning; the guarantees are documented.
…ive kept values

From independent review:
- A multi-area reset whose files change right after its checkpoint is
  recorded marks the checkpoint reverted instead of leaving it unfinished.
- A preferences reset writes out absent update-policy and first-run keys as
  their current effective values, so a sparse or legacy settings file cannot
  change its update policy or onboarding state indirectly.
- The retention warning counts each file once; the guarantees text matches the
  pruner.
@raiseCatError
raiseCatError force-pushed the fix/backup-ui-reset-20261029 branch from 86f76f6 to 8b9be6f Compare October 29, 2026 02:51

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