feat: settlement journal — lossless per-node trade/terminal record (dark)#121
Merged
Conversation
…ark by default) The write half of the Assets Engine settlement feed. Every replica appends every trade and every terminal order status (>= FILLED) to a recorded, disk-backed Aeron archive, hooked on the DETERMINISTIC SERVICE THREAD before the sheddable Disruptor/egress machinery -- so the journal is gap-free by construction, independent of leadership, egress shedding, and the omsEgressQueue. - SettlementJournal: SBE-encodes into a 64MB SPSC ring on the service thread; a full ring BLOCKS loudly (never sheds) -- a stalled journal archive degrades the node to a lagging replica instead of losing a settlement. - JournalWriterAgent (own AgentRunner thread, backoff): drains the ring into a recorded ExclusivePublication on a SECOND Archive (stream 4001, control port +10, control streams 4010/4011, fileSyncLevel(1), SHARED threading, 64MB segments); lazy connect with retry so node boot never waits on it; appends an (egressSeq, position) checkpoint sidecar record at each segment boundary for retention. - Bootstrap (AeronCluster): journal runtime is env-gated dark -- SETTLEMENT_JOURNAL_ENABLED=true requires SETTLEMENT_JOURNAL_DIR (a disk path, never tmpfs); wired in both external- and embedded-driver launch paths, first-in/last-out around the cluster components. Verified: determinism corpus 67/0 with zero golden changes (journal dark = zero behavior change); full match-cluster suite 458/0; new SettlementJournalTest (field fidelity, append order, pure-function byte identity, block-never-shed backpressure) + end-to-end JournalWriterIntegrationTest (append -> ring -> writer -> real archive -> positioned replay reads back in order, the bridge's access pattern). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Test plan
🤖 Generated with Claude Code