Skip to content

refactor: unify reversal execution and lifecycle settlement - #242

Merged
luisleo526 merged 4 commits into
mainfrom
refactor/native-reversal-execution-20260912
Sep 12, 2026
Merged

luisleo526 merged 4 commits into
mainfrom
refactor/native-reversal-execution-20260912

Conversation

@luisleo526

@luisleo526 luisleo526 commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator

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, tree 790a7cdc3c69e3eb92a7a5fc9ecce2000888818c.

  • Full Debug build; 1,417 direct native checks passed. The added stored-owner cases fail on the prior implementation; the existing activation-route integration test is unchanged.
  • ABI, hash coverage and pending-order mirror checks passed. The existing activation-route test also passed locally: 127 checks.
  • All nine PR checks passed: Linux/macOS Release/Debug, ASan/UBSan, native runner and code analysis.
  • Independent Grok review: GREEN, no P0/P1/P2 findings.
  • Cloud cases: 72/72 succeeded; all 4,190 probes have identical full grades and trade bytes versus merged d3996b4, with no substantive verifier differences. Case inputs and images remain fixed; this execution used 64 worker tasks. The pipeline completed successfully.
  • Candidate snapshot: 6a284a89bf6cb5e4e6cc6fc76d6ab6011dfb19934daeac7d533270100b79e4de.

Formal gate pineforge-pr-gate-rr48k: FAIL target.not-positive only. 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.

@luisleo526
luisleo526 merged commit ac526fd into main Sep 12, 2026
9 checks passed
@luisleo526
luisleo526 deleted the refactor/native-reversal-execution-20260912 branch October 5, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant