refactor: replace seven pending-order flags with quantity and event facts - #236
Merged
Conversation
Track quantity requests and reservation bases, exact replacement predecessors, and callback birth/cursor provenance instead of independent Boolean labels. Capture resolved targets for deferred closes before later reservation binding. Keep the remaining Pine historical reach permission explicit. Preserve the v1 C mirror prefix with derived legacy outputs and appended facts. Version PendingOrder and BacktestEngine together to reject stale C++ objects.
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.
Pending orders stored quantity intent, reservation coverage, replacement identity and callback origin in independent booleans. This replaces seven stored fields with Units/Fraction/All requests and numeric reservation bases, an exact predecessor incarnation, and immutable callback/fill/cursor facts.
PendingOrdernow has 25 direct Boolean members instead of 32. The duplicated EXIT predecessor is also removed.The integrated path initializes deferred market-close quantity requests before later rebinding. An independently reproduced missing-intent exception after reversal is fixed without weakening the guard. The recorded placement target remains distinct from the later reservation produced by the existing Pine ANY-relative rule.
The C mirror preserves all 108 existing fields and appends 20 facts; legacy fields are derived outputs only. Both
PendingOrderandBacktestEngineuse internal C++ v5, including rejection of old standalone order callers. Broker/stream fingerprints advance together. Public C ABI 4 and stream API 1 are unchanged.This is a partial state-model refactor related to #227. One persistent binary Pine historical-reach permission remains active, alongside the other 25 booleans and existing scheduling/admission policies. Generic leg-owner activation and external execution ingestion are separate work.
Validation: full configured build; 14 selected native/tool checks; 314 corpus transpile/compile checks without runtime execution; 15 compile-only pairing translation units, 10 positive and 15 rejected links. Independent exact-candidate Grok P0/P1/P2 = 0/0/0 and scoped Q1 repair review passed. Original failing witnesses are preserved.
Full Cloud assessment
exp-pending-order-core-20260910: 4,190/4,190 graded across 72/72 cases. Raw CSVs, trade counts, complete grades and substantive verifier results are unchanged against both c45/741 and official baseline56. Target band score0, zero individual regressions; scoreboard remains4,182 excellent /8 strong. All source/input/runtime and complete Postgres row projections were verified.Formal PR gate
pineforge-pr-gate-rtplvremains FAIL solelytarget.not-positivebecause the score is zero. Publication uses the owner's explicit standing authorization for native neutral fixes with actualZERO and no individual regression. No grading rule, reference, input or population changed; no PASS receipt or baseline promotion is fabricated. Snapshot61afac8eb013fc49f304d9d981c89a3a0dee42290ac60ea33c01d051079b9565; exact source/review evidence archive185c3d7f6fd4e7acff0388d9d00a42120c065369f1727106ef8b0ccc3853619a.