feat: public batch merge and snapshot install - #10
Merged
Conversation
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.
Lets an application replicate craqle batches over its own transport and seed replicas from graph snapshots, so nodes that cannot join the irokle topics (Aruna user devices) still converge with the OR-Set semantics of the store.
Changes
CraqleNode::merge_batch: merges a batch authored elsewhere with the semantics of the irokle apply path (tombstone check, dot dedupe under the graph write guard, OR-Set apply in op order, diagnostics refresh, post-commit SHACL settlement that never rejects); idempotent by dot.Batch::from_changes: one public builder for the op mapping; the irokle path now uses it too.CraqleNode::install_graph_snapshot: state-based OR-Set join with causal context (a dot the local clock covers but the local quad lacks is a known removal), element-wise clock max, idempotent; a lagging replica's snapshot never resurrects a removed quad.plan_rocrate_document_checked,plan_patch_data,plan_patch_contextual: change sets without applying, same validation as the applying variants.graph_snapshotorders quads and dots deterministically and is documented as a sync mechanism;MergeResultandCrossGraphChangeare public.as_chunksin the export cursor decoder, the deprecatedfetch_updateallowed under the current MSRV).tests/merge_api.rs(merge equality, concurrent add and remove convergence in either order, snapshot idempotence, stale snapshot ignored, planner purity).References