P2: the LAN transport, the first mcl_core release #6

Closed
uranus wants to merge 0 commits from uranus/3-lan-transport into main
Member

Refs #3 (design §2, §7 P2). The first mcl_core release; its tag and hex publish wait for Mars's word.

DECIDED 2026-12-02 "trust on sight. mcl-martha services should auto-cluster over LAN, no mcl-station required. Distributed Erlang offers us all we need." (Raf)
DECIDED 2026-12-02 "Shared cookie + secret (Recommended)" (Raf)

Done when, each with its proof in test/mcl_core_lan_SUITE.erl (peer nodes, gossip TTL 0):

  • Two nodes with the cookie and secret cluster with no station; a node with another secret, another cookie, or none does not join or start: two_nodes_with_the_secrets_form_a_cluster, a_node_with_another_secret_does_not_join, a_node_with_another_cookie_does_not_join, a_node_without_the_secrets_refuses_to_start.
  • A capability on one node is called from the other, and the handler sees the caller's node id under caller: a_capability_is_called_from_the_other_node_with_its_caller.
  • A publish on one node reaches a subscriber on the other: a_publish_reaches_a_subscriber_on_the_other_node.
  • With no LAN provider a call falls through to the bridge: with_no_lan_provider_a_call_goes_to_the_bridge.
  • CHANGELOG and README name the release.

Mutants run locally, each caught by its case: the caller not overwritten, a fixed gossip secret, the {nodes, Ids} policy opened.

What P2 decided beyond §2 is appended to docs/DESIGN.md §9.

🤖 Generated with Claude Code

Refs #3 (design §2, §7 P2). The first `mcl_core` release; its tag and hex publish wait for Mars's word. DECIDED 2026-12-02 "trust on sight. mcl-martha services should auto-cluster over LAN, no mcl-station required. Distributed Erlang offers us all we need." (Raf) DECIDED 2026-12-02 "Shared cookie + secret (Recommended)" (Raf) Done when, each with its proof in `test/mcl_core_lan_SUITE.erl` (peer nodes, gossip TTL 0): - Two nodes with the cookie and secret cluster with no station; a node with another secret, another cookie, or none does not join or start: `two_nodes_with_the_secrets_form_a_cluster`, `a_node_with_another_secret_does_not_join`, `a_node_with_another_cookie_does_not_join`, `a_node_without_the_secrets_refuses_to_start`. - A capability on one node is called from the other, and the handler sees the caller's node id under `caller`: `a_capability_is_called_from_the_other_node_with_its_caller`. - A publish on one node reaches a subscriber on the other: `a_publish_reaches_a_subscriber_on_the_other_node`. - With no LAN provider a call falls through to the bridge: `with_no_lan_provider_a_call_goes_to_the_bridge`. - CHANGELOG and README name the release. Mutants run locally, each caught by its case: the caller not overwritten, a fixed gossip secret, the `{nodes, Ids}` policy opened. What P2 decided beyond §2 is appended to docs/DESIGN.md §9. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The LAN transport: services on one LAN cluster and call and publish with no station (Refs #3)
Some checks failed
advisories / erlang in . (pull_request) Has been skipped
template-lint-image / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 2s
advisories / erlang in . (container) (pull_request) Successful in 11s
advisories / Dependency advisories (pull_request) Successful in 0s
docs / doc snippets (erlang) (pull_request) Successful in 2m4s
docs / doc snippets (erlang) (push) Successful in 2m15s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 5m52s
05c23f87fd
DECIDED 2026-12-02 "trust on sight. mcl-martha services should auto-cluster
over LAN, no mcl-station required." and "Shared cookie + secret
(Recommended)" (Raf). Design §2 and §7 P2.

- src/lan/: cluster start (cookie and gossip secret in the data dir, made
  by the first node, never overwritten; macula_cluster_gossip), capabilities
  and calls on pg with the caller's node id written under `caller`, pubsub
  on pg with `sources` checked against the publisher.
- mcl_core_transport tries the LAN first, then the bridge.
  mcl_core_pubsub:publish/2,3 go through it; mesh_publish/3 is the mesh alone.
- Off unless the `lan` app env is set: a node that does not cluster behaves
  as mcl_om 1.9.0 did.
- mcl_core_lan_SUITE: peer nodes, gossip TTL 0, a positive control beside
  every refusal. Guide, README, CHANGELOG; DESIGN §9 records what P2 decided
  beyond §2.
LAN hosts come back after their tree restarts; a failed cookie write leaves no secret (Refs #3)
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 5s
docs / doc snippets (erlang) (pull_request) Successful in 1m49s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 5m14s
advisories / erlang in . (push) Has been skipped
template-lint-image / scaffold lint toolchain runs in its pinned image (push) Failing after 4s
advisories / erlang in . (container) (push) Successful in 13s
advisories / Dependency advisories (push) Successful in 0s
docs / doc snippets (erlang) (push) Successful in 1m57s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (push) Successful in 5m41s
a697a9bdc2
Review r1 (Mercurius): mcl_core_lan_sup is rest_for_one, and a crash of the
gossip or the pg scope restarted mcl_core_lan_hosts with no children, so a
node stopped serving every LAN capability and subscription until its
services booted again.

- mcl_core_lan_hosts records each service's child specs in a
  persistent_term once they all started, and init/1 starts every recorded
  spec. A set that does not start is taken down and not recorded.
  mcl_core:forget_services/0 clears the record.
- Gossip moves after the hosts, so its restart restarts nothing else.
- A cookie that cannot be written deletes the secret the same call made.
- Tests: the suite kills A's gossip, then its pg scope, and B's call is
  still served by A; the subscription is still joined. Mutant (init starts
  nothing) fails that case alone. Secrets: a cookie path that cannot be
  created leaves no secret; mutant (no delete) caught.
Member

Landed on main as a697a9bdc2 (fast-forward from 1256ced9).

Landed on main as a697a9bdc29035c4077ea39bbdecc7c9aeb0cbba (fast-forward from 1256ced9).
terra closed this pull request 2026-12-02 11:39:25 +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 5s
docs / doc snippets (erlang) (pull_request) Successful in 1m49s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 5m14s
advisories / erlang in . (push) Has been skipped
template-lint-image / scaffold lint toolchain runs in its pinned image (push) Failing after 4s
advisories / erlang in . (container) (push) Successful in 13s
advisories / Dependency advisories (push) Successful in 0s
docs / doc snippets (erlang) (push) Successful in 1m57s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (push) Successful in 5m41s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 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!6
No description provided.