Wave 2: mcl-scribe names its own store, data root and boot so a release can host several services (#16) #17

Closed
vesta wants to merge 0 commits from vesta/16-wave2 into main
Member

Wave 2 of martha-ai/mcl-martha#1 for this service: a bundled release can host mcl-scribe beside other services on one node while its own standalone release keeps working unchanged.

  • C8 the scribe log's root is this service's own app env (data_root); MCL_DATA_DIR is still honoured when nothing names one, the laptop default is unchanged, and the store keeps its own subdirectory under the root.
  • C7 bundled: set by a release that boots its own services (mcl_om:boot([Service]), macula-services/mcl-om#8), it opens the store and starts the departments without booting mcl_om itself. Unset, every standalone release boots exactly as before.
  • C2 the read model's projection names the scribe log in its opts instead of taking evoq's single app-env store id; a source guard pins that no dispatch or store read in apps/ takes the store from evoq's env. evoq's own remaining fallbacks are filed as reckon-db-org/evoq#13.
  • C6 and the singleton wrap are NOT here: both need the mcl_om release after a2aa62e3 (service_org/1 and mcl_om_singleton exist only on mcl-om main, whose .app.src still says 1.8.0 while v1.8.0 was tagged 2026-11-02). They land as the last commit when the pin moves to ~> 1.9.

Store mode unchanged (single), as instructed.

Gates, on 46502632: rebar3 lint, rebar3 xref, rebar3 eunit (78 tests), rebar3 dialyzer — all green locally on OTP 28.4.3. Mutants checked on every guard: the bundled clause, the data-root precedence, the projection's store_id, and an injected env read.

Refs #16
Refs martha-ai/mcl-martha#1
Refs macula-services/mcl-om#8

Wave 2 of martha-ai/mcl-martha#1 for this service: a bundled release can host mcl-scribe beside other services on one node while its own standalone release keeps working unchanged. - **C8** the scribe log's root is this service's own app env (`data_root`); `MCL_DATA_DIR` is still honoured when nothing names one, the laptop default is unchanged, and the store keeps its own subdirectory under the root. - **C7** `bundled`: set by a release that boots its own services (`mcl_om:boot([Service])`, macula-services/mcl-om#8), it opens the store and starts the departments without booting `mcl_om` itself. Unset, every standalone release boots exactly as before. - **C2** the read model's projection names the scribe log in its opts instead of taking evoq's single app-env store id; a source guard pins that no dispatch or store read in `apps/` takes the store from evoq's env. evoq's own remaining fallbacks are filed as reckon-db-org/evoq#13. - **C6 and the singleton wrap are NOT here**: both need the mcl_om release after a2aa62e3 (`service_org/1` and `mcl_om_singleton` exist only on mcl-om main, whose `.app.src` still says 1.8.0 while v1.8.0 was tagged 2026-11-02). They land as the last commit when the pin moves to `~> 1.9`. Store mode unchanged (`single`), as instructed. Gates, on 46502632: `rebar3 lint`, `rebar3 xref`, `rebar3 eunit` (78 tests), `rebar3 dialyzer` — all green locally on OTP 28.4.3. Mutants checked on every guard: the bundled clause, the data-root precedence, the projection's `store_id`, and an injected env read. Refs #16 Refs martha-ai/mcl-martha#1 Refs macula-services/mcl-om#8
a node can host several services: the store, the root and the boot are the service's own (#16)
Some checks failed
c4 model / c4-model (pull_request) Has been cancelled
c4 model / c4-model-1 (pull_request) Has been cancelled
lint-and-test / check (pull_request) Has been cancelled
4650263263
- data_root: the scribe log's root is this service's own app env; MCL_DATA_DIR is
  still honoured when nothing names one, and the laptop default is unchanged, so a
  standalone release runs with the configuration it has today.
- bundled: set by a release that boots its own services (mcl_om:boot([Service]),
  mcl-om#8), the app opens its store and starts its departments without booting
  mcl_om itself. Unset -- every standalone release -- it boots as before.
- The read model's projection names the scribe log in its opts instead of taking
  evoq's single app-env store id, which one node cannot hold per service. evoq's own
  remaining fallbacks are reckon-db-org/evoq#13, not this package's.

Tests pin each of the three, and a source guard pins that no dispatch or store read
in apps/ takes the store from evoq's env. Mutants checked: the bundled clause, the
app-env precedence, the projection's store_id, and an injected env read.

Refs #16
C7 in the one shape: bundled, the app still owns its supervisor (mcl-scribe#16 review)
All checks were successful
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) Successful in 3m55s
build-and-push / guard-1 (push) Successful in 3s
build-and-push / guard (push) Successful in 0s
c4 model / c4-model-1 (push) Successful in 3s
c4 model / c4-model (push) Successful in 0s
build-and-push / check (push) Successful in 3m36s
build-and-push / test (push) Successful in 0s
build-and-push / Release (forge, v* tag) (push) Has been skipped
lint-and-test / check (push) Successful in 3m33s
b88e564f87
boot_bundled(true, _) answered a bare ok from start/2, which OTP refuses
as a bad return: a bundled release could not start mcl_scribe. Bundled,
the app now starts mcl_scribe_sup and answers its pid; the service's
start/1 answers the running supervisor, so the release's boot registers
it. Mutants killed: the bare ok, and a start/1 that starts again.
Member

Landed by fast-forward: main is b88e564f87 (from 75965cbc). This repository does not allow the manually-merged style, so the PR is closed by hand.

Landed by fast-forward: main is b88e564f8748faef7ddc68f87a7ea7f4aaf35150 (from 75965cbc). This repository does not allow the manually-merged style, so the PR is closed by hand.
terra closed this pull request 2026-12-02 07:35:40 +00:00
All checks were successful
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) Successful in 3m55s
build-and-push / guard-1 (push) Successful in 3s
build-and-push / guard (push) Successful in 0s
c4 model / c4-model-1 (push) Successful in 3s
c4 model / c4-model (push) Successful in 0s
build-and-push / check (push) Successful in 3m36s
build-and-push / test (push) Successful in 0s
build-and-push / Release (forge, v* tag) (push) Has been skipped
lint-and-test / check (push) Successful in 3m33s

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-scribe!17
No description provided.