feat(load): every file /load replaces is kept beside it as <name>.bak-NNN.<ext> - #508
Merged
Merged
Conversation
…-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
ThreatCrush Security Scan2 finding(s) in the 4 file(s) this pull request changes. MEDIUM: 1 | LOW: 1
91 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 74 | **LOW**: 9Not introduced by this pull request. The full set is in the Security tab.
…and 71 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
@profullstack/synconfig0.1.3 (profullstack/mynaposter#83) copies a file toaliases.bak-001.json(the next timebak-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:/load --jsoncarriesbackups: [{ path, backup }]. A backup is never a synced file: the allowlist names files exactly.The house rule behind it, after
~/.moshcodewas lost today to an installer with no copy of anything: before an overwrite, a numbered.bakbeside the original, every time. Bumps to 0.98.2 so it ships.Verified
test/settings-sync.test.mjs: a forced load leavesaliases.bak-001.jsonwith the overwritten edit and names it;applyFilesnumbersbak-001,bak-002, keeps the first, backs up nothing for a new file, mode 0600;--jsonlists the backups;isSyncable("aliases.bak-001.json")is false.🤖 Generated with Claude Code
https://claude.ai/code/session_014HMV1QDcVY1xiaWWrZQM4S