Packages
The service library for the macula-services/mcl-* daemons: the service contract, a LAN transport and a bridge to the macula mesh
Current section
Files
Jump to
Current section
Files
README.md
# mcl-core
[](https://buymeacoffee.com/rlefever)
**The service library for the `macula-services/mcl-*` daemons.** mcl-core
replaces both mcl-om and mcl-lan (Raf, 2026-12-02). It carries mcl-om's whole
history: 1.0 is mcl_om 1.9.0 renamed to `mcl_core` and split by role.
| directory | what | design |
|---|---|---|
| `src/contract/` | the service contract every service implements and calls: boot, the `mcl_core_service` behaviour, health, info, describe, the inbound guard, the singleton, the wire codec, identity, and the transport boundary `mcl_core_transport` | [§1.2](docs/DESIGN.md) |
| `src/bridge/` | the macula mesh as a transport: DHT advertisement, direct-dial calls, the D25 claim, mesh pubsub, org membership | [§3](docs/DESIGN.md) |
| `src/lan/` | the LAN transport on distributed Erlang: gossip finds the nodes, capabilities and subscriptions on `pg`, the caller written into each call | [§2](docs/DESIGN.md) |
The design is [`docs/DESIGN.md`](docs/DESIGN.md). `mcl_om` 1.x stays on hex
for whoever pins it; moving to mcl_core is a rename (see
[CHANGELOG.md](CHANGELOG.md), Unreleased).
## Model
The system context:

The containers inside one node of the cluster:

## On a LAN
Services on one LAN cluster over distributed Erlang and call and publish to
each other with no station (DECIDED 2026-12-02 "trust on sight. mcl-martha
services should auto-cluster over LAN, no mcl-station required."). The
transport is off until a release turns it on:
```erlang
{mcl_core, [
{identity_key_path, "/data/identity.key"},
{lan, #{data_dir => "/data/lan",
first => true}} %% only on the cluster's first node
]}
```
- The first node generates the cluster's two secrets into `data_dir`: the
Erlang cookie and the gossip secret. Every other node gets the two files
copied at install and refuses to start without them. Anyone holding both
owns the cluster.
- macula's gossip finds the other nodes and connects them. The node must be
distributed already (`-name` in vm.args); see
[`guides/lan_transport.md`](guides/lan_transport.md) for the release
settings.
- `mcl_core:call_capability/4,5` and `mcl_core_pubsub:publish/2,3` try the LAN
first and go to the mesh only when no LAN node takes them. A handler reads
its caller under `caller` as it does on the mesh: the calling node's id.
- Two nodes give copies; three are needed to survive one going down
(DECIDED 2026-12-02 "Three for failover (Recommended)").
## Today: the mesh
**Over-mesh substrate for the PQ fleet**: the shared library every
`macula-services/mcl-X` service daemon stands on, built on macula 18, wire 1.0
(`{macula, "~> 18.0"}`), post-quantum only.
Services in this org are **edge-first**. A service runs wherever its
operator puts it (a cooperative infrastructure node, a relay box, a lab
machine, a laptop) and **dials out** to a `macula-station` over QUIC. It
needs no inbound port, no public address and nothing underneath it: the
station it dials is what puts it on the mesh, and that is how a service
on one edge box reaches a service on another.
Placement is therefore a deployment decision, not a property of the
substrate. What a service always carries with it is its own
**node identity**: a puzzle-hardened pq_hybrid node key whose node id
derives from the carried public key. It answers as itself, never as the
human whose machine it happens to be running on. See
[`guides/identity_model.md`](guides/identity_model.md) for the
town/library metaphor that drives the identity choices.
Every response capability is guarded by inbound size and rate limits,
which a realm's guardian reads and retunes through `get_limits` /
`set_limits`; see
[`docs/design/GUARDIAN_CONTROL_SURFACE.md`](https://git.macula.io/macula-services/mcl-core/src/branch/main/docs/design/GUARDIAN_CONTROL_SURFACE.md).
```text
mcl-core
│
┌──────────┬────────┼─────────┐
▼ ▼ ▼ ▼
mcl-echo mcl-warden mcl-sentinel …
```
Every service is a separate OTP release shipped as an OCI container
to `ghcr.io/macula-services/`. `mcl-core` is the library they all
link against to behave consistently on the mesh: the same service
contract, the same health endpoint, the same identity-claim flow, the
same capability-advertise pattern, and the same generated repository
(Containerfile, compose file, CI workflows).
## What this library is (and isn't)
It **is**:
- An Erlang `behaviour` (`mcl_core_service`) — six callbacks every
service implements: `start/1`, `stop/1`, `health/0`, `capabilities/0`,
`identity_spec/0`, `info/0`.
- Helpers for the bits every service needs: load (or generate) the
puzzle-hardened node key, advertise a capability on the mesh as a signed
DHT record (callable when it carries a handler), serve a `/health`
endpoint.
- The `mcl_service` rebar3 template for a new service repository:
application, supervisor, service module with its eunit suite, release
config, `Containerfile`, `compose.yml`, `health.sh` and both CI
workflows. See [Scaffold a new service](#scaffold-a-new-service).
It **is not**:
- A daemon. It has no `application:start_phase` of its own beyond
the library's facade.
- A plugin host. Services are containerised.
- A network library. Services talk to a PQ `macula-station` via the
macula 17 SDK like any other Macula client: **outbound only**. The
station does the peering, the DHT and the routing, which is what
lets a service sit behind NAT at the edge and still be reachable.
## Layering position
```text
Layer 4 — apps user-facing apps
Layer 3 — session per-identity sessions and UI
Layer 2 — services macula-services/mcl-echo, -warden, -sentinel, …
Always-on, containerised, system-class workloads,
each with its own node identity.
Run at the edge or on realm infrastructure; either
way they dial out to a station.
↑↑↑ this library is the substrate ↑↑↑
Layer 1 — identity macula-realm
Layer 0 — kernel macula-station (the PQ fleet)
```
See [`philosophy/TIER_MODEL.md`](https://github.com/macula-services/mcl-corpus/blob/main/philosophy/TIER_MODEL.md)
in mcl-corpus for the longer cut-criteria discussion.
**Service ≠ provider.** A node that serves a procedure is not thereby a
service: every SDK lets a client serve procedures (`pool.Serve` in
macula-go, say). A *service* is a node under this contract — always-on,
containerised, a claimed identity answering `Org/info` and `/health`,
advertised capabilities, and placement through macula-fleet. For mesh
services the org runs BEAM only, and this library is the substrate; for
mesh clients the SDKs are enough. A daemon written in another stack
that wants onto the fleet under this contract is ported to
Erlang/mcl-core, or runs outside the fleet's responsibility.
## The contract
```erlang
-module(my_service).
-behaviour(mcl_core_service).
%% lifecycle
-export([start/1, stop/1]).
%% introspection
-export([health/0, capabilities/0, identity_spec/0, info/0]).
start(_Opts) ->
my_service_sup:start_link().
stop(_State) ->
ok.
%% Reported on /health endpoint. Return ok | {degraded, Reason} | {down, Reason}.
health() ->
ok.
%% Advertised onto the mesh via mcl_core_capabilities:advertise/1.
%% Other services / plugins find you by these.
capabilities() ->
[
%% No handler: discovery records only. A capability that names a
%% handler must also name `auth` (who may call it: `open`,
%% `{callers, members | role | {nodes, Ids}}`, `handler_authorizes`
%% or a token-gated policy) -- macula 18 has no open-by-default
%% (macula#147) and mcl_core refuses to register one that omits it.
#{name => <<"my_service.do_thing">>, version => 1},
#{name => <<"my_service.list_things">>, version => 1}
].
%% The authority this service asks the realm for, and deliberately nothing
%% more. Ask for exactly the topics you publish and subscribe to.
identity_spec() ->
#{
scope => <<"my_service">>,
actions => [<<"publish_summary">>, <<"answer_query">>],
resources => [<<"my_service/*">>],
ttl_days => 30
}.
info() ->
#{
name => <<"mcl-my-service">>,
version => <<"0.1.0">>,
description => <<"What this service does in one line">>
}.
```
That's the whole user-side contract. Six small functions. Health
endpoint wiring and mesh advertisement come from `mcl-core`; the
release, container image, compose file and CI workflows come from the
`mcl_service` template described below.
On the wire every procedure is `Org/Name`, with the org from mcl_core's `org`
app env; a service without a usable org refuses to boot. What every service
gets without writing it:
- **`Org/info`**, open to any mesh caller: name, version, description, the
claim labels (`service_name`, `box`), org, node id, macula and mcl_core
versions, uptime, the health word (`ok`, `degraded`, `down`, `unknown`, from
the verdict /health last computed, never a fresh probe) and the procedures
it advertises. No environment, paths, keys or reasons. It is also what makes
a publish-only service count as online on the realm's Providers desk. A
service may not declare its own `info`.
- **Your own keys in `/health`.** `info/0` may carry more than name, version
and description; anything a service adds is reported verbatim in the
`/health` body while the verdict is `ok`. That is where a normal setup wait
belongs: a service waiting on a value its operator has not given it yet
answers `ok` and names the wait there, rather than degrade a node that is
behaving correctly (and fail a canary for it). Nothing added there reaches
`Org/info`, which keeps its fixed shape. A value must be what `jsx` encodes
(`mcl_core_service:json_value()` says which: binaries, atoms, numbers, lists
and maps), and a key the body sets itself — `status`, `provider_grants`,
`advertise_liveness`, `subscriptions`, `claim`, `failed_publishes`, atom or
binary — refuses the boot, because a second key of that name in the JSON
lets a reader replace the verdict.
- **`handler_timeout_ms`** on a capability, 1 to 600000: how long macula waits
for the handler before answering the caller `temporary_relay_failure`
(default 30000). Response capabilities only.
- **`confidential`** on a capability (0.34.0, macula 13's provider modes): how
its calls must be protected on the wire. `off` names no KEM key (the
procedure stays keyless even with `kem_advertise` enabled); `preferred`
names one when macula's `kem_advertise` is enabled, so callers seal;
`required` also refuses a clear call and needs `kem_advertise` enabled
(`{macula, [{kem_advertise, enabled}]}` in sys.config). Absent, nothing
changes (macula reads it as `preferred`). Response and streamer capabilities
alike. A service refuses to boot, naming the capability and the setting, on
any other value, on a `kem_advertise` that is not `enabled`/`disabled`, and on
`required` without `kem_advertise` enabled, instead of running green and
unreachable.
- **`health_socket`** (0.39.0): `/health` on a Unix socket, for example
`{mcl_core, [{health_socket, "/run/mcl/health.sock"}]}`, so no service listens
on a port just to be health-checked. Set, it is the only health listener (no
TCP one runs, whatever `health_port` says); a stale socket file left by a
previous container is replaced, and the socket is mode 0600, so only the
service's own user may connect. The container checks it with
`curl -fsS --unix-socket /run/mcl/health.sock http://localhost/health`.
Unset, `health_port` (default 8470, on `health_ip`) is the fallback.
- **`failed_publishes`** on /health: publishes whose publisher exited before
resolving. `mcl_core_pubsub` runs each publisher under a watcher, so such an
exit is counted and logged instead of killing the process that published.
- **`subscriptions`** on /health: the declared topics, the ones actually
running, and the last start failure per topic. A subscription that will not
start — a refused `sources`, a pool that is not there — degrades the
verdict rather than hiding behind `ok`, because the facts that subscriber
exists to react to are not arriving.
## Subscribing under a sealed group
A service that publishes its facts sealed can subscribe to them through mcl_core
too (1.7.0, mcl-om#49). Add two keys, valid only together, to a declaration in
`subscriptions/0`:
```erlang
#{topic => <<"io.example/mcl-tenders/tenders/wire/tender_notice_reported_v1">>,
module => tender_notice_handler,
sources => {org, <<"mcl-tenders">>},
group => <<"io.example/mcl-tenders/tenders">>,
admission => {tender_notices_group, admission, []}}.
```
`group` is the sealed group's prefix, which `topic` must be under on a segment
boundary. `admission` is `{Module, Function, Args}`, called with exactly those
arguments and nothing added, answering `{ok, UCAN}` or `{error, Reason}` —
`{tender_notices_group, admission, []}` reading `MCL_TENDERS_GROUP_UCAN` is
all mcl-tenders needs.
mcl_core calls the admission once per subscribe attempt and hands the token
straight to `macula:subscribe/5` beside the group, so **the token is never in a
child spec, in a subscriber's state or in a log of mcl_core's**: the child spec
carries the function and the `{Module, Function, Args}`, and the token exists
only inside that one call. Nothing is cached — once the group is joined, later
epoch pulls are the SDK keyring's business. (Node-wide that holds once
macula-io/macula#189 lands: the SDK's keyring keeps the ucan in its own state
and its redaction leaves it in place, so until that is fixed a crash report of
the keyring can still show one. That is macula's, not this library's.)
A refusal is a refusal to subscribe, never a fall back to a clear
subscription: the start fails, the reconcile retries it on its 30s tick, and
`/health` names the topic and the reason (an emitted `{group, {admission,
Reason}}`, or macula's own `not_authorized`, `not_a_member`, `no_distributor`).
What your admission answers is never reported as itself: an atom passes through,
any term is reported as `admission_refused`, and a raise as
`admission_raised` — because a refusal can carry the token it just read. A raise
out of the SDK call itself is reported as `subscribe_raised` for the same
reason: its own reason is the call's arguments, the token among them. An
admission is called from the reconcile server, so it must not block: a wait with
no deadline holds up every other subscription's reconcile.
## Persistence is the service's own
`mcl_core` opens no store and starts no `reckon_db`, `evoq` or `reckon_evoq`
application (0.35.0, mcl-om#10): it is the basis for on-mesh services, and each
service chooses its own persistence. An event-sourced service declares those
three in its own `rebar.config` and app.src and opens its store in its
application's `start/2`, before `mcl_core:boot/1`, so projections and process
managers find it up when `start/1` runs. `rebar3 new mcl_service store=1`
generates exactly that: the deps, the wiring in `<name>_app` (start the store,
wait until reckon-db lists it, start the per-store evoq subscription), the
store's id, directory, indexes, mode and integrity in
`<name>_service:event_store/0`, and the `evoq` adapter block in
`config/sys.config.src`.
A service module that still exports the old `store_id/0` and `data_dir/0`
callbacks together boots WITHOUT a store, and `mcl_core:boot/1` logs a warning
(`mcl_core_no_longer_opens_a_store`) naming them and the way out. So a service that
opens its own store must not export those two names from its service module.
## Scaffold a new service
```bash
# From the directory that will hold the new repository,
# typically ~/work/github.com/macula-services:
MCL_VISIBILITY=private scripts/scaffold-service.sh mcl-newservice "Does X over the mesh" 8484
```
**`MCL_VISIBILITY` is asked, never assumed**: `private` or `public`, and the
script refuses anything else before it generates a file. It decides three
things that must agree:
| | `private` | `public` |
|---|---|---|
| `LICENSE`, app.src `licenses`, README | proprietary notice, `["Proprietary"]` | Apache-2.0 |
| CI runner (`runs-on`) | the org's own, `["self-hosted", "msi00", "pq"]`, in macula-services and macula-internal; GitHub's elsewhere | GitHub's, `["ubuntu-latest"]`; a self-hosted runner is refused |
| `gh repo create` in the closing text | `--private` | `--public` |
A public repository never runs on a self-hosted runner, because a pull request
from anyone would run its code on that machine. `MCL_RUNS_ON` overrides the
runner and `MCL_HOLDER` the copyright holder.
A service in one of our orgs also starts with its C4 page and the gate that
keeps it true: `architecture/README.md` says what the scaffold talks to and what
it is made of, and `build-push.yml` calls the shared `c4-model` check, red until
the service draws its own three diagrams in `assets/` (context, containers,
components; macula-codebase-checks#10). Before that, `c4-design-gate.yml` fails
a check on a plan issue given `gate:design` while the context and containers
diagrams are missing (macula-io/macula-sponsors#113). The scaffold draws none,
because a diagram generated from a template is a placeholder with a nicer
shape. A scaffold outside our orgs gets the page and no job, as with the attest
call: the check is ours.
That is a thin wrapper over `rebar3 new mcl_service`, and it exists so you
**say the name once**. A service has two names: the repository, the container
image and the name it answers to on the mesh are kebab-case, while the OTP
application and every module prefix are snake_case because they are Erlang
atoms. Mustache has no functions, so a template cannot derive one from the
other. The generated eunit suite asserts the two agree modulo the separator, so
a hand-rolled `rebar3 new` with a mismatched pair still fails on its first test
run.
**Once the repository exists, seed it.** `rebar3 new` writes files and cannot
know the repository is there — `gh repo create` is yours, because who owns it
and whether it is public is a decision — so the labels and the first issues are
created by their own command, printed first and created only when asked:
```bash
scripts/seed-repository.sh macula-services/mcl-newservice # the plan, creates nothing
scripts/seed-repository.sh macula-services/mcl-newservice --file \
--crew=terra # creates it
```
It makes the five workflow labels, one `crew:<member>` label per member you
name, and four issues each opening with its `Purpose (kind):` line: the C4 model
before there is code, the README with the service's own logo, the walking
skeleton, and `v0.1.0`. Members are named, never guessed.
To use `rebar3 new` directly, install the templates once. rebar3 only finds
custom templates under `~/.config/rebar3/templates`, and an empty directory has
no dependencies to carry them there:
```bash
scripts/install-templates.sh # symlinks; --remove to undo
rebar3 new mcl_service repo=mcl-newservice name=mcl_newservice \
desc="Does X over the mesh" org=your-org registry=ghcr.io
```
**The scaffold is not house-specific.** `org`, `registry`, `builder_image`,
`runtime_image`, `holder`, `proprietary` and `runs_on` are variables, and
nothing generated names our organisation, our registry, our images, our
copyright holder, our runners, our deployment repository or our hosts. If you
are building a service for your own mesh, set the first five and everything
else follows (`proprietary` is empty for Apache-2.0, `1` for a proprietary
notice; `runs_on` is a JSON array and defaults to `["ubuntu-latest"]`). In the house orgs (macula-services, macula-internal, macula-io) `attest` is set, so every image the service pushes is signed by digest, with its SBOM and provenance attested, by macula-ci-images' `attest-image.yml` pinned by commit. `scaffold-service.sh` defaults
them to ours because that is who runs it most; `MCL_ORG`, `MCL_REGISTRY`,
`MCL_BUILDER_IMAGE`, `MCL_RUNTIME_IMAGE`, `MCL_HOLDER` and `MCL_RUNS_ON`
override, and `MCL_VISIBILITY` sets `proprietary`. A test generates a service as a stranger and
fails if any of our own specifics survive.
**The image pair.** `builder_image` is the image the release is built in and
the one the generated lint job runs in; `runtime_image` is the one it runs on.
Both are pinned by digest, and they are a pair: a release built in one runs on
the other's libc and OpenSSL, so `scaffold-service.sh` refuses to override
just one. The defaults are the current plain pair from
`macula-io/macula-ci-images`, the one build (20260928-1800) that republished
every download against a pinned checksum. Services move onto it as they
release; until then some still build on the previous pair (20260923-1444), and
the services with a rocksdb read model (mcl-stations, mcl-mail, mcl-rag) use
the rocksdb pair.
| Variable | Default | Must carry |
|----------|---------|------------|
| `builder_image` | `ghcr.io/macula-io/macula-ci-otp:20260928-1800@sha256:7318a443…` | OTP 28.4.3 with an OpenSSL that has ML-DSA, rebar3, Rust, a C toolchain, git |
| `runtime_image` | `ghcr.io/macula-io/macula-pq-runtime:20260928-1800@sha256:a1d18c6a…` | the builder's libc, OpenSSL with ML-DSA, libstdc++, ncurses, curl |
They are named once, as the defaults in `priv/templates/mcl_service.template`;
the script passes an image only when one is overridden, and the template suite
reads them from there. The generated `Containerfile` refuses to build on any
OTP but 28.4.3 with `mldsa87`, and the generated lint job checks every tool in
the table before it checks out the code. A service that links the erlang
`rocksdb` binding (barrel_docdb) moves both lines to the rocksdb pair,
`macula-ci-otp-rocksdb` and `macula-pq-runtime-rocksdb`. On the plain pair
rocksdb's CMake silently disables any compression backend whose `-dev` package
is missing, the build stays green, and barrel's default snappy blob
compression then fails at `db_open` ("The specified blob compression type
Snappy is not available").
Generates a repository that compiles, tests and deploys:
- `apps/<app>/src/` — the `.app.src`, `_app.erl`, `_sup.erl` and a
`_service.erl` implementing the behaviour
- `apps/<app>/test/` — a suite asserting the contract's shape, the two names,
and that the reported version is the application's own
- `rebar.config` with a relx release, the prod profile and the elvis ruleset
- `config/sys.config.src` and `config/vm.args.src`. The sys.config sets
`{mesh, required}`: the service refuses to boot without `MCL_REALM`,
`MCL_REALM_KEY`, `MACULA_STATION_SEEDS` and `MACULA_STATION_NODE_IDS`,
naming every one that is missing, instead of booting green with no mesh
- `Containerfile`: built in `builder_image`, run on `runtime_image`
- `deploy/docker-compose.yml` — the service's own run contract, **not** the
deployed file; fleet placement lives in `macula-io/macula-fleet`. It mounts a named
volume, `<repo>-secrets`, at `/etc/mcl/secrets`, where the service's identity
key lives, so the node id survives a container recreate
- `.github/workflows/`: `lint` (in `builder_image`) and `build-push` to
`registry`
- `scripts/health.sh`, executable
- `README.md`, `CHANGELOG.md`, `LICENSE`, `.gitignore`
**It emits no TODO and no stub.** What it generates is honestly complete and
empty: the supervisor has no children, and the service announces no capability
and requests no authority. Those are the correct answers for a service that does
nothing yet, and each is asserted by a generated test, so filling one in is a
deliberate act that breaks a test rather than a comment someone forgets.
The templates are exercised by `mcl_service_template_SUITE`, which generates
a service for real and compiles it. The suite exists because the previous
templates drifted unnoticed for months, and a template with no test is
documentation that compiles.
One thing it cannot do for you, and it has bitten: the registry package may be
created **private**, and the pull then fails on the host with a bare
`unauthorized` that names nothing. Check it after the first build.
### Checking an existing service for drift
The template moves; the services made from it do not move by themselves.
`scripts/check-service-drift.sh` reports how each one differs, and how it starts
its Erlang node, as one TSV line per finding — read-only, offline, and read at
`origin/main` rather than from whatever a checkout happens to have:
```bash
scripts/check-service-drift.sh ~/work/github.com/macula-services # every repo under it
scripts/check-service-drift.sh ~/work/github.com/macula-services/mcl-jobs
```
```
# service ref sha kind detail
mcl-news origin/main 517fe2e missing scripts/promote_latest.sh
mcl-jobs origin/main 4e6a664 differs scripts/is_newest_release.sh
mcl-jobs origin/main 4e6a664 distribution open
mcl-jobs origin/main 4e6a664 image-cookie Containerfile
```
Only files the template ships **verbatim** are compared — the four release
scripts and `.tool-versions`, derived from `mcl_service.template` rather than
typed here — because the rest carry the service's own name, org and images, and
a diff of those would report a substituted line as drift. The `distribution`
line is the security row: `no-listener` is the template's form, `loopback`
listens only on 127.0.0.1 (or `::1` — a `inet_dist_use_interface` naming any
other address is `open`, because that directive is also how a node binds the
world), `open` listens on every address with a cookie as its only defence, and
`unknown` means the repository has no `config/vm.args.src` to read.
`image-cookie` and `compose-cookie` report a cookie set to a literal value —
one identical secret in every copy of a public image. A compose file reading
`MCL_COOKIE=${MCL_COOKIE:?…}` is the house form and is not reported.
The sweep is a report, not a gate: it exits 0 and files nothing.
### Deploying on the BEAM Campus fleet
Ours, and deliberately not part of the scaffold. `deploy/docker-compose.yml` in
a generated service carries what the service knows about itself;
`macula-io/macula-fleet` carries **placement**: which box, which station pins,
which realm key, which secret file. The boxes pull it; nothing is pushed to them.
**How a box runs its services.** Each box has macula-fleet checked out at
`~/gitops/macula-fleet`. The `macula-reconcile` systemd `--user` timer runs
`edge/gitops/reconcile.sh` every 2 minutes: it fast-forwards the checkout and
runs `docker compose up -d` for every row of `edge/<box>/reconcile.manifest`.
Who updates images is set per box in `edge/<box>/reconcile.options`. The
default is watchtower, which polls every 60 s and rolls any container labelled
`com.centurylinklabs.watchtower.enable=true` onto a new `:latest`; the
reconciler then applies config only.
**To put a new service on a box:**
1. Add `edge/scripts/docker-compose.<service>.yml` to macula-fleet: the image,
`network_mode: host`, the named identity volume at `/etc/mcl/secrets`, the
watchtower label, and the environment the service reads.
2. Add a row to `edge/<box>/reconcile.manifest`:
`<project> <compose> <config-env|-> <secret-file|-> <prep|->`. Public per-box
configuration, such as `MCL_REALM_KEY` (the realm's public key), goes in a
committed `edge/<box>/<service>-config.env`.
3. Seed the secrets once, on the box, at `~/.macula/secrets/<name>.env`, 0600,
never committed (`MCL_COOKIE`, for one). A row whose secret file is missing
starts nothing: the reconciler logs `[reconcile] FAILED: <project>`, and only
`journalctl --user -u macula-reconcile` shows it.
4. Push macula-fleet. The box picks it up on its next tick, within 2 minutes.
A service answers `/health` on a Unix socket inside its container
(`health_socket`, from 0.39), not on a host port, so there is no health port to
pick or to collide.
## Status
**Working library: 1.x, on macula 18 (wire 1.0), with a LAN transport since mcl_core 1.0.0.** The 0.x line (main until the flag day, macula-io/macula-fleet#27) runs macula 14. The behaviour and all helpers are implemented
(`mcl_core_identity`, `mcl_core_capabilities`, `mcl_core_health`), the boot path
(`mcl_core:boot/1`)
is exercised by a Common Test suite (`mcl_core_SUITE`), the LAN transport by
one on real `peer` nodes (`mcl_core_lan_SUITE`), and `rebar3 new
mcl_service` generates a service that compiles, tests and deploys, guarded
by a suite that generates one for real. `mcl_core:mesh_handles/0` gives every
service the shared `{Pool, Realm}` pair its own PubSub/RPC/Content code needs,
alongside `realm/0` and `identity_key/0` on the same public facade.
Lint, EUnit and the Common Test suites run on every pull request and every
push to main.
Persistence left mcl_core in two steps: the read model in 0.27.0, the event store
in 0.35.0. See the [CHANGELOG](CHANGELOG.md).
Consumers: the `macula-services/mcl-*` services, `mcl-echo` deployed on the
fleet. Not yet burned in under sustained load.
## License
Apache-2.0. See [LICENSE](LICENSE).