Implementation Plan: YU01-lmax-sequencer
Scopeβ
- Sibling branch transition from
009-order-management-matchertoYU01-lmax-sequencer. - Track focus:
architecture(behavior-preserving execution-model replacement, like005/006). - Rebuild the trading hot path only: Gateway encode, sequencer, input disruptor, BLP, output disruptor,
journal/replication, async read-model.
account-service,position-service,people-service,reference-data, Angular UI, ingress, and the LGTM stack are unchanged. - Define requirement deltas, internal contracts (SBE schemas, journal, projection checkpoint), the no-GC conformance gate, and generation/test hooks.
Milestones (strangler phases, all within this state)β
- P0; Latency harness: instrument the
009path end-to-end (HdrHistogram, JLBH, jHiccup) so every later milestone is proven, not assumed. - P1; Input disruptor in
order-matcher: replace the@Scheduledpoll +ReentrantLockwith the input ring and an event-driven single-threaded handler;longfixed-point +int securityId; route price ticks through the ring. - P2; Fused BLP: fuse matching + trade booking + position keeping into one in-memory thread; replace blocking REST validations with event-fed caches; typed output events; determinism contract.
- P3; Sequencer + journal authoritative + output ring: journaler/replicator/un-marshaller in parallel with sequence-barrier gating; snapshot + replay recovery; NATS bridge and async batched read-model projector with checkpointed rebuild.
- P4; Replication + failover + no-GC gate: follower BLP with output suppression and promotion; nightly bounce; Epsilon-GC allocation gate, banned-API static check, penny-parity fixture wired into CI.
Deliverablesβ
- Requirement deltas in
requirements/(functional, non-functional, no-GC conformance profile). - Contract deltas in
contracts/(internal SBE/journal/checkpoint contracts; external surface frozen). - Supporting artifacts:
research.md,data-model.md,quickstart.md. - Architecture and topology deltas in
system/, including ADRs 014β017. - Observability contract for ring/BLP/egress/no-GC metrics and Grafana panel set.
- Generation hook implementation in
pipeline/generate-state-YU01-lmax-sequencer.sh. - No-GC conformance gate in
pipeline/validate-no-gc-conformance.shplus a GradlenoGcTestprofile. - Smoke test implementation in
scripts/test-state-YU01-lmax-sequencer.sh. - Parity fixtures: penny-parity (fixed-point vs
BigDecimal), determinism replay, subject/payload byte-parity against009.
Exit Criteriaβ
- Spec and tasks are complete and reviewed.
- Generation hook produces expected artifacts.
- Smoke tests pass for this state, including parity, determinism, recovery, and decoupling checks.
- Allocation gate (Epsilon GC) and banned-API static check pass in CI on the demo/
C2profile. - Latency report meets NFR-09B01 budgets on the
perfprofile (documented bare-metal run). - State can be published to
code/generated-state-YU01-lmax-sequencer.