jonnify·bcs /bcs/bus/fence-and-keyspace

B3.1 · The Fence and the Keyspace — manuscript chapter 3.1

Seventeen bytes of grammar, fourteen of identity.

Part III opens by walking its own floor. The connector shipped in Appendix A with its record frozen, and this chapter consolidates that substrate into the part's working vocabulary: every key shape asserted byte for byte, the gate at the job position exercised before any wire is touched, the fence read back live through the fenced connector itself, binary discipline proven through real job keys, and the co-location law that keeps every multi-key script legal on a cluster this part does not yet run.

The chapter is content/bcs3.1.md; the rung behind it is bcs_rung_3_1_check.exs, and its committed transcript closes PASS 5/5. The map, the gate, the fence, the binary discipline, the co-location law — five gates, each asserted on stage.

The five gates, mapped to the dives. Drawn in transcript order. Select a gate to read its verbatim line and the dive that teaches it.
F1 map dive 1 F2 gate dive 1 F3 fence dive 2 F4 binary dive 2 F5 slot dive 3
readout · Select a gate to read its verbatim line and the dive that teaches it. Five gates over the appendix's substrate; the full transcript is frozen in §2 below, the dives are mapped in §3.
§1

Below the queue

content/bcs3.1.md · Why

A queue's correctness starts below the queue. Key grammar, wire discipline, and version agreement are the three places where bus bugs are born and surface later as ghosts — a job row written under a hand-built key, a payload mangled by a line-oriented client, a consumer running last month's bundle against this month's keys. The part's answer is to name every shape exactly once, gate it, and have every later chapter cite this vocabulary rather than redefine it. The trading frame makes the stakes plain: the keys built here will carry orders.

GRAMMAR

The grammar is closed

New per-queue facts are new types under the tag; new top-level families do not happen, and the reserve admits only deployment-scoped tenants — gated by F1.

DIVISION

Wellformedness at the key, policy at the script

The key function raises on malformed identity and carries no kind policy; the enqueue script owns admission, where refusals can be typed replies — gated by F2.

PARTITION

The hashtag is the queue

The queue is the partition unit; per-queue scripts are single-slot legal forever by grammar; cross-queue choreography goes through the application — gated by F5.

PARKED

The slot function is committed and parked

Client-side CRC16 with its vector on file, used today for partition arithmetic, promoted to routing only when the topology changes — and not a line sooner.

§2

The proof

content/bcs3.1.md · quoting bcs_rung_3_1_check.out

The full committed transcript, verbatim — five gates, F1 through F5:

content/echo_data/runtimes/elixir/bcs_rung_3_1_check.out · verbatimfrozen
F1 map ok -- the part's map: emq:{orders}:pending | emq:{orders}:job:ORD0NgWEfAEJfs | {emq}:version | {emq}:locks -- 17 bytes before the payload
F2 gate ok -- the job position is gated: a fourteen-byte decimal and a fourteen-byte slug both raise before any wire is touched; kind policy waits for the enqueue script
F3 fence ok -- the fence holds on a live wire: GET {emq}:version answers echomq:2.0.0 through the fenced connector itself
F4 binary ok -- binary payloads with embedded CRLF and NUL survive 500/500 round trips through job keys in two pipelines
F5 slot ok -- co-location law: pending, active, meta, and the job row of {orders} all answer slot 105; {fills} answers 4165 -- multi-key scripts stay legal on the clustered day (vector 12739 holds)
PASS 5/5

Two design facts live in F1's line. The branded payload is the long part of a job key by construction — seventeen bytes of grammar, fourteen of identity — which is Chapter 1.3's economy carried onto the bus. And the version fence lives under {emq}: precisely because it is the one fact that is about the deployment rather than about any queue. F3's negative path is inherited, not re-run: the appendix's frozen record holds the typed refusal of a bogus version and the re-fence after supervised restart, and the part's evidence policy reads records rather than repeating them.

§3

The dives

three lessons, fixed by the chapter spec

The obligation F2 defers — kind policy at the enqueue script — is collected by B3.2 · Jobs Are Entities, the next module of the chapter.

§4

References

sources · related

Sources

Related