Add evidenced dividend lifecycle and deterministic replay - #22
Merged
Merged
Conversation
PureSaber
marked this pull request as ready for review
October 4, 2026 07:39
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.
QExec lacked an evidence-bound account dividend lifecycle, point-in-time FX valuation, and a complete replay contract for those facts. This change adds independent entitlement, issuer-conversion, and payment phases with exact account arithmetic, explicit ex-date evidence, trusted production verification boundaries, and whole-account
EVIDENCED_PITvaluation.Every phase now validates fact availability and economic effectiveness against the request cutoff before any idempotent fast return. Entitlement requires every fact used for the receivable, including
PaymentPolicy, to be effective and available byex_at; repeated calls also reject a stored phase whose actualapplied_atexceeds the new cutoff. Identical retries at the original or a later cutoff return the original record.Issuer conversion uses the issuer-published payment amount and retains the printed rate, source units, precision, approximate flag, exact
Fractiondifference, and an explicit unverified relationship status. Production policy evidence is verified when first used, actual payment is verified separately, and manifests report only the facts actually checked while leaving overall market-admission certification false.Manifest 1.1 adds dividend records and sealed-snapshot export. Opening positions, cash imports, marks, fills and other ledger events, PIT FX observations, valuations, and dividend phases share one operation sequence. Replay applies the original business facts in order, compares final facts instead of injecting them, and verifies transaction bytes, lifecycle state, historical valuations, marks, lots, NAV, and journal. New public records recursively own immutable nested values and return isolated dictionaries.
Validation:
python -m pytest --cov=quant_execution --cov-branch -q: 334 passed; total coverage 94.60%dividends.py90.70%,artifacts.py90.54%,schemas.py92.86%; every gated core module exceeds 90%python -m ruff check .: passedpython -m ruff format --check .: passed