Existing behavior and gap
crates/oh-core/src/transport.rs at b368ea8f7dcfbc4e7f21d4a9911e4c1c24409440 already derives directional session keys from a handshake transcript and tests replay, reordering, tampered headers/ciphertext and opposite-direction records. seal_record refuses send_counter == u64::MAX; receive currently increments recv_counter without an explicit checked boundary. Partial record I/O paths also deserve defined continuation/terminal behavior.
Part of https://github.com/aien-dev/omega-mv/issues/639. This is lifecycle hardening, not a claim of practical counter-wrap exploitation or an already-proven remote bypass.
Work
- Define symmetric send/receive exhaustion behavior and enforce it before wrap. Use test-only state injection near the limit, not billions of iterations.
- Create separate fresh sessions and reject old-session records even when identity keys persist and record numbers restart. Preserve transcript binding and per-direction keys.
- With a deterministic fake Read/Write stream, exercise partial headers/bodies, Interrupted, terminal errors, EOF between/within records, short writes and flush failures. Terminally poison a partially consumed/written stream or preserve resumable framing state explicitly; never silently restart framing at an arbitrary byte.
- Define whether a fatal read-side protocol failure terminates the whole session or only that direction, then ensure callers honor that contract. Preserve valid Read/Write semantics, including empty buffers and legitimate short operations.
Acceptance
- Boundary tests for last permitted counter, exhausted state and attempted continuation on both directions; no wrap/reused send nonce.
- Old session, wrong direction, reordered, dropped, duplicate and modified records cannot deliver accepted plaintext.
- Interrupted/partial I/O tests prove the chosen safe resume or terminal policy, with no duplicate send, framing ambiguity or counter rollback on retries.
- Negative mutants for counter guard, session-key binding and terminal-state handling are detected by specific assertions.
- Retain existing tests; supply exact commands, pins and machine-readable outcomes for the shared gate.
- Host-local tests only; no network deployment, new protocol, or hosted CI workflow required.