A6 · orientation dive 1
Why reliability is its own layer
A5 leaves a built increment correct on the happy path but not proven under failure. A6 closes exactly that gap.
A demo passes the inputs you chose; production sends the inputs you did not. Three failures separate “it builds” from “it survives”: an unhandled malformed input, a crashed process that propagates, and an invariant held by luck rather than proof. Each is invisible to a happy-path demo and fatal in production. Pick a mode on the right to compare how many input cases a happy-path build survives against a production-grade one.
Happy path vs production · pick a mode
Why a reliability layer
A5 — the agent brief turns an A4 spec into running code and produces a built increment: code that exists and passes its own acceptance. That is a genuine milestone, and it is not production. A demo passes the inputs the author chose; production sends the inputs the author did not. The reason A6 is a layer of its own — not a footnote to the build — is that the work it does is invisible to the demo that signed A5 off.
Reliability is not more features; it is the same increment made to hold under conditions the happy path never exercised. A boundary that rejects a malformed value, a supervisor that isolates a crash, a property that proves an invariant across generated inputs — none of these change what the increment does on the valid case. They change what it does on every other case. That is why the work earns its own layer: it targets the inputs the build was never tested against.
- the built increment
- What A5 produces: code that exists and passes its own acceptance on the happy path. Real, and not yet production.
- the reliability layer
- What A6 adds: the same increment made to survive a malformed input, a crashed process, and an unproven invariant.
- why its own layer
- The work is invisible to a happy-path demo. It targets the inputs the build was never tested against, so it must be named and proven separately.
- the seam
- A6's reason-to-exist is the precise gap A5 leaves: correct on the happy path, not proven under failure.
This dive opens the reverse-verification seam the chapter stands on: A5 produces a built increment correct on the happy path; A6 names and closes exactly what it leaves unproven.
The three failures A6 prevents
Three failures separate a build that passes its demo from one that survives production. The first is an unhandled malformed input: the demo sent a well-formed value, a real caller sends a garbled one, and without a boundary that parses or rejects, the malformed value travels inward and corrupts state far from where it entered. The second is a crashed process that propagates: one operation raises, and without supervision the failure takes neighbours down with it. The third is an invariant held by luck: the test asserted a property on three chosen examples, and a fourth input no one imagined breaks it. Select a failure below to read its consequence-if-unhandled and the pillar that prevents it.
The three-failure ledger · pick a failure
A happy-path demo is blind to all three failures — the inputs it never sent are exactly the ones that break in production.
The failures on the Portal
The Portal grounds all three failures in one place. Its identifiers are branded values minted by
Portal.ID.generate/1 and read back by Portal.ID.decode/1,
which returns a typed value carrying its .type and .timestamp
— or rejects the string. That decode is the boundary: a malformed id never reaches the core, because
the core trusts only a decoded value. A crashed process is isolated by a supervisor, so one failed operation
does not take its neighbours down. And the round-trip invariant — a generated id decodes back to
itself — is proven across generated inputs, not asserted on a chosen few. The supervision tree and the
OTP mechanics belong to the companion Elixir course; this chapter cites them and
does not re-teach them.
The principle
A passing demo proves only the inputs you chose; production sends the inputs you did not. So reliability — boundaries, supervision, proven invariants — is separate work from the build, targeting the cases the demo never exercised.
On the Portal
Portal.ID.decode/1 returns a typed value or rejects the string — the
boundary a malformed id never crosses — while a supervisor isolates a crashed process and a property
proves a generated id round-trips.
A demo passing the happy path is not a production guarantee; A6 is the layer that proves the rest.
Recap — the gap A5 leaves
Reliability is its own layer because the work it does is invisible to the demo that signs the build off. A5 produces a built increment correct on the happy path; three failures — a malformed input, a crashed process, an invariant held by luck — separate that from an increment that survives production, and a happy-path demo exercises none of them. A6 exists to name and close exactly that gap. The next dive lists the four pillars that close it: OTP supervision, boundaries, parse-don't-validate, and property tests.
Next in A6: What the chapter covers — the four scope pillars at roadmap altitude, each closing one of the failures named here.
References
Primary sources for parsing at the boundary, a closed error discipline, and proving an invariant rather than asserting it — and where the built increment whose gap this dive names is produced in the course.
Sources
- King, A. — Parse, don’t validate — the boundary that turns a malformed input into a rejection before it reaches the core.
- Wlaschin, S. — Railway-oriented programming — a closed error discipline: a failure is a typed value, never a propagating surprise.
- Elixir — StreamData — property-based testing: proving an invariant across generated inputs instead of asserting it on a chosen few.
Related in this course
- A5 · The agent brief — the built increment whose gap this dive names.
- A6 · Reliability and correctness — the chapter landing.
- A6 · What the chapter covers — the four pillars that close this gap.
- A1.05 · Correct by definition — done as a closure over proven, not asserted, checks.
- Companion · Functional Programming in Elixir — the Portal’s OTP foundations (cited, not re-taught).