RFC-026: add private B2 token authority and exact fold recovery#382
Open
aaltshuler wants to merge 5 commits into
Open
RFC-026: add private B2 token authority and exact fold recovery#382aaltshuler wants to merge 5 commits into
aaltshuler wants to merge 5 commits into
Conversation
Attribute the new (3 opens, 2 scans) budget for `native_branch_controls_use_one_post_gate_manifest_capture`. The cost moved on main, not here: 57113f1 ("Read manifest-only snapshots in branch delete's dependency check", #379) made delete take one operation-local target capture plus one fresh manifest-only snapshot per surviving branch and one native-ref opener, so the old (2, 1) expectation no longer describes the engine. Because the heavy CI gates only run post-merge, `Test Workspace` has been red on main at this exact assertion since that merge. This realignment records the new shape; it is not a loosening to accommodate the token-authority work in this branch, which adds only a process-local mutex to the delete path.
`DrainDescriptor::validate` iterates the drain's own `expected_binding`-keyed epoch floors but looks each shard up in the entry's `binding`-keyed map. The caller proves those two bindings equal only *after* `drain.validate(self)` returns, so a corrupt or foreign DRAINING row naming a shard outside the current binding reaches an `.expect()` and aborts the process — on exactly the state this validator exists to classify fail-closed. This test reproduces it. Against the current code it panics at stream.rs:723 with "both maps exactly match the binding" rather than returning the typed refusal.
Look the current epoch floor up with a typed `manifest_internal` refusal naming the offending shard, matching the sibling `validate_epoch_floors` pattern, so `DrainDescriptor::validate` is self-contained regardless of call order. A classifiable corrupt or foreign DRAINING row now fails closed rather than aborting the process. The path is unreachable from current production writers because lifecycle management is inactive; the fix closes the class rather than relying on that.
Recovery-v12's `EffectFree` arm — retire a durably armed intent whose exact base and token participants were never invoked — had no failpoint and therefore no test. Nothing could produce that cell deterministically: STREAM_FOLD_POST_DRAIN_PRE_SIDECAR fires before the sidecar exists, and RECOVERY_SIDECAR_WRITE makes the arm itself fail, so no sidecar survives. Add STREAM_FOLD_POST_SIDECAR_PRE_BASE_COMMIT between the sidecar write and the base commit, plus a cell proving open-time recovery retires the intent without advancing the base-table pointer or publishing, and that the acknowledged generation still folds exactly once afterwards. Without this, a regression in EffectFree classification could delete a sidecar that owns a durable pre-manifest effect, and no test would fail.
aaltshuler
force-pushed
the
codex/rfc026-b2-token-authority
branch
from
July 25, 2026 17:40
faaa755 to
d347ac4
Compare
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
_stream_tokens.lanceauthority__manifestCAS publishing both pointers, lifecycle state, lineage, and durable attributionidPK metadata, and ordinary__omnigraph_stream_v1user dataWhy
Private B1 proved durable admission and bounded folding, but it did not yet provide durable per-key sequencing, idempotent retry classification, trusted contributor attribution, or an exact two-participant fold outcome. This slice closes that correctness gap without exposing a product API or inventing an OmniGraph WAL/transaction manager beside Lance.
Compatibility and risk
This is an intentional internal storage-format boundary: v8 graphs are refused by v9 and must cross through export/init/load. Recovery-v11 remains historical and is refused under v9 because it lacks the token participant and complete lifecycle-v2 authority. The topology remains main-only, unsharded, and one live writer process; fresh reads and managed generation reclamation remain inactive.
Validation
cargo test --workspace --lockedcargo test --locked -p omnigraph-engine --features failpoints --test failpoints— 141 passed, 1 ignoredcargo test --locked -p omnigraph-engine --features failpoints --test memwal_stream— 34 passedcargo test -p omnigraph-server --features aws --lockedscripts/check-agents-md.shgit diff --checkGreptile Summary
The PR completes the private RFC-026 B2 compare-and-chain storage path.
Confidence Score: 5/5
The PR appears safe to merge because no blocking failure eligible for this follow-up review remains.
No blocking failure remains.
Important Files Changed
Sequence Diagram
Reviews (2): Last reviewed commit: "test: pin the armed-before-any-effect St..." | Re-trigger Greptile
Context used: