No description
  • Erlang 72.8%
  • Python 18%
  • Shell 5.3%
  • Dockerfile 3.9%
Find a file
2026-11-24 01:10:36 +01:00
.github ci: call the C4 gate that reads the front page 2026-10-23 21:06:57 +02:00
apps/mcl_bookclub_observer The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:14:16 +01:00
architecture migrate to mcl_om 1.6 and macula 18: a subscription names its sources 2026-10-30 14:50:05 +01:00
assets c4_model: an observer model that verifies every club and counts nothing 2026-10-23 04:31:32 +02:00
config The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:14:16 +01:00
deploy The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:14:16 +01:00
scripts The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:14:16 +01:00
.gitignore feat: the scoreboard groups by club and pins verification to the publisher 2026-09-25 07:36:53 +02:00
.tool-versions feat: the observer -- the consumer half of the bookclub's facts 2026-09-25 06:09:01 +02:00
CHANGELOG.md 0.4.0: the minor bump, and the changelog states both caller rules 2026-10-30 14:54:19 +01:00
Containerfile The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:14:16 +01:00
LICENSE feat: the observer -- the consumer half of the bookclub's facts 2026-09-25 06:09:01 +02:00
README.md README: drop the GitHub Sponsors badge 2026-11-23 22:19:52 +00:00
rebar.config dialyzer: the strict unknown warning class, as the siblings use 2026-10-30 16:11:50 +01:00
SECURITY.md SECURITY.md: response times, attachment and identity rules, drills (macula-io/macula#174) 2026-10-31 02:58:58 +01:00

CI License ghcr.io BEAM Buy Me a Coffee

Macula

--- **The consumer half of mcl-bookclub's facts: a storeless mesh service that subscribes to what the bookclub publishes, folds it into its own read model, and serves a scoreboard over the mesh.**

Where mcl-bookclub is the producer — events, projections, emitters — this service is the consumer. It owns no reckon-db store and never dispatches a command: it watches the fact topics and answers its question ("what has the bookclub been up to?").

What it does

Topic (published by mcl-bookclub) What the observer does with it
bookclub/member/member_registered_v1 records the member
bookclub/book/book_procured_v1 records the book as on-shelf — unless it is already retired
bookclub/book/book_retired_v1 supersedes: records the book as retired, in any arrival order

Each fact goes through the three-module shape from mcl_om's guides/read_model_services.md: a listener (a macula_subscriber, wired by subscriptions/0) hands the payload to a policy, then writes the decision to the read model (one sqlite file, absolute idempotent writes). The policy is where the wire shape is unwrapped, with mcl_om_wire:field/2, and where the admit/supersede decision is made: the retired-book rule is the reason it is its own module.

Its own procedure, mcl-bookclub-observer/get_scoreboard, answers from the local read model and then verifies the bookclub over the mesh by calling mcl-bookclub/get_bookclub_by_id for every club the answer names, which get_scoreboard.erl verifies one by one — a live cross-service call on every answer, reported as bookclub_verified. Beyond it mcl-om adds mcl-bookclub-observer/info and mcl-bookclub-observer/get_limits to every service, both open, and capabilities/0 is the list.

Why it exists

This service is the end-to-end proof of the FACT transport: the bookclub emits, this observer consumes, and the two meet only over the mesh. Its tests cover everything except the mesh itself (the one mesh call is mecked, like every fleet suite); the live smoke test is the scoreboard's bookclub_verified => yes on a box where both run.

Status

First version: the three ingestions, the supersede policy, the scoreboard, and the verification call. Not yet: history/trends, per-member views, paged lists.

Running it

rebar3 compile
rebar3 eunit
rebar3 lint
rebar3 dialyzer

scripts/health.sh                      # against a running node

The runtime is pinned to OTP 28.4.3 (.tool-versions, Containerfile, lint workflow); run mise x erlang@28.4.3 -- rebar3 eunit if your shell is on another release. Building the image: podman build -t mcl-bookclub-observer -f Containerfile ..

Configuration

config/sys.config.src carries the realm, its trust anchor and the PQ profile; deploy/docker-compose.yml is runnable as-is (MCL_REALM, MCL_REALM_KEY, station seeds, and MCL_COOKIE from the environment). The read model lives on the /data volume.

Architecture

The C4 model is in architecture/README.md, with its diagrams drawn by architecture/c4_diagrams.py into assets/. Change the script, run it (python3 architecture/c4_diagrams.py), and look at the result before committing.

mcl-bookclub-observer system context