Repository navigation
fix(undo): reject impossible snapshot dates and document the name filter - #76
Merged
Merged
Conversation
Review follow-up for abogartz#63: snapshot names must carry a real calendar date (UTC round-trip, leap years included), and the tool description and README now say that non-standard files in snapshots/ are not listed or restorable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 24, 2026
abogartz
approved these changes
Oct 24, 2026
abogartz
left a comment
Owner
There was a problem hiding this comment.
Approving. Verified independently on the merged batch (all five applied cleanly onto 0.8.4):
listSnapshots()hides1000-2026-02-29.logfmtand1002-2026-13-45.logfmt;restoreSnapshot()on the impossible name throwsinvalid snapshot name: ….1001-2028-02-29.logfmtis listed and restores — the UTC round-trip (setUTCFullYear+ three-field compare) gets leap years right without timezone drift, which is the detail most date-grammar checks fumble.- The README line ("only lists and restores its own
<stamp>-YYYY-MM-DD.logfmtsnapshots; any other file insnapshots/is ignored") says exactly what someone mid-recovery needs to know.
Combined-batch gates: 324 pass / 4 skip / 0 fail, tsc --noEmit clean, biome exit 0.
|
🎉 This PR is included in version 0.8.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
The two nits from your #63 review. #63 merged before I pushed them.
Change:
123-2026-13-45.logfmtand124-2026-02-29.logfmtare rejected with the existinginvalid snapshot nameerror and hidden fromlistSnapshots().125-2028-02-29.logfmtis listed and restores. No namesnapshotFiles()mints is affected.memory_undotool description and the README say that non-standard files insnapshots/(e.g. an old<stamp>-canonical.logfmt) aren't listed or restorable, so someone mid-recovery knows why a file is missing.Tests (
test/undo.test.ts): impossible dates are rejected and not listed, and a real leap day restores. With the source change reverted, the test fails.Checks (Linux, Bun 1.4.4, on 0.8.4):
bun test ./test/303 pass, 4 skip, 0 fail.bun run test:e2eagainst opencode 2.0.26: 9 pass.tsc --noEmitis clean, andbiome lintexits 0 with warnings unchanged frommain. Nothing here is platform-specific.Merge order: independent of #62, #66, #67 and #77. I merged all of them together on 0.8.4 and they apply cleanly.
🤖 Generated with Claude Code