restore-verified fixes 3 gaps in file-mutation safety that try/finally misses
A developer has released restore-verified, a Python and JavaScript package designed to reliably restore source files after intentional mutation during testing or benchmarking. Standard try/finally blocks only guard against mid-run exceptions, leaving files broken after SIGTERM signals, SIGKILL timeouts, or silent restore failures. The package addresses these gaps by snapshotting files before mutation, verifying byte-for-byte restoration afterward, and providing an external sentinel for SIGKILL scenarios where in-process guards cannot run. Snapshots are stored in a temp directory rather than alongside source files to avoid skewing file-walker results. The tool ships with a CLI that exits with a distinct code of 3 when a restore was needed or failed, signaling that the run should not be trusted even if recovery succeeded.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in