Skip to content

feat(load): every file /load replaces is kept beside it as <name>.bak-NNN.<ext> - #508

Merged
ralyodio merged 1 commit into
mainfrom
feat/load-backups
Sep 13, 2026
Merged

ralyodio merged 1 commit into
mainfrom
feat/load-backups

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

@profullstack/synconfig 0.1.3 (profullstack/mynaposter#83) copies a file to aliases.bak-001.json (the next time bak-002, never reused) before a load replaces it, so a load, forced or on a machine that never synced, can no longer be the thing that loses an edit. moshcode takes the bump and says where each previous copy went:

loaded revision 6 — 1 file written
   replaced aliases.json  (previous copy: aliases.bak-001.json)

/load --json carries backups: [{ path, backup }]. A backup is never a synced file: the allowlist names files exactly.

The house rule behind it, after ~/.moshcode was lost today to an installer with no copy of anything: before an overwrite, a numbered .bak beside the original, every time. Bumps to 0.98.2 so it ships.

Verified

  • test/settings-sync.test.mjs: a forced load leaves aliases.bak-001.json with the overwritten edit and names it; applyFiles numbers bak-001, bak-002, keeps the first, backs up nothing for a new file, mode 0600; --json lists the backups; isSyncable("aliases.bak-001.json") is false.
  • Full suite against 0.1.3: 2978 tests, 0 failures.

🤖 Generated with Claude Code

https://claude.ai/code/session_014HMV1QDcVY1xiaWWrZQM4S

…-NNN.<ext>

@profullstack/synconfig 0.1.3 copies a file to `aliases.bak-001.json` (the
next time `bak-002`, never reused) before a load replaces it, so a load —
forced, or on a machine that never synced — can no longer be the thing
that loses an edit. moshcode takes the bump and says where each previous
copy went:

  loaded revision 6 — 1 file written
     replaced aliases.json  (previous copy: aliases.bak-001.json)

`/load --json` carries `backups: [{ path, backup }]`. A backup is never a
synced file: the allowlist names files exactly.

The house rule behind it, after ~/.moshcode was lost today to an installer
with no copy of anything: before an overwrite, a numbered .bak beside the
original, every time. 0.98.2.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HMV1QDcVY1xiaWWrZQM4S
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

2 finding(s) in the 4 file(s) this pull request changes.

MEDIUM: 1 | LOW: 1

Severity Rule Location
MEDIUM js-timing-unsafe-mac-compare src/settings-sync.mjs:366
LOW secret-generic-credential test/settings-sync.test.mjs:50
91 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 74 | **LOW**: 9

Not introduced by this pull request. The full set is in the Security tab.

Severity Rule Location
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
HIGH tls-verification-disabled apps/pwa/src/lib/moshpit-gateway.mjs:299
HIGH sh-remote-script-execution install.sh:86
HIGH sh-remote-script-execution install.sh:90
HIGH sh-remote-script-execution install.sh:258
HIGH sh-remote-script-execution install.sh:269
HIGH sh-remote-script-execution install.sh:275
HIGH tls-verification-disabled src/dns.mjs:766
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:139
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:153
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:179
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:373
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:377
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:422
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:671
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:867
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:869
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:928
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:974
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1044

…and 71 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 93c8d1e into main Sep 13, 2026
6 checks passed
@ralyodio
ralyodio deleted the feat/load-backups branch September 13, 2026 07:51
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