app: a bundled release boots the service, this application then does not (#16) #17

Closed
hygiea wants to merge 0 commits from hygiea/16-bundle-member into main
Member

The bundled switch (C7) for macula-services/mcl-stations#16, in the one shape Mars ruled for the wave (mail#31's): the application always starts its own supervisor, bundled=true skips only the application's own mcl_om:boot, and mcl_stations_service:start/1 is idempotent.

mcl_stations_app:start/2 starts mcl_stations_sup in both shapes, and the application's own process is that supervisor. Bundled, the hosting release's one mcl_om:boot([...]) list calls the service's start/1, which answers {ok, Pid} with the supervisor that is already running rather than {error, {already_started, _}}; standalone, this application runs the boot itself exactly as before. The boot's own answer is checked against the supervisor this application started, so a service that built a second tree fails the start by name instead of hiding it.

r=2 replaces my first shape — a holder process, and no local supervisor when bundled — which Jupiter found divergent from the other services.

Five mutants, each red on its named test: bundled also boots; standalone stops booting; the switch never reads the env; the application stops asking for its supervisor; start/1 stops being idempotent. Two lessons from running them: a mutant the compiler refuses (an unused function) proves nothing about the test, so M2 keeps booted/2 reachable; and a failed compile leaves the previous beam, so the runner deletes the four beams before each mutant rather than running yesterday's.

Still held for the last commit, per Mars on 2026-12-02, because all of it needs mcl_om 1.9 and hex tops out at 1.8.0: org in info/0 (C6); the mcl_om.org literal leaving config/sys.config.src (C9); the floor test at 1.9.0 with the pin at ~> 1.9 (the lock is gitignored here; CI files the tested resolve); and the ingest_node_records singleton wrap (A3 package 4). Until then the env literal stays, which is what keeps the standalone release booting with an org on 1.8.

Refs #16.

Local, OTP 28.4.3, all green: rebar3 lint, rebar3 xref, rebar3 eunit (140 tests), rebar3 dialyzer, rebar3 as prod release.

The bundled switch (C7) for macula-services/mcl-stations#16, in the **one shape Mars ruled for the wave** (mail#31's): the application always starts its own supervisor, `bundled=true` skips only the application's own `mcl_om:boot`, and `mcl_stations_service:start/1` is idempotent. `mcl_stations_app:start/2` starts `mcl_stations_sup` in both shapes, and the application's own process is that supervisor. Bundled, the hosting release's one `mcl_om:boot([...])` list calls the service's `start/1`, which answers `{ok, Pid}` with the supervisor that is already running rather than `{error, {already_started, _}}`; standalone, this application runs the boot itself exactly as before. The boot's own answer is checked against the supervisor this application started, so a service that built a second tree fails the start by name instead of hiding it. **r=2 replaces my first shape** — a holder process, and no local supervisor when bundled — which Jupiter found divergent from the other services. Five mutants, each red on its named test: bundled also boots; standalone stops booting; the switch never reads the env; the application stops asking for its supervisor; `start/1` stops being idempotent. Two lessons from running them: a mutant the compiler refuses (an unused function) proves nothing about the test, so M2 keeps `booted/2` reachable; and a failed compile leaves the previous beam, so the runner deletes the four beams before each mutant rather than running yesterday's. **Still held for the last commit**, per Mars on 2026-12-02, because all of it needs mcl_om 1.9 and hex tops out at 1.8.0: `org` in `info/0` (C6); the `mcl_om.org` literal leaving `config/sys.config.src` (C9); the floor test at 1.9.0 with the pin at `~> 1.9` (the lock is gitignored here; CI files the tested resolve); and the `ingest_node_records` singleton wrap (A3 package 4). Until then the env literal stays, which is what keeps the standalone release booting **with an org** on 1.8. Refs #16. Local, OTP 28.4.3, all green: `rebar3 lint`, `rebar3 xref`, `rebar3 eunit` (140 tests), `rebar3 dialyzer`, `rebar3 as prod release`.
app: a bundled release boots the service, this application then does not (#16)
All checks were successful
Test / erlang in . (pull_request) Has been skipped
c4 model / c4-model-1 (pull_request) Successful in 2s
c4 model / c4-model (pull_request) Successful in 0s
Test / guard-1 (pull_request) Successful in 5s
Test / guard (pull_request) Successful in 0s
Test / erlang in . (container) (pull_request) Successful in 12s
Test / Dependency advisories (pull_request) Successful in 0s
Test / rebar3 lint, xref, eunit, dialyzer (OTP 28.4.3) (pull_request) Successful in 4m15s
Test / File the tested resolve for the signer (pull_request) Has been skipped
Test / Release (forge, v* tag) (pull_request) Has been skipped
Test / The tested lock arrives whole (pull_request) Successful in 3s
358e2c984c
mcl_stations_app:start/2 now reads {mcl_stations, [{bundled, true}]} from app
env. Set, it starts nothing: the hosting release's one mcl_om:boot([...]) list
starts this service's supervisor, and a second start here would be a name
clash on mcl_stations_sup. Absent -- every deployment that exists today, and
this service's own release -- it calls mcl_om:boot(mcl_stations_service)
exactly as before.

The switch's two arms take the boot as a function, so the tests prove both
without booting mcl_om: a real boot wires a mesh pool against a realm and
stations a node, which is not something a unit test may do. Three mutants
(bundled boots, standalone does not boot, the switch always false) each turn
the matching test red.

Part of macula-services/mcl-stations#16 (C7, macula-services/mcl-om#8): the
org from info/0, the ingest_node_records singleton wrap and the ~> 1.9 pin
follow in the last commit, once the 1.9.0 release exists.
app: the C7 shape is mail#31's -- always start the sup, bundled skips only the boot (r=2, #16)
All checks were successful
Test / erlang in . (pull_request) Has been skipped
c4 model / c4-model (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 4s
Test / guard-1 (pull_request) Successful in 2s
Test / guard (pull_request) Successful in 0s
Test / erlang in . (container) (pull_request) Successful in 19s
Test / Dependency advisories (pull_request) Successful in 0s
Test / rebar3 lint, xref, eunit, dialyzer (OTP 28.4.3) (pull_request) Successful in 3m29s
Test / File the tested resolve for the signer (pull_request) Has been skipped
Test / Release (forge, v* tag) (pull_request) Has been skipped
Test / The tested lock arrives whole (pull_request) Successful in 2s
Test / erlang in . (push) Has been skipped
c4 model / c4-model-1 (push) Successful in 2s
c4 model / c4-model (push) Successful in 0s
Test / guard-1 (push) Successful in 5s
Test / guard (push) Successful in 0s
Test / erlang in . (container) (push) Successful in 18s
Test / Dependency advisories (push) Successful in 0s
Test / rebar3 lint, xref, eunit, dialyzer (OTP 28.4.3) (push) Successful in 3m11s
Test / The tested lock arrives whole (push) Has been skipped
Test / Release (forge, v* tag) (push) Has been skipped
Test / File the tested resolve for the signer (push) Successful in 2s
12b164d958
Jupiter found two C7 shapes in the wave; Mars ruled one for all six, mail#31's.
This is mcl-stations on that shape:

- start/2 ALWAYS starts this service's supervisor, in both shapes, and the
  application's own process is that supervisor. Bundled, the hosting release's
  one mcl_om:boot([...]) list no longer starts a tree under whatever process
  ran the boot: its call to mcl_stations_service:start/1 finds this one
  running and answers with it.
- bundled=true now skips one thing only, this application's own
  mcl_om:boot/1.
- mcl_stations_service:start/1 is idempotent: a second call answers {ok, Pid}
  with the running supervisor instead of {error, {already_started, _}}, which
  is what would have refused the bundle's boot.

The boot's answer is checked rather than trusted: with an idempotent start/1
it must be the supervisor this application started, so a different pid is a
second tree and start/2 fails naming it.

Tests: five mutants, each turning its named test red -- M1 bundled also boots,
M2 standalone stops booting, M3 the switch never reads the env, M4 the
application stops asking for its supervisor, M5 start/1 stops being
idempotent (logs under ~/.claude/sessions/hygiea-stations/mutants-r2/).
Two mutant lessons worth keeping: a mutant the compiler refuses (an unused
function) proves nothing about the test, so M2 keeps booted/2 reachable; and a
failed compile leaves the previous beam, so the runner deletes the four beams
before each mutant or the suite runs yesterday's mutant.

Refs macula-services/mcl-stations#16, macula-services/mcl-om#8.
Member

Landed by fast-forward: main is 12b164d958 (from 734d2285). This repository does not allow the manually-merged style, so the PR is closed by hand.

Landed by fast-forward: main is 12b164d958cbf3622de045a44ae251c3d1908f34 (from 734d2285). 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:47:32 +00:00
All checks were successful
Test / erlang in . (pull_request) Has been skipped
c4 model / c4-model (pull_request) Successful in 0s
c4 model / c4-model-1 (pull_request) Successful in 4s
Test / guard-1 (pull_request) Successful in 2s
Test / guard (pull_request) Successful in 0s
Test / erlang in . (container) (pull_request) Successful in 19s
Test / Dependency advisories (pull_request) Successful in 0s
Test / rebar3 lint, xref, eunit, dialyzer (OTP 28.4.3) (pull_request) Successful in 3m29s
Test / File the tested resolve for the signer (pull_request) Has been skipped
Test / Release (forge, v* tag) (pull_request) Has been skipped
Test / The tested lock arrives whole (pull_request) Successful in 2s
Test / erlang in . (push) Has been skipped
c4 model / c4-model-1 (push) Successful in 2s
c4 model / c4-model (push) Successful in 0s
Test / guard-1 (push) Successful in 5s
Test / guard (push) Successful in 0s
Test / erlang in . (container) (push) Successful in 18s
Test / Dependency advisories (push) Successful in 0s
Test / rebar3 lint, xref, eunit, dialyzer (OTP 28.4.3) (push) Successful in 3m11s
Test / The tested lock arrives whole (push) Has been skipped
Test / Release (forge, v* tag) (push) Has been skipped
Test / File the tested resolve for the signer (push) Successful in 2s

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