proto(v37): libmrr M2 Drop 3 — finality-gated owed/overlay ledger + KAT-4 goldens - #1068
Merged
Conversation
…AT-4 goldens Adds mrr.Settlement over the Drop-2 owed base: three integer ledgers (owed / pending / settled) with I-CONSERVE (accrued == owed + pending + settled) held across every transition. The three m1 settlement-machine block transitions are weight moves: BlockFound->OverlayAdded (owed->pending), BlockFinalized-> OwedSettled+OverlayCleared (pending->settled), BlockOrphaned->OverlayReverted (pending->owed). Finalize gates on finalityK (the symmetric payout-side finality-gate): a payout cannot settle below depth K, matching the work side. A found->orphaned round trip restores the prior digest bit-for-bit (reorg-safety snapshot revert); found order over disjoint identities commutes; a found overlay cannot overdraw an identity's owed (rejected atomically). The owed base seeds from a Drop-2 Ledger via its exported accessors — Drop 2 is untouched. KAT-4 golden vectors pin per-step disposition/totals/digest and the hand-derived final balances; cmd/genkat4 asserts I-CONSERVE and the snapshot-revert pairs before minting. Additive only: KAT-1/2/3 goldens unchanged, zero production call sites, diff confined to prototypes/libmrr.
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
Drop 3 of the libmrr V37 prototype line:
mrr.Settlement(prototypes/libmrr/mrr/overlay.go) — the finality gate that turns owed work into paid work, built additively on the Drop-2 owed base. Prototype/research only; no production wiring.Model
Three integer ledgers over one identity space with the conservation invariant
accrued == owed + pending + settled(I-CONSERVE) held across every transition:owed— accrued, un-earmarked (the Drop-2 self-carry base)pending— earmarked to a found-but-not-final block overlay (reversible)settled— paid by a finalized block (irreversible)The three m1 settlement-machine block transitions are weight moves that leave I-CONSERVE invariant:
BlockFound → OverlayAddedBlockFinalized → OwedSettled + OverlayClearedBlockOrphaned → OverlayRevertedFinalize(blockID, depth)is the symmetric payout-side finality-gate (round-4/5 conceded fix): a payout cannot settle belowfinalityK(the sameGeometry.FinalityDepthKthat seals the work side) —depth < KreturnsNotFinaland moves nothing.Properties pinned (tests)
Ledgervia its exported accessors; Drop 2 is untouched.KAT-4 golden vectors (
kat4_overlay_vectors.json, 3 scenarios) pin per-step disposition/totals/digest + hand-derived final balances;cmd/genkat4asserts I-CONSERVE and the snapshot-revert pairs before it will mint. KAT-4 golden is regeneration-deterministic (identical hash across repeated runs).MUST-NOTs honored
cmd/genkat4.prototypes/libmrr.Base
Off
v37-dev@86c46bba(Drop-2 tip). PR targets v37-dev, not master. Merge-cp into master is a separate later ask.