Open
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4f07e21. Configure here.
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.

Currently, delete_xorb lives on DirectAccessClient and performs unconditional deletion — there is no way for GC workflows to do compare-and-delete style operations that guard against deleting an object that has been rewritten since it was listed. This PR moves delete_xorb to DeletionControlableClient and adds conditional deletion APIs for both xorbs and shards, keyed on an opaque 32-byte ObjectTag.
New DeletionControlableClient methods:
list_xorbs_and_tags / list_shards_with_tags — return object hashes paired with content-derived tags.
delete_xorb_if_tag_matches / delete_shard_if_tag_matches — delete only when the current tag matches the provided one, returning whether the delete occurred.
Tags are derived differently per backend: LocalClient hashes filesystem metadata (modified/created timestamps, size, permissions) to detect overwrites; MemoryClient hashes object content. MemoryClient now also fully implements DeletionControlableClient, so in-memory simulation servers wire through deletion routes instead of returning 501.
verify_integrity on LocalClient gains a third pass that validates every shard referenced by the global dedup table still exists on disk, catching stale references that previously went undetected. Corresponding HTTP routes and SimulationControlClient methods are added for the new operations.
Note
Medium Risk
Touches deletion semantics and integrity verification paths and introduces a new on-disk redb table (
FILE_TO_SHARD_TABLE), which could affect GC simulations and file visibility if the mapping logic is wrong. Changes are localized to simulation clients/servers but include concurrency-sensitive rename/tag checks and new API contracts.Overview
Adds compare-and-delete support to simulation GC workflows by moving
delete_xorboffDirectAccessClientontoDeletionControlableClientand introducing anObjectTagplus new list/conditional-delete methods for both XORBs and shards.Extends the simulation HTTP surface and
SimulationControlClientwith endpoints for listing hashes with tags and tag-guarded deletes, and wires deletion controls for the in-memory backend (previously returned 501).Strengthens
LocalClientintegrity semantics by tracking active file entries in a newFILE_TO_SHARD_TABLE(with byte offsets for direct-seek reads) and expandingverify_integrity()to validate dedup-table shard references exist on disk; updates upload/delete logic and tests accordingly.Reviewed by Cursor Bugbot for commit 02a5f75. Bugbot is set up for automated code reviews on this repo. Configure here.