B2.5 · dive 1 — the edge is the relation
One relation, one owner.
Portfolio holds asset is a row keyed by a tuple of names, never an id list
embedded in either endpoint. One relation kind is one system: :holds, subjects gated
PRT, objects gated AST, declared at start_link. An edge is
{subject, object} → props, and the pair's facts live on the edge.
Source: content/bcs2.5.md, quoting bcs_rung_2_5_check.out; the system is
committed at runtimes/elixir/lib/echo_data/bcs/edge_store.ex.
The transcript
bcs_rung_2_5_check.out · verbatim · this dive reads E1 and E2boot: the holds relation is its own system -- PRT subjects, AST objects, indexes private E1 surface ok -- the relation's surface: link, unlink, props, from, to, degree -- and its indexes are nobody's business E2 gates ok -- both ends gated: subject must be PRT, object must be AST -- {:error, :namespace} on either violation E3 retire ok -- the interim representation retired: positions struck out of the balance row and copied down as edges -- the 2.2 label is paid E4 traverse ok -- forward 200 ascending with a 10-edge page head; reverse finds all 50 holders, ascending E5 unlink ok -- unlink removes both directions atomically: degree 199; the reverse index no longer lists the subject PASS 5/5
E1 — the surface, gated a third time
content/bcs2.5.md · What · WhoE1 performs the review gate the part now runs by habit: link, unlink, props, from,
to, degree -- and its indexes are nobody's business. The reverse index exists — the system
maintains it — and no export names it; reverse traversal is a verb (to/2), not a table.
Exporting the reverse table would hand callers a representation and start the coupling clock; the system
owns its indexes, and the boundary stays six verbs wide.
The desk's three joins, by verb: the positions blotter is from/2, the
holders report is to/2, the concentration check is degree/2 — three joins that
were a scan, a denormalization, and a batch job in the embedded world. Risk asks exposure through the
boundary instead of reading anyone's rows. And agents, for whom the contract is six verbs and one rule:
a pair's facts go on the edge — the quantity of a holding belongs to the holding, not to the portfolio
and not to the instrument.
E2 — both ends gated
content/bcs2.5.md · What · WhereE2 closes the silent join at both doors: an ORD subject is refused,
a PRT object is refused, each with {:error, :namespace} — the first relation in
the series where two namespaces are checked per write, because a relation is the place wrong-kind pairs
would otherwise be minted. The supervisor composes the store like any other — a
{name, relation, subject_ns, object_ns} child among children; the two admitted kinds are
declared at start_link and checked at every link.
:holds store, whose declared pair is PRT subjects and AST
objects. Select a subject kind and an object kind; the readout names the verdict.PRT, object must be AST —
{:error, :namespace} on either violation.Static verdicts — PRT → AST →
admitted, the edge written into both indexes · ORD subject →
{:error, :namespace} (the rung's recorded subject refusal) · PRT object
→ {:error, :namespace} (the rung's recorded object refusal) · both wrong →
{:error, :namespace} — either violation refuses, and the write never reaches a table.
References
sources · relatedSources
- Codd, E. F. — A Relational Model of Data for Large Shared Data Banksrelations as first-class; the model the edge store implements
- Erlang/OTP — the ets moduleordered_set term-order traversal over tuple keys; match specifications
Related
- B2.5 — Relations Are Systemsthe module hub; the full rung in context
- B2 — The Elixir BCS Corethe chapter landing; the Part II arc
- B2.2 — Property Stores on ETSwhere the interim representation shipped
- Functional Programming in Elixirthe umbrella where echo_data lives