Harden RFC-022 pre-arm recovery ownership#346
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.
What & why
Completes the next RFC-022 slice by preventing SchemaApply, BranchMerge, and EnsureIndices from claiming physical effects or uncovered Lance HEAD drift that existed before their recovery intent. It also makes metadata-only SchemaApply recovery and interrupted EnsureIndices rollback unambiguous across crashes.
Backing issue / RFC
Checklist
Notes for reviewers
Validation:
Greptile Summary
This PR tightens recovery ownership for RFC-022 write paths. The main changes are:
Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Writer participant Gates as Schema/Branch/Table gates participant Sidecar as Recovery sidecar participant Lance as Lance table HEADs participant Manifest as Manifest participant Recovery as Recovery sweep Writer->>Gates: Acquire ownership envelope Writer->>Manifest: Revalidate schema, branch, and table pins Writer->>Lance: Verify existing HEAD matches manifest pin Writer->>Sidecar: Write recovery intent before effects Writer->>Lance: Apply table, index, or schema effects Writer->>Sidecar: Confirm completed effect phase Writer->>Manifest: Publish graph commit Writer->>Sidecar: Delete sidecar best-effort Recovery->>Sidecar: Read versioned intent Recovery->>Lance: Classify visible effects Recovery->>Manifest: Roll forward or roll back Recovery->>Sidecar: Record audit and delete%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Writer participant Gates as Schema/Branch/Table gates participant Sidecar as Recovery sidecar participant Lance as Lance table HEADs participant Manifest as Manifest participant Recovery as Recovery sweep Writer->>Gates: Acquire ownership envelope Writer->>Manifest: Revalidate schema, branch, and table pins Writer->>Lance: Verify existing HEAD matches manifest pin Writer->>Sidecar: Write recovery intent before effects Writer->>Lance: Apply table, index, or schema effects Writer->>Sidecar: Confirm completed effect phase Writer->>Manifest: Publish graph commit Writer->>Sidecar: Delete sidecar best-effort Recovery->>Sidecar: Read versioned intent Recovery->>Lance: Classify visible effects Recovery->>Manifest: Roll forward or roll back Recovery->>Sidecar: Record audit and deleteReviews (1): Last reviewed commit: "Harden RFC-022 pre-arm recovery ownershi..." | Re-trigger Greptile
Context used: