Expand description
W-of-N quorum-write layer for the peer-mesh sync (v0.7 track C).
This module scaffolds the quorum-write contract described in
docs/ADR-0001-quorum-replication.md. The QuorumWriter sits ABOVE
the existing sync-daemon — deployments that don’t configure
--quorum-writes keep the v0.6.0 one-way push behaviour byte-for-byte.
§What ships in this PR
QuorumPolicy— configuration: N peers, W quorum size, timeouts.QuorumWriter::commit— the atomic-from-caller contract: local write + W-1 remote acks within deadline, elseQuorumError::QuorumNotMet.AckTracker— collects remote acks with a simpleInstantdeadline. Pure logic, no network — so the unit tests don’t need a live sync mesh.- Metrics:
replication_quorum_ack_total{result},replication_quorum_failures_total{reason},replication_clock_skew_seconds.
§What does NOT ship in this PR
- Wiring into the
memory_storepath — follow-up PR once the sync-daemon gains a synchronous ack channel. - Real chaos harness — follow-up PR under
tests/chaos/with three-node fixture and failure-injection hooks.
That phasing matches the ADR’s implementation plan.
Structs§
- AckTracker
- Collects remote acks against a deadline. Pure logic — no I/O.
- Quorum
Policy - Operator-tunable quorum policy. See ADR-0001 § Model for the complete contract.
Enums§
- Quorum
Error - Errors surfaced by the quorum writer. Non-exhaustive so we can add variants without breaking downstream matches.
- Quorum
Failure Reason - Reason a quorum failed — reported in metrics.