# Shutdown Write-Admission Quiesce Contract (`K2141–K2145`) 1. **Admission Boundary (`Open` vs `Quiescing` / `Quiesced`)**: - New client writes are admitted only while `Phase::Open` holds and `client_id`, `bytes`, and `digest` are non-zero within the bounded `MAX_WRITES` table. - Once `begin_quiesce` is invoked, the gate transitions to `Phase::Quiescing` (or `Phase::Quiesced` when `inflight == 0`). Every subsequent `admit_write` attempt is refused with `Error::Shutdown` (`ESHUTDOWN = 108`) and increments `rejected_eshutdown`. 2. **Preservation of Existing Work During Drain**: - Already-admitted writes continue to complete via `complete_write`, recording `drained`, `drained_bytes`, `drained_digest`, and per-write `CompletedWrite` receipts. - Racing `admit_write` calls that fail with `Error::Shutdown` (`ESHUTDOWN`) never alter or discard in-flight or completed write records. - `require_quiesced` succeeds only when `Phase::Quiesced` is reached and `inflight == 0`.