Repository navigation
Fix clippy issues and handle duplicate graph nodes - #112
Merged
Merged
Conversation
These referenced intents created in a different (pomodoro) project and aren't relevant to atomic. Rewrote each comment to describe the bug/fix directly (orphan-view duplication, whole-file-replace safety) while preserving the technical explanation.
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.
This pull request addresses two critical issues related to session view handling and file diffing in the presence of graph forks or cycles. It ensures that missing session views are created just-in-time to prevent content duplication, and that file diffs avoid corruption by falling back to whole-file replacements when necessary. The changes also clarify and harden the logic for deleting all file content in complex graph states, and introduce robust tests to prevent regressions.
Session View Handling and Duplication Prevention:
record_turn()now detects when a session view is missing (often due to a failed or skipped SessionStart) and proactively forks the view from its intended parent or the current view as a last resort. This prevents recording onto the wrong view, which previously led to content duplication when merging views.test_orphaned_session_view_duplicates_content_on_merge) simulates the orphaned session view scenario and verifies that content is not duplicated after merging, ensuring the fix remains effective.File Diffing and Whole-file Replace Safety:
output_file_to_buffer_with_options) now returns a flag indicating whether semantic merge resolution was required, allowing callers to make safe decisions about diffing. [1] [2] [3] [4] [5]Content Deletion Logic Improvements:
delete_all_content) is refactored to always use a thorough, SCC-aware traversal, ensuring all content vertices are deleted even in the presence of forks (as produced by the orphan-view duplication bug). This replaces previous fallback mechanisms that could leave orphaned content alive. [1] [2] [3]find_content_vertices_cachedfunction is removed, further simplifying the code and reducing the risk of incomplete deletions.Diff Heuristic Clarification:
These changes collectively make the system more robust against subtle bugs caused by missing session views and complex file histories, while also improving code clarity and maintainability.