← the depth behind redis-patterns R2 · Coordination
The Proof · module 01
The contract is run
The bus contract is not asserted in prose — it is run against a live server, scenario by scenario.
EchoMQ.Conformance is the protocol written as a set of runnable
scenarios. Each is a name and a one-line contract that drives the
public surface — or raw commands where the contract is the wire — against a live
server and asserts the externally visible verdict: the fence, the row shape, idempotent admission,
the kind law, the lex law, the token discipline, the schedule, the morgue, the reaper, the lanes, the read /
operator / watch planes, the flow family. The suite is the polyglot promise made testable: any
runtime that speaks the wire is conformant exactly when it drives the same server to the same verdicts. It is
all real code.
Run, don’t assert
A scenario is a name plus a one-line contract. scenarios/0 returns the whole set as a
keyword list in run order; run(conn, queue) walks it, drives each one
against a live server on its own sub-queue, and records the verdict. Pick a scenario below to read its contract,
the verb (or raw command) it drives, and the externally visible verdict it asserts — the value an outside
caller, or a port in another language, must reproduce.
A scenario · drive the surface, assert the verdict
A scenario is one honest row: a named contract, a live drive, an externally visible verdict. The set is the protocol — and the set is run.
CONF line each →
{:ok, n}), never a count that would go stale.Which executor a run proves
A run drives the server through EchoMQ’s connector, so the connection’s wire decides which
executor it proves. On the default wire: 4 connection every scenario evaluates the
scripts on a node branded echomq:4.0.0. On a wire: 6
connection the job-core scripts travel as their native verbs, and run/3 with
only: :jobs runs a pinned subset of the job scenarios against them; three of those
(fence, lock_extend, extend_fenced)
expect the native difference. The rest of the set leans on scripts with no native verb, which a wire 6
connection refuses, so the whole suite runs on wire 4.
The dives
Three dives: the list of scenarios, the run that walks it, and the law that lets the set grow without breaking
the wire. Each grounds in the real echo/apps/echo_mq code —
EchoMQ.Conformance's scenarios/0 and
run/2.
The scenarios
scenarios/0: the names + one-line contracts in run order, each asserting an externally visible verdict — or a raw command where the contract is the wire.
Run & the verdict
run/2: the loop over per-scenario sub-queues, the purge that leaves no residue, one CONF line each, and the {:ok, n} verdict.
The additive-minor law
How the set grows: prior scenarios byte-frozen, each new one probe-registered, the count re-pinned. A minor appends; a major rewrites.
Redis Patterns Applied
This is the depth behind the Redis Patterns Applied chapters that door here: R2 · Coordination — the atomic claim, the fencing token, idempotent admission: exactly the externally visible promises the conformance scenarios assert against a live server.
And R8 · Production Operations — running the tier as it grows: the additive-minor law is how the contract gains clauses without breaking the clients already passing it.
The manuscript
The Proof shows the four libraries hold as one system. That whole is the subject of The Branded Component System · Together — one umbrella, one write down, one read up, the branded id the thread through all of it.
References
Sources
- Beck — Test-Driven Development — the verdict-asserting scenario as the contract, run rather than assumed.
- Valkey — ZCARD — a read whose cardinality a read-plane scenario asserts.
- Valkey — HGET — the row-field read a state scenario asserts against.
- Elixir — :telemetry — the standard surface the sibling read-plane module re-roots under
[:emq, …].
Related in this course
- The Proof — the pillar this module opens.
- The Protocol — the keyspace, the kind law, and the branded-id gate every scenario asserts against.
- The Queue — the first pillar the suite proves whole.
- The Bus — the second pillar, whose stream verbs the later scenarios assert.
- The Branded Component System · Together — the manuscript chapter the Proof shows holds.