Skip to content

Add evidenced dividend lifecycle and deterministic replay - #22

Merged
PureSaber merged 3 commits into
mainfrom
codex/qexec-dividend-lifecycle-20261004
Oct 4, 2026
Merged

PureSaber merged 3 commits into
mainfrom
codex/qexec-dividend-lifecycle-20261004

Conversation

@PureSaber

@PureSaber PureSaber commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

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_PIT valuation.

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 by ex_at; repeated calls also reject a stored phase whose actual applied_at exceeds 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 Fraction difference, 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%
  • Core pure branch gate: dividends.py 90.70%, artifacts.py 90.54%, schemas.py 92.86%; every gated core module exceeds 90%
  • python -m ruff check .: passed
  • python -m ruff format --check .: passed
  • Scenario/production retry matrix covers entitlement, conversion, and payment cutoffs with atomic rollback
  • Legacy golden SHA-256 values unchanged; new dividend-record golden added

@PureSaber
PureSaber marked this pull request as ready for review October 4, 2026 07:39
@PureSaber
PureSaber merged commit 384025a into main Oct 4, 2026
8 checks passed
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