Wave 2: mail names its own store, org and data root, and leaves the boot to a bundle (mcl-mail#31) #32

Manually merged
terra merged 2 commits from pluto/31-wave2 into main 2026-12-02 07:22:45 +00:00
Member

Refs martha-ai/mcl-martha#1 (wave 2, the per-service packages), macula-services/mcl-om#8, and macula-services/mcl-mail#31

What changes

The per-service changes a bundle of several mcl services needs, with its own standalone release left doing exactly what it does today.

  • C2, the replay names its own store. mailboxes_read_model_replay read evoq's store_id app env, which is one value per VM and is set differently by every service in a bundle. It names mcl_mail_store:id/0 now, the one place this service's store id is written. The nine CMD desks already name it on every dispatch and are untouched.
  • C6, its own org. mcl_mail_service:info/0 carries org => <<"mcl-mail">>, which mcl-om#8's boot reads. The pinned hex release, mcl_om 1.8.0, reads only the mcl_om app env, so that config line stays and a test holds the two equal; the key is inert until the pin is ~> 1.9, and C6 completes with that move, not this one.
  • C7, the bundled switch. {bundled, true} stops the application calling mcl_om:boot/1; it opens the store and starts the service supervisor, and mcl_mail_service:start/1 answers a supervisor that is already running, so a bundle's own mcl_om:boot([...]) registers the service instead of failing already_started. Unset, which is every standalone release, keeps today's one call.
  • C8/C9, the data root is the app env's. The store's root comes from {mcl_mail, data_root}, which the shipped config fills from MCL_DATA_DIR; no code reads the OS variable. The store keeps its mcl_mail_store subdirectory, so /data/mcl_mail_store is unchanged.
  • A3 package 4: nothing to wrap. Mail publishes and subscribes to no mesh topic, and its read model is local ETS, so a second copy on another node runs no doubled side effect. No singleton is added.

Gates

rebar3 eunit 157 pass, rebar3 lint clean, rebar3 dialyzer clean, OTP 28.4.3.

Refs martha-ai/mcl-martha#1 (wave 2, the per-service packages), macula-services/mcl-om#8, and macula-services/mcl-mail#31 ## What changes The per-service changes a bundle of several mcl services needs, with its own standalone release left doing exactly what it does today. - **C2, the replay names its own store.** `mailboxes_read_model_replay` read evoq's `store_id` app env, which is one value per VM and is set differently by every service in a bundle. It names `mcl_mail_store:id/0` now, the one place this service's store id is written. The nine CMD desks already name it on every dispatch and are untouched. - **C6, its own org.** `mcl_mail_service:info/0` carries `org => <<"mcl-mail">>`, which mcl-om#8's boot reads. The pinned hex release, mcl_om 1.8.0, reads only the `mcl_om` app env, so that config line stays and a test holds the two equal; the key is inert until the pin is `~> 1.9`, and C6 completes with that move, not this one. - **C7, the bundled switch.** `{bundled, true}` stops the application calling `mcl_om:boot/1`; it opens the store and starts the service supervisor, and `mcl_mail_service:start/1` answers a supervisor that is already running, so a bundle's own `mcl_om:boot([...])` registers the service instead of failing `already_started`. Unset, which is every standalone release, keeps today's one call. - **C8/C9, the data root is the app env's.** The store's root comes from `{mcl_mail, data_root}`, which the shipped config fills from `MCL_DATA_DIR`; no code reads the OS variable. The store keeps its `mcl_mail_store` subdirectory, so `/data/mcl_mail_store` is unchanged. - **A3 package 4: nothing to wrap.** Mail publishes and subscribes to no mesh topic, and its read model is local ETS, so a second copy on another node runs no doubled side effect. No singleton is added. ## Gates `rebar3 eunit` 157 pass, `rebar3 lint` clean, `rebar3 dialyzer` clean, OTP 28.4.3.
Wave 2 (mcl-martha#1): mail names its own store, org and data root (mcl-mail#31)
Some checks failed
c4 model / c4-model-1 (pull_request) Successful in 3s
c4 model / c4-model (pull_request) Successful in 0s
lint-and-test / check (pull_request) Has been cancelled
lint-and-test / The tested lock arrives whole (pull_request) Has been cancelled
431a50bbaa
The per-service changes a bundle of several services needs, without moving
its own standalone release off what it does today.

- C2: the read-model replay names mcl_mail_store:id/0 instead of reading
  evoq's `store_id' app env, which is one value per VM that every service in
  a bundle sets differently. The nine CMD desks already name it on dispatch.
- C6: info/0 carries the service's org and a test holds it equal to the
  config line. The key is inert on the pinned mcl_om 1.8.0, which reads only
  the app env; the line stays until the pin is ~> 1.9.
- C7: a `bundled' app env stops the application calling mcl_om:boot itself,
  and the service's start/1 answers an already-running supervisor, so a
  bundle's boot registers the service instead of failing already_started.
- C8/C9: the store's data root comes from {mcl_mail, data_root}, which the
  shipped config fills from MCL_DATA_DIR; no code reads the OS variable.
- A3 package 4: nothing to wrap. Mail publishes and subscribes to no topic,
  and its read model is local, so no side effect runs twice per node.

eunit 157 pass, lint and dialyzer clean on OTP 28.4.3.
test: the replay's store, proven by what it asks evoq's adapter for (mcl-mail#31 review)
All checks were successful
c4 model / c4-model-1 (pull_request) Successful in 5s
c4 model / c4-model (pull_request) Successful in 0s
lint-and-test / check (pull_request) Successful in 4m58s
lint-and-test / The tested lock arrives whole (pull_request) Successful in 1s
build-and-push / guard (push) Has been skipped
build-and-push / guard-1 (push) Has been skipped
c4 model / c4-model-1 (push) Successful in 2s
c4 model / c4-model (push) Successful in 0s
build-and-push / check (push) Successful in 3m52s
build-and-push / The tested lock arrives whole (push) Has been skipped
build-and-push / test (push) Successful in 0s
build-and-push / build-and-push (push) Successful in 1s
build-and-push / File the tested resolve for the signer (push) Successful in 1s
build-and-push / attest (push) Has been skipped
26ef0a880a
The source grep let a replay through that reads evoq's store_id with
mcl_mail_store:id() as its default. This test sets evoq's store_id to
another store and stands in as evoq's adapter: the replay must still ask
for mcl_mail_store. Killed that mutant; 157 eunit green on the real source.
terra manually merged commit 26ef0a880a into main 2026-12-02 07:22:45 +00:00
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-mail!32
No description provided.