Build the standalone native resting-order state machine - #246
Merged
Conversation
luisleo526
marked this pull request as ready for review
September 12, 2026 17:10
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.
Native strategies previously had queued market actions but no persistent resting-order lifecycle. This PR adds that state machine to the standalone C++ host: limit, stop, stop-limit and trailing requests; partial execution with capacity per input point; owner-bound children; and causal group cancellation/reduction through general
submit,replaceandcancelcommands.Confirmed OHLC and forward ticks use the same working-request core. Matching chooses the earliest remaining price crossing, preserves exact reached prices across rescans, and keeps observed gaps distinct from modeled continuous paths. Committed opening events establish child ownership and quantity. Cycle changes, replacement, exhaustion, group effects and dependency cleanup have deterministic terminal behavior.
The existing physical lot book remains the accounting authority. Scoped closes preserve unrelated lots and historical costs with one current fee per execution. Typed immutable events retain partial quantities, activation, ownership, receipts and failure prefixes; failed runs require discard/replay.
Requests/core/events use
native_order_v2; identity values remain v1. Engine, pending, host and consumer C++ boundaries move together to epoch13, with broker/stream hash domains and old return-onlynative_events()link controls. C ABI4 prefixes and current calendar/session/timezone/DST/timeframe support are preserved. Complete Pine policy lowering remains codegen/adapter work in R4.Validation on exact final candidate
c57e8687d91027df09474b414369162e47b94bbb, treee209c89035ec884774f8f3e68e1dc118f26aaf51:exp-native-r2-c57e868-20260912: 72/72 cases, 4,190/4,190 probes, both provider executions successful. Zero full-grade, raw-trade, substantive-verifier, configuration, metadata, or coverage differences against the accepted R2a reference. Raw verifier metadata differences are retained under the existing comparator rules.pineforge-pr-gate-n976j: FAIL, target.not-positive only. Unchanged compatibility is accepted under the standing neutral-refactor authorization; no PASS receipt or baseline promotion is claimed.Squash merge must preserve the exact reviewed/measured tree. R3/R3b accounting consolidation, R4 source-policy ownership, final audit, and the later parity campaign remain subsequent roadmap work.