Autosave#217
Open
matt-pharr wants to merge 5 commits intodevelopfrom
Open
Conversation
Expose node_digest() as public API in checksum.py for per-node XXH3-128 comparison. Add autosave_cache parameter to serialize_node() that skips file I/O for data nodes (ndarray, DataFrame, binary, etc.) whose content hash hasn't changed since the last autosave. File-backed nodes (scripts, notes) continue to use smart_copy() which already deduplicates. The cache is a module-level dict in handlers/project.py, threaded through _collect_nodes → serialize_tree_to_dir → handle_project_save. It is activated when is_autosave=True in the save payload and cleared on explicit saves. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Timer-driven autosave that serializes the tree to .autosave/ inside the project directory (or working dir for unsaved projects). The timer fires at a configurable interval (default 300s, min 30s) and only triggers when the kernel is idle — deferred autosaves run as soon as the kernel goes idle. Key changes: - kernel-manager: track executionState from iopub status messages, emit kernel:executionState events - project-manager: autosave timer lifecycle, autosave() method that sends is_autosave=true to the kernel, static helpers for checking and clearing .autosave/ directories - config: add autoSaveIntervalSeconds field - ipc/preload: add autosave channel group (run, clear, check, scanWorkingDirs) and push.autosaveTrigger - pdv-protocol: extend save payload with is_autosave and clear_cache - index: wire timer to kernel lifecycle, clear .autosave/ on explicit save, handle deferred autosave on idle transition - ipc-register-project: onExplicitSaveCompleted callback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Autosave section to Settings/General with a configurable interval input (default 300s, min 30s) and a button to clear autosave data for the current project. Subscribe to the autosave trigger push in app/index.tsx — when the main process requests an autosave, the renderer sends its current code-cell state back via window.pdv.autosave.run(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The autosave interval is now re-applied immediately when the user saves a new value in Settings/General, without requiring a kernel restart. Adds an onConfigChanged callback to the app-state IPC handler. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When opening a project that has .autosave/ data, show a confirmation dialog offering to restore the autosaved changes or discard them. Recovery load flow: - Copy baseline files from the main save dir to the working dir - Overlay autosaved files on top (changed nodes take precedence) - Use .autosave/tree-index.json and code-cells.json for the load - Clean up .autosave/ after successful restore or on discard Python handler accepts optional tree_index_dir in the load payload so the kernel reads from the autosave directory while save_dir stays pointed at the real project for future saves. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
.autosave/subdirectory, with configurable interval (default 5 minutes)How it works
The Python kernel reuses
xxh3_128checksums from previous autosaves to skip serialization of unchanged ndarray, DataFrame, and binary nodes. Explicit saves clear both the.autosave/directory and the kernel-side cache.Test plan
.autosave/directory appears withtree-index.jsonandcode-cells.json.autosave/is deleted and timer resets.autosave/is removedpytest tests/ -vinpdv-python/— checksum rename is coverednpm testinelectron/— config defaults and IPC handler mocks updated