Commit f11a223
test(realtime): RG2 — silent-gap property fuzzer (trichotomy: append|reorg/dup|fatal, never silent-skip)
Property fuzzer for the realtime campaign plan item (e).2. Feeds randomized adversarial
block-delivery sequences (dropped / duplicated / out-of-order / mutated hash|parentHash,
interleaved 204-idle & 409-fork phases) through the REAL realtime consumer
`portalRealtimeEvents` and asserts the trichotomy: every delivery is APPENDED (realized chain
matches the model), RECONCILED (reorg rolled back to the right ancestor / duplicate no-op), or
FATAL (a `gap` throws) — NEVER silently skipped.
The reference model is derived PURELY from hash/parentHash relationships (it never calls
`reconcile`, so the check is not circular); the code's realized chain is reconstructed from the
consumer's own emitted event stream and asserted equal to the model or the consumer must have
thrown. Seeded mulberry32 PRNG (not Math.random); the failing seed is printed on any violation.
Default N=2500 (~1s); heavy/nightly acceptance via FUZZ_N=100000 (>= 10^5, verified zero
violations). Finality held inert so the fuzzer isolates the append|reorg|dup|gap decision.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent afc5c4a commit f11a223
1 file changed
Lines changed: 502 additions & 0 deletions
0 commit comments