Conversation
Use the published filesnap 0.5.0 Rust crate for content-addressed snapshots and native prompt history. Preserve compatibility with existing per-file snapshot references while keeping recovery checkpoints and garbage collection within the snapshot store. Capture before prompts and declare known file writes before mutation, including paths that do not exist yet. Add a native /rewind picker, multi-level /redo, and /rewind-recover. Restore files and persisted conversation state together with workspace locking and a durable recovery journal, then refresh the terminal conversation. Document capture boundaries, ignore policy, binary-file coverage and recovery behavior. Link the engine into Forge without an external CLI or local filesnap source override. Validation: 12 snapshot/history tests, affected-crate clippy and CLI checks, and a complete locked debug build plus launcher version check. Verified the resolved filesnap source against every file in the published crate archive. Co-Authored-By: ForgeCode <noreply@forgecode.dev>
Replace direct checkpoint indexing and slicing with checked access to satisfy the string-safety Clippy checks. Document public snapshot and conversation-history parameters, errors, and lease requirements. Validation: related-crate Clippy with warnings and string-safety lints denied; 12 snapshot/history tests; changed-file rustfmt checks. Co-Authored-By: ForgeCode <noreply@forgecode.dev>
This branch has not been deployed
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
Add native rewind and redo that restore captured workspace files and the persisted conversation together. This lets users return to an earlier prompt, retry an approach from its corresponding file state, and reverse a rewind.
/rewindopens a prompt selector and, after confirmation, restores files and conversation to before the selected prompt./redorestores the state before the last rewind, with support for multiple levels./rewind-recoverrecovers an interrupted restore before the next prompt can proceed.Checkpoints are captured before prompts, and supported local file tools preserve pre-edit contents, including the absence of newly created files. A new prompt clears redo. These commands do not call a model.
Implementation and compatibility
filesnap = "=0.5.0"Rust crate in-process; no separate executable or Node/npm runtime is required..snapfiles. New snapshots use content-addressed storage, and failed restores retain their checkpoint for retry.Related to #1192, #232, and #432. Those completed issues provide the background for per-file undo and snapshots; this PR adds prompt-level file-and-conversation recovery and redo while retaining per-file compatibility.
The workflow draws on my own codex-rewind, which also integrates the engine in Rust, and pi-better-rewind-redo projects.
Related to #1192, #232, #432
Also related to Discussion #2631, where a user asks how to step back in a conversation. This PR adds explicit prompt-level rewind with corresponding file restoration and redo.
Validation
Validated on Linux with Rust 1.98.1 after rebasing onto
daf8bf80:forge_snaps,forge_repo,forge_services, andforge_main, usingcargo nextest run --locked --offline --test-threads 2. The default-parallelism run had one runtime-heartbeat timing failure; the complete run passed with two test threads.-D warnings.--version/CLI--helpchecks passed.hello.py, add a greeting function, rewind to the earlier state, then redo to restore the function and its conversation state.macOS and Windows runtime validation has not been performed locally.
Screenshots
Native command selection, including rewind, redo, and recovery:
Select the prompt whose preceding file and conversation state should be restored:
Confirm the rewind:
Rewind followed by redo restores the greeting-function conversation state. File contents were also checked during manual testing:
Co-Authored-By: ForgeCode noreply@forgecode.dev