# Java replay of stored administrative frames — 2026-10-04

Pure Java replays full administrative payloads from QuickFIX file stores instead
of gap-filling their sequence numbers. A stored Logout is emitted again as
`35=5|34=1|43=Y`; the expected output is a SequenceReset with
`35=4|34=1|123=Y|36=2`. Logon and Heartbeat show the same eligibility error.

The public-API probe reproduced **12 failures with 8 passing controls** on
`21dd8ef3e68b130e9307e2a5490b28a90eb55117`. Its Java sources are identical to
the source-audit base, `0524dd511`. Both `quickfix-cpp` and `quickfixj` layouts
fail through transcript and TCP-acceptor sessions. Each combination tests full
stored Logon, Heartbeat and Logout payloads; zero-length administrative markers
and ordinary application payloads pass. Every case also replays a second stored
application correctly. The probe exits 1 for the defective baseline.

`QuickFixReplayStore.contains` accepts every positive-size record. Neither
`replayStored` nor `replayTcpClientStored` excludes administrative message types
before `encodePossDupReplay`, whose documented job includes rewriting admin
frames. QuickFIX/J and QuickFIX C++ persist complete admin messages, so this
matters when taking over their stores. Existing Java admin replay tests write
libhft's zero-length markers and therefore miss that handoff. Exact source
references and coverage analysis are in the [audit](evidence/java-replay-admin-20261004/REVIEW.txt).

The [driver](evidence/java-replay-admin-20261004/ReplayAdminProbe.java) uses public
APIs without reflection or production changes. It seeds files through
`QuickFixFileStore.append`, uses `TestTempFiles` for fixture cleanup, and checks
raw transcript output or actual TCP frames. [baseline.log](evidence/java-replay-admin-20261004/baseline.log)
retains all emitted frames, the process/memory preflight, and the final counts.

Production classes were compiled normally with `LIBHFT_BUILD_ROOT` set using
`mvn -q -f engine/java/pom.xml -DskipTests compile`. No Maven test suite ran.
The probe exercised pure Java only; it did not run JNI/native sessions or
external QuickFIX engines. This is a bug reproduction, with no fix or latency
measurement in this handoff.

To rerun after compiling the candidate's production classes, use the same
absolute build root supplied to Maven:

```sh
bash internal/docs/bench/evidence/java-replay-admin-20261004/run.sh \
  "$PWD" "$LIBHFT_BUILD_ROOT"
```

The Java LogFactory owner currently reserves the session's outbound paths.
Coordinate the eligibility fix in both replay-selection paths and add coverage
for nonempty admin records. Preserve the generic encoder's ability to rewrite
admin frames. Sparse per-integer replay scans remain a separate source finding.
The audit found no current C++-style borrowed-buffer-across-GapFill defect:
Java loads the replay payload after the GapFill. The pending wire-hook work
should preserve that ordering and cover callback stop/restart and buffer reuse.
