P1: mcl-om history into mcl-core, renamed mcl_core, contract/bridge split (Refs #1) #5

Closed
uranus wants to merge 0 commits from uranus/1-p1-split into main
Member

Refs #1. P1 of the design: mcl-om's history into mcl-core, renamed mcl_core, split into contract and bridge behind a transport boundary. No behaviour change.

Commits, in order (each reviewable alone):

  1. c815dbb merges mcl-om main (a8e35a1) with --allow-unrelated-histories. LICENSE is mcl-core's full Apache text, README is mcl-om's, and .gitignore is the union of both.
  2. a2011c5 renames files only: src/ becomes contract/ and bridge/ (design §1.2), mcl_om* becomes mcl_core*, and no file's content changes, so git log --follow and blame reach mcl-om's commits.
  3. 939c36a renames inside the files: modules, app, app env key, MCL_OM_*, the hex name and the template dependency (~> 1.0). vsn is 1.0.0, unreleased. History stays as written: CHANGELOG, the proof vector's provenance, version mentions and mcl-om#N references.
  4. 71b873b adds mcl_core_transport (call_capability/4,5 go through it, and mcl_core_bridge is the one transport), docs/DESIGN.md and the C4 SVGs from mcl-lan 4020832 with a §9 appended, the README model, and the CHANGELOG 1.0.0 entry with the steps to move from mcl_om.

Local, OTP 28.4.3, rebar 3.28.0: sealing test, lint, xref, eunit (480 tests, 0 failures), ct (mcl_core_SUITE, mesh_pool, singleton), dialyzer and ex_doc all pass. mcl_service_template_SUITE did not run locally, because this machine's ~/.config/rebar3/templates links to another checkout and the suite refuses that by design. CI runs it.

CI: mcl-om's forge workflows came over in the merge, renamed. template-lint-image is red on the forge for a known reason (#2, carried from mcl-om#2). No tag, no hex publish.

Refs #1. P1 of the design: mcl-om's history into mcl-core, renamed `mcl_core`, split into contract and bridge behind a transport boundary. No behaviour change. Commits, in order (each reviewable alone): 1. `c815dbb` merges mcl-om main (a8e35a1) with `--allow-unrelated-histories`. LICENSE is mcl-core's full Apache text, README is mcl-om's, and `.gitignore` is the union of both. 2. `a2011c5` renames files only: `src/` becomes `contract/` and `bridge/` (design §1.2), `mcl_om*` becomes `mcl_core*`, and no file's content changes, so `git log --follow` and blame reach mcl-om's commits. 3. `939c36a` renames inside the files: modules, app, app env key, `MCL_OM_*`, the hex name and the template dependency (`~> 1.0`). vsn is 1.0.0, unreleased. History stays as written: CHANGELOG, the proof vector's provenance, version mentions and `mcl-om#N` references. 4. `71b873b` adds `mcl_core_transport` (`call_capability/4,5` go through it, and `mcl_core_bridge` is the one transport), `docs/DESIGN.md` and the C4 SVGs from mcl-lan 4020832 with a §9 appended, the README model, and the CHANGELOG 1.0.0 entry with the steps to move from mcl_om. Local, OTP 28.4.3, rebar 3.28.0: sealing test, lint, xref, eunit (480 tests, 0 failures), ct (mcl_core_SUITE, mesh_pool, singleton), dialyzer and ex_doc all pass. mcl_service_template_SUITE did not run locally, because this machine's `~/.config/rebar3/templates` links to another checkout and the suite refuses that by design. CI runs it. CI: mcl-om's forge workflows came over in the merge, renamed. `template-lint-image` is red on the forge for a known reason (#2, carried from mcl-om#2). No tag, no hex publish.
Adopts the four-tier architecture:

  Layer 4  apps       — hecate-app-* (live in hecate-daemon)
  Layer 3  session    — hecate-daemon (per-user, user laptop)
  Layer 2  services   — hecate-services/* (this org)
  Layer 1  identity   — hecate-realm / macula-realm
  Layer 0  kernel     — macula-station

hecate-om is the library every hecate-services/hecate-X daemon
depends on. Defines:

- hecate_om_service behaviour (6 callbacks: info, start, stop,
  health, capabilities, identity_spec)
- hecate_om facade (boot/1, advertise_capabilities/0, health/0,
  service_cert/0, macula_client/0)
- workers: hecate_om_identity (loads realm-signed service-principal
  cert), hecate_om_capabilities (publishes onto mesh bloom-channel),
  hecate_om_health (serves /health), hecate_om_health_handler (Cowboy)

Services run on REALM INFRASTRUCTURE NODES (BEAM cluster,
dedicated relay boxes, future cooperative-contributed nodes),
never on user laptops. Each has its own realm-signed
service-principal credential — institutions of the realm, not
user agents. See guides/identity_model.md for the
town/library metaphor.

Container deployment under system-wide systemd-managed Podman
(Quadlet units), orchestrated by hecate-gitops. Images at
ghcr.io/hecate-services/hecate-X:{latest,semver}. Filesystem
under /etc/hecate/ + /bulk0/hecate/<service>/ per beam-cluster
convention.

Templates render Containerfile, Quadlet unit, manifest.json,
CI workflow, _app.erl, _service.erl from variables. Generator
script: scripts/scaffold-service.sh.

Guides: service_anatomy.md, identity_model.md, container_deployment.md.
Real macula:connect / macula:publish calls behind hecate-om's
identity and capability workers. Services that depend on hecate_om
now get genuine mesh integration when seeds are reachable, and
graceful no-op behaviour when they aren't (no station yet, test
harness, etc.).

hecate_om_identity:
- attach_client/1 now calls macula:connect(Seeds, Opts), caches
  the pool pid, returns undefined on failure (degraded mode)
- new realm/0 accessor (reads from app env; supports raw 32-byte
  binary OR 64-char hex). v2 will extract from the service-cert.

hecate_om_capabilities:
- do_publish/1 now calls macula:publish(Pool, Realm, Topic, Payload)
- topic = <<"_mesh.cap.", service_name>>
- payload = #{type=>capability_summary, service, capabilities, published_at}
- skipped silently when no client / no realm; publish/0 can be
  re-called when state catches up

app.src:
- {realm, ...} env entry documented (operator pins via gitops env)
- {station_seeds, []} env entry — empty list = run offline
- version bumped to 0.2.0

handler_table dispatched from advertise_all/0 uses the
{module(), atom()} form that macula_client:handler/0 accepts —
keeps the per-call hot path off the BEAM message queue.
The previous commit landed hecate_om_identity + app.src but the
Write to hecate_om_capabilities.erl had been rejected (file not yet
read) and I missed the error in the parallel output. This is the
real do_publish/1 + helpers.
Two-role worker now. Publishes own caps onto <<"_mesh.cap.announce">>
AND subscribes to the same topic at boot. Inbound announcement
summaries land in handle_info, populate a peer_caps map keyed by
service name.

lookup(CapName) returns every fresh peer that advertised the given
capability. 'Fresh' = announcement <= 120s old (STALE_AFTER_MS).
Callers use that to pick a target for macula:call.

Wire-shape change: publishing topic changed from
<<"_mesh.cap.<service>">> (per-service) to <<"_mesh.cap.announce">>
(single channel). Per-service topics were speculative — wildcard
subscribe isn't a thing in macula pub/sub, and aggregating across
peers needs ONE subscription. Service name is in the payload, so
receivers can still filter by hand.

New API:
- peers/0    snapshot of all known service summaries
- lookup/1   (existing) now returns real results

Retries: if macula client / realm aren't ready at init, retries
subscribe every 5s until they are. No publish-side retry — the
publish path already returns ok silently when not configured, and
register/1 + publish/0 are caller-driven so the next call retries.

Stale-summary expiry: lookup filters out announcements older than
STALE_AFTER_MS. Peers that crash + never republish naturally fade
out of the lookup result.
Move the reckon_db_sup:start_store/1 + evoq_store_subscription:start_link/1
boilerplate out of every CMD/PRJ services _app.erl and into hecate_om.

Adds:
- src/hecate_om_store.erl: ensure/2, ensure_store/2, wait_for_store/2,
  ensure_subscription/1. Single-mode store at <data_dir>/<store_id>/.
- hecate_om_service behaviour: optional store_id/0 + data_dir/0
  callbacks; -optional_callbacks([store_id/0, data_dir/0]).
- hecate_om:boot/2: maybe_wire_store(ServiceMod) runs before
  ServiceMod:start/1 if both optional callbacks are exported.
- templates/sys.config.src.tmpl: canonical reckon_db + evoq blocks.
- scripts/scaffold-service.sh: renders the new sys.config template.
- rebar.config + hecate_om.app.src: reckon_db, evoq, reckon_evoq as
  hard deps. Producer-only services pay image-size cost; nothing
  starts unless they declare store_id/0.

Each CMD/PRJ services _app.erl shrinks back to a one-liner:

  start(_StartType, _StartArgs) ->
      hecate_om:boot(my_service_module).

Service module exports two extra helpers:

  store_id() -> {ok, S} = application:get_env(my_app, event_store_id), S.
  data_dir() -> {ok, D} = application:get_env(my_app, data_dir),       D.

Motivated by the parksim trio shipping without the evoq adapter
wiring and without any reckon_db_sup:start_store/1 call - the spike
documented in reckon-gateway/plans/RESEARCH_CATALOGUE_SPIKES.md.
This release ensures that mistake cant repeat for future scaffolded
services.

Bumps vsn 0.2.0 -> 0.3.0. Non-breaking for existing consumers; the
new callbacks are optional, omitting them keeps the old behaviour.
reckon_db 1.6 → ~> 2.3, evoq 1.13 → ~> 1.15, reckon_evoq 1.5 → ~> 2.1.
cowboy + jsx loosened to `~> X.Y.0` (no exact pins).

Aligns hecate-om with the current reckon-* library line (reckon_gater 2.x
renamed esdb_* → reckon_gater_*; reckon_evoq 2.0 + reckon_db 2.3 are the
matching consumer versions). Stale exact pins blocked downstream consumers
(parksim) from picking up coordinated library updates.
- repo path: hecate-social/hecate-agents → hecate-social/hecate-corpus
- ALC reorg: skills/ANTIPATTERNS_*.md → skills/antipatterns/
- ALC reorg: philosophy/HECATE_ALC*.md → philosophy/alc/
- file rename: HECATE_VENTURE_LIFECYCLE.md → HECATE_DOMAIN_LIFECYCLE.md
- Venture → Domain (architectural term; app identifiers like setup_venture unchanged)

Old Codeberg + GitHub URLs still 301-redirect; this commit aligns content.
attach_client refused to connect unless a service cert file existed, yet
the cert was never used: macula:connect/2 wants a raw Ed25519 keypair (or
auto-generates one), and the mesh does not verify realm membership at
connect/publish. So the cert gate kept every hecate service dark for no
reason — no service was actually mesh-connected via hecate_om.

Now: connect whenever station_seeds are configured (the proven path the
hecate-daemon uses), passing a stable on-disk keypair via identity_key_path
when present, else letting the SDK auto-generate. The realm-signed cert is
still loaded + held (service_cert/0) for the v2 swap-in, when the SDK
enforces realm-signed identity.
The single inline macula:connect in init raced the macula SDK app
startup — hecate_om often starts before macula is fully up, so connect
threw and the service stayed no_client forever (observed: connect
succeeds live, but failed at boot with no retry). Now connect is
deferred off init and retried every 5s until a pool attaches, and the
pool is monitored so a death triggers a reconnect.
- CHANGELOG: 0.3.1 entry (cert-decoupled + deferred/retry mesh connect)
- edoc: convert markdown backticks to edoc quotes; escape <placeholder>
  angle brackets; move callback @doc to OTP-27 -doc attributes
  (edoc chunks build clean, 19 html, no warnings)
- test: behaviour_attributes now asserts 6 required + 2 optional callbacks
- scripts/publish-to-hex.sh: user-run hex publish helper
- gitignore generated /doc/
rebar3 dialyzer hard-failed on OTP 28 ("Could not get Core Erlang code")
because the macula + reckon-db hex packages ship without debug_info. Exclude
those apps from the PLT + analysis and suppress the resulting unknown-function
notes (no_unknown), keeping cowboy/jsx/ranch in-PLT so handler/JSON call sites
still type-check. ct + dialyzer + ex_doc now all exit 0.
configured_seeds/0 now reads the MACULA_STATION_SEEDS env var
(comma-separated station URLs) ahead of the station_seeds app env;
empty/unset falls back to the app env. Lets one deployed image dial a
distinct station per instance without a rebuild — one bot per node,
one station each — matching the existing seed-via-env convention.
hecate_om:boot/1 auto-starts a service's reckon-db store from store_id/0 +
data_dir/0, but built the #store_config with no indexes. A service that also
declared indexes via its own start_store hit {already_started} (swallowed),
so the declarations were dropped and CCC payload indexes never registered.

Add an optional store_indexes/0 callback; boot threads its result into the
store config (ensure/3, ensure_store/3). Bump the reckon-db stack pins to the
current ecosystem (reckon_db ~> 5.4 for the #store_config.indexes field).
0.3.3 added the index-carrying ensure/3 + ensure_store/3 but left them out
of -export, so hecate_om:boot/1's cross-module call crashed with undef at
boot. The store-index wiring was dead on arrival. Export both.
The README contract + service_anatomy guide only covered the 6 mandatory
callbacks; the optional store-backed path (and the new store_indexes/0 CCC
index declaration added in 0.3.4) lived only in source @doc. Add a
store-backed-services subsection to both, with the index example + boot
order.
The behaviour_attributes suite hard-coded 8 callbacks; store_indexes/0
(0.3.4) makes 9. Update the count, name list, and optional set.
Release 0.4.0. hecate_om:boot/1 auto-started every store in single mode
with no way to override it, so a service could not run its store as a Ra
cluster. Add an optional store_mode/0 callback (default single); boot
reads it and passes it through new hecate_om_store:ensure/4 +
ensure_store/4. The /2 and /3 arities still default to single (backward
compatible). Consumers export store_mode/0 -> cluster to enable reckon-db
discovery + Ra clustering across every node that starts the same store_id.
behaviour_attributes asserted exactly 9 callbacks / 3 optional; 0.4.0 adds
store_mode/0, so the behaviour now has 10 callbacks and 4 optional. Update
the assertions to match.
When a service exports store_integrity/0, hecate_om:boot/1 threads its value
(disabled, or #{enabled => true, key_source => ...}) into the reckon-db store
config, enabling per-store HMAC event tamper-resistance. Defaults to disabled
(backward compatible). hecate_om_store:ensure/5 + ensure_store/5 take the
integrity config explicitly.

Release 0.5.0.
The Status section was frozen from the first commit. Code is at 0.5.0 with
implemented helpers, a Common Test suite, and store-wiring callbacks
(store_indexes/store_mode/store_integrity); hecate-spartan already depends on
it. Correct the stale 'scaffold / no runtime testing / helpers stubbed' text.
macula ~> 4.7 resolved to 4.8.0, whose quic connect NIF wedges the runtime
reactor (endpoint accumulation) — the bug behind the multi-hop pubsub outage.
5.1.0 shares a quinn::Endpoint per address family + whole-op timeout. Every
hecate-om service (hecate-spartan et al.) inherits the fix. Compiles clean.
hecate_om_health_handler defined routes for GET /health but nothing ever
mounted them on a listener, so /health was dead code and every hecate_om
service reported unhealthy to Podman/k8s (nothing bound health_port).

Start a Cowboy listener on health_port in hecate_om_sup (ranch:child_spec,
dispatching to the handler), gated on a valid health_port so a service that
wants no HTTP health endpoint just omits the config. snapshot/0 already calls
the registered service's health/0 live, so a healthy service now returns 200.

Bump 0.5.0 -> 0.6.0.
- Equip with elvis (rebar3_lint + macula_min ruleset: no_deep_nesting L2,
  no_nested_try_catch, no_if_expression), flat-src glob. Flatten the 8
  pre-existing no_deep_nesting violations it surfaced (nested case/try inside
  a case clause) into guard-clause helpers across capabilities/identity/
  health_handler/store/hecate_om.
- ex_doc: fix store_mode/0 -doc backticks (edoc-style `x' -> markdown `x`)
  that ex_doc read as unclosed code spans.
- CHANGELOG: 0.6.0 (the /health listener fix + macula ~> 5.1).

Release checklist clean: eunit, dialyzer, elvis, ex_doc.
The 0.6.0 /health listener binds hecate_om's production default port
(8470) via the app-src env, so the CT suite collided with any beam
already holding it (a dev instance, a prior run) and failed the publish
gate with eaddrinuse. Override health_port to 0 before starting the app
so the OS assigns a free port; the health tests exercise hecate_om:health/0,
not the HTTP socket.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
macula 6.0.0 makes an unsendable payload fail its sender instead of killing the shared peering connection, so macula:publish/4,5 can now return an error where it returned ok. That passes through hecate_om to all 16 L2 services, which is why this is 0.7.0 and not 0.6.1.

No wire change: the guard is sender-side, so a 0.7.0 service interoperates with stations and peers still on macula 5.x. Compiles clean, 3 CT tests pass, dialyzer clean.
The three-component pin ~> 2.12.0 capped cowlib below 2.14, so any consumer also pulling a modern gun (2.4 requires cowlib >= 2.15) could not resolve. hecate-victron was blocked on precisely this. 3 CT tests pass.
Loosening to ~> 2.13 broke the build. cowboy 2.13+ declares its cowlib dependency as '>= X and < Y', a form rebar3's first-wins resolver cannot satisfy in this tree, while 2.12 uses '~>'. The loosening was a speculative fix for hecate-victron's emqtt conflict, which is a separate problem and one that wants emqtt removed rather than cowboy moved.

Verified with the generated rebar.lock DELETED, which is how the earlier claim went wrong: a stale lock silently pinned macula at 5.1.0 while rebar3 compile reported success. Actually built now: macula 6.0.0, reckon_db 5.11.0, reckon_gater 3.11.0, evoq 1.23.0, reckon_evoq 2.7.0. 3 CT tests pass, dialyzer clean, ex_doc builds.
macula 7.0.0 teaches the canonical encoder floats (IEEE 754 binary64, RFC 8949 major 7), so services publish raw float telemetry again instead of scaling to integers to get a number past our own codec. 0.7.0 was the stopgap that made the restriction loud; this removes it.

Upstream this is a WIRE change: a macula 6.x peer finds no clause for major 7 and rejects a frame carrying a float, so stations and services on any float-carrying topic must roll together. Verified with rebar.lock deleted: built against macula 7.0.0, reckon_db 5.11.0, reckon_gater 3.11.0, evoq 1.23.0, reckon_evoq 2.7.0. CT green, ex_doc clean.
The workspace moved out of work/codeberg.org after Codeberg banned
mostly-AI-written projects. Path references only, no behaviour change.
rebar3 new hecate_service generates a repository that compiles, tests and
deploys: application, supervisor, the six-callback service module, a eunit suite
asserting the contract, a relx release, a Containerfile, both CI workflows, an
executable health script, a compose file and the documentation.

WHY REPLACE THE OLD TEMPLATES RATHER THAN FIX THEM. They had drifted from the
estate they serve. They emitted a Quadlet unit nothing on the fleet uses, since
the beam nodes run docker compose under a pull-based reconciler. They emitted
TODO comments in place of two callbacks, which is a stub generator. They defaulted
to a store-backed service in a mostly producer-only estate. Their identity_spec
claimed two actions and a wildcard resource for a service that could exercise
none of them, which is a lie on the mesh generated by default. And they shipped
no test. Nothing consumed them either: the scaffold CLI the README documented was
never written.

THE SUITE IS THE POINT, NOT THE TEMPLATE. Those files drifted for months because
nothing ran them, so the new ones are generated for real through rebar3 new and
then compiled against this library, which makes the behaviour attribute check all
six callbacks. This repository also had no CI at all, so the guard now runs.

TWO THINGS FOUND BY RUNNING IT, both of which would have shipped silently.

Mustache eats GitHub Actions. ${{ secrets.GITHUB_TOKEN }} renders to $ and
rebar3 reports success, so the workflow fails later at its login step with an
empty password, a long way from the cause. Every template file now switches
delimiters on its first line, and two independent tests catch a regression.

Sandboxing HOME to isolate the test looked right and was wrong twice. rebar3
resolves its template directory from HOME, but overriding it breaks an asdf
shim, which then cannot find its installs, and after that its version selection.
The suite installs into the real template directory and removes exactly what it
added, which behaves the same on a laptop and in a bare container.

The wrapper script now takes the name once and derives the Erlang atom, because
a service has two names, mustache has no functions, and typing both is how they
end up disagreeing. The generated suite asserts they agree.
The first version was not. It hardcoded our organisation, our registry, our
GitOps repository and our fleet's port allocations, so a stranger generating a
service got a repository that pushed to an account they cannot write to and a
README telling them to edit a repository they have never seen.

org and registry are now variables. Nothing generated names hecate-services,
ghcr.io as a path, macula-demo, our nodes or our reconciler. The compose file
stopped explaining our GitOps split and now just says how to run the service,
with the placement idea stated generically for whoever deploys it.

Our own deployment steps moved OUT of every generated repository and into this
repository's README, under a heading that says whose fleet it is. The wrapper
still prints them, but only when the org is ours.

ASSERTED BY ABSENCE, WHICH IS THE PART THAT LASTS. leaks_no_house_specifics
generates as acme-widgets against a made-up registry and fails if any of our own
strings survive. Asserting the presence of the variables would not have worked:
a comment naming us would still have slipped through. Checked by putting
macula-demo and beam01 back into the generated README, which fails the test on
both strings.

Verified end to end by generating hecate-doorbell for acme-widgets: its image,
its LABEL and its workflow all point at their registry, nothing of ours appears
anywhere in the tree, and its nine tests pass.

Also parameterised the port advice rather than listing the ports our fleet
happens to be using, since that list is ours and would have been wrong for
everyone else on day one.
No change to src/. Consumers of the library get exactly the behaviour they had
on 0.8.0; what ships is the scaffold, its guard, and a documentation pass that
was overdue.

THE GUIDES DESCRIBED A SYSTEM THAT DOES NOT EXIST, and they were being published
to hexdocs. container_deployment.md documented system-wide Podman Quadlets
reconciled by hecate-gitops, a hecate-realm-admin CLI, a dedicated service user
and a loopback-published health port, none of which is how anything runs. It
also pointed at three template files deleted in the previous commit. It now
describes what a generated service actually does, and closes with a section
naming what is intended rather than built, so nothing in it reads as working.

service_anatomy.md showed a repository layout with quadlet/, a manifest.json and
a flat src/, none of which the scaffold produces. Corrected to the real layout.

The package links and the ex_doc source_url still pointed at Codeberg, which
stopped being canonical on 2026-07-26, and the README status line claimed
v0.5.0 against an 0.8.0 application.

Verified before tagging: 10 Common Test cases green, elvis clean, dialyzer clean
at 0 warnings, ex_doc builds with no errors, and every internal markdown link in
the extras resolves to a real page in the generated docs.

One checklist item deliberately not done: the directory tree and the lifecycle
flow in service_anatomy.md are still ASCII rather than SVG. A file tree is more
readable as text than as an image, and the lifecycle diagram is pre-existing
content rather than something this release broke.
The hecate_service template pinned erlang:27 in both the Containerfile and
lint.yml from the beginning, and nothing revisited it while development machines
moved on. Every service scaffolded from it inherited 27.

What it cost in hecate-biotope: rebar3 eunit passing locally meant "passing on
28" and nothing more. CI failed for three consecutive commits on a crash that
does not occur on 28 at all, and because build-push.yml is a separate workflow
the image went to the fleet regardless of the red tests.

Worse for that repo specifically: a world there is a pure function of its seed
only WITHIN one OTP release. rand and map iteration are not promised to agree
across releases, so a seed is a different world on 27 and on 28, and every
recorded result is a result about the release it was measured on.

Both pins now say 28 and both carry a note saying they must agree.

Fourteen other services and this repo's own lint-and-test still run 27. Not
touched here: bumping them without running their suites would be guessing.
The README opened by saying Layer-2 services run on realm infrastructure
nodes and "not on user laptops", and repeated it in the layering diagram.
That is a deployment policy for the realm shared services, written as if
it were a property of the substrate, and it reads backwards: a hecate-om
service dials out to a macula-station over QUIC, needs no inbound port
and no public address, and reaches its peers through the station. The
edge is the ordinary case.

The identity rule the sentence was reaching for stands and is now stated
on its own: a service answers with its own service-principal credential
chaining to a realm root, never as the human whose machine it runs on.

Also repoints the tier-model link from Codeberg to GitHub.
A handler {error, Reason} now reaches its caller with the reason intact
rather than as {call_error, 15, unknown_error}. Nothing here matched on
the old shape, so this is the constraint and nothing else.
Requires macula ~> 8.0, which is the line that matters. The pin was
already changed in 54b7160 but the version was not bumped, so the fix
sat in git under the same 0.9.0 that hex serves pinning ~> 7.0 and
reached nobody. Twenty-two hecate services resolve this package from
hex and take macula through it.

What it buys them: macula 8.0.0 stopped answering
{error, {call_error, 16#0F, unknown_error}} for a handler refusal and
returns the handler's own reason instead. 0x0F is the code the SDK
stamps when a handler says no, so it never meant "unknown error" — it
meant a service had refused and could not say why. Measured over two
live stations with no direct edge: fails on 7.0.0 with exactly the old
constant, passes on 8.0.0 with the reason intact.

Nothing here matches the old shape; there is no call_error or
unknown_error in src/, priv/ or test/. Consumer impact is documented in
the CHANGELOG entry.

Also releases what was sitting unreleased: the store variable on
rebar3 new hecate_service, the generated suite's OTP pin agreement
check, and the README correction about where services run.

CT 10 tests passed, elvis clean.
Replaces the pubsub _mesh.cap.announce discovery with signed DHT records.
On capability register (and a 30s republish tick), write one signed
procedure_advertisement per capability (advertiser = service key, serving_station
= a connected station via macula:links/1, procedure_uri = realm-namespaced cap
name). lookup/1 resolves via macula:find_records/2 + read_procedure_advertisement,
verifying each signature, returning the {advertiser, serving_station} set.

Retain the service keypair in hecate_om_identity (+ keypair/0) so records can be
signed; an ephemeral service is correctly not advertised. Consumes macula ~> 8.0
(resolves 8.2.0; lock is gitignored per org policy).

Pure helpers unit-tested (RED-verified); elvis + dialyzer clean. Live cross-node
mesh e2e is covered by composition and needs a fleet check. Deferred: org URI
segment (Slice 7), multi-station per provider (Q10/Slice 5).
Adds a gen_server test covering the no-mesh boot path (the one that actually runs
before a pool/keypair connect): register/publish no-op without crashing, list
still reports own caps, lookup returns {ok, []}, and identity reports
{error, no_keypair}. Raises hecate_om_capabilities cover to ~53% (remainder is
live-pool I/O glue, proven by macula-station's cross-station SUITE).
DHT record-based capability discovery (procedure_advertisement), replacing the
pubsub _mesh.cap.announce broadcast. Requires macula ~> 8.2. Adds
hecate_om_identity:keypair/0; removes the pubsub announce path and peers/0.

Verified: eunit 9/0, elvis clean, dialyzer clean. Cross-station e2e in
macula-station (macula_station_procedure_advertisement_SUITE).
hecate_om:call_capability/3 (and the testable /5 form) composes the direct-dial
data plane: resolve a capability's providers (procedure_advertisement), resolve a
provider's serving station to a dialable URL (station_endpoint), dial it directly
and CALL the raw CapName there; fail over to the next provider on error. Adds the
station_url/2 helper (brackets IPv6). Requires macula ~> 8.4 (call_station +
station_endpoint readers + the 8.4.1 atom-key reader fix).

Unit-tested: station_url shapes, no-mesh degradation (11/0); elvis + dialyzer
clean. Full resolve->dial->call composition is e2e'd over real QUIC in
macula-station (macula_station_direct_call_SUITE).
hecate_om:call_capability/3 (direct-dial data path) + capability resolution now
works over the real SDK find_records path (requires macula ~> 8.4; 8.4.1 fixed the
record readers' atom-key handling that silently broke resolution on 8.2-8.4.0).

Verified: eunit 11/0, elvis + dialyzer clean; composition e2e in macula-station.
Capabilities addressed by (realm, org, name): procedure_uri/3, advertisements
carry <org>, hecate_om_identity:org/0 (org app env, default <<"_">>).
call_capability now (Org, CapName, Payload, Timeout, Opts): verify=>true drops
providers whose realm->org->server delegation chain fails (7c);
ucan_token=>Bin presents a token to a gated provider (7b). Default open.

Requires macula ~> 8.6, which fixes the storage_key put crash that had silently
broken procedure_advertisement publishing since Slice 2.

Verified: eunit 11/0 (RED-checked), elvis + dialyzer clean. verify=>true needs
realm/org publishing infra (separate package); mechanism proven in macula-station
delegation e2e.
Replace the Ed25519 delegation-record verify (which could never go live:
the realm tag is a keyless SHA-256(name) and the realm holds no signing
key) with managed-realm cert-chain verification rooted in the realm CA.

- Advertise: build_advertisement/6 embeds the service cert chain
  (leaf ++ org CA) from hecate_om_identity:cert_chain/0.
- Verify: under verify => true, keep only providers whose embedded chain
  verifies to the realm CA via macula_record:verify_advertisement_cert_chain/3
  (org-scoped); no realm CA provisioned -> drop all.
- hecate_om_identity loads org CA + realm CA from disk and exposes
  cert_chain/0 and realm_ca/0.

Requires macula ~> 8.7. hecate_om 0.14.0. 13 eunit (2 new, RED-verified),
dialyzer + elvis clean.
hecate-om was pinned at macula ~> 8.7 (locked 8.7.0), unable to float
past the 9.0.0 macula_cluster_system/macula_dist_system split let
alone reach any of the direct-dial work shipped today (9.5.0 through
9.8.0). Confirmed hecate-om uses none of the split-apart dist/cluster
APIs (grep clean), so the 9.0.0 breaking change does not touch this
repo. Compiles clean against 9.8.0, full eunit suite (13 tests) and
dialyzer both clean.
Records current state before next session's deep-dive: hecate-om's
macula surface today (RPC-only via call_capability, raw pool access
via macula_client/0, nothing for PubSub/Content/Streaming), the
service-behaviour optional-callback precedent worth reusing, the
README's stated network-library non-goal to reconcile with, and four
real services already hand-rolling their own raw macula pubsub
wrappers because hecate-om gives them nothing to build on. No design
decision made yet - this is the launching pad, not the survey.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Closes the repeated boilerplate the API-integration survey found in
four independent hecate-services repos, each hand-rolling the same
{macula_client(), realm()} pairing because hecate_om gave them nothing
to build on. hecate-tube's mesh-fact emitters and direct-dial provider
desks are the first real consumers.

Also carries two changes already sitting here from the prior survey
session: the finished survey write-up, and the scaffold template's
stale hecate_om version pin (~> 0.8 -> ~> 0.13).
macula 10.0.0 (published today) removed the dormant macula-net L3
substrate -- grepped src/ and include/ first: hecate-om never called
any of it. Verified: fresh rebar3 compile clean (real fetch off hex,
not a local checkout), 13/13 eunit passing.
.app.src already said 0.14.0 (bumped by an earlier, unpublished commit
for the macula ~> 9.0 direct-dial pull) but the CHANGELOG entry only
covered the Slice 7c Direction B work and predated everything since --
the macula ~> 9.0 and ~> 10.0 bumps, the mesh_handles/0 facade
addition, and the scaffold template fix. hex has never seen anything
past 0.13.0, so this is one real release bundling everything
accumulated since, not several. README's Status section still said
v0.9.0.
load_keypair/0 only ever loaded from identity_key_path. A service
deployed with the env pointed at a path with nothing there yet (the
common case - nobody provisioned it out-of-band) got keypair() ->
{error, no_keypair} forever, every boot, with no error logged
anywhere.

Confirmed live on hecate-tube: mesh_handles/0 resolved fine (the
service peers and calls just fine on an ephemeral identity),
keypair/0 never did, so tube_mesh_providers retried its three
direct-dial advertisements (RPC lookups + video streaming) every 5s
forever and never once succeeded, since hecate-tube's very first
deployment. No amount of local testing catches this kind of gap - it
only surfaces against a real deployment that actually gets called,
not just one that calls out.

Now: any load failure (missing file, or a corrupt one) generates a
fresh keypair and persists it to the configured path, same
self-provisioning pattern macula-realm's own mesh identity already
uses. Falls back to undefined (prior behavior) only if the save
itself fails. identity_key_path left unconfigured is unaffected.

Bumped to 0.14.1. rebar3 lint clean, dialyzer clean, 17/17 eunit
(4 new, verified they fail without the fix before confirming they
pass with it).
Every station in this fleet enforces S/Kademlia puzzle validation on
CONNECT/HELLO. A plain (non-puzzle) identity's handshake completes and
is then closed with puzzle_invalid -- graceful drain, then drained --
on every single connection, forever. This is the full, final
explanation for the tube_mesh_providers advertised=>true mystery: that
flag reflects local client-side bookkeeping only, never actually
confirmed against any station's DHT-facing registry, because no
connection using this identity ever survived long enough to matter.
Two independent pieces of work landing together:

- read_model_id/0 optional hecate_om_service callback: hecate_om:boot/1
  opens a barrel_docdb database before the service's own start/1 runs,
  same shape as the existing store_id/0 reckon-db wiring but for a
  persistent, queryable read model. New hecate_om_read_model:ensure/2
  and hecate_om:read_model/0.

- hecate_om_pubsub:publish/2,3 and publish_many/2,3, built on macula's
  supervised macula_publisher rather than a raw synchronous publish
  call. Piece C of PLAN_HECATE_OM_MESH_WRAPPERS.md: a 2026-08-24
  workspace-wide survey found ~20 hecate-services/* repos independently
  hand-rolling the same guarded macula:publish call, in three different
  flavors of outcome handling. This wrapper covers all three
  (async_silent default, async_log, sync) plus a realm override, with
  realm/mode resolution exposed as pure, directly-testable functions.
  Also adds the two mesh-wrappers plan documents (root/handover +
  implementation plan) that this design was derived from.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
hecate_om_service:capability() grows an optional handler => {Module, Args}
field. hecate_om_capabilities advertises such a capability via
macula_response:advertise_direct/7 instead of hand-building a bare DHT
discovery record — the old path made a capability discoverable but never
callable, since nothing ever registered a handler with a station. A
capability with no handler keeps the legacy record-only path unchanged.
Per-capability factory-supervisor pids are round-tripped through state
and passed back as reuse_sup on every 30s republish tick, so periodic
re-advertise does not leak a supervisor per tick.

Verified genuinely callable end-to-end against a real demo-fleet station
(station-de-frankfurt.macula.io), not just wired: two independent
pools/identities (provider + consumer), full RPC round trip. Getting
that live test to pass surfaced two real, pre-existing bugs in
hecate_om_capabilities' consumer side, neither introduced by this piece:

- resolve_at/4 and resolve_full/4 keyed DHT lookups by procedure_uri/3
  (Realm+Org+Name), but a handler-bearing capability is written under
  macula's own discovery_uri/2 key (Realm+bare-Name — Org is a
  post-resolve verify_cert_chain concern in macula's model, never part
  of the discovery key). call_capability's own dial side already used
  the bare name, so the two could never have matched. Fixed with a new
  discovery_key/2 matching macula's private formula; the legacy
  record-only path is untouched.

- dial_provider called macula:call_station/7 with no
  verify/pin_tls_cert/expected_node_id override, so every direct-dial
  call failed at the TLS layer before the real, application-level
  trust check (the DHT record's pubkey signature) ever ran.
  macula_direct_dial:call/6, macula's own canonical implementation of
  this exact resolve-then-call pattern, sets exactly that triad because
  a station's TLS certificate has no relationship to its macula
  identity. hecate_om_capabilities was missing it entirely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
hecate_om_service grows an optional subscriptions/0 callback: a list
of {Topic, HandlerMod, Args} triples, HandlerMod implementing the
macula_subscriber behaviour. hecate_om:boot/1 wires it exactly like
store_id/0 / read_model_id/0.

Two new processes under hecate_om_sup: hecate_om_pubsub_sup, a plain
supervisor whose children (macula_subscriber instances, restart =>
transient) are added/removed dynamically by topic; and
hecate_om_pubsub_subscriptions, a reconciler gen_server holding the
desired set with a 30s self-heal tick, same shape as
hecate_om_capabilities' own republish timer and for the same reason —
retry a topic that couldn't start because the mesh wasn't attached
yet, or whose child exhausted its restart budget after a full pool
replacement. hecate_om_pubsub:ensure_subscriptions/1 is the public
entry point, diffing desired against currently-running children so a
service can call it again whenever its desired set changes at runtime
(e.g. one topic per newly-registered entity) and touch only the delta.

No hand-rolled reconnect logic: macula_subscriber already turns a
genuine subscription loss into {stop, Reason, State}, and an ordinary
link respawn is invisible to it (macula_client_replay already replays
it one layer down, confirmed live in macula-io/macula's
macula_link_respawn_replay_tests.erl during this plan's design phase).
Supervision restart is the entire reconnect story.

Verified with real event delivery against the same live demo-fleet
station used for piece B: declared a subscription, published a real
fact via piece C's hecate_om_pubsub:publish/2, confirmed the handler
received it end-to-end. Then proved the dynamic-membership design
directly — adding a topic left an existing child's pid unchanged and
started exactly the new one; removing a topic stopped exactly it and
left the other untouched.

Also fixes a real bug in this codebase's own test-teardown convention,
unrelated to piece D's design: supervisor:stop/1 does not exist in
OTP (verified directly against OTP 28) despite the analogy with
gen_server:stop/1. Used inside a catch, it silently failed, leaking
supervisors across test runs and causing registration collisions.
Fixed with the correct idiom: unlink/1 + exit(Pid, shutdown) + a
monitor-wait for confirmation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
hecate_om_content:put/1,2 and get/1,2 block with a timeout for macula's
supervised content-transfer behaviours, matching what an HTTP handler
actually wants (bytes or an MCID back, not a pid). Always the pooled
macula_feeder:start_link/5 / macula_download:start_link/5, never
start_link_direct: macula_download's own moduledoc confirms the
hard-won lesson hecate-tube already learned live on beam02 -- only
chunked content ever gets a content_announcement DHT record, so
direct-dial resolution can never succeed for a small blob (a logo, a
thumbnail) even immediately after upload. Put and get sides can never
disagree about which path a given piece of content is reachable
through, because there is only one path.

Regression-proofed live against a real demo-fleet station, not just
documented: a small random blob round-trips through put/get, and the
returned MCID is asserted to carry the non-chunked codec byte before
the round trip is trusted -- proof the pooled path was used, since
non-chunked content structurally could never have resolved via
start_link_direct in the first place.

The macula_feeder/macula_download callback implementations live in
their own small modules (hecate_om_content_feeder,
hecate_om_content_downloader) rather than on the facade: the two
behaviours both declare init/1, and the compiler rejects a module
declaring both, conflicting behaviours. These two files carry no
domain content of their own -- every real behavior (mesh handle
resolution, realm override, timeout, cancel-on-timeout) lives in the
facade -- so they're named for the SDK contract each satisfies rather
than the operation, which is the one thing actually worth knowing
about them from the filename alone.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
hecate_om_pubsub:start_publisher/3,4,5 and hecate_om_content:
start_feeder/2,3,4 / start_downloader/2,3,4: each resolves
hecate_om:mesh_handles/0 exactly like the terminal publish/2,3 and
put/1,2 / get/1,2 do, then starts the real macula_publisher /
macula_feeder / macula_download with a caller-supplied callback
module instead of hecate_om's own, returning {ok, Pid} rather than a
blocked-until-done value. hecate_om has no say over what the caller's
own callback does with the outcome.

Motivated by a concrete gap: pieces B and D (capabilities' handler,
subscriptions' HandlerMod) already let a service supply its own
callback, because handle_request/2 and handle_event/4 necessarily
carry business logic hecate_om can't know in advance. Piece C and E's
callbacks don't, in any real example surveyed -- every hand-rolled
publish site and hecate-tube's content wrappers used the callback as
a pure value-relay -- which is why they collapse into a terminal,
synchronous API by default. But a service that wants something the
three publish modes or the block-and-return content shape don't cover
(retry-with-backoff on a batch publish, decoupled from any caller;
a per-item completion side effect during a batch upload) had no way
to get mesh_handles resolution without hand-rolling the whole thing
and reintroducing the boilerplate this plan exists to eliminate.
Nothing about the original design was wrong for the common case; it
was just missing the same harness path B and D already had.

Renamed the private mode-dispatch helper in hecate_om_pubsub.erl
(start_publisher/6 -> publish_with_mode/6) to avoid a same-name-
different-arity clash with the new public start_publisher/3,4,5.

Tested the same way as the terminal APIs, plus a live proof specific
to the escape hatch's actual point: a real round trip through a
test-owned callback module (not hecate_om's own) against the real
demo-fleet station, for both publish and content, confirming the
caller's module genuinely receives the SDK outcome.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The prior commit proved a caller-supplied callback receives the SDK
outcome, which is necessary but not sufficient: it never actually
built or ran the retry-with-backoff / batch-upload scenarios that
justified building the escape hatch in the first place. This commit
does.

hecate_om_pubsub_tests: a real retry-with-backoff coordinator, run to
genuine exhaustion against the zero-link pool -- three real attempts,
in order, with real backoff between them, notifying the original
caller of every intermediate failure and the final outcome.

hecate_om_content_live_station_tests: a batch-upload coordinator, run
to real completion against the live demo-fleet station -- three
concurrent uploads via start_feeder/3, a shared collector process,
distinct MCIDs confirmed for all three.

The first version of the retry test called start_publisher/4 again
recursively from *within* handle_published/2 -- i.e. from inside a
macula_publisher gen_server's own callback, in the same beat that
gen_server was about to stop. That passed in isolation and under
light load, then failed deterministically inside the full suite, and
adding diagnostic io:format calls (which perturbs scheduling) made it
pass again -- the signature of a genuine race, not bad luck. Raising
the timeout made it worse: it stopped failing fast and instead hung
for the outer EUnit group's budget before being cancelled. The actual
fix was moving the retry decision into a separate, ordinary process
that orchestrates N one-shot start_publisher/4 calls, each using the
already-proven {simple, Pid} relay, rather than looping inside a
short-lived per-attempt callback. This is also simply the more
correct design for "fully decoupled from any caller waiting
synchronously," the original justification for the escape hatch --
not a workaround, the right shape from the start. Confirmed clean
over 8 isolated runs and 3 full-suite runs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI previously ran only rebar3 lint and rebar3 ct. None of the mesh-
wrappers test coverage built across pieces B-E -- pure-helper tests,
degrade-path tests, and every live-station proof that ever caught a
real bug -- was running automatically. A regression in any of it would
have stayed green.

Fixing that outright would have made CI depend on a real external
station (station-de-frankfurt.macula.io) on every push and PR: the
demo fleet is documented, disposable dev infra with no uptime
guarantee, so that dependency has to not be able to block an unrelated
merge.

Split by directory instead of by exclusion list: the three test
modules that hit a real station move from test/ to test_live/, a
sibling directory rebar3 does not discover by default. A new
`live_test` profile (extra_src_dirs => ["test_live"]) makes them
reachable via `rebar3 as live_test eunit --dir test_live`. This makes
"part of the default, CI-gated suite" the safe default for any new
test file going forward -- it takes a deliberate choice to opt a test
out, not a maintained list that silently goes stale as files are
added.

CI now runs rebar3 lint + rebar3 eunit (fast, local, ~0.6s, no
network) + rebar3 ct as the blocking gate, plus a separate
live-mesh-tests job (continue-on-error: true) so a genuine regression
in the live-station coverage is still visible in the run without
turning the check red over a station blip.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI has been failing since barrel_docdb (pulling in rocksdb) was added,
predating this session's CI-split work: `rebar3 lint`'s dependency
compile step shells out to rocksdb's do_cmake.sh, and the erlang:27
container image ships neither cmake nor a C++ toolchain. Two prior
pushes this session (701427a, 71c4ce5) went out failure and were not
caught, because nothing checked `gh run view` after them.

Also moved the container image from erlang:27 to erlang:28 -- local
dev is OTP 28, and running CI a major version behind is its own source
of drift (this is exactly the mismatch that let supervisor:stop/1's
absence go unnoticed until it was checked directly against the local
runtime).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
cmake alone got rebar3 lint/eunit compiling clean, but rebar3 ct then
failed at boot: rocksdb's CMakeLists auto-detects system Snappy via
find_package(Snappy) and silently disables it when missing rather than
failing the build, so the NIF compiled fine but barrel_docdb's runtime
config -- which asks for Snappy blob compression -- couldn't open it
("The specified blob compression type Snappy is not available").
lz4/zstd/bz2 go through the same silent auto-detect, so all four are
installed now rather than fixing them one crash at a time.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
macula's frame decoder round-trips a payload's keys through
binary_to_existing_atom/1, so a caller that sent binary keys can find
them waiting as atoms on the other side. Three incompatible ways of
coping with this were already live in the workspace: hecate-embedder's
gf/2 (atom-first, binary-fallback), hecate-spartan's mget/2,3
copy-pasted 11+ times across federation_*.erl for pubsub payloads, and
hecate-dns/-git/-llm/-rag's route/2 handlers matching binary keys only
with zero tolerance -- silently wrong if a real payload ever arrives
atom-keyed.

hecate_om_wire:field/2,3 replaces all three with one shared, tested
lookup: pass the atom or binary key literal you'd naturally write,
the atom form is tried first (the confirmed-live shape per pieces
B/D's own live tests), the binary form second, a default if neither
is present -- without crashing on a binary key whose atom form
doesn't exist anywhere in the VM yet, which a bare
binary_to_existing_atom/2 would.

Landed as its own module rather than folded into
hecate_om_capabilities as the plan originally guessed: piece B calls
macula_response:advertise_direct with the caller's own handler
module, so there's no hecate_om-owned dispatch step to hang a decode
call on for free, and the same gotcha hits pubsub payloads (piece D)
as much as RPC args (piece B) -- a shared module fits both without
either owning it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
hecate_om_identity used to hand-roll the mesh pool's whole lifecycle:
self() ! connect, a 5s retry timer, and erlang:monitor + DOWN to
notice and reconnect if the pool died. Reading macula_client.erl
directly showed both defenses were redundant: each seed link dials
and retries forever on its own timer without ever crashing the pool
process for an unreachable seed, and hecate_om.app.src already lists
macula in applications, so standard OTP boot ordering means macula
has finished starting before hecate_om ever does.

The pool is now an ordinary hecate_om_sup child (restart => permanent)
started via hecate_om_identity:start_mesh_pool/0 -- it runs after
identity (an earlier sibling) has already loaded the keypair, so it
reads that back rather than duplicating the loading logic, then
registers the pool locally so macula_client/0 becomes a plain
whereis/1 check with no gen_server round trip. The child is
conditionally included: omitted entirely with no seeds configured, so
macula_client/0 degrades to {error, no_client} exactly as it did
before this migration, rather than a real-but-idle pool making
"nothing configured" indistinguishable from "connected".

The open boot-race question this comment carried is resolved, not
assumed: a real application:ensure_all_started(hecate_om) boot with
seeds configured resolves macula_client() with no poll or retry on
the assertion itself, proven both against an unreachable seed
(test/hecate_om_mesh_pool_SUITE.erl) and a real station
(test_live/hecate_om_mesh_pool_live_station_tests.erl). The same CT
suite also proves the actual point of "proper supervised child": kill
the pool pid and confirm OTP, not hand-rolled code, brings up a new
one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
hecate-tom-player's tom_wire_macula.erl was, before this, the one
place in the workspace classifying a failed RPC call as worth
retrying by asking macula_bolt4:is_retryable/1 instead of keeping a
second copy of the BOLT#4 code table locally. hecate_om_wire:
retryable/1 generalizes that instinct rather than porting tom's own
three-way {ok,_}|{refused,_}|{unreachable,_} vocabulary, which is
tom's own business framing, not a generic mesh concept: just the
boolean every caller actually needs to decide whether to retry.

{error, {call_error, Code, _Name}} is confirmed (via
macula_station_link.erl's own doc table) to be macula's documented
CALL-failure shape, not tom_wire_macula.erl's private convention, so
this covers macula:call/5, call_station/6,7,8, and
hecate_om_capabilities:call_capability/5,7 uniformly.

Preserves the one non-obvious correctness detail from the original:
macula_bolt4:is_retryable/1 raises for a code its own table doesn't
recognize (confirmed by reading macula_bolt4.erl directly) rather
than returning false, a real possibility across a protocol version
skew -- caught here and treated as retryable rather than crashing the
caller over an unrecognized code.

Landed in hecate_om_wire.erl alongside piece F, as F's own module doc
already anticipated. Also corrects a plan-doc misattribution from the
original survey: tom_wire_macula.erl lives in hecate-tom-player, not
hecate-tom-world.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
service_cert/0, realm/0, keypair/0, org/0, cert_chain/0, and
realm_ca/0 were plain gen_server:call/2, which raises {noproc, _} if
called before this gen_server has started. Confirmed by reading them
directly, not assumed: hecate-biotope, hecate-society, and
hecate-dronex each hand-roll a try/catch around
hecate_om_identity:realm() specifically; biotope and society also
wrap macula_client() -- which became dead code the moment piece A
shipped a non-raising whereis/1 check for it, not just theoretically
obsoleted.

A shared safe_call/1 catches exit:{noproc, _} -- called before boot,
or the process died between the registered-name lookup and the send
-- and converts it to {error, not_booted}. A genuine timeout is a
different, real bug and is deliberately left to propagate rather than
silently degrading. org/0 keeps its own "always a binary" contract:
not_booted collapses into the same <<"_">> placeholder already used
for "unconfigured", not a new tuple shape callers would need to
handle.

Audited every internal call site in hecate_om/hecate_om_capabilities
before landing -- all either delegate the {error, term()} shape
through unchanged or already pattern-match a generic {error, _}
catch-all, so widening the error set introduced zero breakage.

6 new EUnit cases prove the non-raising contract directly against a
genuinely-killed gen_server (killed and confirmed dead first, restored
after), not assumed from EUnit's test ordering in a shared VM where
other modules in this suite start their own hecate_om_identity.

This closes out the mesh-wrappers plan -- pieces A through H are now
all implemented, tested, and (as of this commit) pushed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
A how-to manual for writing hecate-services/* daemons that talk to
the mesh: connecting (piece A), RPC (piece B, plus the wire-decode
and retryability helpers from pieces F/G), pub/sub (pieces C/D),
content put/get (piece E), and streaming.

Content and streaming get honest treatment rather than pretending
hecate_om covers ground it doesn't: content put/get is
content-addressed storage, not destination-addressed file transfer,
with a pointer to the genuinely different (and unwrapped)
macula_pusher/macula_upload pair for the "push at a known recipient"
case; streaming isn't wrapped by hecate_om at all yet (one exemplar
in the whole workspace, not enough evidence to generalize a facade
from), so that chapter calls macula_streamer/macula_stream_sink's
own supervised API directly rather than gesturing at "figure it out."

Registered in rebar.config's ex_doc extras alongside the existing
guides; verified with a real `rebar3 ex_doc` build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Local barrel_docdb artifact from running the app/tests outside CT's
own priv_dir sandbox -- was showing up as untracked in every git
status since barrel_docdb was added.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Had drifted 10 releases behind the fleet, including the domain-filter
fix that was silently dropping every macula_diagnostics:event call on
any consumer. No use of anything removed in 10.0.0's macula-net
deletion; full eunit + CT suite clean at the new version.
rebar3 dialyzer failed with 3 'Callback info about the X behaviour is
not available' warnings (macula_publisher, macula_feeder,
macula_download) when the user ran the publish script for 0.15.1.
Confirmed pre-existing at macula 10.0.0 too, not caused by the version
bump in the prior commit -- macula's exclude_apps entry (it ships
without debug_info, a NIF-heavy lib) means dialyzer has no callback
info for any behaviour it defines. no_unknown doesn't cover this: the
warning is tagged ?WARN_UNDEFINED_CALLBACK internally
(dialyzer_behaviours.erl), and no_behaviours (?WARN_BEHAVIOUR) is the
wrong option too -- verified directly against dialyzer 5.4's source
before picking no_undefined_callbacks. Clean run confirmed on a fully
fresh PLT, eunit and CT both still green.
Every scaffolded service transitively depends on rocksdb (via
barrel_docdb) and khepri/ra through hecate_om, unconditionally -- true
even for a storeless, producer-only service. The generated
Containerfile and lint.yml both failed to build without cmake +
openssl-dev (+ zstd/snappy/lz4-dev for the Containerfile's alpine
stage), confirmed while scaffolding hecate-turn-credentials. Matches
the package set hecate-tube's Containerfile already carries, which was
previously (and incorrectly) attributed to that service owning its own
reckon-db store.
The builder stage compiles rocksdb against zstd-dev/snappy-dev/lz4-dev,
but the runtime stage never carried their actual .so runtime packages.
A generated service crash-loops on boot with 'Failed to load NIF
library: Error loading shared library liblz4.so.1' -- confirmed live
on hecate-turn-credentials, deployed and immediately crash-looping on
beam00 with this exact error before the fix.
rocksdb's CMakeLists auto-detects libsnappy-dev/liblz4-dev/libzstd-dev/libbz2-dev via find_package() and silently disables whichever is missing rather than failing the build -- the compile step goes green while producing a NIF barrel_docdb's own default config (document-body/BlobDB compression = snappy) can't actually open at runtime. This repo's own lint-and-test.yml already carries the fix after hitting it directly; the shared scaffold template never got the same update, so hecate-stations (the first scaffolded service to actually exercise read_model_id/0 in CI) hit it again today.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01DdfxHXsBShakDyqyUJZnF7
The concrete how-to against this library's real API (subscriptions/0,
macula_subscriber, hecate_om_wire) for the pattern documented in full in
hecate-corpus/examples/MESH_FACT_READ_MODELS.md. Also flags a real gap
found while writing this: hecate_om_capabilities re-advertises every 30s
but never passes ttl_ms, so a dead service's capability still survives up
to the 48h envelope default regardless of the fast refresh cadence.

Cross-linked both directions with mesh_native_services.md's own
'Where to look next' section, matching this guide family's existing
linking convention.
Two orgs advertising the same bare capability name from the same relay
station used to collide on macula_remote_advertise_registry's
single-provider-per-bare-name invariant: whichever org's 30s republish
landed last silently answered every targeted call, regardless of Org.
Proven live by a new two-org test before the fix (both acme- and
contoso-targeted calls answered by whichever org registered most
recently) and after (each call answered only by its targeted org,
station-de-frankfurt.macula.io).

Fix: advertise_one/7 now makes two independent advertise_direct calls
per handler-bearing capability -- the existing bare name (unchanged,
any-provider fallback) plus org_procedure(Org, Name) as a second,
genuinely distinct wire-level ADVERTISE + DHT record. resolve_full/4
tags each resolved provider with which wire-level procedure string
actually matched, and dial_provider CALLs with that string, not the
raw capability name -- so an org-scoped resolution can only ever be
answered by that org's own registration.

Also, found necessary to get the live test genuinely green:
hecate_om_capabilities:find/2 had no retry margin against DHT-write
propagation lag, unlike macula_direct_dial's own internal resolution;
mirrored its retry budget (50 x 100ms). ttl_ms now flows through
advertise_opts/1 on every advertisement (proportioned to the 30s
republish interval, not the ~48h envelope default) -- the DHT-record
half of this needs macula bumped past 10.11.1 to take live effect for
the handler-bearing path (macula_direct_dial:adv_opts/1's own bug,
fixed separately in macula).

Plan: macula-station/plans/PLAN_ORG_SCOPED_DISPATCH_AND_WILDCARD_DISCOVERY.md

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DdfxHXsBShakDyqyUJZnF7
Clarify that the guide's discovery-scaling section is specific to
find_records_by_type (bulk, local-only listing); exact-key resolution
already walks multi-hop station-side as of the current macula-station,
so it never shared that ceiling. Don't conflate the two.

Plan slice 8: macula-station/plans/PLAN_ORG_SCOPED_DISPATCH_AND_WILDCARD_DISCOVERY.md

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DdfxHXsBShakDyqyUJZnF7
Two separate pools were a workaround for a macula connection-reuse
bug (fixed upstream in macula 10.13.1) where a second call_station
on one pool to an already-connected station failed. One shared pool
is the simpler, more representative shape and is what actually
proves the fix; a note explains the dependency for whoever hits this
before hecate-om's macula dep is bumped past 10.13.1 on hex.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DdfxHXsBShakDyqyUJZnF7
Genuinely new -- neither the bare key nor the org-qualified key
(Realm/Org/Name) can serve this: both need a capability NAME as part
of the key, and there is no name-less browse key to resolve.

The original plan called for publishing the same procedure_advertisement
record again under an org-prefix-only DHT key, reusing the multi-value
bag semantics that already let multiple providers of one capability
share a key. Turned out infeasible: macula_record:storage_key/1
derives a procedure_advertisement's storage key from its own
procedure_uri payload field, so a record cannot be stored under an
independently-chosen key without that field lying about what it
actually advertises, and building a second DHT record type just for
this (with its own write-conflict semantics across multiple
advertisers of one org) was judged more than this needs.

Implemented instead as a client-side filter over
macula:find_records_by_type/2, matched via macula_topic_pattern (from
macula 10.12.0). This reuses the exact same local-relay-view,
warm-start-only mechanism read_model_services.md already documents
for bulk browsing -- honest about that limitation rather than
pretending to a DHT-wide authoritative index this record type cannot
support. Live-verified against station-de-frankfurt.macula.io: finds
both of an org's advertised capabilities and correctly excludes a
different org's capability under the same bare name.

Plan: macula-station/plans/PLAN_ORG_SCOPED_DISPATCH_AND_WILDCARD_DISCOVERY.md, slice 4

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DdfxHXsBShakDyqyUJZnF7
Bumped from 0.15.1, which was already published to hex 2026-08-27 and
is immutable past hex's one-hour edit window -- today's changes (the
org-scoped dispatch fix, list_org_capabilities, the macula 10.13.1
dependency bump) needed a new version number, not a re-publish attempt
at the same one.

Compile, full eunit (82/82), and dialyzer all clean at this version.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DdfxHXsBShakDyqyUJZnF7
Never referenced anywhere in this library's source -- confirmed by grep
across src/. The SDK connects directly over QUIC to MACULA_STATION_SEEDS
(macula_peering_sup, embedded client); no unix socket to a local station
process is ever created or read. Every scaffolded service shipped this
unexplained key in sys.config.src, which reads as a real requirement
and sends the next reader looking for a socket mount that was never
needed. 82 eunit tests pass.
advertised/3 discarded advertise_direct's {error, Reason} outright.
put_advertisement/2's try ... catch _:_ -> ok end discarded BOTH a
plain {error, _} return from macula:put_record/2 (never pattern-matched
at all, not just the exception guard) and any real exception, with no
logging in either case. Combined with register/1's handle_call always
replying ok regardless of what do_advertise actually did, a service
could run healthy indefinitely with its capability never reaching the
mesh's DHT and nothing anywhere to say why.

Also a correctness gap against this repo's own CLAUDE.md: a try/catch
is only justified when it adds monitoring value neither branch
actually did here.

Both paths now logger:warning/2 the real reason, matching the existing
hecate_om_pubsub:handle_published/2 precedent (same module, same
style). Found live investigating why hecate_stations.list_stations was
unreachable: macula-cli dht find-records-by-type (new subcommand,
macula-io/macula-cli) confirmed the advertisement genuinely never
landed in the DHT, but nothing in hecate-stations' own logs said why
until this fix -- existing tests already exercised the failure path
and now show a real reason (no_healthy_station in the test fixture's
case) instead of silence.

82/82 existing tests pass, dialyzer clean.
Both jobs run on erlang:28 with no Rust toolchain, on the documented
assumption that none was needed -- true for macula's QUIC NIF (its own
precompiled-download path), false for macula_cbor_nif, which always
builds from source and has no Erlang fallback by design. macula's own
build script silently skipped it when cargo was missing (fixed
separately in macula-io/macula 10.14.3 to hard-fail instead), but a
louder failure in the dependency doesn't put cargo in this container --
only actually installing one does.

Same silent-then-late pattern as the two earlier incidents documented
in this file's own header comment (cmake missing, then Snappy
auto-detect): rebar3 compile/lint went green with the NIF never built,
then rebar3 eunit failed 7 tests with nif_not_loaded. Confirmed locally
(cargo present here): 82/82 tests pass, dialyzer clean -- this is what
CI should now also see.

dtolnay/rust-toolchain@stable, matching the existing convention in
macula-io/macula's own build-nif.yml.
The job's own comment blamed 'occasional station blips'. Checked: dig
confirms station-de-frankfurt.macula.io has only an AAAA record, no A
record at all, and GitHub-hosted runners have no IPv6 egress -- a
platform limitation, deterministic on every run, not intermittent.
wait_healthy/2 in every test_live/*.erl module times out because the
QUIC connect can never reach the station, not because it's unhealthy.

continue-on-error already does the right thing (confirmed live: the
33339845889 run's overall conclusion was success with only
live-mesh-tests failing) and stays as-is. This is a documentation
correction only -- the real fix (self-hosted runner with IPv6, or an
IPv4 listener added station-side) is infrastructure outside this
workflow file, not something to silently provision here.
Second silent-failure path in the same area as 0.16.1 -- worse than
that bug, since this clause fires BEFORE advertise_direct is ever
called at all. Its own comment assumed a transient mesh gap resolving
within a few republish ticks; a genuinely stuck pool or identity means
it fires forever, silently.

Deployed 0.16.1 to hecate-stations (beam03) specifically to observe
this live and found exactly this: 0.16.1's new logging never fired,
and hecate_stations.list_stations still wasn't in the DHT (confirmed
via macula-cli dht find-records-by-type) -- the failure was one level
earlier than 0.16.1 could see.

Logs the specific reason for each of pool/keypair/realm now, throttled
to once per distinct reason triple (process-dictionary-scoped gate) so
a persistent boot problem doesn't spam a warning every 30s forever.

30/30 capabilities tests, 82/82 full suite, dialyzer clean.
The actual root cause, found by deploying 0.16.2's new logging to
hecate-stations (beam03) and reading it: {ok, no_keypair, ok} -- pool
and realm both fine, no stable signing keypair. identity_key_path was
simply absent from the scaffold template every service is generated
from (priv/templates/hecate_service/sys.config.src), so every
generated service inherits the gap unless someone remembers to add it
by hand.

Without it, hecate_om_identity:load_keypair/0 returns undefined
forever -- the self-heal/auto-generate-and-persist path only fires
when a path IS configured but the file fails to load -- so keypair/0
stays {error, no_keypair} permanently, and advertise_with/7 no-ops on
every republish tick by design ('an ephemeral service cannot sign and
is correctly not advertised'). This module's own comment already
named this as a known recurring issue (hecate-tube hit it before); it
just wasn't caught at generation time until now.

Template now sets identity_key_path to /etc/hecate/secrets/identity.key,
the same already-mounted secrets volume service_cert_path uses -- no
new infrastructure needed. Added
sys_config_configures_a_stable_identity to
hecate_service_template_SUITE so a future template regeneration can't
silently drop this again -- confirmed RED without the fix, GREEN with
it.

82/82 eunit, 15/15 CT (incl. the new template test), dialyzer clean.
The live fleet's procedure_advertisement DHT records carry uppercase
hex in procedure_uri, but binary:encode_hex/1 produces lowercase.
SHA-256(uppercase) != SHA-256(lowercase), so the Go direct-dial resolver
was looking up the wrong DHT key and every direct-dial call failed.

Changed all three call sites (procedure_uri/3, discovery_key/2,
org_capability_pattern/2) to use binary:encode_hex(Realm, uppercase),
matching macula_direct_dial:discovery_uri/2 and macula-go's
dht.DiscoveryURI, both updated in parallel. Tests updated to match.
No rebar.config change needed -- already permitted by this repo's own
reckon_db ~> 5.4 constraint. Fresh resolve + this release marks it
verified: 82/82 eunit + 15/15 CT pass against the new version. Fixes
catch-up-on-restart for every evoq-based hecate-service, not just the
one that surfaced it (hecate-sentinel). See reckon_db's own CHANGELOG
for the full writeup.
The primitive already existed one layer down: macula:advertise/5's
auth => {ucan_required, Issuer} policy, enforced on every inbound call
by macula_station_link's authorize_policy/2. Nothing in hecate_om used
it -- advertise_one/7's capability-map pattern never read an auth key
to merge into the Opts it already builds for advertise_direct.

New auth_opts/1 (pure, exported), merged alongside the existing
cert-chain and reuse_sup opts. Default absent (open), matching every
existing caller unchanged. 3 new tests, 85 total pass, dialyzer clean.

hecate-rag still hand-rolls its own advertise loop and won't benefit
until it migrates onto register/1 -- flagged as separate work in
plans/PLAN_UCAN_GATED_CAPABILITIES.md, not done here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDq2jUtd2F5EYWQyEgp1g7
Add auth key to capabilities, forwarding macula's existing UCAN gating
policy through hecate_om_capabilities:register/1 -- see
plans/PLAN_UCAN_GATED_CAPABILITIES.md.

Add hecate_om_simple_handler, bridging macula's native {Module,
Function} handler convention into macula_response's init/1 +
handle_request/2 contract -- discovered as a real prerequisite while
migrating hecate-rag's 15 capabilities onto register/1, not
hecate-rag-specific.

89 tests pass, dialyzer clean, ex_doc builds clean for both new
modules.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDq2jUtd2F5EYWQyEgp1g7
hecate_om_service:capability() gains kind => response | streamer (default
response) and stream_opts. advertise_one/6 now dispatches through
provider_module/1, calling macula_streamer:advertise_direct instead of
macula_response:advertise_direct for a streamer-kind capability -- both
provider modules publish the identical procedure_advertisement record and
read the same Opts keys, so this is a dispatch change, not new plumbing.

Motivated by hecate-tube's tube_mesh_providers.erl, which hand-rolled its
own advertise loop for tube.watch_video_clip because this capability kind
didn't exist yet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177byzQCK5t1WQeonmxdyx1
A perfectly fixed 30s republish interval can permanently lose a race
against a station-side cooldown of the same length: macula-station's
macula_remote_advertise_registry tombstones a re-registration for 30s
(deliberately bumped from 10s in ea95857 for its own gossip-convergence
reasons) whenever it is unregistered, and only the same advertiser
node-id may re-register during that window. Found live 2026-09-01:
hecate-rag's get_document_verbatim capability stayed unknown_method for
45+ minutes across ~90 identically-timed retries while sibling
capabilities in the same advertise batch self-healed on their next
tick, having landed just outside whatever tombstone they individually
raced.

Neither side's 30s value was wrong in isolation -- the bug was the two
periods being exactly equal, giving a losing retry no drift to ever
land outside the window again. Fixing this client-side with jitter
protects against any station's cooldown period, known or not, rather
than tuning to one station's specific constant.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDq2jUtd2F5EYWQyEgp1g7
Follows this file's own convention for exported pure helpers, and this
repo's release checklist requiring @doc/@spec on every export.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDq2jUtd2F5EYWQyEgp1g7
field/2,3 fixed the atom/binary KEY hazard but still returned the
wire-level CBOR VALUE representation unchanged. A JSON string sent as
an RPC arg is a CBOR text string (major type 3), which decodes to
{text, binary()}, not a bare binary() -- a plain binary is reserved
for a CBOR byte string (major type 2), a different wire type. Every
is_binary/1 guard and :: binary() field spec downstream silently
failed to match a real caller's payload, indistinguishable from a
missing field.

Found live 2026-09-01 diagnosing hecate-rag's get_document_verbatim: a
temporary diagnostic log showed the actual payload as
#{source_path => {text, <<"...">>}} -- the key lookup was already
correct, the value never was.

New unwrap/1 (exported, pure) recurses through list elements and map
values, so a topics :: [binary()] or hits :: [map()] field round-trips
correctly too, not just a flat top-level field. field/2,3 now applies
it to whatever is found (or the caller's own Default) before
returning.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDq2jUtd2F5EYWQyEgp1g7
A timed-out advertise_direct call for one capability during a republish
tick used to crash hecate_om_capabilities entirely -- and since
macula_response/macula_streamer link each factory supervisor they
create to this process, the crash killed every OTHER, already-healthy
capability's supervisor too. Found live 2026-09-01 via hecate-rag:
a timeout on ingest_document's advertise call cascaded into noproc
failures on unrelated capabilities (search_chunks_semantic/
answer_query/add_knowledge) for several minutes after a clean boot.

advertise_one/7 is now called through advertise_one_safely/7, which
catches per-capability and logs which one failed and why -- the
documented exception to this org's let-it-crash default, since the
alternative (one opaque supervisor-exit report) erases exactly that
distinction along with every sibling's live registration. A failed
capability's previous registration stays in place and retries on the
next ~30s tick.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPWhPRks8eDj87aD7Vmvj2
Companion to macula 10.15.0's Phase 1 fix (macula_station_link now merges
the CALL frame's caller into Payload). One well-known accessor instead of
every desk re-deciding the field name, matching field/2,3's own reasoning.
Reads undefined against an older macula, same as any other absent field.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016vYH48rnRe3RhKqQVoJeLD
caller/1's own doc comment backtick-referenced macula_station_link:handle_inbound_call/2,
an internal function ex_doc can't autolink (undefined or private in macula's published
docs), so it warned. Plain prose instead, same information.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016vYH48rnRe3RhKqQVoJeLD
hecate_om_ownership_proof:verify/3 proves a caller holds the private
key for the Ed25519 identity they claim to be asserting on behalf of,
inside an otherwise-open mesh payload -- a signature over {identity,
timestamp, procedure}, procedure-bound so a proof minted for one gated
capability can't be replayed against another.

Extracted after the identical ~40-line verifier was written twice
independently: hecate-citizens' citizen_ownership_proof and
hecate-mail's mailbox_ownership_proof, each one's own moduledoc naming
the exact trigger for consolidating -- a third, unrelated consumer.
hecate-graph needing the same mechanism to make its learn_link
provenance mind-grained (an individual mind's own signed identity, not
just the wire-level connection identity spartan's shared mesh pool
carries) is that third consumer.

A different mechanism from {ucan_required, Issuer} capability gating
(plans/PLAN_UCAN_GATED_CAPABILITIES.md): that controls who may call a
procedure at all. This proves who asserted a specific claim inside one.

Neither existing consumer migrated here -- no bug in either, out of
scope for this extraction, worth doing later.

10 new tests, 120 total. ex_doc clean, elvis clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016vYH48rnRe3RhKqQVoJeLD
The scaffolded lint workflow's header said "no Rust toolchain is needed" on the
glibc image. macula_cbor_nif (macula >= 10.14, every service on hecate_om >=
0.20) builds from source or fails the compile hook outright, so a freshly
scaffolded service's first CI run was red before a single test ran. Hit by
hecate-agora 2026-09-02; hecate-stations had patched its own copy by hand.
Same step, same header correction, in the template so the next service starts
green.
Quick successive pushes to main used to queue several image builds racing to
overwrite :latest; the last to FINISH won, not the last pushed, and watchtower
rolled the fleet onto it. hecate-rag hit this live and fixed its own copy; the
template now ships the same guard so the next scaffolded service starts with it.
GitHub has been canonical since 2026-07-26 and the Codeberg copies are
being deleted. Repository, raw-file, release and container-image URLs
now name github.com, raw.githubusercontent.com and ghcr.io; hex/Cargo/
NuGet/npm metadata, git dependencies, CI comments and installer scripts
follow. Changelog entries keep their history as written.
register/1's auth key has been available since 0.17.0 but adoption is
per-capability, per-service, and opt-in -- nothing catches a service
that never set one. hecate_om_capabilities:unguarded_capabilities/1
(exported, pure) names every capability in a list with no explicit
auth key; register/1 now logs that list once per (re-)registration,
free per-boot visibility for any service routing through this module.

That can only see what a service's own capabilities/0 reports, so it
structurally can't catch a service still bypassing this module
entirely with its own direct macula:advertise/5 call -- the
pre-migration hecate-rag pattern this module's own moduledoc already
documents fixing for one service. scripts/audit-fleet-ucan-adoption.sh
is the other half: greps every sibling hecate-services/* repo's real
source (umbrella-app-aware -- a first draft's literal top-level src/
glob silently missed every umbrella-structured repo) for that bypass
pattern. Run 2026-09-03 against the real fleet: 7 services still
bypass the shared path (hecate-dns, hecate-dronex, hecate-embedder,
hecate-git, hecate-llm, hecate-tom-ocean, hecate-tom-world) -- flagged
for individual migration review, not fixed here.

3 new eunit tests, full suite (123 tests) and dialyzer both clean.

See macula-io/macula-architecture/plans/PLAN_CLOSE_SERVICE_AUTH_GAPS.md
Phase 4, which sequences this ahead of hecate_om_capabilities'
auth_opts/1 default eventually flipping from silent-open to
explicit-required.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0133Pf7x2FFKnRp4cTn844en
Matches the OTP major (28) Containerfile and lint.yml already pin.
Without it, a dev machine whose asdf/rebar3 global points elsewhere
compiles a dependency's deprecated bare-catch syntax under a version
that turns it into a hard build failure via warnings_as_errors --
unrelated to the generated service's own code. Hit this exact gap in
four repos today (reckon-db, evoq -- same root cause, unrelated to this
scaffold -- then hecate-sentinel and hecate-echo, both actually
generated by it) before landing the fix here. This repo itself was a
fifth, fixed alongside the template.

Verified: hecate_service_template_SUITE (generates a real service and
compiles it) still passes 8/8, a fresh manual scaffold produces a
correct .tool-versions, and the library's own 123 eunit tests are
unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1CrKkDyvYmEVmdJvVZjtd
Ships everything accumulated in Unreleased: the unguarded_capabilities/
audit-fleet-ucan-adoption UCAN-visibility feature (a real addition, the
reason this is 0.24.0 and not a 0.23.1 patch), plus three scaffold
fixes (this session's .tool-versions generation, lint.yml's Rust
toolchain, build-push.yml's concurrency guard).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1CrKkDyvYmEVmdJvVZjtd
Lets a service arm barrel_docdb's native per-document TTL sweeper on its
own read model instead of hand-rolling scan-and-delete retention code.
Additive and backward compatible: defaults to disabled, existing
ensure/2 callers see no behavior change.

Motivated by hecate-agora's storage-retention design (real barrel_docdb
primitive already covers what a bespoke pruning desk would have
duplicated).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QFHPxb2H9GANFJFMw1yB6F
capability().auth gains {realm_member_required, RealmDid, RequiredCan}
-- macula added this policy after PLAN_UCAN_GATED_CAPABILITIES.md was
written and explicitly called the realm-membership case unbuilt in
macula "today". auth_opts/1 needed no code change (already
policy-agnostic); the type and moduledoc were the whole gap. A
hecate-nvidia-pair implementation the same day had to bypass this
module entirely to use the policy, purely because the type made it
look unsupported through the normal path.

describe_rpc_capabilities/0 + describe_pubsub_capabilities/0 (both
optional): human-facing capability/topic documentation, distinct from
capabilities/0's/subscriptions/0's dispatch-wiring-only metadata. When
either is exported, boot/2 advertises a synthetic
<service-name>.describe_capabilities RPC (hecate_om_describe,
stateless) returning both lists live. Real motivating cost: macula-
lazymesh's MeshServices catalog hand-maintains a hardcoded description
list today purely because there's nowhere on the mesh to pull it from.

Both optional, matching store_id/0's/subscriptions/0's own precedent --
a service with nothing to describe implements neither and gets no
synthetic capability advertised at all.

131 eunit tests pass (8 new). RED/GREEN verified specifically on
capability_for/2's "undefined when neither callback is exported"
behavior. Dialyzer did not complete within a reasonable time in this
sandbox -- not run to a result, flagging rather than claiming clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFKNhxq5qzEXD6fbnFKjGg
macula encodes every map key as CBOR text, and its frame decoder turns a
key back into an atom only when that atom already exists in the receiving
VM. Otherwise the key stays {text, Bin}. field/2,3 looked up the atom form
and the binary form only, so such a key read as absent and the caller got
the default.

The lookup now tries the atom form, then the binary form, then
{text, Bin}. The first form present wins, as before. The moduledoc and
field/3's doc describe the new order.

New tests cover a text key reached from an atom literal and from a binary
literal, a text key whose atom does not exist, and the lookup order.
Without the fix, hecate_om_wire_tests gives 30 tests, 3 failures (the
three text-key cases); with it, 30 tests, 0 failures. Full run on OTP
28.4.2: rebar3 lint clean, rebar3 eunit 135 tests, 0 failures.

Refs #1

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xRyALYtnYX1D7u5AiGWGc
3fd17dd added describe_rpc_capabilities/0 and
describe_pubsub_capabilities/0 as optional hecate_om_service callbacks,
but hecate_om_SUITE:behaviour_attributes still expected 14 callbacks, 8 of
them optional. The case has failed every lint-and-test run since (run
34264550409 on 3fd17dd: 1 failed, 15 passed).

The suite now expects all 16 callback names and the 10 optional ones.
On OTP 28.4.2: rebar3 ct, all 16 tests passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xRyALYtnYX1D7u5AiGWGc
health_ip (optional) sets the address hecate_om's health listener binds, as a string such as "127.0.0.1" or an address tuple, and passes it to ranch as {ip, Addr}. Unset or empty, the listener binds every interface, as before. A service whose health is probed only from its own container or host can keep the endpoint on loopback. Tests cover the socket options and a loopback listener refusing a connection on another interface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UyWXBuNgV8YGRLRsCZJG95
hecate_om_identity treated every macula_identity:load/1 error as a first
boot: it generated a new keypair and saved it over the configured
identity_key_path. A corrupt file, a directory or unreadable file at the
path, or a key file readable by group or others (which the next macula
release refuses to load) therefore gave the service a new node id and
destroyed its real key, with nothing in the logs.

Now only {error, enoent}, a missing file, generates and saves a keypair.
Any other load error makes keypair_from/1 return
{error, {identity_key_unloadable, Path, Reason}}. init/1 stops with that
reason, so hecate_om_sup and the service refuse to start and the file is
left as it was.

Tests: a corrupt key file is refused and left byte-identical; a directory
at the key path is refused and stays empty, a real case even when tests
run as root; start_link with a corrupt configured key returns the error,
leaves the file unchanged and registers no process. First boot still
generates and persists a puzzle-valid keypair. The group-or-others mode
case needs macula 66c2c30 or later to go red; the same non-enoent clause
covers it.

On OTP 28.4.2: without the fix, hecate_om_identity_tests gives 18 tests,
5 failures (the corrupt file came back as a regenerated keypair and was
overwritten, the directory path came back undefined, start_link succeeded
and left the process registered); with it, 18 tests, 0 failures. Full run:
rebar3 lint clean, rebar3 eunit 146 tests, 0 failures, rebar3 ct all 16
passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xRyALYtnYX1D7u5AiGWGc
rebar3 ex_doc exited 0 on the release tree but printed warnings, and the
release checklist requires none. Following each one to its source found
more than broken links.

hecate_om_service's module doc never reached the generated docs. The
module has -doc attributes, so the compiler writes a Docs chunk into the
beam and ex_doc reads that instead of edoc's; the %%% @doc comment was
dropped without a word. It is now a -moduledoc, corrected on the way: six
required callbacks and ten optional ones (it said two), the store mode
store_mode/0 names, and the rebar3 new hecate_service template in place of
the templates/ directory removed in July. The callback docs used edoc
quoting inside markdown strings, which renders as broken code spans (three
of them warned, the rest broke silently); they now use backticks.

guides/read_model_services.md was linked from the mesh-native services
guide and from hecate_om_capabilities' moduledoc but was missing from the
ex_doc extras, so hexdocs carried a dead link. It is now published, with
its TTL section rewritten: it said hecate_om_capabilities sends no ttl_ms
and a dead service's advertisement lingers for 48 hours, but since 0.16.0
every advertisement carries four times the 30s republish interval.

The README described Quadlet templates, a manifest.json parser and
bloom-channel advertisement, none of which exist any more; it now
describes the hecate_service template and DHT-record advertisement.

References ex_doc could not resolve are reworded or given the right kind.
macula_direct_dial's discovery_uri/2 and adv_opts/1 are private (adv_opts/1
is exported only under TEST), macula_station_link is internal, macula_client's
auth_policy is a type, and supervisor:stop/1 does not exist. The guide's
macula:call/4 is call/5, and the call path uses call_station/7 (the facade
has no /8). hecate_om_service's capability/0 is a type and
describe_rpc_capabilities/0 and read_model_ttl_sweep/0 are callbacks, now
linked as such. An old changelog entry named hecate_om:call_capability/3,
the arity of that release; it keeps the arity and loses the link. Two old
changelog entries used edoc quotes in markdown and one left a backtick
unclosed; three references further down only surfaced as warnings once it
was fixed. The moduledoc also said the handler-bearing ttl_ms needed a
macula "past 10.11.1"; the fix shipped in 10.11.1 itself.

On OTP 28.4.2: rebar3 lint clean, eunit 146 tests, 0 failures, ct all 16
passed, dialyzer clean, ex_doc with no warnings. Checked in the generated
HTML: the behaviour page shows the moduledoc with callback links, the
callback docs render their code spans, the changelog's type and callback
references link to the behaviour page, and read_model_services.html
exists. Every external link in the README, changelog and guides answers
200; the only other URL, station.example in a shell example, is a
placeholder.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xRyALYtnYX1D7u5AiGWGc
Added since 0.24.0:
- health_ip (optional): the address the /health listener binds.
- describe_rpc_capabilities/0 and describe_pubsub_capabilities/0 (optional
  callbacks), served live through a <service>.describe_capabilities RPC.
- The {realm_member_required, RealmDid, RequiredCan} auth policy in the
  capability() type.
- read_model_ttl_sweep/0 (optional callback) arming barrel_docdb's TTL
  sweeper on a service's read model.

Fixed since 0.24.0:
- hecate_om_identity refuses to replace a key file that fails to load;
  only a missing file generates a keypair.
- hecate_om_wire:field/2,3 finds keys that arrive as {text, Bin}.
- hecate_om_SUITE expects the 16 hecate_om_service callbacks.

vsn 0.25.0 in src/hecate_om.app.src; the CHANGELOG's Unreleased section
becomes [0.25.0] - 2026-09-11.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xRyALYtnYX1D7u5AiGWGc
Fork of hecate-services/hecate-om (full history, v0.25.0) into
macula-services/mcl-om. No upstream PRs from here: the two lines
diverge, hecate-om keeps serving the classical fleet and mcl-om is the
PQ-only substrate.

This commit: the mechanical rename (hecate_om -> mcl_om everywhere),
plus the toolchain fixes a fresh build on modern OTP demands: meck
1.2.0 in the test profile, a nowarn_deprecated_catch override for
khepri 0.17 (via reckon_db), and the bare catch usages in our own
content module and tests converted to try-catch.

The macula floor stays ~> 10.0 for exactly one more commit: the 11.x
floor bump and port land together next.
The branch is red until the port lands; main stays on the green 10.x
baseline. PLAN_MCL_OM_11X_PORT.md is the module-by-module map, every
entry verified against the 11.3.1 source.
- mcl_om_identity: node key (purpose identity, pq_hybrid, puzzle-
  hardened) via macula_node_keys; pinned seeds (MACULA_STATION_SEEDS
  pairs index-for-index with MACULA_STATION_NODE_IDS; an unpinned seed
  refuses the boot); realm_trust and verify opts for the pool. The
  service cert and the org/realm CA accessors are gone with the cert
  authorization form.
- mcl_om_capabilities: one org-qualified registration per capability
  (11.x refuses bare names); the SDK's advertise path resolves the D25
  authorization; build_advertisement on the 11.x record field order;
  verify/2 under the configured profile; discovery keyed by
  procedure_key/2; the 7c cert-chain verify path deleted; call_station
  pins the provider as the Target.
- mcl_om_wire: retryable/1 over the 11.x binary/atom call_error codes.
- mcl_om: facade identity_key/0 replaces keypair/0; service_cert/0 gone.
The om compiles against 11.3. The test suite's port is next: the
failures are the tests still building 10.x keypairs (macula_identity
mecked) and calling the deleted procedure_uri/3 — capabilities tests
(68 calls), identity tests (44), ownership_proof (16), wire (6),
pubsub + content (a handful). The identity tests' keypair fixtures
move to macula_node_keys node keys; the capabilities tests drop the
bare-name and cert-chain cases.
The wire and API are incompatible with every hecate-om release, so the
PQ line starts at 0.1.0; the inherited history stays below in the
changelog.
The 11.x test port, completed against the live PQ fleet:
- test/: identity (node keys, pinned-seed env contract), capabilities
  (org_procedure, node-key signing, cert-chain/bare-key cases dropped),
  ownership proof (proof carries the carried public key), wire (11.x
  binary codes). mesh_pool SUITE on the 11.x seed shape; ct opts carry
  the crypto sys_config.
- test_live/: mesh_pool/pubsub/capabilities ported to puzzle-hardened
  node keys, pinned seeds and the D25 chain (published by the tests
  themselves), all against pq.station-fi-helsinki; the content live
  test is deleted — the PQ fleet serves no content procedures.
- The smoke paid for real port fixes in mcl_om_capabilities: the D25
  authorization embedded in the direct-dial record (via the SDK's
  provider_authorization/3, macula ~> 11.4), the CALL target as the
  provider's node id, the pinned dial triad, the SDK's retrying
  endpoint resolver, and a bound-variable map pattern in try...of
  (try_clause escapes try's catch) in the org browse filter.
- The mcl_service template: renamed off the hecate lineage and
  11.x-ported (crypto profile block, pinned seeds, no service cert);
  operator scripts follow. CI builds OpenSSL 3.6.4 + OTP 28.1 from
  source (ML-DSA keygen); publish-hex.yml + the publish guard scripts
  for the first hex release. Docs and PLAN_MCL_OM_11X_PORT.md updated
  to the shipped state.

Gates: eunit 141/0, ct 16/16, lint + dialyzer clean, live 5/0.
The ct runner spawns its test node without the job env on the hosted
runner: crypto.so resolved the SYSTEM libcrypto there and refused to
load (OPENSSL_3.4.0 not found), while eunit -- which runs in rebar3's
own VM -- loaded the PQ libcrypto fine and passed 141/0. Baking
-Wl,-rpath,/opt/openssl-pq/lib into the OTP build makes every binary
find the PQ libcrypto regardless of how a spawn inherits (or drops)
LD_LIBRARY_PATH.
The ct node boots barrel_docdb, whose rocksdb NIF links OpenSSL::Crypto
(encrypted-env AES): it pulled the SYSTEM libcrypto.so.3 into the
process before OTP crypto loaded, so crypto.so's own NEEDED resolved to
the already-loaded system library and its OPENSSL_3.4.0 version check
failed -- eunit never boots rocksdb, which is why it was green. Point
rocksdb's CMake (ERLANG_ROCKSDB_OPTS, the port's own override) at the
PQ openssl: whichever NIF loads first, the VM holds one libcrypto and
crypto.so finds the symbols it needs.
The lock already resolved 1.5.0 through the old ~> 1.3 range; the
constraint now says the intent, so a future lock refresh can't drift
below the newest line. Gates re-run locally against 1.5.0: eunit 141/0,
ct 16/16.
The workflows were burning ~18 minutes per run twice over: the
live-mesh-tests job cannot pass on GitHub-hosted runners (AAAA-only
stations, no IPv6 egress -- its own comment said so), and the check job
rebuilt OpenSSL + OTP + rocksdb/Rust from source on every single run.

- lint-and-test.yml: the PQ toolchain (OpenSSL 3.6.4 + OTP 28.1) builds
  into the workspace and is cached across runs; _build + the rebar3
  cache are cached too, with rebar3 upgrade --all after a restore so a
  cache hit never pins stale hex deps (the station repo's discipline).
  First run still pays the ~9 minute toolchain build; later runs
  restore it in ~1.
- live-mesh-tests.yml: the live smoke is now manual-dispatch-only
  (gh workflow run live-mesh-tests), sharing the toolchain cache, with
  a note on the self-hosted IPv6 runner being the real fix that would
  warrant wiring it back into push/PR.
The push/PR CI churn is retired: the gate stays available on manual
dispatch, and publish-hex.yml verifies every release tag itself.
port-11x: the 11.x port — test port, live smoke, template, publish pipeline
New mcl_om_claim worker (sup child after capabilities): once the pool
is connected, it calls the realm's request_provider_authorization_v1
over the mesh with this service's wire-authenticated identity — the
realm issues or records the pending request; either reply ends the
retries and the advertise path resolves the delegation independently.
Stops normally when no seeds are configured; retries while the pool
is connecting. service_name/box app envs are informational labels.
The service asks the realm for its D25 delegation over the wire at
boot, by its own authenticated identity; the realm issues or records
the pending request, and the advertise path resolves the delegation
once it exists.
This is the file someone reads to work out how to call a service, and it
described a mesh that is two majors old. Four places, all documentation, no
behaviour change.

1. The moduledoc said a handler-bearing capability is advertised TWICE, under
   the bare name and under the org-qualified one. advertise_one/6 makes one
   registration, org-qualified, because 11.x refuses a procedure with no org
   namespace (no_org_namespace). A reader following the old text would call
   the bare string and reach nothing, which is exactly how mcl-echo's README
   came to tell operators to call io.macula.echo.

2. The moduledoc said call_capability resolves under the org first and falls
   back to the bare any-provider key. resolve_at/4 looks up exactly one key
   and has no fallback branch. Its own inline comment was already correct;
   the moduledoc above it was not.

3. The reuse_sup note said the bare and org-qualified registrations each keep
   their own supervisor. There is one registration.

4. resolve_full/4's comment described tagging a fallback-to-bare hit with the
   bare CapName. There is no such hit to tag.

Added the 10.x contrast explicitly rather than just deleting the old text: a
caller written against the bare name does not silently degrade, it does not
arrive, and someone debugging that should find the reason here.

Flagged in place, deliberately not fixed: org_scoped_full_or_any/5 still
carries _or_any in its name and takes no such branch. It is exported, so
renaming it is an API change and does not belong in a documentation commit.

Verified: compiles, 141 eunit tests pass, elvis clean, edoc builds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A service with no realm trust anchor started, went green, answered /health and
was permanently unable to resolve anything org-namespaced. Traced off a
deployed box: with no realm key pinned, macula_client:realm_key/2 answers none,
macula_record:verify_authorization/3 refuses every advertisement with
no_realm_key, and macula_direct_dial reports
{unresolved, no_trusted_advertisement}. The boot claim never reached the realm,
so there was no pending row for an operator to approve, no delegation and
nothing callable. Every symptom was downstream of one unset variable, and
nothing anywhere said so.

BREAKING. realm and realm_key are both required now. realm_trust_opts/0 used to
fall through to an empty map, which made unset indistinguishable from
deliberately empty. It raises instead, and the pool does not start. An
unconfigured trust anchor is not a deployment that half works.

realm_key is a new app env: the realm's public signing key, hex encoded.
MCL_REALM beside it is an IDENTIFIER, sha256 of the realm name, and was never a
key. The two are different things and the old config only carried the first.

THE DECODE LIVES IN mcl_om, and that is the decision worth stating.
macula:connect/2 takes realm_trust as raw bytes and deliberately refuses
anything else, because it is a typed in-memory contract. A deploy environment
can only carry text. Translating one into the other is exactly what this module
already does for realm, 64-hex to 32 bytes, and for every seed's
expected_node_id. Putting it in the SDK would push deploy-shaped text into a
typed contract; putting it in a service means every mcl-* service doing it
again, which is the duplication that caused this. A malformed value names the
variable rather than raising a bare badarg out of the hex decoder.

THE SCAFFOLD TAUGHT THE BUG, so the template is fixed in the same commit. Its
sys.config.src carried realm_trust commented out, called it necessary only for
a service that CALLS org-namespaced capabilities, and said the realm's key
comes from a foundation_realm_trust_list DHT record rather than from that file.
That last claim is wrong for this path: macula_direct_dial never supplies the
foundation form, so the pinned key is the only way an advertisement is ever
trusted. Every service generated from the template inherited a mandatory
setting that looked optional. The template, its compose file and its README now
require MCL_REALM_KEY.

FOR WHOEVER MEETS THAT ATOM NEXT: trusted_stations/2 filters on the
authorization check AND a readable serving_station in the record. A record
missing the latter is dropped silently and produces the identical
no_trusted_advertisement. Do not assume it is this cause.

Verified: the four new tests FAIL against the committed pre-fix module, 5
assertions red, and pass with the fix. Full suite 146 tests 0 failures, elvis
clean, edoc builds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The pool asked for webpki and it never meant anything. macula 11.4.0's
start_dial/1 read only alpn and timeout_ms off the dial target and passed a
literal verify none, so the value was decorative and every mcl-* service
connected regardless. 11.5.0 fixes that bug and honours the target's value.
A default nobody chose would then start deciding whether a pool can reach the
mesh at all.

Nothing is lost by not checking the chain. What binds a station link to the node
it dialled is the D16 handshake pin: expected_node_id is required and a link
without one refuses to start. 11.5.0's own dial_opts/1 states it plainly, that a
station's leaf is self-signed or issued by an unrelated PKI and the signed
handshake binds the connection rather than the chain. Checking the chain as well
adds nothing the pin does not already give, and it makes reaching the mesh depend
on a public CA and on a certificate renewal nobody is watching. A lapsed or
rotated cert would take every mcl-* pool offline for a reason with nothing to do
with the mesh, and nobody would look there first.

macula-station accepted the same argument for its own outbound links in e07010d.
This is the consumer side, which never got the equivalent.

THE SCAFFOLD IS WHY THIS MATTERS MOST. priv/templates/mcl_service/sys.config.src
sets no verify at all, so the library default is what every mcl-* service yet to
be written silently inherits. Fixing the default fixes all of them before they
exist.

MCL_OM_VERIFY=webpki stays as the opt-in for a caller that genuinely has a chain
worth checking, which is the shape dial_opts/1 documents. Any other value now
names the variable instead of silently selecting a mode. verify => true was the
10.x spelling and still appears in this repo's own older guides, so a stale
deploy carrying it is not hypothetical, and under a silent fallback it would get
whichever mode the fallback happened to be while its operator believed they had
asked for the other.

Tests first, and verified failing before the change: with MCL_OM_VERIFY unset,
base_pool_opts/0 returned verify => webpki, and "true" silently returned webpki
as well. base_pool_opts/0 is exported for the suite because the composed map is
what reaches macula:connect/2, so asserting there rather than on verify_mode/0
alone catches a regression in either half. Full suite 150 tests, 0 failures,
elvis clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The verify_mode default flip and its loud refusal of an unrecognised value.

Minor rather than patch in 0.x: it changes a default that reaches every
consumer's pool, and it adds a boot failure on a value that used to be
silently tolerated. Consumers on "~> 0.2" take it without a constraint change.

is_checkout_publishable.sh derives the tag from {vsn, ...} in src/mcl_om.app.src
and requires a CHANGELOG section for it, so the bump and the section name are
what make v0.4.0 publishable at all rather than bookkeeping after the fact.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This repo's next tag would have failed to publish, silently and with no
reason printed, and nothing here would have changed to cause it.

`rebar3_hex` 7.3.0 was published upstream on 2026-09-22 and reads NO
environment variable for authentication. With the plugin unpinned, a tag
run fetches it, ignores `HEX_API_KEY`, resolves no credentials, and dies on
`{badmatch, #{...}}` at `rebar3_hex_publish.erl:372` with the bare message
"Uncaught error in rebar_core". Nothing reaches hex.

Found on macula's `v12.0.0`, which failed exactly this way today. This repo
last published on 2026-09-21 with 7.2.0, hours before 7.3.0 existed, so it
looks healthy and is not.

⚠ The publish workflow's `--dry-run` guard cannot catch this: a dry run
never authenticates, so it passes with a placeholder key while the real
publish dies.

7.2.0 reads `HEX_API_KEY` in `rebar3_hex_config.erl`. Verified on macula by
running the publish under the pin with a throwaway config dir and an
invalid key: it resolves 7.2.0, reaches hex.pm and is refused by name.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
macula 12 refuses 'verify' in any value -- on a seed, at connect and in
call_station opts -- so the pool composes none and MCL_OM_VERIFY,
verify_mode/0 and verify_mode_of/1 are gone with the three modes they
chose between. A client verifies the station's own ML-DSA-87 certificate
and nothing else; what binds a link is still the D16 expected_node_id pin.

D30 makes the puzzle difficulty one fleet constant (still 8), and macula
now REFUSES a {macula, puzzle_difficulty, _} setting at application start
whatever its value, so it goes from test.sys.config and from the service
scaffold every future mcl-* service inherits. The generate/3 option of
the same name is untouched.

Raf's 2026-09-23 ruling gives a machine one stored identity, so a suite
that leaves node_identity_path unset reads -- and on a fresh machine
writes -- the identity of whatever is running it. The suite now uses its
own key file. The machine's key is not touched.

The three pool_verify_* tests are replaced by one that asserts the new
contract rather than dropping the coverage.

148 tests, 0 failures against macula 12.0.0-alpha.1 via _checkouts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The version follows 0.4.0 directly as 0.26.0: this repo already carries
tags v0.5.0 to v0.25.0 from the hecate_om era, and they stay untouched.
A minor bump either way, because removing MCL_OM_VERIFY and
verify_mode/0 breaks consumers. The CHANGELOG's Unreleased section
becomes 0.26.0.

The service scaffold and the anatomy guide now ask for ~> 0.26, so a new
service cannot resolve a pre-macula-12 mcl_om that cannot start a pool.

rebar3_ex_doc and rebar3_lint are pinned to the versions this tree was
verified with (0.3.0, 6.0.0). The pin is inside the tag, so if a plugin
moves between a green run and the tag, a re-run cannot fix it.

Also points a stale doc reference at identity_key/0. keypair/0 has not
existed since the PQ port, and the docs build warned on it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mcl_om_claim:init/1 returned {stop, normal} with no seeds, which a
supervisor reads as a failed start, taking mcl_om down with it. It
returns ignore now.

mcl_om_mesh_pool_SUITE's seeded cases never configured the realm trust
mcl-om requires, so they failed before reaching macula. They pin a
generated realm key now. Mutation-checked: verify => none back in
base_pool_opts/0 turns the suite red with one_verification_mode.

Both were red on main before the macula 12 port, unseen because
lint-and-test only runs on workflow_dispatch. Released as 0.26.1.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
generate_and_save/1 returned undefined when saving a new identity key
failed, so the service ran on a throwaway identity and generated another
on every start: a new node id per restart, silently. It now returns
{identity_key_unsaveable, Path, Reason}, which init turns into a stop,
the same as an unloadable key already did.

The scaffold's compose file mounts a named volume, <repo>-secrets, at
/etc/mcl/secrets. With nothing mounted there, docker gave each recreated
container a new anonymous volume, and so a new identity per watchtower
roll. The volume is named explicitly so a different -p cannot fork it.

Both test-first (seen red: got undefined; got nomatch). Released as
0.26.2.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
It was manual dispatch only, which is how rebar3 ct sat red on main
until 0.26.1 with nobody seeing it. Docs-only pushes skip it
(paths-ignore on **.md, guides/**, LICENSE).

The toolchain is now the public macula-ci-otp image pinned by its dated
tag, 20260923-0912 (OTP 28.4.2, ML-DSA OpenSSL, rebar3, Rust, cmake),
instead of OpenSSL 3.6.4 + OTP 28.1 built from source. A step refuses
anything but exactly 28.4.2 with mldsa87. Only the hex package cache is
kept; nothing that can hold a module is cached.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Every deployed mcl-* service holds an identity key written by 11.4
(mcl-echo's on beam00 is 10401 bytes, 11.4's size; 12 writes ~5540).
Crossing to 12 must load it with the same node id, which the realm's
delegation is bound to, and leave the file untouched.

The fixture is a throwaway pq_hybrid key written by macula 11.4.0's own
macula_node_keys:save/2, 10401 bytes; the expected node id is the one
11.4.0 computed for it. Green on first run, so checked by mutation:
making node_key_from/1 regenerate instead of load turns it red with a
different node id.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
It said mcl-* services ride "the 11.x wire" and that mcl-om talks via
"the 11.x macula SDK"; both are macula 12 now. Also checked against the
tree and corrected:
- status said v0.14.2 (a hecate_om-era number); it is 0.26.x
- the facade has identity_key/0, not keypair/0
- the generated workflows are lint and build-push, not lint-and-test
- the generated compose mounts the <repo>-secrets identity volume
- the ">= 0.3.4" note was hecate_om version history, gone
- hecate-daemon, hecate-spartan and hecate-rag were cited as live;
  they are obsolete. Consumers are mcl-echo, mcl-warden, mcl-sentinel
- scaffold directory and example data_dir named hecate paths

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The template published :latest on tag pushes too, and watchtower rolls
every box on :latest, so cutting a release deployed it. A v* tag now
publishes its own version only (the shape mcl-echo already uses).

A docs-only push no longer rebuilds :latest. The decision is a generated
script, scripts/is_image_push.sh, reading the pushed range, not
paths-ignore: GitHub evaluates that filter on the head commit alone for
the push that creates a branch, so a first push ending in a docs commit
built no image (hit on mcl-warden). The script builds on every case it
cannot read: all-zeros before, no before, a before not in the history,
an empty diff.

Test-first: the template suite runs the generated script against a real
git history, one push shape per assertion, and checks the workflow has
no path filter and a single :latest. Mutation: the zero-sha rule and the
unreadable-range fallback are independent guards, so each survives its
own removal; removing both turns the suite red.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A provider with no grant looked healthy while serving nothing: the
advertise path asked macula:provider_authorization/3 every tick, dropped
the refusal and retried quietly. The answer is kept per org procedure in
a protected ETS table (read without a call, so /health never waits behind
a republish) and judged by mcl_om_provider_grant:

- procedure_delegation not_found: degraded at once (an operator grants);
- org_directory not_found, or any other refusal: waiting for
  provider_grant_grace_ms (default 60 s) from the first failure of the
  run, then degraded; macula's reason as given.

mcl_om_health combines it with the service's own verdict (the service's
wins when not ok), and every /health body lists provider_grants.

Test-first: classifier, combination and handler body are pure and tested;
a live zero-seed-pool test checks the capabilities server records the
answer. Mutation: dropping the table insert turns that test red.

Also releases the scaffold build-push fix as 0.26.3.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The scaffold's builder was erlang:28-alpine and lint erlang:28; Docker
Hub moved both on 2026-09-22 and mcl-echo, generated from this, shipped
OTP 28.5 without anyone choosing it. Team standard is now 28.4.3, which
Docker's own erlang does not publish, so both are hexpm images pinned by
index digest: builder hexpm/erlang:28.4.3-alpine-3.22.6 (the runtime
stage's Alpine), lint hexpm/erlang:28.4.3-debian-trixie-20260918, and
lint's first step refuses anything but 28.4.3 with mldsa87. Public
images on purpose (leaks_no_house_specifics).

The generated service's runtime guard compared majors only (it passed on
28 vs 28.5) and could not parse a pinned lint image, which would have
failed every newly scaffolded service's first eunit run. It compares full
releases across builder, lint image, lint check step, .tool-versions and
the VM, and requires the digests.

mcl-om's own CI moves to macula-ci-otp:20260923-1347 by digest (OTP
28.4.3), .tool-versions and the hex publish to 28.4.3.

Test-first: generated_service_is_pinned_to_one_otp (red against the
28.4.2 template), and generated_runtime_guard_passes, which compiles the
GENERATED guard inside the generated repository and runs it (red with
badmatch before the guard fix). Gate run inside macula-ci-otp:20260923-1347:
lint 0, eunit 167/0, ct 22/22, dialyzer 0, hex build 0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The header said `publish` "waits in the hex-publish environment until its
required reviewer approves it", and a step comment spoke of "before
anyone is asked to approve". Neither is true, and by design: a pushed
v*.*.* tag IS the release. Checked against the environment itself via
the API: its only protection rule is a deployment policy allowing tags
matching v*.*.*, it holds HEX_API_KEY, and it has no reviewers. Comments
only; the environment is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The key lives only in the hex-publish environment, which admits v* tags
alone, so nothing can inspect it before a tag. A blank key (mcl-embed,
2026-09-23) or a revoked one failed only inside `rebar3 hex publish', as
"No write key found".

The publish job now runs scripts/is_hex_publish_key_live.sh right after
checking out the tag, before anything reaches hex:
- an empty HEX_API_KEY is refused by name;
- GET hex.pm/api/users/me with the key: 401 (no key, or not accepted)
  refuses; 200 or 403 (valid key without read scope, e.g. publish-only)
  accepts; anything else (hex.pm unreachable) refuses, since publishing
  would fail too.
The value is never printed. The secret is read at run time, so after
fixing the key a re-run of the job is enough: nothing was published and
the version is not burned.

Verified locally: empty -> refused; a garbage key -> hex.pm answers 401,
refused; hex.pm unreachable -> refused; a stub answering 403 -> accepted.
The step order was checked by parsing the workflow: after "Check out the
release tag", before "Publish the package and docs". Whether a real
publish-scoped key gets 200 or 403 is confirmed on its first run; both
are accepted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
It sent readers to macula-demo, which drives nothing any more. Rewritten
from Terra's account of beam00, checked against macula-fleet origin/main:
the hecate-reconcile timer runs edge/gitops/reconcile.sh every 2 minutes
over edge/<box>/reconcile.manifest; watchtower is the default image
updater (reconcile.options); public config in a committed per-box env
file; secrets once in ~/.hecate/secrets, 0600. A missing secret is no
longer silent: reconcile.sh logs "[reconcile] FAILED: <project>" to its
journal. Health ports bound on beam00 updated.

The scaffold's house-specifics test also forbids "macula-fleet" now, as
it forbade macula-demo.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The pinned lint image (hexpm/erlang:28.4.3-debian-trixie) carries OTP and
little else: no rebar3, git, curl, C toolchain or OpenSSL headers. Every
check here read the workflow's text, which was right, so a generated
service's first push died on `rebar3 version` unseen (found by Pluto).

The toolchain step now runs before checkout (checkout needs git for a
real clone) and installs git, curl, cmake, build-essential, libssl-dev,
the codec libs, and rebar3 3.27.0 verified by sha256; the image build
installs the same rebar3 the same way, not whatever S3 served. libssl-dev
is the same Debian version as the libcrypto the image's OTP links, so the
VM keeps one libcrypto. The image stays public (leaks_no_house_specifics).

scripts/is_lint_toolchain_runnable.sh runs a lint.yml's marked toolchain
block inside the image it names. The template suite runs it on the
generated lint.yml (red first: rebar3 not found, 127); where no runtime
exists it skips by name, and a template-lint-image job on the bare runner
runs it in CI. generated_rebar3_is_pinned_by_sha256 (red on the old
Containerfile). Also removes the guard beams the runtime-guard case left
in the generated repo: its bytes made no_unrendered_variable_survives
flaky (the failed run's log names the .beam).

End to end, once, on a freshly generated service in the pinned images:
lint 0, its 10 tests pass, its image builds on OTP 28.4.3.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mcl_om_capabilities advertised under mcl_om_identity:org/0's `_'
placeholder when no org was set: `_/Name', which no realm grants, from a
service that looked healthy. It now advertises nothing unless the org is a
wire segment, logs once, and records each handler-bearing procedure as not
granted with {org_unset, Org}; mcl_om_provider_grant makes that degraded
at once (operator_must_set_org). The live capability tests move to a real
org, since under `_' they would no longer reach the SDK and pass for the
wrong reason; `_' has its own test (red first).

The scaffold sets {org, <<"<repo>">>} in sys.config.src (one org per
service, named after the repository, fixed in the release). Its README,
compose and sys.config no longer describe 11.x, a classical-profile
fallback macula 12 does not have, or CI publishing :latest on tags; the
README states the two image channels and where the org comes from.
Comments no longer name obsolete services, and the house-specifics test
forbids that prefix in generated output. Tests: generated_service_has_its_org
and generated_text_is_current (red first); the rendered sys.config parses
after substitution.

Released as 0.26.4, carrying the template fixes already on main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
scripts/is_hex_publish_key_live.sh asked hex.pm /api/users/me. For a key
with no user behind it, an organisation key like this package's, that is
404, which the script took as "could not check" and refused. The v0.26.4
publish run stopped there: nothing was published, the version is not
burned. The same secret published 0.26.1-0.26.3 today, and an
unauthenticated /users/me is 401, so 404 meant "authenticated, no user".

Publishing needs the key to WRITE, which hex answers at
/api/auth?domain=api&resource=write: 200/204 accept, 401 (not a key hex
accepts), 403 (no write permission) and anything else refuse.

mcl_om_hex_publish_key_tests runs the script against a one-shot fake hex
API on localhost: the endpoint asked, the exit code per answer, and that
the key never appears in the output. Red first (it refused 204 and
accepted 403).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
v0.26.4 (164456c) was tagged, but its publish stopped at the key
preflight, which refused a working key; nothing was published. 0.26.5 is
that release plus the preflight fix (8280145). The v0.26.4 tag stays
where it is, per Raf, and the CHANGELOG says so.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mcl_om_ownership_proof:verify/3 read timestamp, signature and public with
maps:find/2 on atom keys. A proof decoded by macula's codec carries every key
as {text, Key}, so every proof a caller actually sent was refused as
missing_proof, forged and genuine alike, before a signature was checked. The
fields are read through mcl_om_wire:field/2 now.

The suite's wire-shaped test built that shape by hand with atom keys; two new
tests send the proof inside a CALL through macula_frame and verify what comes
out. Release 0.26.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- lint.yml runs `rebar3 dialyzer`, and rebar.config puts macula in the PLT
  (`plt_extra_apps`): a service's handlers implement macula_response and call
  macula, which reaches it only through mcl_om, so dialyzer saw neither.
- .gitignore ignores /data/, where barrel_docdb writes its system databases
  when a read-model service's eunit suite starts it.
- The CHANGELOG said a v* tag publishes :latest too; build-push.yml publishes
  :latest from main only. The CHANGELOG now says what the workflow does, and
  the stale-text check folds whitespace so a phrase wrapped over two lines is
  caught.

mcl_service_template_SUITE rendered whatever templates were INSTALLED in
~/.config/rebar3/templates, which from a worktree are another checkout's: it
passed or failed on files it never looked at. It now refuses, naming both
paths, unless the installed templates are this checkout's own (same file after
following links). Verified: 20/20 against this branch's templates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mcl_om_service moduledoc still sent readers to `rebar3 new hecate_service`
and priv/templates/hecate_service. The read-model guide's running example is
now macula-services/mcl-stations, and the mesh guide's streaming example
mcl-tube. Incident history that names hecate services stays as written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
barrel_docdb brings the erlang rocksdb binding, whose C++ build every service
paid for in CI, image builds and local tests, read model or not; three
services use one. The read-model wiring leaves mcl_om: the optional
read_model_id/0 and read_model_ttl_sweep/0 callbacks, mcl_om:read_model/0 and
mcl_om_read_model, with the dependency. data_dir/0 stays for the reckon-db
store. The CHANGELOG carries the migration for a service that had a read
model; mcl-stations is the worked example.

Also for 0.27.0: lint-and-test runs dialyzer and drops the rocksdb codec libs;
the template's rocksdb packages say they serve a service that adds a read
model; service_anatomy.md describes the service-owned read model;
CONTRIBUTING names mcl_om and its issue tracker, not hecate_om.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The service_name and box a boot claim shows the realm's operator came only
from mcl_om's app env: two services set box, seven set no service_name, and
the template set neither, so claims reached the realm desk unlabelled.
mcl_om_claim:labels/0 takes the app env, else the OS variable, and for
service_name finally the service's own info/0 name, so no service needs a
sys.config line. The template's compose sets MCL_SERVICE_NAME to the repo and
passes MCL_BOX through from the deploying host; its README lists both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A service with no usable org (unset, empty, `_`, an unexpanded ${MCL_ORG},
anything that is not a wire segment) booted, logged "advertise skipped, no
org configured" and ran green without advertising or claiming: a bot on
beam01 went unnoticed that way. mcl_om:boot/2 now refuses before wiring
anything, naming the setting; mcl_om_identity:checked_org/1 is the rule.

mcl_om_claim:labels/0 treated an empty app env value as a label, so a
sys.config `{box, <<"${MCL_BOX}">>}` with the variable unset sent an empty box
instead of falling back. Empty now falls through to the OS variable and the
service name.

Tests first: mcl_om_org_tests (7 refused shapes, 4 accepted),
mcl_om_claim_tests (empty app env), mcl_om_SUITE boots a service on an
unexpanded ${MCL_ORG} and expects the refusal. The SUITE's other cases now
boot with an org, as every service must.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A capability may set `handler_timeout_ms`, 1 to 600000: how long
macula_response waits for its handler before answering the caller
temporary_relay_failure. It was a fixed 30 s, so a slow handler's success
reached its caller as a failure (mcl-git capped its own work at 25 s to stay
under it). Passed through to advertise_direct; absent means macula's 30 s
default. macula_streamer has no such option, so a streamer capability that
sets one is refused by name rather than advertised as if it took effect.
macula floor ~> 12.2. Test first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macula 12.2's macula_publisher returns {ok, Pid} before announcing, so a
failed start announcement ends the publisher after the start; a crashed
publish worker ends it too. Started with start_link from the caller, either
exit killed the service process that called mcl_om_pubsub:publish/2.

Each publisher now runs under a watcher that traps its exit: an abnormal
exit is logged, counted (failed_publishes/0, and `failed_publishes` on
/health), and answered to a sync caller at once as
{error, {publisher_exited, Reason}} instead of after its timeout. A start
that raises answers the caller {error, {publisher_not_started, Reason}}.
`publisher_opts` passes macula_publisher's own options through, so
`announce => false` publishes the payload without the two fact frames.
publish/2,3 keep their contract. Test first, failures injected through
macula_publisher's publish/fact_publish options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build-push passes github.sha as REVISION and the runtime stage labels the
image org.opencontainers.image.revision, as mcl-mpong, mcl-echo and
mcl-stations now do. Test first in the template suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The realm's Providers desk counts a node online only while it has an
unexpired procedure advertisement signed by it, so a publish-only service
(the mpong bots) advertised nothing and always showed offline while it
worked. mcl_om:boot/2 now adds `info` to every service's capabilities,
advertised through the same delegation path (it appears once the org is
admitted), open to any mesh caller.

The reply is public facts only, strings as {text, _}, no booleans: name,
version, description, service_name, box, org, node_id (hex), macula and
mcl_om versions, uptime_s, the health word and the Org/Name procedures it
advertises. The health word comes from mcl_om_health:last/0, the verdict
/health last computed, never a fresh probe per call, so an open caller
cannot drive the service's own health checks. A service that declares its
own `info` refuses to boot: {mcl_om_capability_name_reserved, <<"info">>}.

Tests first: the reply shape, public keys only, the verdict words, a round
trip through macula_frame (every string arrives as text), the name clash,
and a booted service answering. READMEs updated; mcl-om's status said 0.26.x.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The template's runtime stage was `FROM docker.io/alpine:3.22`, a moving tag,
while the builder was pinned by tag and digest: two builds of one commit
could run on different bases. It is now alpine:3.22.6 by its index digest
(checked against Docker Hub's registry, which also serves it for 3.22 today),
the Alpine release the builder compiles against.

The generated runtime guard requires the runtime digest and that the builder's
and the runtime's Alpine releases match; mcl_service_template_SUITE asserts
both on the generated service, and runs the guard. Test first. mcl_om 0.28.1.

Fixes #4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The many-provider contract model (a thousand book clubs, one
get_bookclub_by_id) needs a caller-side pin: resolving under Org/Name
returns every provider, a club that does not own the asked id answers
not_found, and not_found is a valid answer, not a failover signal --
so the wrong club wins by record order. The fix is a pin, not a smarter
retry: Opts gains advertiser => node_id, the caller names the node that
published the facts it consumed, only that provider is dialed, and a
stale pin fails closed as {error, no_provider}.

mcl_om:call_capability/5 is the facade; pinned_providers/2 is exported
and unit-tested.
boot/2 now runs ServiceMod:start/1 BEFORE registering capabilities and
wiring subscriptions: a procedure is advertised only once the service
can answer it, and a service that refuses to start leaves no
advertisement behind (issue #2). The CT suite gains the refusal fixture
and the ordering proof -- the dummy's capabilities/0 answers only while
the worker its start/1 spawned is alive, so the existing boot case
fails red if registration ever moves back before start.

The advertiser pin and this fix ride one release: 0.28.2.
Issue #5's headline (resolve_full drops the org-key advertisement) was
read from a collapsed error: the pinned call for one club returned
{error, no_provider} because call_providers' failover turned every dial
failure on the last candidate into no_provider -- the same answer as a
stale pin, so the diagnosis went into the resolve path while the real
failure was the dial timing out.

- call_capability: no_provider now means exactly "nothing to dial"
  (nothing resolved, or the pin matched none); a provider that WAS
  dialed reports its own failure ({error, timeout},
  {error, {station_endpoint, Reason}}, ...).
- find/2's resolve budget is wall-clock (5s), not a retry counter: a
  slow DHT used to stretch one resolve to ~255s inside the capabilities
  gen_server (lookup/1), wedging every capability call behind it.
  lookup/1 and list_org_capabilities/1 now wait 15s, past that bound.
- /health gains advertise_liveness: per procedure, the last successful
  advertise age and the last failure, degrading when the loop is stale
  or has never succeeded -- ok + failed_publishes: 0 could hide a dead
  advertise loop, because zero is exactly what a loop that makes no
  attempts produces.
- test_live: a two-providers-under-one-org fixture on the real station
  (both records resolve, the pin dials the named provider, a stale pin
  fails closed, the displaced provider fails with a real dial error) --
  the fixture issue #5 named the gap.
The fleet symptom (one club's pinned call failing) is not a resolve
drop: a station's remote_advertise_registry is single-provider per
(realm, procedure), last direct ADVERTISE wins, so two providers of one
procedure that name the same serving station are not both dialable.
The record's station was the SDK's first-connected link (map-term order
over the seeds -- alphabetical host name, nothing a deploy can steer),
so both clubs named one station.

advertise_direct now gets a publish_advertisement opt that names the
station choose_serving_station/2 picks for THIS node (phash2 over the
sorted connected stations): providers spread whenever there are
stations to spare, stable across republish ticks. Unit-tested with the
estate's two real node ids as the regression (they must land apart).
The 0.29.0 spread named distinct serving stations in the DHT records,
but the ADVERTISE frame still went out on the SDK's default fanout to
EVERY connected link -- so two providers of one procedure on
overlapping station sets kept fighting over every shared station's
registry (one advertiser per (realm, procedure), last direct ADVERTISE
wins), and the pinned calls kept flapping live on beam03.

A response capability now registers its handler only on the link of
the station its record names (the SDK's advertise opt, replicating the
same pool-signed provider advertisement and realm-key authorization
check), so each station's registry holds exactly its own providers.
Streamers keep the default advertise. Unit-tested: exactly one
ADVERTISE frame, on the chosen station's link.
Raf, 2026-09-25: delete rather than rewrite. No mcl service called
mcl_om_content (grep across macula-services: only build artefacts), and
macula 12.6.0 (D27) made share_content/get_content/unshare_content the
calls a service wants. Removes mcl_om_content, mcl_om_content_feeder,
mcl_om_content_downloader and their tests; the guide's chapter 4 now shows
the macula calls with #{org => Org}. Breaking for a 0.x: 0.30.0. mcl_om
keeps requiring macula ~> 12.2; a service that shares content requires
12.6.0 itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macula 12.7.0's `stations => [Station]' registers an advertisement on
those stations' links only and names the first in the DHT record, which
is what mcl_om's `advertise' and `publish_advertisement' overrides did by
hand through the internal macula_station_link:advertise/6 (issue #5).
advertise_one now passes `stations => [serving station]' and neither
override; a streamer is registered on its serving station too. With no
connected station nothing is advertised and /health records no_station.
The overrides and their exports go. macula >= 12.7.0, which also brings
the pool's renewal of an advertised chain (D32) to every mcl service.

Tests first, seen red: advertise_direct got no `stations' ([none,none]),
and was called with no connected station (1 call, expected 0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rebar3 ct exits 0 on a case that skipped itself, so a suite whose tests
never ran reads as green (macula#43). The test profile takes
macula_testkit ~> 0.2, and its cth_skip_is_failure hook turns any skip
without an allowance into a failure.

One case is allowed to skip: generated_lint_toolchain_runs_in_its_image
needs a container runtime, and the template-lint-image CI job runs it where
one exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
reckon_evoq 2.7.0 read snapshots back empty (reckon-db 5.5.2 already
unwraps them, and reckon_evoq unwrapped again), so an aggregate reloaded
past a snapshot rebuilt from nothing. The fix ships in 2.7.2 (2.7.1 never
reached hex). Most services get reckon_evoq only through mcl_om, so the
floor lives here. evoq 1.26.1 measures telemetry durations on the monotonic
clock in native units.

Test first: mcl_om_dependency_floors_tests reads the versions actually
built; it failed on reckon_evoq 2.7.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1 signs identity, time and procedure only: no payload field, no domain
tag, version or realm, and replayable for 60 s into a learn_link that is
not idempotent. v2 signs a deterministic CBOR message with a tag, a
version, the realm, a nonce and the payload as the handler receives it,
minus asserted_by and the station-merged caller. An mcl_om-owned replay
cache takes the nonce only after the signature verifies. Realm-join
proofs keep the v1 layout, out of scope. Reviewed once by Fable; its three
required changes and five observations are applied.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1 signed identity, timestamp and procedure only: a relay holding a
captured proof could make the same identity assert anything within 60 s,
across realms, and replay it identically into a learn_link that is not
idempotent. v2 signs deterministic CBOR (macula_record_cbor:encode/1): a
domain tag, version 2, identity, realm, procedure, a nonce, and the payload
as the handler receives it, minus asserted_by and the station-merged
caller, re-encoded raw with a decoded null as null. make/5,6 applies the
frame's own wire conversion so the signer encodes what the verifier
rebuilds. A supervised replay cache takes a nonce only after the signature
verifies. verify/3 and message/3 are removed (breaking): nothing live
depends on v1 asserted_by.

Test first: the payloads travel through macula's frame codec and the
caller merge; a mutation that stops signing the fields fails all six
field-tamper tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macula-go's ownershipproof package reproduces this module's message/6 byte
for byte and verifies an Erlang signature over it, from a vector emitted by
mcl_om 0.32.0 (91e59d8). The same four files now live here too, and a test
holds mcl_om to them: the message bytes, the identity's derivation from the
carried key, and the signature. A change to the format now fails on both
sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From macula 12.11.1, macula_station_link:with_caller/2 removes a
caller-sent text "caller" before the handler reads the payload, so a
signer that included one was refused bad_signature by 0.32.0, which
dropped only the atom. make/5,6 and the verifier now drop caller in every
key form, as they drop asserted_by: the same result on any macula version.
The test helper that delivers a payload mirrored the caller merge by hand
and skipped the removal, which is how this passed; it now mirrors
with_caller/2 and a test pins that step (macula does not export it).

The cross-SDK vector is repinned to macula-go ownershipproof d48601b (no
caller in the fields; erlang_payload.hex checked), and mcl_om_wire's
moduledoc no longer describes pre-12 key atomisation.

Found by Neptunus's macula-go interop, through Fable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pq_hybrid key includes RSA-4096, whose generation takes seconds on a
GitHub runner. corrupted_first drew about five fresh keys, outlived eunit's
default 5 s timeout in macula_node_keys:generate, and the fixture was
cancelled with it: '232 tests, 0 failures, 2 cancelled', exit 1 (the
macula#43 shape). The fixture now makes a pool of four keys once, in setup,
hands them out in rotation (so a test that needs two distinct keys gets
two), and the whole group, setup included, runs under an explicit 600 s
timeout. Test-only; mcl_om 0.32.1 on hex is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mcl_service template built on hexpm/erlang:28.4.3-alpine-3.22.6 and ran
on alpine:3.22.6, while every running mcl service (mcl-tube, mcl-sentinel,
mcl-warden) builds in macula-ci-otp:20260923-1444 and runs on
macula-pq-runtime:20260923-1444. Each new service was born on retired images.

The generated Containerfile now matches the fleet's stage by stage: FROM
builder_image and runtime_image, two new scaffold variables pinned by digest
whose defaults (named once, in the template manifest) are the fleet pair. The
builder installs nothing (the image carries OTP, rebar3, Rust, a C toolchain)
and asserts OTP 28.4.3 with mldsa87 first; the musl-only env is gone; the
runtime stage installs nothing. The generated lint job runs in builder_image
and checks each tool the build needs. The generated guards compare the
asserted releases and require lint and the builder to name one image.

scaffold-service.sh passes MCL_BUILDER_IMAGE / MCL_RUNTIME_IMAGE through and
refuses half a pair. The template suite scaffolds through the script with the
house defaults and checks the pair; the stranger generation must name no
macula-io image. CI's template-lint-image job scaffolds a house service first,
since the template's lint.yml now names its image as a variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From Fable's review of 482fa0e.

- The fleet statements were false: mcl-echo (and mcl-graph) still build on
  the hexpm Alpine pair and the rocksdb services use the rocksdb pair. README
  and CHANGELOG now name who moved. The generated Containerfile no longer
  narrates mcl-om's history; the CHANGELOG keeps it, plus the other reason
  for a Debian builder: JS actions cannot run in an Alpine container.
- One build image per repository: the check job moves from macula-ci-otp
  20260923-1347 to 1444, the scaffold's builder, and the template suite
  fails when they differ.
- template-lint-image reads the check job's image by its path with yq,
  not the first image: line, and asks ghcr anonymously, by digest, whether
  the house pair is still published (scripts/is_image_published.sh).
- The rocksdb trap regains its symptom: a missing compression -dev package
  is silently dropped by CMake and barrel's snappy blob compression fails at
  db_open.
- scaffold-service.sh refuses an exported but empty MCL_BUILDER_IMAGE or
  MCL_RUNTIME_IMAGE instead of falling back to the house pair.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macula 13 seals a call to the KEM key the provider's signed advertisement
names (E2E payload confidentiality, Amendment A1), and refuses a
call_station that carries no signed state (no_signed_state). call_providers
now passes the advertisement its resolve already verified (the provider
map's `record`) as `advertisement`. macula seals to its key, or calls in
the clear when it names none, and a station can withhold it but never
downgrade the call. The macula constraint moves to ~> 13.0. A unit test
(call_providers exported under TEST, the endpoint lookup and
macula:call_station meck'd) asserts the advertisement and the pinned
station reach the call. The module passes against a local macula 13
build, 54 of 54.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New app env `mesh`, `optional` (default, unchanged) or `required`. With
`required`, init/1 stops with {mcl_om_mesh_unconfigured, #{missing => [...]}}
naming each of MCL_REALM, MCL_REALM_KEY, MACULA_STATION_SEEDS and
MACULA_STATION_NODE_IDS that is unset, empty or left unexpanded by relx.
An unset seed list used to boot a green service with no pool.

Whatever the mode, a set realm that is neither 32 bytes nor 64 hex is
refused as {mcl_om_realm_malformed, ...}; an empty MCL_REALM used to stop
the process with {case_clause, {ok, <<>>}}. The check runs before the node
key is loaded or generated. Tests first, seen red (7 of 8).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- sys.config.src sets {mesh, required}; rebar.config floors mcl_om at ~> 0.33
  (was ~> 0.26), and the suite holds the floor to the released minor.
- scaffold-service.sh requires MCL_VISIBILITY (private|public). It sets the
  licence (proprietary notice or Apache-2.0, in LICENSE, app.src and README),
  the CI runner ([self-hosted, msi00] for private services in macula-services
  and macula-internal, ubuntu-latest otherwise; self-hosted for public is
  refused) and the gh repo create flag. New template variables proprietary,
  runs_on and holder (the Apache LICENSE hardcoded the holder).
- Closing text: a tag publishes only its version, deployment is macula-fleet's,
  remote is origin, package note matches the visibility.
- README and guides follow; the deployment guide's rollback text matched to
  the two channels.

Template suite: 8 new or tightened cases seen red, now 31 pass (the one skip
is the existing no-container-runtime case).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
template-lint-image calls scaffold-service.sh, which now refuses to run
without MCL_VISIBILITY. Replayed locally with podman for docker: scaffold,
lint toolchain and published-pair steps pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docker/build-push-action needs Docker's buildx; the msi00 runners' docker
is a shim for podman (buildx = buildah). Plain docker CLI steps run on
both. Login to DOCKER_CONFIG / REGISTRY_AUTH_FILE under $RUNNER_TEMP (the
msi00 runners share one podman and its default auth file); a run-unique
build tag, removed by name, never pruned; BUILDAH_FORMAT=docker, since
podman's default OCI format drops the HEALTHCHECK.

Proven on msi00 through the shim inside ci-runners.slice with mcl-fovea's
Containerfile (build only): revision label and healthcheck present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test first, seen red (37 tests, 1 failure), then green. Mercurius's
review suggestion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by Fable on mcl-fovea, inherited from this template.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fleet is a dev and demo fleet (Raf, 2026-09-28). Generated README and
compose, and the deployment guide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README, the audit script and two suite comments (Raf, 2026-09-28, via the
Supervisor). CHANGELOG history and the historical hecate plans keep their
wording as written. Also "somebody else's" in the template compose, to
match its README (Mercurius).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One pair across the template, the CI that tests it and the services it
releases (Supervisor, 2026-09-28). The template suite checks the pair is
one dated build, published, and the same image this CI runs in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The identities pre-minted for mcl-stations and mcl-citizens were written by
macula 12.6.0 through mcl_om 0.29.1; moving those services to mcl_om 0.33
must keep their node ids. Fixture: a throwaway key minted with macula
12.6.0's own save/2 in the CI image (node id 00c963e2...).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The template suite's own checks, seen red on c0fd31e: leaks_no_house_specifics
found "self-hosted" in a comment, and image_build_runs_on_docker_and_podman_alike
found "prune" in the comment warning against it. Reworded; no step changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mcl_om_claim settles on the bare {error, <<"not_admitted">>} macula 13
returns as well as the older call_error shape; each change of the claim's
state is one log line naming realm and org; /health carries it under
`claim'. Found on mcl-fovea's first boot: the realm had filed the claim
as pending, and the service kept re-sending it every minute, silently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The warning level makes it loud; capitals made "pending" unfindable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build-push reads the pushed digest back from ghcr and an attest job calls
macula-ci-images' attest-image.yml@b304162c (the sha mcl-echo uses; the
file is unchanged since) with it, on the build's runner, for the house
orgs only (the attest variable, set by scaffold-service.sh). mcl-mail
shipped unsigned because the scaffold had no such job (M6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The claim runs inside the worker (init/1 and every retry) and a call to an
unreachable realm takes up to 15 s; status/0 asked the worker with a 5 s
timeout, so /health could 500 mid-call (Mercurius). The worker now writes
{Claim, Since} to a persistent_term on every change of kind; status/0 reads
it, no entry being no_mesh. scaffold-service.sh refuses a non-JSON
MCL_RUNS_ON (Mercurius's observation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the red run (68eb829) the old status/0 timed out inside setup, the
cleanup never ran, and the leaked mocks failed ten unrelated identity
tests. The call is caught and handed to the assertion instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macula 13 seals calls end to end; a provider declares how its calls must be
protected with the advertise option `confidential'. mcl_om had no way to pass
it: capability() had no such key and advertise_one/6 built the Opts from auth,
stream, handler timeout, authorization and reuse_sup only. So a service on
mcl_om could not advertise a procedure that refuses clear calls (found
building mcl-echo's sealed mode for M4).

- capability() gains `confidential => preferred | required'; confidentiality_opts/1
  forwards it into advertise_direct's Opts for response AND streamer
  capabilities. Absent, the Opts are unchanged. `off' (a caller's choice) and
  anything else are refused by name.
- `required' needs macula's kem_advertise enabled, or macula refuses the
  advertisement and the service runs green and unreachable. register/1 now
  checks in the caller, before its server call, and fails the boot naming
  every such capability and the setting (confidentiality_verdict/2).
- 9 tests, seen red (undef) first; README and CHANGELOG.

eunit 258/258, dialyzer 0, lint and xref clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mcl_service_template_SUITE:generated_service_floor_is_this_release holds the
scaffold's mcl_om constraint to this release; the 0.34.0 bump left it at
~> 0.33 (CI run 36479259670 caught it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mercurius's review of 0.34.0:
1. A bad `confidential' value still booted green and unreachable:
   confidentiality_verdict/2 looked only at `required', so a typo passed
   register/1, then confidentiality_opts/1 raised inside advertise_one/6 on
   every republish tick, caught as a warning. The verdict now runs the whole
   check in the caller, in order: a value other than off/preferred/required
   ({mcl_om_confidential_not_a_provider_mode, #{capabilities => [{Name, Value}]}}),
   a kem_advertise that is neither enabled nor disabled
   ({mcl_om_kem_advertise_not_a_switch, ...}; macula raises not_a_switch on
   every advertise otherwise), then `required' without kem_advertise enabled.
2. `off' is a real provider mode in macula 13 (confidentiality(off, _) is
   {ok, #{}}): it keeps a procedure keyless while kem_advertise is enabled,
   where absent means macula's `preferred'. It is now forwarded, and the type,
   the doc, README and CHANGELOG say what it does.

Tests: off is carried; the verdict names every capability with a bad mode; a
non-switch kem_advertise is refused; register/1 refuses a misspelled mode at
boot; confidentiality_opts/1 still refuses a bad mode by name. Seen red first.
eunit 262/262 and dialyzer clean, run on msi00 in the CI image (host00 slot rule).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
restore_env/2 did nothing for a variable that had been unset, so the pin
the seed tests set stayed in the os env. Under `rebar3 do eunit, ct' (one
VM) mcl_om_mesh_pool_SUITE then booted with ids and no seeds and failed
three cases on node_ids_without_seeds; separate CI steps hid it. Restore
now unsets, and restore_mesh_config's explicit unsets, which worked
around this, are gone. The new test was seen red on msi00 first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pq_hybrid keygen (RSA-4096 among its parts) takes seconds on a slow
runner. Four tests each made their own keys inside eunit's 5 s, and on
msi00 under load, and at --cpus=0.25 in the CI image, they were
CANCELLED (exit 1: "4 tests, 0 failures, 3 cancelled"). They now run as
one group whose setup makes two distinct keys, with a 120 s timeout that
covers the setup. At --cpus=0.25 the module passes: 67 tests, 0 failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mcl-om#10, decided by Raf: mcl_om is the basis for on-mesh services, and each
service chooses its own persistence. So mcl_om no longer depends on or starts
reckon_db, evoq or reckon_evoq (khepri, ra and reckon_gater no longer start in
every service), mcl_om_store is gone, and so are the store callbacks of
mcl_om_service and the store wiring in mcl_om:boot/1.

A service still exporting store_id/0 and data_dir/0 boots without a store and
is warned at boot (mcl_om_no_longer_opens_a_store), naming the callbacks and
the way out, instead of failing later where nobody connects it to this release.

`rebar3 new mcl_service store=1' now generates the service's own copy of the
wiring in <name>_app (start the store, wait until reckon-db lists it, start
the per-store evoq subscription, before mcl_om:boot/1), the store's name,
directory, indexes, mode and integrity in <name>_service, and the three
dependencies with the floors mcl_om used to carry. A storeless scaffold names
none of them. The template suite now also generates and compiles a store=1
scaffold; reckon_db, evoq and reckon_evoq are test-only dependencies for that.

Tests first, seen red on msi00: mcl_om_storeless_tests (4), the behaviour's
callback set, and the two scaffold cases. The plan and consumer list are in
plans/PLAN_MCL_OM_STORELESS.md; the 8 store-owning services follow, one each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mercurius, on e72fbb5:
- A store=1 service generated by this very release exported store_id/0,
  data_dir/0 and three more from <name>_service, so mcl_om:boot/1 warned it
  had lost a store at every boot, while its own start/2 had just opened it.
  A false warning teaches everyone to ignore the true one. The service now
  exposes one map, event_store/0 (id, dir, indexes, mode, integrity), which
  <name>_app reads; a generated test and the template suite assert that
  mcl_om:leftover_store_callbacks/1 finds nothing on it.
- The warning's way out and mcl_om_service's moduledoc named a
  <name>_store.erl no scaffold generates; both now name <name>_app, and the
  warning says to stop exporting store_id/0 and data_dir/0.
- The warning fires only on the old contract's activation, store_id/0 and
  data_dir/0 together: a storeless service with its own data_dir/0 never had
  a store and is told nothing.

The plan says the same for the migrating consumers (step 3) and the tag ask
(step 5), and notes the unsupervised evoq subscription as a later change.
Seen red on msi00: the two eunit cases against e72fbb5, and the suite's
assert against e72fbb5's template ([store_id, data_dir, store_indexes,
store_mode, store_integrity]).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fix shipped as 0.33.3 on maint/0.33 (0971132), applied to main before
the 0.35.0 tag: register/1 records the set, replies, and advertises right
after from a message to itself, so mcl_om:boot/1's 5 s call no longer
depends on the network and the capability count. The same test (red on the
old code with the exact msi00 exit) and the registered/1 barrier in the
tests that assert on the advertising; CHANGELOG [0.35.0] Fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
publish/0 (mcl_om:advertise_capabilities/0) advertised every capability
inside its gen_server default of 5 s, the shape register/1 had: it now
replies and advertises right after in the same process (Neptunus, reviewing
0.33.3). Red first: a 3-capability publish with a 2 s advertise each failed
{timeout,{gen_server,call,[mcl_om_capabilities,publish]}} on the old code.

Three identity tests generate a real key (first boot with its puzzle grind,
an existing key saved and loaded back, a key whose save fails), which on
msi00 at load 19 outlived eunit's 5 s and was cancelled. Each has its own
timeout now; at --cpus=0.25 the module passes, 39 tests, and was cancelled
before.

The mcl-om#10 plan records the consumers' measured exposure (only bookclub
and bookclub-gleam could float onto 0.35 unmigrated; phoenix, tube and
whiteboard are held by their macula 12 pin) and the storeless M3 services.
CHANGELOG [0.35.0] counts mcl-rag's 18 capabilities, not 17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Handshake v5 and station_version for every service on mcl_om. No call site changes: every
macula function mcl_om uses keeps its arity and result in 13.3.0. The service template pins
mcl_om ~> 0.36, and its store variant (and mcl_om's test profile) takes evoq ~> 1.26 and
reckon_evoq ~> 2.7 instead of bounded floors: Raf's dev rule, 2026-09-30.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* guard: inbound pipeline for every response capability, with alert facts (#13)

- mcl_om_guard_pipeline: a macula_response running the stages (payload size, then rate, then the handler) around every response-kind capability advertised through mcl_om_capabilities; guard => none opts out, streamers keep their own path.
- mcl_om_guard_limits: per-procedure limits + envelope in persistent_term; guardian-tier sets are bound by the envelope, the operator tier may exceed it and set it; shared validation; redeclare never wipes runtime overrides.
- mcl_om_guard: fixed-window counters keyed (procedure, caller), denial counters, stats/1, a bounded audit ring, and a per-window denials_observed alert fact published through mcl_om_pubsub for mcl-sec-guard to subscribe to.
- mcl_om_sup starts the guard ahead of capabilities; mcl_om_service:capability() gains limits/guard keys; CHANGELOG entry.

* guard: gated limits.get / limits.set / limits.set_operator control surface (#13)

- mcl_om_guard_control: limits.get (open: limits + stats, one procedure or all) and, with inbound_guard.guardian config, the realm-gated limits.set (guardian tier, envelope-bound) and limits.set_operator (operator tier, may exceed and set the envelope); applied changes land on the audit ring with caller and tier, unchanged sets are no-ops.
- mcl_om:boot wires with_caps around the service capabilities; the mcl_service template's sys.config.src documents the inbound_guard block; CHANGELOG.

* scripts: fall back to asdf exec erlang, not mise
The 0.37.0 hex publish was blocked on edoc: my comments used Markdown backticks and plain apostrophes. Fixed across the guard modules and the touched service/capabilities/sup docs; edoc green.
- Control surface renamed to verb-first snake_case: get_limits (open) + set_limits (guardian tier). The operator-tier mesh procedure is gone: humans use deploy config and the service's admin surface.
- Window starts use system_time: OTP 28's signed monotonic clock made every limits.get reply unsendable (unknown_error).
- Template and changelog updated; control tests rewritten.
get_limits replies carrying over-limit callers failed with unknown_error because the codec refuses tuples. Stats are now wire-clean.
- Caller ids hex-encoded in top_callers and the audit ring: the wire turns binaries into text (UTF-8), and node ids are arbitrary bytes — unsendable replies surfaced as unknown_error. Regression test asserts the stats reply passes macula_frame:check_payload/1.
- Guard test fixtures start the gen_server under a keeper (eunit exits its setup process after building the fixture, killing start_link'd children), tolerate a lingering stray name from an in-test guard, and the codec test self-starts if the fixture's instance is gone.
alert_payload/3 now carries distinct_callers and top_callers — the
wire-safe list of maps with hex-encoded caller ids the stats already
computed — so the guardian's rule can propose against the actual
offenders instead of a blind floor. The payload passes check_payload/1
outright (asserted in the test).

TDD: the offenders test was written and seen red first. Gate: compile
+ lint + eunit (guard suite 9/9) + dialyzer all green.
They were cumulative since boot: one denial ever made every later
window read as denied, so should_report published a fact every tick
forever — the quiet service became the fact amplifier the design
exists to prevent — and the alert fact's denied_rate/denied_size were
lifetime totals. The counters now key by window start like the caller
buckets, the sweep ages them out, and a quiet window reads zero.

TDD: the windowed-counter test (a legacy cumulative entry must not
leak into the current window's stats) was written and seen red first.
Gate: compile + lint + eunit (111, 0 failures; the 5 cancelled are the
pre-existing fixture-kill flake) + dialyzer all green.
A caller is a distinct node id, and allow/3 allocated the bucket
BEFORE the rate check: a flood of fresh identities grew the ETS table
regardless of global_max — memory scaled with attacker-chosen distinct
callers within the retention window. Once a window has seen
max_distinct_callers (default 1024, a validated limit key), a NEW
caller is denied before its bucket exists; known callers keep their
per-caller budget. The '$distinct' counter rides the windowed sweep,
and the caller fold excludes it.

TDD: the flood test (deny new callers at the bound, no bucket for
them) was written and seen red first; it also caught the '$distinct'
leak into top_callers. Gate: compile + lint + eunit (112, 0 failures;
5 cancelled are the pre-existing fixture-kill flake) + dialyzer.

Closes #15.
`the_stats_reply_passes_the_wire_codec_test/0` ends in `_test`, which
eunit auto-collects at module level, so it ran a second time outside its
fixture; the start_link'd guard it left behind kept the registered
name, and the next fixture waited the full 5000 ms in
`start_tolerating_stray` until eunit's own timeout killed its setup,
cancelling every test in it. lint-and-test has been red since 0.37.1.

Drop the `_test` suffix so only the fixture list runs it, and harden all
three guard keepers: a 100 ms grace for a genuine async exit, then kill
and wait the DOWN, with the keeper reporting its outcome so a refused
start fails loudly instead of hanging the fixture.

rebar3 eunit: 310 tests, 0 failures, 0 cancelled (was 112, 5 cancelled).
Every service has carried the guard control surface's `get_limits' since
0.37.1 (mcl_om prepends it via `mcl_om_guard_control:with_caps/1'), but
this suite's exact-list assertion predates it, so CT has been red on
main since 0.37.1 as well -- masked until now, because the eunit step
aborted the job before `rebar3 ct` ever ran.

rebar3 ct: All 47 tests passed.
Implemented, deleted:
- PLAN_HECATE_OM_MESH_WRAPPERS.md: pieces A-H shipped from 0.1.0 (piece E
  removed on purpose in 0.30.0)
- PLAN_MCL_OM_11X_PORT.md: the 11.x port, 0.1.0
- PLAN_MCL_OM_STORELESS.md: 0.35.0 (mcl-om#10)
- PLAN_OWNERSHIP_PROOF_V2.md: 0.32.0 (mcl-om#7)
- PLAN_UCAN_GATED_CAPABILITIES.md: 0.24.0 and 0.25.0; framework-level
  inbound protection is tracked by mcl-om#13

Obsolete, deleted:
- PLAN_HECATE_OM_MESH_WRAPPERS_ROOT.md: hecate-om era handover for a
  plan that is done; the hecate-services it surveys are retired
- PLAN_MACULA_API_INTEGRATION_SURVEY.md: superseded by the mesh wrappers
  plan, which implemented it (macula 10.x era)

Comments that cited these files (many already named a file that never
existed) now cite guides/mesh_native_services.md, the CHANGELOG version
or the issue. The guide drops its stale status note and plan link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README, guides, script comments, module docs and test comments. Corpus
links point at macula-services/mcl-corpus (TIER_MODEL.md,
examples/MESH_FACT_READ_MODELS.md). The service_anatomy guide uses the
mcl_X names the mcl_service template generates. Runtime names that still
say hecate are tracked in #17. Refs macula-io/macula-station#54.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
get_limits / set_limits, the denials_observed fact, the envelope, the
audit ring and what a set refuses, written from the code. Moved here from
mcl-sec-guard's plan file of the same subject (mcl-sec-guard#18): mcl_om
implements the contract, so its spec lives with it. The plan's service-side
anti-thrash interval is not built and is recorded as such.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
service_cert_path defaults to /etc/mcl/secrets/service-cert.pem, inside
the identity volume the deploy mounts at /etc/mcl/secrets, as mcl-corpus
documents it. Nothing reads the key today and nothing mounts the old
path, so no box changes. The README names the fleet's reconcile timer
macula-reconcile and its secrets directory ~/.macula/secrets, the names
macula-fleet already uses; no macula-fleet change is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The boot claim stopped retrying once the realm filed it as pending, so
/health read claim.state pending until a restart after an operator admitted
the node. asks_again/1 now re-sends a pending claim every 60 s, as an
undelivered one: the realm answers not_admitted while pending and issues at
once after admission. Red first: a_pending_claim_is_asked_again_test failed
on the old rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macula refuses node_identity_path and stores a node identity at <identity_dir>/<name>.<profile>.key;
the suite keeps its own key under the build tree. Closes #21.

macula constraint moves to ~> 14.0, the release carrying #76.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A newer push queues behind a run in flight instead of cancelling it, so an
image already pushed is never left unsigned; the template's test guards the
digest step id and id-token: write; the attest comment names no one fleet;
attest-image.yml pinned at 601c719 (macula-io/macula-ci-images#2).

Closes #9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main and tag runs, which push and sign images, queue behind a run in flight;
pull-request runs, which push nothing, still cancel each other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
health_socket (a path such as /run/mcl/health.sock) serves /health on that
socket only: no TCP health listener runs, whatever health_port says. A
stale socket file is replaced, and the socket is mode 0600 so only the
service's own user may connect. Unset, health_port is the fallback.
The mcl_service template generates the socket: sys.config, a HEALTHCHECK
over curl --unix-socket, no EXPOSE or MCL_HEALTH_PORT, and health.sh asks
the running container. scaffold-service.sh takes no health port.

Test first, seen red: GET /health answers over the socket, no TCP port is
open with the socket set, a stale file is replaced, mode is 0600, and the
port stays the fallback; the template case asserts the generated files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The claim worker's moduledoc named mcl_om_capabilities:resolved_authorization/3,
which does not exist; it now names macula:provider_authorization/3, the call
the advertise path makes. mcl_om_service's -moduledoc and -doc text is
Markdown but was written with EDoc quotes (`x'), leaving three unclosed
backquotes; it now uses Markdown code spans. The README's guardian design link
points at the file on GitHub, since docs/design is not part of the hex docs.
CHANGELOG.md is history kept as written, so ex_doc skips undefined-reference
warnings there.

Refs #8

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The advertise loop (register/1 after its reply, publish/0, and every
30s republish tick) ran inside the gen_server, so list/0 and publish/0
waited behind it on their 5s default and lookup/1 on its 15s: a
service with many capabilities (mcl-rag's 17, 2026-09-29) or slow
stations could time out callers right after boot and on each tick.

do_advertise/2 now runs in ONE long-lived, monitored worker: its loop
serialises runs, a trigger arriving mid-run is coalesced into one
follow-up run, and a worker death is a DOWN the server logs and
retries instead of anything on the caller's path. The grants and
liveness tables stay this server's (public now, since the run records
into them) and are cleared at the start of the first run after a
capability set changes, so a row for a procedure no longer advertised
cannot outlive the change. The worker monitors the server and exits
with it, and terminate/2 takes it down; the factory supervisors it is
linked to therefore keep the lifetime they had while the server called
advertise_direct/7 itself.

Tests: with a slow advertise_direct, list/0 answers immediately and
lookup/1 answers inside its budget while the advertise is in flight;
three triggers during a run collapse to exactly one follow-up run.
An issued claim was never sent again, so a delegation the realm lapsed
and tombstoned left the service dark until restart. While issued, a
resolution that finds the delegation or org directory gone now sends the
claim again (at most once a minute); the realm re-issues a live member
(macula-realm#81).

provider_grants entries carry not_after_ms, the chain's bound. A third
or less of its life left is "expiring" (degraded, one warning), past it
"expired" (error). A failed re-resolve keeps the bound of the chain the
registration still carries.

Refs #25, macula-io/macula-realm#81

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generated_service_floor_is_this_release holds the template to the
release's own MAJOR.MINOR; af2b26f bumped the version without it.

Refs #25

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macula verifies who signed a publication, not who may publish on a topic.
org_member/2 asks macula:org_member/4 (macula 14.11) about a delivery's
publisher and caches the answer: a member until its chain expires, a
refusal for a minute (at most 10,000 entries), and 'could not find out'
never. The macula floor is ~> 14.11. Refs macula-services/mcl-agora#1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generated_service_floor_is_this_release holds the template to the
release's own MAJOR.MINOR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After macula-station#106 a station forwards each publisher advertisement
renewal to its peers, so the renewal bytes a station relays are proportional
to 1/interval. On a live station that floor was 6.76 of 11.62 Mbit/s out.

Raise the one knob, REPUBLISH_INTERVAL_MS, from 30s to 70s. ADVERTISEMENT_TTL_MS
is four republish intervals, so the TTL goes 120s->280s, held under macula's
300s procedure-advertisement record cap (enforced as a refusal, not a silent
clamp). Expected cut ~2.3x, to be confirmed by an after-capture.

The go-dark margin is unchanged: the TTL stays four intervals, so one or two
missed re-asserts never age a record out, and the SDK's own half-life renewal
remains a backstop. The one cost is a dead provider stays listed up to 280s
(vs 120s) before its advertisement lapses. Authorization is re-checked per
advertise admission and per caller resolve, and the advertisement is bounded
by the delegation's own expiry, so a longer TTL is not a wider revocation
window.

Health windows (mcl_om_advertise_liveness) now derive from the one knob
(mcl_om_capabilities:advertisement_ttl_ms/0 and republish_interval_ms/0)
instead of a second hard-coded copy of the TTL, so a single missed tick at
the longer cadence does not flap /health. Operator env overrides still win.

No wire change: ttl_ms is an existing field and every node already accepts an
advertisement up to the 300s cap.

Jitter scaled to 14s (+/-7s) to hold the proportion; at 70s the interval is
no longer a multiple of the 30s station tombstone the jitter guards against.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
macula ~> 14.11 -> ~> 15.6 (macula#105, macula-fleet#27). Wire 1.0 carries
1 to 8 serving_stations per procedure advertisement (macula-station#55):
build_advertisement/5 publishes [Station]; decode_resolved/1 and lookup/1
yield one {advertiser, serving_station} per listed station. Major version so
no `~> 0.x` service floats onto a wire the live fleet cannot speak.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
caller/1 returns the caller as macula injects it: the raw 32-byte node id.
Stored and sent back as CBOR text that fails macula's reply check (32 random
bytes are not valid UTF-8), which is how mcl-chess 0.7.2 would have failed
every successful call (mcl-chess#10, caught in review). Its spec said only
binary() and its doc did not say the bytes were raw.

caller_hex/1 returns lowercase 64-hex, or undefined — the same cases as
caller/1, plus a value that is not a 32-byte node id, because hex of
something that was never a node id is a plausible-looking id no node answers
to. macula has injected the caller as raw bytes since 10.15.0, the first
version to inject one at all, so a payload built in process is the only way
a non-node-id caller reaches the reader. Lowercase is fixed here: mcl-graph,
mcl-sec-guard and mcl_om_guard encode lowercase by hand, mcl-rag's
rag_operators encodes uppercase, so two services cannot match ids for the
same node.

caller/1's spec names the wire shape (the union keeps admitting any binary,
because a payload built in process can carry one); its doc says the bytes are
raw and points at caller_hex/1 for anything stored, compared or answered with.

Red first: three caller_hex tests failed with undef against the old module.
344 eunit, 48 ct, lint and dialyzer green; services migrate in their own
packages (mcl-om#30 lists them).

Co-Authored-By: Claude Code <noreply@anthropic.com>
A capability test that builds its own request map tests the handler against the
shape the handler expects, which is how mcl-chess 0.7.1 passed 206 eunit tests
and then refused every real call on the live mesh (mcl-chess#10). The wire
delivers text keys as {text, Bin} and the verified caller under the atom key as
a raw 32-byte node id, and a reply's plain binaries go out as CBOR byte strings
while a raw node id tagged as text is refused outright.

mcl_om_wire_test:call/3 closes that gap for any service's suite: it encodes the
request with macula's own codec, decodes it through macula_frame:plain_payload/1
which is the provider's own path, merges the caller the way
macula_station_link:with_caller/2 merges it (a peer that names itself is
dropped), runs the handler inside the request's caller context the way the link
does, puts the reply through macula_frame:check_payload/1 before anything else,
and answers the client's view. A handler that refuses with the behaviour's own
{error, Reason, NewState} is answered as the client answers it, {error, Detail}
carrying the reason's name, instead of crashing the test on a badmatch.

The two directions do not convert the same way, on purpose. A request is
authored by a JSON client, so strings are text; a reply is the provider's terms,
so a plain binary stays a byte string, because smoothing that over would hide
the very fault this helper exists to catch. A boolean in a request is refused
rather than translated to 1/0.

Its own suite pins the killing power rather than the convenience: a fixture
handler written the way mcl-chess wrote one is refused by the helper, and the
same capability written against the wire answers through the same path. That
second fixture reads its caller through mcl_om_wire:caller_hex/1 (1.1.0), so the
two released helpers are exercised together.

The template's capability note now points a new service at the helper.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The client view ran the decoded reply through mcl_om_wire:unwrap/1, which maps
{text, Bin} to Bin and passes a plain binary through unchanged. A reply carrying
{text, <<"x">>} and one carrying <<"x">> therefore both read as <<"x">>, and
macula_frame:check_payload/1 accepts bytes, so a responder that regressed a field
to a bare binary kept every test green while its clients got a blob where they
expected a string. That is the mirror of the fault the helper exists to catch.

The strict decoder already tells the two apart: {text, Bin} for CBOR text, a
plain Bin for CBOR bytes. The client view keeps that apart now, naming a byte
string {bytes, Bin} and unwrapping text as before, which is also how the request
side authors bytes. An existing assertion such as ?assertEqual(<<"checkmate">>,
Field) fails on a bytes field, so a consumer's tests need no change.

Pinned by two tests: a reply's byte string does not read as text (both shapes,
plus the inequality the capability assertion relies on), and a byte string nested
in a list is named as bytes too.

eunit 358/0, dialyzer clean, lint clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
priv/templates/mcl_service/rebar.config emitted {mcl_om, "~> 1.0"} while
mcl_service_template_SUITE derives the expected floor from mcl_om's own version,
so `rebar3 ct` has been red on main since 1.1.0. At both 1.1.0 and 1.2.0 the job
failed with

  generated_service_floor_is_this_release: expected: "~> 1.2", got: "~> 1.0"

and hex published anyway, because the publish workflow does not depend on the
test job. The template now emits ~> 1.2, so the suite's policy holds: a service
scaffolded from this release starts on the release it came from.

A generated service is unaffected in practice, since ~> 1.0 also resolves the
newest release; what was broken was the statement the floor makes and the check
that guards it. Whether a tag should publish while that job is red is a separate
decision, recorded on #33.

rebar3 ct 48/0 (the suite that was red), eunit 358/0, dialyzer clean, lint clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
publish-hex.yml and lint-and-test.yml ran side by side on a tag, so 1.1.0
and 1.2.0 reached hex from commits whose `rebar3 ct` had failed. The
publish workflow now calls lint-and-test.yml (workflow_call) on the tagged
commit as its `test` job, and `publish` needs [verify, test]. A red suite
leaves the tag with no package. A dispatch dry run skips `test`, which would
test the dispatching branch, not the tag.

The service scaffold gets the same gate: build-push.yml calls the scaffold's
lint.yml as `test`, and build-and-push needs it, so a generated service
pushes no image, on main or on a tag, while its tests are red.
mcl_service_template_SUITE:image_publishes_only_after_the_tests_pass holds
that shape (seen red before the template change).

Gate run in the pinned CI image: rebar3 lint, eunit, ct (48 passed, 1 skip
as in CI) and dialyzer, all green.

Refs #34

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A generated house service called attest-image at 601c719, before the release guard
existed, so its tags were signed unchecked, and even with the guard inside
attest-image the build would already have pushed :<semver>. The house build-push.yml
now has a guard job (macula-ci-images release-guard.yml at b4c41ab, on the build's
runner) and build-and-push needs [guard, test]; the attest call moves to the same
commit. The stranger's scaffold stays as it was: no attest, no guard, needs: test.

mcl_service_template_SUITE: image_publishes_only_after_the_tests_pass now also holds
the house build's needs: [guard, test], and house_images_are_signed_by_digest holds
the guard job and the new pin, and that the stranger names no release-guard. Seen red
first: both fail against the previous template; all 40 green after.

Refs macula-io/macula-codebase-checks#3

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A v* tag now waits on the release guard: the tagged commit has to be an ancestor
of the default branch, and the tag's version has to be the version this
repository publishes. It sits beside the test gate and the publish needs both.

No if: on the guard job. A skipped job skips the publish that needs it, and the
guard exits 0 by itself for a ref that is not a release tag, so it costs one
short job on a main push and refuses the release it should.

Refs macula-io/macula-codebase-checks#3

Co-Authored-By: Claude Code <noreply@anthropic.com>
Same job, same pin, one name across the sweep: macula-ts already had a job
called guard, so the longer name is the one that never collides.

Refs macula-io/macula-codebase-checks#3

Co-Authored-By: Claude Code <noreply@anthropic.com>
A reader who copies an example from the README or a guide gets code that
works (macula-codebase-checks#8). docs.yml runs the shared doc-snippets
check from macula-ci-images on every change, doc-only ones included, and
publish-hex.yml waits on it for the tagged commit.

The check found, fixed here at the docs: the read-model listener calling
macula_record:verify/1 (it takes the crypto profile: verify/2), a spec
naming a pool() type nobody defines, and `...` inside a map. A module head
listing the callbacks is marked as such; fences name their language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shared ruleset gains max_function_length 60 beside the nesting rules
(macula-codebase-checks#9). Elvis counts code lines only: comments and
blank lines are left out. No function here exceeds it; lint is clean on
OTP 28.4.3 in the CI image.

Refs macula-io/macula-codebase-checks#9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mcl_service template's mcl_min ruleset had nesting 2, no nested
try/catch and no if, but not max_function_length 60, so every new service
started one rule short of the structural floor (macula-codebase-checks#9),
and the sweep would list it on day one. The scaffold already ships the lint
step in lint.yml; with this line a new service starts on the whole floor.

Checked: scaffold-service.sh with the house defaults, in the pinned image,
then rebar3 lint on the scaffolded service: 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macula-codebase-checks#10, criterion 2: the mcl_service template ships the C4
check, plus an architecture README filled in from the real service.

- architecture/README.md is generated from the service's own name, description
  and module: what a just-scaffolded service talks to (the operator, the realm,
  the stations and the DHT) and what it is made of (its six callbacks, mcl_om,
  the macula SDK, the identity key), with the two diagram embeds the gate looks
  for. NO diagram is drawn for it: a diagram generated from a template is a
  placeholder with a nicer shape, so the service draws its own and the job is
  red until it does.
- the house scaffold's build-push.yml gains the shared c4-model job, pinned by
  full commit sha in one place (the `c4_gate` template variable).
  IT IS NOT IN THE IMAGE'S PATH: nothing needs it and it needs nothing, so a
  new service still publishes its first image while it owes its readers a
  model. It is at the workflow's own level rather than in lint.yml because
  build-and-push's test job IS lint.yml, and every job in a called workflow is
  part of what the image waits for.
- a scaffold outside our orgs gets the architecture page and no job, as with
  attest: the check is ours, and a stranger's CI citing our internal issue is
  what leaks_no_house_specifics refuses. The README and the page say different
  things in that case (macula-codebase-checks#10 is named only where the job
  is).
- scripts/scaffold-service.sh sets both from the org, next to ATTEST.
- the suite gains the_c4_model_is_asked_for_and_not_faked: the page names the
  service and shows both diagram paths, no SVG is generated, the house
  workflow calls the shared check by a full sha, a stranger's does not, and
  nothing needs it.

Note for the changelog of whoever merges: `c4` is the one-character flag,
because mustache iterates a string as a list and a full URL repeated the job
once per character (caught in the generated output: seventy copies of the job).

Gate: lint clean, eunit 358, ct 50 (template suite 41), dialyzer clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Three parts, one package (macula-codebase-checks#11, folded in for this
repository by the Supervisor).

1. THE TEMPLATE, criterion 2. The mcl_service template's lint.yml gains the
shared dependency-advisories workflow for erlang: a service scaffolded from it
cannot ship a dependency with a published advisory, and build-push.yml already
waits on lint.yml before it pushes an image. The job is inside the template's
house block, with the release guard and the attest call in build-push.yml,
because that workflow is macula-ci-images': a scaffold for another org carries no
macula-io path at all, which the template suite asserts (leaks_no_house_specifics).

2. MCL_OM'S OWN CI. lint-and-test.yml gains the same job, so this package's CI
refuses an advisory too. publish-hex.yml already calls that workflow on the
tagged commit and publishes only when it is green.

3. THE DEPENDENCIES, which is why 2 was red. cowboy was pinned at ~> 2.12.0,
which resolves to cowlib 2.13.0 and four advisories fixed in 2.16.1:
GHSA-32p9-57cr-4x65 (8.7, uncontrolled resource consumption in cow_http_te),
GHSA-84f2-rp86-235p (8.2, decompression bomb in cow_spdy), GHSA-hv23-4qp7-8c8r
(6.3, CRLF injection in SSE), GHSA-g2wm-735q-3f56 (3.2, cookie header
injection). The requirement moves to ~> 2.18, which resolves to cowboy 2.20.0
and cowlib 2.21.0, and rebar3 upgrade moves the lock.

One advisory is left and has no released fix: EEF-CVE-2026-43966 (HTTP response
splitting via non-VCHAR bytes in cow_http_struct_hd:escape_string/2, 6.3),
upstream only in 4401b858f2229abb3ea115c60924f6c77e5f8aa3 and cowlib 2.21.0 is
the newest release. It is waived in .github/advisories-waivers.txt by a row that
names the advisory, the package, why, who owns it and an expiry of 2026-11-20,
which is the same mechanism a service gets.

Verified: the scan reports 1 finding, 1 waived, 0 left; rebar3 eunit is 358
tests, 0 failures; rebar3 ct is 49 tests, 0 failures (run with the template
installed from this checkout into an isolated HOME, which is what the suite
requires and what CI does).

Refs macula-io/macula-codebase-checks#11

Co-Authored-By: Claude Code <noreply@anthropic.com>
Two review findings on macula-codebase-checks#11, and the release that carries
them.

1. THE TEMPLATE SAYS WHAT A GENERATED SERVICE MEETS. It calls the advisory gate
but ships no .github/advisories-waivers.txt, so a new service goes red on the
first advisory it inherits and stays red until that advisory is fixed or a
dated, owned row is added. That is the gate working, and the comment now says
so instead of leaving a scaffold's author to work it out.

2. THE FLOOR FOLLOWS THE RELEASE. {mcl_om, "~> 1.2"} becomes "~> 1.3", which is
what mcl_service_template_SUITE:generated_service_floor_is_this_release derives
from this release's own vsn. Left at 1.2 it would be the #33 defect again.

3. THE RELEASE IS A MINOR, not a patch: cowboy "~> 2.12.0" to "~> 2.18" is the
base dependency of every generated service, and the CHANGELOG names what it
buys and the one advisory it does not (cowlib EEF-CVE-2026-43966, waived, dated
2026-11-20, owner ceres: no released cowlib carries the fix, and a git
dependency would hide the advisory from the gate rather than fix it).

Verified on this tree with the templates installed from this checkout into an
isolated HOME: rebar3 eunit 358 tests, 0 failures; rebar3 ct 49 tests, 0
failures, template suite included.

Refs macula-io/macula-codebase-checks#11

Co-Authored-By: Claude Code <noreply@anthropic.com>
The shared workflow now refuses, rather than obeying, anything in a repository
that could make the scanned set smaller than the shipped set: a scanner config
outside a short allow-list (.cargo/audit.toml, composer.json config.audit), a
.npmrc that prunes the install or redirects a registry, a rebar.lock or mix.lock
entry from git or a path, python's build backend requirements resolved and
audited, and a composer.json that switches packagist.org off. Every action is
pinned by full commit.

Only the pin line changes here.

Refs macula-io/macula-codebase-checks#11

Co-Authored-By: Claude Code <noreply@anthropic.com>
The requirement moves from ~> 15.6 to ~> 16.0, which resolves 16.0.0
(macula-codebase-checks#4, the class-4 finder: a floor behind the library's
current major).

16.0 keeps wire 1.0, so a node on this release still speaks to every wire
1.0 box. What it brings is the revocation bound from macula#118: an
endorsement admits its holder for at most 24 hours, and a gated overlay
context must pass member_standing or it admits nobody. mcl_om gates no
overlay context and issues no endorsement, so nothing in it changes; a
service that does is fixed in that service.

Minor rather than patch for the same reason the cowboy move in 1.3.0 was:
this is the base dependency of every generated service.

Verified locally against 16.0.0: rebar3 compile, rebar3 lint, and 358
eunit tests with 0 failures. The service-template suite is run by CI: it
refuses to run on a machine whose rebar3 template directory points at
another checkout, which is the case here.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The template carried ~> 1.3 while this release is 1.4.0, and the suite's
generated_service_floor_is_this_release caught it on the first CI run of
the previous commit: expected ~> 1.4, got ~> 1.3. A service scaffolded
from this release must declare the minor it came from.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Jupiter, on review: line 64 still called the SDK macula 15, and the
status line said 1.0.x for a 1.4.0 release and carried a dash. Both now
say what this tree is: a 1.x library on macula 16, colon rather than dash.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The release doc was wrong in a way that cost real time on 2026-10-22:
`scripts/publish-to-hex.sh` said "YOU run this — it fires the actual
`rebar3 hex publish`. Claude prepares the release ... but never runs the
publish itself." That has not been true since `.github/workflows/publish-hex.yml`
shipped: a pushed vX.Y.Z tag runs the suite, publishes and verifies, with no
manual step. The script is deleted rather than corrected, because keeping a
hand-run publish beside the tag gate is the footgun that misled us, and
nothing references it.

CONTRIBUTING gains a Releasing section stating the real flow, and its style
example no longer tells a contributor the floor is `~> 0.27` when the
scaffold writes `~> 1.4`.

The two `%%%` references to `macula_station_link:with_caller/2` are prose,
not links: that function is private in both macula 15.6.0 and 16.0.0, so
ex_doc warned twice on every doc build, including the package we published.

Refs #35

Co-Authored-By: Claude Code <noreply@anthropic.com>
`with_caller/2` was opened with a backtick and closed with a backtick; EDoc
closes a span with an apostrophe, so the span ran on through the blank line
between the two gotchas and swallowed about twelve lines as one <code> block
on the module page. Rendered from the tip to confirm the fix: the page now
reads <code>with_caller/2</code> and the prose after it is prose.

Refs #35

Co-Authored-By: Claude Code <noreply@anthropic.com>
The base library is macula 17 (mcl-om#36): `~> 16.0` moves to `~> 17.0`,
which resolves 17.1.0. 17 keeps wire 1.0, so a node on this release still
speaks to every wire 1.0 box; what it brings is group read control
(macula#129) and the realm rights of macula#128, both of which a service
opts into. Nothing changes for a service that gates its procedures as it
did before.

Two types catch up with what macula already accepts:

- `mcl_om_service:capability()`'s `auth` names `handler_authorizes`
  (macula 17): the link runs no gate and the handler checks the call's
  own token and proofs. `mcl_om_capabilities:auth_opts/1` forwards it
  untouched, deliberately, so only the type and the boot warning's list
  of policies needed the word -- and the docs say what a service gives up
  when it uses it.
- `mcl_om_service:info()` gains `_ => _`, so a service may carry keys of
  its own, reported verbatim in /health's `ok` body. That is where a
  normal setup wait belongs: a service waiting on a value its operator
  has not filled yet answers ok and names the wait, rather than degrade a
  node that is behaving correctly and fail a canary for it
  (mcl-distributor#5). `Org/info` keeps its fixed shape.

Suite on macula 17.1.0: eunit 360/360, lint and dialyzer clean, the two
non-template CT suites 9/9 (the template suite needs a clean rebar3
template directory, which is CI's; it refuses rather than clobber another
checkout's install).

Co-Authored-By: Claude Code <noreply@anthropic.com>
generated_service_floor_is_this_release caught it in CI: a service
scaffolded from priv/templates/mcl_service must depend on the mcl_om
minor it came from, so 1.5.0 moves the template's floor from ~> 1.4 to
~> 1.5. The anatomy guide's tree showed ~> 1.0, two minors stale.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
R2: /health merges the service's info() into its own map with atom keys, so
a service key of the same name in binary form survived the merge as a second
JSON key beside the verdict and a reader keeping the last one reported the
service's value as the node's health. boot/2 now refuses an info key whose
atom or binary form is one of status, provider_grants, advertise_liveness,
claim, failed_publishes -- before start/1 runs, so nothing is advertised
either.

R1: `_ => _' admitted a tuple, a pid or a fun, which jsx:encode raises on
inside the handler: /health answered 500, exactly the canary failure the key
exists to avoid. The extra keys now take json_value(), so dialyzer rejects a
value jsx cannot write (probed: a tuple is refused), and the suite encodes
the merged body and decodes it back instead of only comparing maps.

R3: handler_authorizes does not verify anything and hands the handler the
token the caller put on the request, `<<>>' when it carried none. Said so in
mcl_om_capabilities, in the capability() type and in the CHANGELOG, and named
macula_ucan:authorize/3 as the check the handler must make itself.

Mars's round 1 on 4d999d6.
Mars asked for R2 proof through jsx:encode and not only body/6. This is
that: the merge is a map merge, so a binary <<"status">> rides beside the
verdict, jsx writes the key twice, and a parser keeps the last -- the
service's value, with the node's health silently replaced. The boot
refusal is what stops it reaching a body at all.
`_ => json_value()' still let an integer key through, and jsx raises on
one the same way it raises on a tuple: the same 500 from /health. The
key type is now `binary() | atom()', which is what jsx writes.
A call to a function that does not exist compiled and crashed at runtime;
dialyzer sees arity and type but not a function that was removed. xref_checks
stays at its default: exports_not_used would fail on the exports a supervisor
spec or a test names.

Refs macula-services/mcl-om#39.
rebar3's default counts an unused export as a failure, and xref cannot see a use
a supervisor spec, a test or a facade names rather than calls: mcl-om alone has
97 such exports. Left to the default, the step in the lint job is red on every
commit. Spelled out as undefined_function_calls only, so the gate is a call that
goes nowhere and nothing else, and a future rebar3 changing its defaults cannot
silently change what we gate on.

Refs macula-services/mcl-om#39.
Review of the xref change: the comment said the check set stayed at rebar3's
default, while the rebar.config in the same change pins it. A reader met a
false sentence right above the gate.

Refs macula-services/mcl-om#39.
macula 18 stops serving openly by default (macula#147): an advertise with no
`auth' is refused, a subscription with no `sources' is refused, and
`macula_subscriber:start_link/6' replaces the arity-5 call. mcl_om moved onto
`~> 18.0' and now makes both mistakes unrepresentable at boot, naming what is
missing, instead of leaving them to the SDK.

Capabilities: `mcl_om_service:capability()' names macula 18's call class
`{callers, members | role | {nodes, Ids}}' beside the policies it already
forwarded, and `mcl_om_capabilities:register/1' refuses a capability that
names a handler and no policy (`{auth_required, [Name]}'). Only
handler-bearing capabilities are asked: a capability with no `handler' is a
discovery record, which macula does not gate. `auth_opts/1' loses its
silent `#{}' default, and `unguarded_capabilities/1' and its boot warning go,
since the warning described a default that no longer exists. The synthetic
`<service>.describe_capabilities' names `auth => open'.

Subscriptions: `subscriptions/0' returns
`#{topic, module, args, sources}' with `sources' required and `{open, Reason}'
for an opt-out that someone wrote down. `validate/1' is pure and runs in
`mcl_om:boot/2' before the service's own `start/1', so a bad declaration
leaves no half-built tree behind; the reconciler compares the WHOLE
declaration read back from the child spec, so changing one subscription's
sources, module or args restarts that subscriber and no other. A start
failure is logged once, kept per topic and reported on `/health', where it
degrades the verdict instead of hiding behind `ok', and cleared when that
topic next starts.

`/health' gains a `subscriptions` key in every state (declared, running,
last failure per topic), read lock-free from ETS the way the grant and
liveness tables are, so a probe never queues behind a reconcile that is
subscribing. `body/6' becomes `body/7', and `subscriptions' joins the key
names boot refuses from a service's own `info()'.

Gates, all run locally on this tip: rebar3 lint, xref, eunit (396), ct (51),
dialyzer.

Co-Authored-By: Claude Code <noreply@anthropic.com>
CI's Erlang-block check caught both: `macula_upload:advertise_direct/7` and
`macula_streamer:advertise_direct/7` take the options map as their seventh
argument, and a streaming advertise needs an `auth` policy as much as a unary
one does (macula#147, macula#150). The examples now pass one, and the prose
names the arity it means.

Checked with the checker docs.yml pins (macula-ci-images@2b50b7ac):
0 failures in 8 docs.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The Supervisor's macula 18 sweep, for mcl-om. mcl_om_wire_test delivered
what a station delivers for every policy but `handler_authorizes': the
link merges the request's own `ucan_token' and `proofs' under the atom
keys, dropping a payload's text-keyed pair of those names first, and the
helper merged neither. The handler on that policy has no gate behind it,
so the token check it makes IS the capability's only gate, and a test
written through the helper could not reach it: every such handler
refused everybody, and a test asserting the refusal agreed with a
service no caller can reach (the mcl-chess#10 fault this module exists
to catch).

`deliver/3' and `call/4' take the request's token and proofs as a
`handler_authorizes' capability's request carries them, bytes and bytes,
and merge them as macula_station_link:with_call_token/3 does. Both keys
are always written, `<<>>' and `[]' for a request that carried none,
never absent. `deliver/2' and `call/3' are unchanged and merge neither,
because that is what a station sends to any other policy.

Pinned by a handler whose admission is the token check itself: with the
merge it admits the granted token and counts the two proofs; without it
it admits nobody. Both new paths are mutation-checked -- dropping the
merge fails the admitting assertion, dropping the text-keyed removal
fails the drop -- and a non-binary token or proof is refused with the
error macula would give before it dialled.

The other two sweep items needed nothing here: no mix.exs exists in the
tree, rebar.config pins macula `~> 18.0' and the template's floor is
mcl_om `~> 1.6', and no handler of mcl-om's own authorizes a call --
`mcl_om_ownership_proof' verifies a signed payload, and macula 18 merges
nothing into a payload under any other policy.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Half of the evidence that closes the sealing register row: a pure checker that reads a listing of procedure_advertisement records and fails on four ways the fleet can look sealed while not being so.

A keyless procedure with no written opt-out is clear by omission. An opt-out nothing answers is stale. A service expected on the fleet that advertised nothing is ABSENT rather than a zero -- the failure mode a bare listing cannot see. A procedure belonging to no known service means an unmeasured service.

FOUR RULES, each a test in scripts/check-sealing_test.sh (written next, not in this commit): NO-OFF, STALE-OFF, ABSENT, UNKNOWN.

Data beside it, read out of the source rather than guessed: services.tsv (the 19 deployed mcl-* images), opt-outs.tsv (empty, correctly -- nothing has written off yet), edits.tsv (the per-service release-A edit list: eight kem_advertise deletions, the topics that must gain open, and what is still unenumerated).

NOT DONE, and not claimed: the acquisition half (scripts/measure-sealing.escript) is not written, and the test harness is not written, so the checker is UNVERIFIED. Do not run it as evidence until both exist.

Co-Authored-By: Claude Code <noreply@anthropic.com>
WHAT RAN. scripts/check-sealing_test.sh, 26 cases, 0 failed. It is not a smoke
test: every rule gets a case that must fire and a case that must stay quiet, and
the harness is mutation-tested -- breaking any one of the seven rule bodies turns
it red. The quiet cases are the ones that matter, because a checker that fails
everything cannot be a gate.

Held against the first real listing (170 advertisements in the fleet's realm): all
20 services seen, 103 procedures keyed, 67 keyless with no written opt-out, and
one finding the work did not expect. mcl-fovea advertises two procedures although
the plan's inventory calls it "not deployed" -- it runs on a box outside the fleet
repo and its reconciler, so a survey of release targets could not see it. It is
added to services.tsv: a service that serves is a service whose absence must be a
finding.

TWO RULES GREW, and both because the real listing forced them:

- Every rule now judges a PROCEDURE once, not a listing line once. A procedure
  served by six boxes arrives six times; a service mid-roll arrives keyed on some
  boxes and keyless on others, and one keyless box is enough to read the payload,
  so a procedure seen keyless even once counts keyless. Without this a roll that
  is half done reads as sealed.
- Rule D asked a question the fleet cannot answer cleanly: an agent's own ring
  procedure and the realm's identity surface are not services, but rule D has only
  one answer for a procedure belonging to nobody. Rule E and
  scripts/sealing/not-services.tsv answer it the way opt-outs.tsv answers rule A:
  a written claim with a reason, and a claim that answers nothing is itself a
  finding (STALE-NOT-SERVICE). Nothing is excluded by omission.

WHAT DID NOT RUN. scripts/measure-sealing.escript has never returned a listing. It
loads the SDK, starts it, builds a pool and gets as far as the dial; every one of
the six fleet stations then refuses the connection
(_macula.station_link.connect_failed, reason "refused") while macula-mcp on the
same host reaches them, so the gap is station-side admission and not the script.
The listing quoted above was taken through macula-mcp instead and is evidence
about the checker, not about the script. Until the script takes a listing itself,
a measurement cannot be re-run by an operator, and this package is not done.
THE DIAL WAS THE IDENTITY, NOT THE NETWORK. Last commit recorded that every fleet
station refused the connection and could not say why. It can now: a station admits
a node whose identity key proves the fleet's proof-of-work puzzle, and refuses one
whose does not -- at the dial, before any realm or wiring is discussed, so a plain
key reads as an unreachable fleet rather than a refused one.
scripts/measure-sealing.escript now generates the key at
macula_node_keys:puzzle_difficulty(), which is the same thing every live test and
every service already does. The repo's own live suite had the same symptom from
this host, so the diagnosis cost more than the fix.

AND THE LISTING IS REAL. scripts/measure-sealing.escript took 201 advertisements
from a fleet station, 170 of them in the fleet's realm, and the listing is BYTE
IDENTICAL to the one macula-mcp returned for the same realm on the same afternoon.
Two SDKs, one answer: what follows is a measurement of the fleet, not of a client.

  services expected   20        (19 in the plan, plus mcl-fovea -- see the last commit)
  services seen       20
  procedures listed   170
    keyed             103
    keyless           67   (0 with a written opt-out, 26 not a service)
  findings            41   NO-OFF, all of them

Forty-one is the honest number today: release A does not exist, so no service can
write `off`, and every keyless service procedure is clear by omission. That is the
baseline release B is measured against, which is the whole reason this exists.

RULE A LEARNED ONE THING FROM THE REAL DATA. An agent's ring procedure and the
realm's identity surface are keyless and always will be, and a written
not-a-service claim is already their reason -- so a procedure under a declared
prefix is exempt from NO-OFF, and the summary counts it separately rather than
folding it into the fleet's clear procedures. 67 keyless, 26 of them not services,
41 the fleet must answer for.

28 cases, 0 failed; eight mutations of the checker (any one rule disabled or
mis-matched) all turn it red.
R1, the listing covered ONE station. A DHT read is answered from the records that
station holds, so six `--seed' flags on one pool widened nothing: the pool answers
from one of them. The escript now dials ONE POOL PER SEED under a single puzzle-
solved identity, closes each before the next, unions the rows, and writes
`# station <label> advertisements=<n>' per station. A seed takes `[label=]host:port
[:nodeid]'; unlabelled seeds are station-1..N in the order given, and two seeds with
one label is refused, because a station that cannot be told apart cannot be reported
on. A station that cannot be read halts the run.

The checker gained rule F over a committed `scripts/sealing/stations.tsv` (six, no
hostnames): a station the file names that the listing never mentions, or that says it
contributed nothing, fails the run. A listing that does not cover the fleet is no
longer a quiet zero.

R2, the service match had no path boundary: `index(proc, s) == 1' credited
mcl-bookclub-phoenix/info to mcl-bookclub, leaving the undeployed service neither
UNKNOWN nor its owner ABSENT. It matches `s "/"' now. And check-sealing_test.sh runs
in CI (lint-and-test.yml): no workflow ran it, so 40 cases could have been broken and
green.

R3, a 0-byte input shifted the sections: `FNR == 1' never fires for an empty file, so
the listing was read as the not-services file and the wrong findings printed. Sections
are marked (`@@section <name>') and piped in, and a fixture puts a 0-byte file in the
middle. Two cases hold the boundary, one for opt-outs and one for not-services.

Also fixed while testing it: the awk invocation still passed the four files as
ARGUMENTS while the marked form pipes them on stdin, so every section was empty and
the run died on SIGPIPE (141). Deleting the trailing arguments is the whole fix.

The header's "outside the realm" count was `length(Records) - length(deduped listing)':
it mixed advertisement count with distinct pair count and reported 1036 dropped where
54 records were. It counts the records now, and the distinct pairs get their own line.

Tests: 40 cases, 0 failed. Mutation-tested: a bare prefix match, a silenced station
rule, a station that says zero passing, and FNR boundaries all turn the suite red.

Fleet measurement (six public stations, the fleet's realm, 2026-10-31):
  stations           6/6, 192 advertisements each, 1206 returned, 54 outside the realm
  distinct pairs     170
  services           20 expected, 20 seen
  keyed / keyless    103 / 67 (0 written opt-outs, 26 not a service)
  findings           41 NO-OFF, the release-B baseline

All six stations returned the same 192 in-realm advertisements, so on today's fleet
the union adds no row a one-station listing lacked. The rule is still the right one --
it is what makes a missing or silent station a finding rather than a smaller number --
but "one station is not the fleet" is argued from how the DHT answers, not from a
difference this run measured.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Pluto r=2, one required, exact line. The markers are printed and then a file is
concatenated, so a file whose LAST LINE HAS NO TRAILING NEWLINE runs straight into the
next marker: `@@section stations' stops being a marker, the stations section is read as
the file before it, and rule F is silenced -- replaced by findings about the wrong file.
His repro, and mine after it: not-services = "~<TAB>ring" without a final newline,
stations = s1, s2, listing naming only s1 -> UNMEASURED station s2 disappears and
STALE-NOT-SERVICE takes its place. It still exited 1 there by luck, which is worse than
a wrong pass: a red run that names the wrong rule teaches people to ignore it.

Every marker now starts with a newline. Blank lines are ignored by every section, so the
cost is nothing, and an editor that strips the final newline can no longer move a
boundary.

The fixture is a file that ends without a newline, in the middle of the run, asserting
that UNMEASURED still fires and still names station-6. Mutation-tested: drop the leading
newline from the stations marker and those two cases go red (40 passed, 2 failed); with
it, 42/0. The real six-station listing is unchanged at 41 findings, so the fix moved no
number, only a class of failure.

Co-Authored-By: Claude Code <noreply@anthropic.com>
* subscription: a sealed group, admitted by a token the subscriber never holds

mcl-om#49. The publish side has had its hook since mcl-tenders
(`publisher_opts => #{publish => Fun}`, the token read at the publish); the
subscribe side had none, so a service that publishes its facts sealed could
not subscribe to them through mcl_om at all. It had to hand-roll a
subscriber and lose the reconcile, /health and the fail-closed bookkeeping.

A subscription may now carry `group` and `admission`, valid only together.
`group` is the sealed group's prefix, which `topic` must be under on a
segment boundary; `admission` is {M, F, A}, called as apply/3 with exactly
those arguments and nothing added, answering {ok, Token} or {error, Reason}.
Declared wrong, the boot is refused naming the topic, the way a missing
`sources` already is.

THE TOKEN LIVES FOR ONE CALL. mcl_om starts such a subscriber with its own
`subscribe` function (macula_subscriber:start_link/6's `subscribe` option):
the admission is called there, and the token goes straight to
macula:subscribe/5 beside the group. The child spec carries the fun and the
{M, F, A} and never the token; macula_subscriber keeps no options in its
state at all; and a refused admission is reported by a fixed atom rather
than by whatever it answered or raised with -- an admission reads a token
and can fail holding it, so echoing that term is exactly how a token would
reach a crash report. The tests look for a canary in the child spec, in the
read-back, in the recorded failure and in the /health report, and the whole
run prints it nowhere.

CALLED ONCE PER ATTEMPT, NEVER ON A TICK: a first start, a restart, a pool
replacement, a changed declaration -- not the 30s reconcile that finds the
subscriber running and matching. Nothing is cached in mcl_om: once the group
is joined, a later epoch pull is macula's keyring's business.

FAIL CLOSED. A refusal starts nothing, is recorded per topic, and degrades
/health naming the topic and the reason ({group, {admission, Reason}} for
ours, macula's own verdict once one is presented). No fallback to a clear
subscription, ever.

The declaration-equality check gains both keys, so changing either restarts
that subscriber and no other; a declaration with neither reads back exactly
as it did before.

Minor, not patch: a service that wants a sealed subscription has to declare
two keys it could not declare in 1.6, and mcl-tenders#4 is waiting on it.

1.7.0. Refs mcl-om#48, mcl-tenders#4.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* subscription: a raise out of the subscribe call does not print the token

Pluto found the publisher side logging a publisher's raw exit reason with
`~p`, the group token living in the keyring's state; Uranus files that
separately. This is the subscribe-side twin, and the fun mcl-om#49 added is
what puts a token in that position: `macula:subscribe/5` is not ours, and an
exception raised from it carries the call's own arguments -- a
`function_clause` reason IS the argument list, which is the options, which is
the token. The subscriber's start failure keeps that reason and `recorded/3`
logs it with `~p`, so the token reached a log line and `/health`.

Probed before it was fixed, with the canary as the token:

    subscription to .../tender_notice_reported_v1 did not start:
    {function_clause, [{macula_pubsub, subscribe,
                        [not_a_pool, <<0:256>>, <<"...">>, <0.9.0>,
                         #{group => <<"...">>, sources => {org,<<"...">>},
                           ucan_token => <<"CANARY-admission-token-do-not-print">>}], ...

`handed_over/7` now answers the fixed atom `subscribe_raised` for a raise and
never passes its reason on: the token dies at the frame that held it. Fail
closed is unchanged -- nothing subscribes, the topic is recorded with the
reason, `/health` degrades naming it, and the next 30s tick retries -- only
the cause is less specific than it would be for a call that holds no secret.
The test drives a real start under the real supervisor with a pool that is
not a pool, captures every log event, and asserts the canary is in no recorded
failure, no `/health` report and no log line -- and that the log capture really
saw that start, so "the canary is not in the log" is not vacuous.

Also the scaffold's floor: `priv/templates/mcl_service/rebar.config` still
emitted `{mcl_om, "~> 1.6"}`, and `mcl_service_template_SUITE` derives the
expected floor from mcl_om's own version, so `rebar3 ct` was red on the 1.7.0
tree. CI would have caught it; the local gate did. CONTRIBUTING and
service_anatomy now name the same floor.

Refs mcl-om#49.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* subscription: an admission's own refusal is not reported as itself

Terra's r1, REQ1 (security). `admission_token/1` passed `{error, Reason}`
through unexamined, so an admission answering `{error, {expired, Token}}` --
which is what a real admission looks like when the token it just read has
expired -- put the token in `recorded/3`'s log line and in `/health`, and a
test pinned that pass-through. Probed before the fix: the canary reached
`failures/1` through `{group, {admission, {expired, CANARY}}}`, while the
module doc and the CHANGELOG claimed the opposite.

The only reason that survives is an ATOM: `no_admission_token` and the like
are the operator's lead and can carry nothing, so they pass through; a term
becomes the fixed atom `admission_refused`, a raise stays `admission_raised`,
and the SDK raise stays `subscribe_raised`. The test that pinned the
pass-through now pins the atom, and a new one drives a real start under the
real supervisor with an admission that refuses with the token in a tuple, and
asserts the canary is in no recorded failure, no `/health` report and no log
line -- and that the term it arrived in is gone from the log too.

Two observations from the same review, folded in:

- A test that the admission is asked again on a second attempt, by an
  admission that reports each call: nothing is cached, which is the only way
  a rotated token ever reaches macula.
- An admission runs inside the reconcile server (through
  `supervisor:start_child/2`), so one that blocks delays every other
  subscription's reconcile and the `/health` report with it. Said in the
  module doc, the README and the guide rather than bounded here: what an
  admission does to fetch a token in under a second is the service's design.

And the claims corrected where they were wrong: "in no state and in no log"
is true of mcl_om's own artefacts and node-wide only once
macula-io/macula#189 lands, which Terra filed -- the SDK keyring keeps the
ucan in its state and `macula_node_keys:redacted/1` leaves it there. The
CHANGELOG bullet, the README and the guide now say exactly that.

Local on this tree: eunit 463/0, ct 51/0, dialyzer, xref, `rebar3 lint`,
sealing 42/0.

Refs mcl-om#49.

Co-Authored-By: Claude Code <noreply@anthropic.com>

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
scripts/check-service-drift.sh prints one TSV line per difference, so the sweep
becomes one issue per service per difference instead of a paragraph somebody has
to split by hand. Read-only and offline: every file is read with `git show' at
origin/main (HEAD when a repository has none), never from the working tree, so a
checkout left on a branch reports what people deploy. It fetches nothing and
writes nothing.

The compared set is derived from mcl_service.template, not typed into the
script: a template file that substitutes nothing -- and whose destination names
no variable beyond the repository -- must appear unchanged in every service.
Today that is the four release scripts and .tool-versions; adding one to the
template adds it to the check, and a file that starts taking a variable leaves,
without anyone editing this script.

It also answers #24's remaining half: how a service starts its Erlang node.
no-listener is the template's form, loopback listens only on 127.0.0.1, open
listens on every address with a cookie as its only defence, unknown means no
config/vm.args.src to read. A baked-in cookie is reported apart from the form,
because one cookie in a public image is one secret in every copy of it.

Shown to fail: deleting the differs line, classifying open as no-listener, and
reading HEAD instead of origin/main each turn exactly one case red. The
read-only claim is pinned too -- a fixture with a branch carrying a file main
does not have reports it missing, and its `git status' stays empty.

Gate: scripts/check-sealing_test.sh, rebar3 lint, xref, eunit, ct 62/0,
dialyzer, all green.

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Per-procedure inbound limits from the node's config

{inbound_guard, #{procedures => #{<<"org/proc">> => Limits}}} sets one
procedure's limits (and envelope) per environment without a rebuild:
merged over the capability's declared limits, under runtime set_limits.
validate_config/0 checks the whole block at guard boot.

Refs #19, Refs macula-services/mcl-echo#11

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Boot refuses a procedure entry whose per_caller_max exceeds its global_max

Terra R1 on #19: validate_configured/1 ran only the key check, so the
entry passed boot and its procedure was then never advertised. Docs
name what boot cannot know (the capability's own numbers, a name that
matches nothing).

Refs #19

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Release 1.8.0

Per-procedure inbound limits from config (#19, PR #61) and slices A-C
of #51 (scaffold). The template asks for mcl_om ~> 1.8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
priv/templates/mcl_service/is_image_push.sh counted `.md', docs/ and LICENSE
as documentation, so a commit carrying only a re-rendered assets/c4-*.svg
answered build=true and the workflow built and pushed an image for it. The
shared C4 gate writes those files, so that shape is ordinary, not exotic.

Every service that carries the file already has `^assets/' in that regex; the
template was the only copy without it. check-service-drift.sh is what showed
it, while catching mcl-turn-credentials up to the template: that service's
copy was NEWER than the template's, and copying the template verbatim would
have re-broken the gate there.

The comment above the regex is corrected as well. It said a push to main
rebuilds :latest and watchtower rolls every box; no box runs watchtower, and a
main push publishes :main and :<sha>.

docs_only_gate_decides_each_push_shape now commits an asset on its own, which
must answer build=false, and an asset after code, which must answer
build=true. The assets-only case answers build=true against 5cdc3f3's script
and build=false against this one; the suite is what keeps it.

Refs #63

Co-authored-by: Claude Code <noreply@anthropic.com>
Refs #67

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A house scaffold now ships .github/workflows/c4-design-gate.yml, calling
macula-ci-images' c4-design-gate.yml: gate:design on a plan issue without the
C4 Context and Container diagrams gets a comment and a failing check, and the
label stays. The C4 pin moves 40c349d -> b268b87 and both shared calls take it
from one C4_PIN in scripts/scaffold-service.sh. The template default stays off;
outside the house the workflow renders empty and the scaffold removes it. The
architecture README gains Level 2 containers and names assets/c4-containers.svg.

Refs macula-io/macula-sponsors#113

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Terra's two required changes. The seeded "Model the service in C4" issue, the
one gate:design lands on, said Done = context + components, a state that fails
both the Design gate and c4-model at b268b87; it now asks for Context and
Container before code and components with it, and a test holds the body to
all three file names. The "two diagrams" text in the template README, the
build-push.yml c4-model comment, the root README, the template's c4
description and the scaffold comment now say three (the root README also
named lint.yml where build-push.yml calls the check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fix (Uranus): publish-hex's verify job is not guarded, and its
erlef/setup-beam takes github.token by default, which on the forge is the
forge's run token, sent to github.com.
macula-ci-images main is 9cc57e86: the dependency-advisories and
doc-snippets-erlang setup-beam steps fold the token to '' off github.com, and
the advisories setup-php step is a github.com one beside a forge one. Both
copies here are that main, byte for byte, and the two jobs lose their
`if: github.server_url == ...` guard.

publish-hex's verify job ran the short, unpinned `erlef/setup-beam@v1` on the
forge; it now takes the full commit sha macula-ci-images pins (54075bcc,
v1.24.1), so the label cannot move under a release.

Done when advisories is green on this repository's forge main.
The advisories call took the called workflow's default runner, where
setup-beam finds no ImageOS on a self-hosted runner, and died in ~2 s before
the scan (task 566). It now passes runs-on ["docker"], macula-station's scan
image (macula-ci-otp 20261031-2106, which carries python3; check's 20260928
does not) and --user 1000:1000. The stand-in is re-pinned byte for byte to
macula-ci-images d42d37e6.

The cowlib waiver for EEF-CVE-2026-43966 goes: it expired on 2026-11-20, and the
build now resolves cowlib 2.22.0, on which osv-scanner reports nothing.
The check job died in 2 s on the forge (task 8240 on main a1b20ca): its
first step, actions/checkout@v4, is a JavaScript action, and the job runs
inside a macula-ci image that carries no node. It never reached rebar3.

This brings back the plain-shell checkout from Pluto's 3e410196 (PR 1,
pluto/p1-pin, the last green check on this forge, task 1000), byte-identical
to the sibling repositories' copy, and drops actions/cache@v4 with it: the
instance runner keeps no cache for a plain-shell step.

The container image moves from ghcr to the forge registry's copy of the
same build line, git.macula.io/macula-pub/macula-ci-otp:20261124-0509
(OTP 28.4.3, the version the toolchain step checks), the image mcl-bookclub
already runs on. ghcr is not reachable while the account is suspended, and
the advisory scan made the same move in macula-io/macula-ci-images#27.

Refs #7
mcl_service_template_SUITE:this_repository_builds_in_the_scaffold_builder
pins the check job's image to the scaffold's builder_image, and failed on
run 6546 (job 26928) once b63f87e moved only the job. The scaffold's pair
cannot move to the forge yet: git.macula.io/macula-pub has macula-ci-otp
20261124-0509 but no macula-pq-runtime at any date, and builder and runtime
move together. So #7 is the plain-shell checkout alone, as ordered; the
image goes back to ghcr's 20260928-1800.

Refs #7
Red until mcl_om hosts several services (mcl_om:boot/1 with a list,
service_modules/0, capabilities per org, health naming the failing service,
info and describe per service, a claim per org) and mcl_om_singleton exists.

Refs #8
mcl_om:boot/1,2 now adds its service to the ones the node hosts, and
boot/1 takes a list for a bundle. Each service advertises under its own
org (info/0's `org`, else the env), with its own capability set merged
beside the others', its own info and describe handlers, and a claim per
distinct org. Health combines the services and names a failing one. One
identity key, one pool, one health socket, as before; a standalone
release's single boot/1 behaves as it did.

mcl_om_singleton runs a child on exactly one node of a cluster under a
`global` name: standbys take over when the holder's node goes, and two
holders that meet keep the one on the node whose name sorts first.

Refs #8
The work's start function answers as a supervisor child's does. {ok, Pid,
Info} runs the work as {ok, Pid} does; ignore ends the guard as an ignored
child, and global drops its name with it. Before, both crashed the guard
with a case_clause (Jupiter, r1).

The moduledoc now says that a netsplit runs one copy per connected
partition, and that resolve/3 keeps one when the parts meet (Jupiter's
note, r1).

Refs #8
vsn 1.9.0 in mcl_om.app.src. The CHANGELOG's Unreleased section becomes
[1.9.0] - 2026-12-02: #8 (multi-service boot, service_org/1,
service_modules/0, mcl_om_singleton) and, under Fixed, the #7 check job.

Refs #11
mcl_service_template_SUITE:generated_service_floor_is_this_release
derives the floor from mcl_om's own vsn, and failed on job 27062 with
expected "~> 1.9", got "~> 1.8" once the bump moved vsn to 1.9.0.

Refs #11
publish-hex.yml ran release-guard and publish on github.com only, so a tag
pushed to the forge published nothing. It is now evoq's forge workflow:
the docker runner, the ci-otp image by digest, plain-shell checkouts, no
if: on a reusable call, release-guard on ["docker"], and evoq's
scripts/is_erlang_the_pinned_version.sh. publish needs verify, test
(lint-and-test.yml), release-guard and docs.

docs.yml runs evoq's way, in the ci-otp image (#5); its stand-in copy of
doc-snippets-erlang.yml goes, nothing calls it now. template-lint-image
moves unchanged into its own workflow, so the release's test gate is the
suite (check + advisories); #2 stays open for it.

Refs #13, #2, #5
Dry run 6648 never reached publish: test's advisories job (27241) died on
"OSV_SCANNER_VERSION: unbound variable". The stand-in keeps that in a
workflow-level env:, which the forge drops in a callee two calls deep
(publish-hex -> lint-and-test -> stand-in). At depth 1 (PR/push) it ran.

The advisories job moves unchanged into advisories.yml, and publish-hex
calls the stand-in itself as advisories, with the same inputs; publish
needs [verify, test, advisories, release-guard, docs].

Refs #13
# Conflicts:
#	.gitignore
#	LICENSE
#	README.md
Moves only: no file's content changes here, so git follows every file
across the rename and blame keeps mcl-om's lines. The content rename is
the next commit. The modules split as in the design (docs/DESIGN.md §1.2).
The content half of the rename: every mcl_om module, the application, its
app env key, MCL_OM_* names, the hex package and the template's dependency
become mcl_core. The version starts the fresh 1.0 line (1.0.0, unreleased).

History stays as written: CHANGELOG.md, the ownership-proof vector's
provenance, version mentions (mcl_om 0.35.0, mcl-om 0.37.x) and issue
references (mcl-om#41) still name the old package and repo.
- mcl_core_transport (src/contract/): the seam between the contract and a
  transport. mcl_core:call_capability/4,5 reach the wire through it, and
  mcl_core_bridge (src/bridge/) is its one transport in 1.0, delegating to
  the mesh code unchanged. src/lan/ holds a note for the LAN transport.
- docs/DESIGN.md and assets/mcl-lan-{context,container}.svg, moved from
  macula-services/mcl-lan at 4020832, with a §9 appended on what changed
  since (mcl-core, §8 void, what P1 leaves for P2 and P3). README shows the
  model, ex_doc carries both.
- CHANGELOG: mcl_core 1.0.0 and how a service moves from mcl_om.
LICENSE: keep mcl-om's copyright notice, which the merge replaced with the forge's (Refs #1)
Some checks failed
advisories / erlang in . (pull_request) Has been skipped
advisories / erlang in . (container) (pull_request) Successful in 11s
advisories / Dependency advisories (pull_request) Successful in 0s
template-lint-image / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 6s
docs / doc snippets (erlang) (pull_request) Successful in 2m11s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 5m12s
advisories / erlang in . (push) Has been skipped
advisories / erlang in . (container) (push) Successful in 13s
advisories / Dependency advisories (push) Successful in 0s
docs / doc snippets (erlang) (push) Successful in 1m40s
template-lint-image / scaffold lint toolchain runs in its pinned image (push) Failing after 4s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (push) Successful in 6m11s
1256ced9df
Member

Landed on main as 1256ced9df by fast-forward from 423fe1a9; the mcl-om history comes along unchanged. Closing.

Landed on main as 1256ced9dfe291c04ee48f8e925c019f2030c295 by fast-forward from 423fe1a9; the mcl-om history comes along unchanged. Closing.
terra closed this pull request 2026-12-02 10:29:55 +00:00
Some checks failed
advisories / erlang in . (pull_request) Has been skipped
advisories / erlang in . (container) (pull_request) Successful in 11s
advisories / Dependency advisories (pull_request) Successful in 0s
template-lint-image / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 6s
docs / doc snippets (erlang) (pull_request) Successful in 2m11s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 5m12s
advisories / erlang in . (push) Has been skipped
advisories / erlang in . (container) (push) Successful in 13s
advisories / Dependency advisories (push) Successful in 0s
docs / doc snippets (erlang) (push) Successful in 1m40s
template-lint-image / scaffold lint toolchain runs in its pinned image (push) Failing after 4s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (push) Successful in 6m11s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
macula-services/mcl-core!5
No description provided.