Repository navigation
refactor: unify reversal execution and lifecycle settlement - #242
Merged
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.
Reversal fills now use one physical settlement coordinator for closing exposure, opening the remainder, charging one execution fee, and applying selected exit lifecycle effects. It validates allocations, exact lifecycle targets/revisions and required counters before dependent effects, then performs pre-close transitions, closes and unbinds the old position, removes authorized exits, and binds retained exits to the new position.
Flat cleanup unbinds each exit's actual stored lifecycle owner, including prearmed owner zero, while preserving exact pending-order identity. Explicit stale lifecycle targets and revisions are refused before money or order state changes. Pine quantity/dust selection and price resolution remain at the adapter boundary; the original two-argument settlement API is preserved.
Validation candidate:
52eca5446a64b330f5f133b66686a46a087353ca, tree790a7cdc3c69e3eb92a7a5fc9ecce2000888818c.d3996b4, with no substantive verifier differences. Case inputs and images remain fixed; this execution used 64 worker tasks. The pipeline completed successfully.6a284a89bf6cb5e4e6cc6fc76d6ab6011dfb19934daeac7d533270100b79e4de.Formal gate
pineforge-pr-gate-rr48k: FAILtarget.not-positiveonly. The user authorizes zero-improvement refactors with no regression; the actual failure is retained and baseline promotion is deferred.This is a bounded step toward a standalone native execution state machine, with no claim of complete native independence or reduced durable flags. Use squash merge under the user's no-regression refactor authorization. Record the actual merge SHA and tree equality; keep pre-merge measurements attributed to the reviewed head. Preserve the formal gate's actual result and defer baseline promotion when no valid promotion receipt exists.