# DDR-0004: Envelope Seq Decoded but Not Tracked (v1)

Status: Accepted  
Date: 2025-12-22  
Related ADRs: ADR-0005 (connection/pump responsibilities)
              ADR-0007 (dispatch/correlation is API/JSON-centric)
              ADR-0002 (state-driven behavior; correlation choices belong in the protocol model)
## Context

The E27 protocol includes two distinct sequence numbers:
- A 4-byte little-endian envelope sequence in the binary container
- A JSON-level numeric `seq` field in the API payload

The envelope sequence appears intended for encryption or protocol features
that are not required for initial functionality.

## Decision

The envelope sequence field will be:
- Parsed and decoded where the envelope is processed
- Exposed as metadata for debugging and future use
- NOT tracked, correlated, or used for request/response matching in v1

JSON `seq` remains the sole correlation mechanism at the message layer.

## Rationale

- Simplifies initial implementation
- Matches existing Node-RED usage patterns
- Avoids premature assumptions about envelope-level semantics
- Preserves future compatibility by decoding the field

## Consequences

- No pending maps keyed by envelope seq
- Correlation logic relies exclusively on JSON seq
- Envelope seq must be clearly named as metadata to avoid misuse
