host_bookclub parity with mcl-bookclub, and an evoq behaviour for command handlers #4

Closed
opened 2026-12-01 03:54:48 +00:00 by supervisor · 7 comments
Owner

Purpose (parity): mcl-bookclub-phoenix (Elixir) carries the same domain, slices and evoq use as mcl-bookclub (Erlang, the leading implementation), so either repo shows the method in full; and every command handler in both implements the fitting evoq behaviour.

Raf, 2026-12-01: "In mcl-bookclub, i see that the implementation is A LOT more complete than in mcl-bookclub-phoenix (e.g. host_bookclub)" and "shouldn't command handlers (e.g. maybe_procure_book) implement some kind of evoq behaviour? (maybe evoq_command_handler?)". mcl-bookclub (Erlang) leads; mcl-bookclub-phoenix is just as important; mcl-bookclub-gleam is postponed.

Done when:

  1. A gap table (every slice, aggregate, handler, projection, emitter, PM, query, test and API of mcl-bookclub's host_bookclub and sibling apps, with its Phoenix counterpart or "missing", file:line both sides) is posted here.
  2. The evoq question is answered with file:line from reckon-db-org/evoq: which behaviour a maybe_<command> handler should implement (an existing one, or none exists and what that would mean), and what mcl-bookclub does today.
  3. mcl-bookclub-phoenix reaches parity: every "missing" row built in idiomatic Elixir/Phoenix, tests included, CI green.
  4. If (2) says a behaviour fits, both repos' command handlers implement it.
Purpose (parity): mcl-bookclub-phoenix (Elixir) carries the same domain, slices and evoq use as mcl-bookclub (Erlang, the leading implementation), so either repo shows the method in full; and every command handler in both implements the fitting evoq behaviour. Raf, 2026-12-01: "In mcl-bookclub, i see that the implementation is A LOT more complete than in mcl-bookclub-phoenix (e.g. host_bookclub)" and "shouldn't command handlers (e.g. maybe_procure_book) implement some kind of evoq behaviour? (maybe evoq_command_handler?)". mcl-bookclub (Erlang) leads; mcl-bookclub-phoenix is just as important; mcl-bookclub-gleam is postponed. Done when: 1. A gap table (every slice, aggregate, handler, projection, emitter, PM, query, test and API of mcl-bookclub's host_bookclub and sibling apps, with its Phoenix counterpart or "missing", file:line both sides) is posted here. 2. The evoq question is answered with file:line from reckon-db-org/evoq: which behaviour a `maybe_<command>` handler should implement (an existing one, or none exists and what that would mean), and what mcl-bookclub does today. 3. mcl-bookclub-phoenix reaches parity: every "missing" row built in idiomatic Elixir/Phoenix, tests included, CI green. 4. If (2) says a behaviour fits, both repos' command handlers implement it.
Member

Gap table: mcl-bookclub (Erlang, leading) vs mcl-bookclub-phoenix (Elixir)

What was compared: mcl-bookclub main 0ce055a47e96d9c51328ee7dd8e47f6d20f322ca (E) and mcl-bookclub-phoenix main a93a8b7836e9745ed5bc422317b87dbf8110c64e (P). I read every module, test and repository-level file on both sides. file:line is relative to these prefixes:

Short E P
host/ apps/host_bookclub/src/ apps/host_bookclub/lib/host_bookclub/
prj/ apps/project_bookclub/src/ apps/project_bookclub/lib/project_bookclub/
qry/ apps/query_bookclub/src/ apps/query_bookclub/lib/query_bookclub/
fac/ apps/mcl_bookclub/src/ apps/mcl_bookclub_phoenix/lib/mcl_bookclub_phoenix/
web/ (none) apps/mcl_bookclub_phoenix_web/lib/mcl_bookclub_phoenix_web/

Status values: same (same behaviour, idiom aside), thinner (P exists but lacks something E has), missing (no P counterpart), moved (P puts it in another app, on purpose and with a written reason).

Summary

The two repos have the same domain: the same 4 aggregates, the same 8 command slices, the same events and fields, the same policy, emitters, facts, projections and queries. Every event struct has exactly the fields of its Erlang record (checked field by field). Where P falls short of E is in the following areas:

  1. The API entry points. E has 9 {command}_api modules. P has none. P's LiveView mints ids and enriches the club name inline (web/admin_live.ex:210-334).
  2. State and snapshots. P's state modules do not declare evoq_state and have no to_map/from_map. P's aggregates have no snapshot/from_snapshot. evoq only snapshots when snapshot/1 is exported (reckon-db-org/evoq src/evoq_aggregate.erl:757), so a P aggregate never snapshots: every load replays its whole stream.
  3. Events. No P event has from_map/1 or typed fields (@type t :: %__MODULE__{}).
  4. The desk's dispatch. E dispatches a built command (dispatch(Cmd)) and stamps a timestamp on the evoq command (evoq_command:new/5). P's dispatch/1 takes a raw params map and builds the command inside. It also uses evoq_command:new/4, so there is no timestamp metadata.
  5. Tests. E tests every command slice through a real reckon-db store (store_test_, with host/test/host_bookclub_test_store.erl). It also tests the policy firing on the 5th registration, emitters publishing (meck on macula), the admin HTTP API, projection replay idempotence, the PRJ/QRY schema contract, the department boundaries, and 23 service/image/runtime contract tests. P's host tests are pure only: none dispatches a command through a store. P has 0 tests for the policy's dispatch, for an emitter's publish, or for the admin over HTTP.
  6. Elixir idiom. 70 of 75 P modules say @moduledoc false and carry their documentation as # comments, so mix docs renders nothing. P has 2 @specs in total, against 286 -specs in E.
  7. The JSON admin API (E fac/mcl_bookclub_admin.erl, POST /api/{plural}/{verb}, GET /api/{plural}/:id) does not exist in P. P has a LiveView instead.
  8. Dependencies have drifted. E uses mcl_om ~> 1.6, macula ~> 18.0 (rebar.config:42,48). P uses mcl_om ~> 1.4, macula ~> 16.0 (apps/mcl_bookclub_phoenix/mix.exs:37-38): two macula majors behind, older wire.
  9. Repo and ops files. P lacks the following, which E has:
    • health on a Unix socket (config/sys.config.src:15, scripts/health.sh)
    • a self-made cookie (scripts/start.sh:13-24)
    • deploy/docker-compose.yml
    • guides/ (admin_ui, event_delivery)
    • wall.json (the event-storming wall) and its wall-tree workflow
  10. CI. P has only .github/workflows/ci.yml, which runs on GitHub and pulls a ghcr.io image. There is no .forgejo/ workflow. Forge Actions are held on moved repos (forge-actions-off-until-ported), so P has no running CI today.

A. Aggregates, state, status (host)

Item E file:line P file:line Status Difference
bookclub_aggregate host/bookclub_aggregate.erl:15 host/bookclub_aggregate.ex:1 thinner P has no snapshot/1/from_snapshot/1 (E :50-54). P also has an extra stream_id/1 (:61) that nothing calls
book_aggregate host/book_aggregate.erl:7 host/book_aggregate.ex:1 thinner as above (E :38-42); P extra stream_id/1 :44
member_aggregate host/member_aggregate.erl:8 host/member_aggregate.ex:1 thinner as above (E :39-43); P :45
reading_aggregate host/reading_aggregate.erl:8 host/reading_aggregate.ex:1 thinner as above (E :39-43); P :46
bookclub_state host/bookclub_state.erl:11 host/bookclub_state.ex:1 thinner P does not declare evoq_state (E :13). It has no to_map/from_map (E :61-84), no getters (E :86-104), no typespecs. P event_data/1 returns the raw event unstripped (P :51 vs E :114-117)
book_state host/book_state.erl:6 host/book_state.ex:1 thinner same four gaps (E :8, :53-79, :81-111, :113-116)
member_state host/member_state.erl:7 host/member_state.ex:1 thinner same (E :9, :50-70, :72-94, :96-99)
reading_state host/reading_state.erl:8 host/reading_state.ex:1 thinner same (E :10, :54-77, :79-105, :107-110)
bookclub_status (.erl + .hrl) host/bookclub_status.erl:1, host/bookclub_status.hrl:9 host/bookclub_status.ex:1 same the flags and their names live in one module (labels/0 in P, flag_map/0 in E)
book_status host/book_status.erl:8 host/book_status.ex:1 same as above
member_status host/member_status.erl:1 host/member_status.ex:1 same as above
reading_status host/reading_status.erl:1 host/reading_status.ex:1 same as above

B. Command slices (host), 8 desks × command / event / handler / API

In every row, the P command and event modules declare @behaviour :evoq_command / :evoq_event with @impl, as E's do.

Slice · item E file:line P file:line Status Difference
initiate_bookclub · command host/initiate_bookclub/initiate_bookclub_v1.erl:8 host/initiate_bookclub/initiate_bookclub_v1.ex:1 same P from_map/1 passes a stray club_name key into new/1 (:55); it is ignored, but it is a copy-paste wart
· event host/initiate_bookclub/bookclub_initiated_v1.erl:7 host/initiate_bookclub/bookclub_initiated_v1.ex:1 thinner P has no from_map/1 (E :51-58) and no getters (E :61-74); the type is untyped
· handler host/initiate_bookclub/maybe_initiate_bookclub.erl:9 host/initiate_bookclub/maybe_initiate_bookclub.ex:1 thinner P dispatch(params) builds the command inside (:47); E dispatch(Cmd) (:57). P has no timestamp metadata (evoq_command:new/4 :51 vs E /5 :66-69)
· API host/initiate_bookclub/initiate_bookclub_api.erl:8 — missing mints club_id when absent (E :15-17). In P this lives in web/admin_live.ex:210-220
archive_bookclub · command host/archive_bookclub/archive_bookclub_v1.erl:6 host/archive_bookclub/archive_bookclub_v1.ex:1 same
· event host/archive_bookclub/bookclub_archived_v1.erl:10 host/archive_bookclub/bookclub_archived_v1.ex:1 thinner no from_map/getters (E :65-98)
· handler host/archive_bookclub/maybe_archive_bookclub.erl:11 host/archive_bookclub/maybe_archive_bookclub.ex:1 thinner dispatch shape (P :63 vs E :63); P reads state.club_id etc. directly (:48-51), where E goes through state getters (:48-51)
· API host/archive_bookclub/archive_bookclub_api.erl:5 — missing
plan_party · command host/plan_party/plan_party_v1.erl:6 host/plan_party/plan_party_v1.ex:1 same
· event host/plan_party/party_planned_v1.erl:7 host/plan_party/party_planned_v1.ex:1 thinner no from_map/getters (E :45-63)
· handler host/plan_party/maybe_plan_party.erl:7 host/plan_party/maybe_plan_party.ex:1 thinner dispatch shape (P :54 vs E :55); P reads state.parties_planned directly (:43)
· API host/plan_party/plan_party_api.erl:4 — missing
register_member · command host/register_member/register_member_v1.erl:8 host/register_member/register_member_v1.ex:1 same
· event host/register_member/member_registered_v1.erl:8 host/register_member/member_registered_v1.ex:1 thinner no from_map/getters (E :52-76)
· handler host/register_member/maybe_register_member.erl:8 host/register_member/maybe_register_member.ex:1 thinner dispatch shape (P :54 vs E :55)
· API host/register_member/register_member_api.erl:1 — missing mints member_id. The club-name enrichment is in E's admin (fac/mcl_bookclub_admin.erl:100-108) and in P's LiveView (web/admin_live.ex:325-334)
unregister_member · command host/unregister_member/unregister_member_v1.erl:8 host/unregister_member/unregister_member_v1.ex:1 same
· event host/unregister_member/member_unregistered_v1.erl:9 host/unregister_member/member_unregistered_v1.ex:1 thinner no from_map/getters (E :60-93)
· handler host/unregister_member/maybe_unregister_member.erl:9 host/unregister_member/maybe_unregister_member.ex:1 thinner dispatch shape (P :55 vs E :56)
· API host/unregister_member/unregister_member_api.erl:1 — missing
procure_book · command host/procure_book/procure_book_v1.erl:6 host/procure_book/procure_book_v1.ex:1 same
· event host/procure_book/book_procured_v1.erl:5 host/procure_book/book_procured_v1.ex:1 thinner no from_map/getters (E :55-85)
· handler host/procure_book/maybe_procure_book.erl:6 host/procure_book/maybe_procure_book.ex:1 thinner dispatch shape (P :55 vs E :56)
· API host/procure_book/procure_book_api.erl:5 — missing mints book_id (E :10-12)
retire_book · command host/retire_book/retire_book_v1.erl:8 host/retire_book/retire_book_v1.ex:1 same
· event host/retire_book/book_retired_v1.erl:9 host/retire_book/book_retired_v1.ex:1 thinner no from_map/getters (E :68-107)
· handler host/retire_book/maybe_retire_book.erl:9 host/retire_book/maybe_retire_book.ex:1 thinner dispatch shape (P :57 vs E :58)
· API host/retire_book/retire_book_api.erl:1 — missing
start_reading · command host/start_reading/start_reading_v1.erl:9 host/start_reading/start_reading_v1.ex:1 same
· event host/start_reading/reading_started_v1.erl:7 host/start_reading/reading_started_v1.ex:1 thinner no from_map/getters (E :47-70)
· handler host/start_reading/maybe_start_reading.erl:8 host/start_reading/maybe_start_reading.ex:1 thinner dispatch shape (P :53 vs E :54)
· API host/start_reading/start_reading_api.erl:1 — missing mints reading_id
finish_reading · command host/finish_reading/finish_reading_v1.erl:8 host/finish_reading/finish_reading_v1.ex:1 same
· event host/finish_reading/reading_finished_v1.erl:10 host/finish_reading/reading_finished_v1.ex:1 thinner no from_map/getters (E :61-94)
· handler host/finish_reading/maybe_finish_reading.erl:9 host/finish_reading/maybe_finish_reading.ex:1 thinner dispatch shape (P :55 vs E :56)
· API host/finish_reading/finish_reading_api.erl:1 — missing

C. Policy, emitters, facts, supervision

Item E file:line P file:line Status Difference
policy on_member_registered_v1_maybe_plan_party host/on_member_registered_v1_maybe_plan_party/on_member_registered_v1_maybe_plan_party.erl:21 host/on_member_registered_v1_maybe_plan_party.ex:1 thinner P is not in a slice folder of its own. It dispatches a raw map (MaybePlanParty.dispatch(%{club_id: ...}) :59), where E builds plan_party_v1:new/1 first (:52-62). P logs a string, E a structured map (:65-67)
emit_member_registered_v1_to_mesh host/emit_member_registered_v1_to_mesh/emit_member_registered_v1_to_mesh.erl:19 fac/emit_member_registered_v1_to_mesh.ex:1 moved P puts the emitters in the facade, because host_bookclub has no mesh SDK (P fac/supervisor.ex:6-12). The logic is the same
emit_book_procured_v1_to_mesh host/emit_book_procured_v1_to_mesh/emit_book_procured_v1_to_mesh.erl:1 fac/emit_book_procured_v1_to_mesh.ex:1 moved as above
emit_book_retired_v1_to_mesh host/emit_book_retired_v1_to_mesh/emit_book_retired_v1_to_mesh.erl:1 fac/emit_book_retired_v1_to_mesh.ex:1 moved as above
facts (mcl_bookclub_facts) host/mcl_bookclub_facts.erl:18 fac/facts.ex:1 moved same topics, fields and wire rules
CMD supervision host/host_bookclub_sup.erl:16-46 (policy + 3 emitters) host/application.ex:14-27 (policy) + fac/supervisor.ex:28-36 (emitters) moved
host app module host/host_bookclub_app.erl:1 host/application.ex:1 same

D. Facade (service)

Item E file:line P file:line Status Difference
service (mcl_om_service) fac/mcl_bookclub_service.erl:14 fac/service.ex:1 same, one drift P info version is "0.1.0" (:17), while the umbrella is 0.2.0 (mix.exs:7). E pins info = app vsn by test (mcl_bookclub_service_tests.erl:52)
event store open fac/mcl_bookclub_store.erl:13 fac/event_store.ex:1 same P has no public ensure/2 for tests (E :34-36)
app (open store then boot) fac/mcl_bookclub_app.erl:18-20 fac/application.ex:15-18 same
capability handler get_bookclub_by_id fac/mcl_bookclub_get_bookclub_by_id.erl:9 fac/get_bookclub_by_id_handler.ex:1 same
facade supervisor fac/mcl_bookclub_sup.erl:16-24 (admin listener) fac/supervisor.ex:28-36 (emitters) moved P's admin is the Phoenix endpoint (web/application.ex)
admin JSON API (POST /api/{plural}/{verb}, GET /api/{plural}/:id) fac/mcl_bookclub_admin.erl:30-34, 63-93 — missing P serves only live "/" (web/router.ex:19)
admin UI apps/mcl_bookclub/priv/admin/index.html:1, app.js:6-55 web/admin_live.ex:46-107, admin_live.html.heex:1 same the same 9 tasks and 5 lookups. P adds a live feed over PubSub (prj/bookclub_changed.ex:1)
admin port / LAN bind config fac/mcl_bookclub_admin.erl:137-147 web/endpoint.ex:1 + config/runtime.exs same

E. Projections (PRJ) and queries (QRY)

All 8 projections are evoq_event_handler with replay_policy() -> deliver on both sides, and both use idempotent INSERT OR REPLACE with event_id and version on the row.

Item E file:line P file:line Status
read model store (schema) prj/bookclub_read_model_store.erl:27-60 prj/bookclub_read_model_store.ex:19-52 same
bookclub_initiated_v1_to_sqlite_clubs prj/bookclub_initiated/bookclub_initiated_v1_to_sqlite_clubs.erl:22 prj/bookclub_initiated/bookclub_initiated_v1_to_sqlite_clubs.ex:14 same (P also broadcasts BookclubChanged)
bookclub_archived_v1_to_sqlite_clubs prj/bookclub_archived/bookclub_archived_v1_to_sqlite_clubs.erl:12 prj/bookclub_archived/bookclub_archived_v1_to_sqlite_clubs.ex:14 same
member_registered_v1_to_sqlite_members prj/member_registered/member_registered_v1_to_sqlite_members.erl:9 prj/member_registered/member_registered_v1_to_sqlite_members.ex:11 same
member_unregistered_v1_to_sqlite_members prj/member_unregistered/member_unregistered_v1_to_sqlite_members.erl:9 prj/member_unregistered/member_unregistered_v1_to_sqlite_members.ex:11 same
book_procured_v1_to_sqlite_books prj/book_procured/book_procured_v1_to_sqlite_books.erl:9 prj/book_procured/book_procured_v1_to_sqlite_books.ex:11 same
book_retired_v1_to_sqlite_books prj/book_retired/book_retired_v1_to_sqlite_books.erl:9 prj/book_retired/book_retired_v1_to_sqlite_books.ex:11 same
reading_started_v1_to_sqlite_readings prj/reading_started/reading_started_v1_to_sqlite_readings.erl:10 prj/reading_started/reading_started_v1_to_sqlite_readings.ex:11 same
reading_finished_v1_to_sqlite_readings prj/reading_finished/reading_finished_v1_to_sqlite_readings.erl:10 prj/reading_finished/reading_finished_v1_to_sqlite_readings.ex:12 same
PRJ supervision prj/project_bookclub_sup.erl:1 prj/application.ex:1 same
query store qry/bookclub_query_store.erl:1 qry/bookclub_query_store.ex:1 same
get_bookclub_by_id qry/get_bookclub_by_id/get_bookclub_by_id.erl:11 qry/get_bookclub_by_id/get_bookclub_by_id.ex:10 same
get_member_by_id qry/get_member_by_id/get_member_by_id.erl:8 qry/get_member_by_id/get_member_by_id.ex:11 same
get_book_by_id qry/get_book_by_id/get_book_by_id.erl:8 qry/get_book_by_id/get_book_by_id.ex:11 same
get_reading_by_id qry/get_reading_by_id/get_reading_by_id.erl:7 qry/get_reading_by_id/get_reading_by_id.ex:10 same
get_readings_by_member qry/get_readings_by_member/get_readings_by_member.erl:9 qry/get_readings_by_member/get_readings_by_member.ex:12 same

F. Tests

E test paths are apps/<app>/test/<x>_tests.erl; P test paths are apps/<app>/test/<x>_test.exs. "store" means the case dispatches through a real reckon-db store; "pure" means it calls handle/2 or the module directly.

Test file E file:line P file:line Status What P lacks
initiate_bookclub host_bookclub/test/initiate_bookclub_tests.erl:12 (store), :20 (pure), :112 (CMD mesh boundary) host_bookclub/test/initiate_bookclub_test.exs:9-44 (pure) thinner the store cases (initiated on its own stream, second initiation refused, a rejected id never touches the store); the state round-trip through a map; the CMD-imports-no-mesh boundary test
archive_bookclub host_bookclub/test/archive_bookclub_tests.erl:11 (store), :21 host_bookclub/test/archive_bookclub_test.exs:20-75 (pure) thinner the store cases (archived; second archive refused; archived club refuses initiation)
plan_party host_bookclub/test/plan_party_tests.erl:11 (store), :19 host_bookclub/test/plan_party_test.exs:19-69 (pure) thinner the store cases (incremented count; archived club cannot plan)
register_member + unregister host_bookclub/test/register_member_tests.erl:11 (store), :22 host_bookclub/test/register_member_test.exs:14-103, unregister_member_test.exs:26-66 (pure) thinner the store cases
procure_book + retire host_bookclub/test/procure_book_tests.erl:11 (store), :22 host_bookclub/test/procure_book_test.exs:14-111, retire_book_test.exs:23-63 (pure) thinner the store cases
start_reading + finish host_bookclub/test/start_reading_tests.erl:13 (store), :24 host_bookclub/test/start_reading_test.exs:15-85, finish_reading_test.exs:22-71 (pure) thinner the store cases (the finished reading carries the fold, end to end)
status host_bookclub/test/status_tests.erl:12 host_bookclub/test/statuses_test.exs:13-29 same
policy host_bookclub/test/on_member_registered_v1_maybe_plan_party_tests.erl:13 (store: the 5th registration plans a party, 4 plan none) host_bookclub/test/on_member_registered_v1_maybe_plan_party_test.exs:10-20 (callbacks only) thinner nothing checks that the policy dispatches
emitters host_bookclub/test/emit_member_registered_v1_to_mesh_tests.erl:12 (store + meck: each of the 3 emitters publishes its fact), :20 mcl_bookclub_phoenix/test/facts_contract_test.exs:52-62 (callbacks only) thinner nothing checks that an emitter publishes
admin API entry points host_bookclub/test/admin_api_tests.erl:9 (store), :19 — missing follows from the missing _api modules
test store helper host_bookclub/test/host_bookclub_test_store.erl:1 — missing the fixture every store case uses
admin over HTTP mcl_bookclub/test/mcl_bookclub_admin_tests.erl:12 mcl_bookclub_phoenix_web/test/admin_live_test.exs:11-65 (task table + run_task refusals; no LiveView render or event test) thinner P has no Phoenix.LiveViewTest mount/click test
service contract mcl_bookclub/test/mcl_bookclub_service_tests.erl:27-379 (23 cases) mcl_bookclub_phoenix/test/service_test.exs:8-75 (6) + event_store_test.exs:17-75 (5) thinner health probes the stores (:61); supervisor starts/stops (:107); the capability answers from the read model (:126); info version = app (:52); sqlite default agreement (:241); runtime/image pins (:260, :273, :287); health on a Unix socket (:340); cookie (:361, :379)
PRJ: clubs project_bookclub/test/bookclub_initiated_v1_to_sqlite_clubs_tests.erl:14 (store), :23 (schema contract) project_bookclub/test/projections_test.exs:52-85 thinner reapplying the same event changes nothing; the row carries the applied version and event_id; the query columns are all in the PRJ schema; PRJ imports no mesh module
PRJ: books / members / readings project_bookclub/test/book_procured_v1_to_sqlite_books_tests.erl:13, member_registered_…_tests.erl:13, reading_started_…_tests.erl:13 (store) project_bookclub/test/projections_test.exs:116, 176, 228 (handler called directly) thinner delivery through a real store
PRJ status-literal boundary project_bookclub/test/bookclub_initiated_v1_to_sqlite_clubs_tests.erl (the_prj_department_writes_no_status_literal) project_bookclub/test/division_boundary_test.exs:22 same
QRY get_bookclub_by_id query_bookclub/test/get_bookclub_by_id_tests.erl:10, :19 (QRY imports no framework/mesh) query_bookclub/test/get_bookclub_by_id_test.exs:30-47 thinner an archived club is found with its status; a non-binary id is refused; the QRY boundary test
QRY get_member / get_book query_bookclub/test/get_member_by_id_tests.erl:10, get_book_by_id_tests.erl:10 query_bookclub/test/get_member_by_id_test.exs:27-47, get_book_by_id_test.exs:27-48 thinner a non-binary id is refused
QRY readings query_bookclub/test/get_reading_by_id_tests.erl:11 query_bookclub/test/get_reading_by_id_test.exs:27-65, get_readings_by_member_test.exs:27-59 same

G. Repository, release, ops

Item E P Status
dependencies rebar.config:42 mcl_om ~> 1.6, :48 macula ~> 18.0, :54 evoq >= 1.26.1 apps/mcl_bookclub_phoenix/mix.exs:37 mcl_om ~> 1.4, :38 macula ~> 16.0, :46 evoq ~> 1.27; apps/host_bookclub/mix.exs:30 evoq ~> 1.24 drift
health on a Unix socket config/sys.config.src:13-15, scripts/health.sh:1 — missing
cookie made when absent scripts/start.sh:13-24 rel/env.sh.eex refuses to start without MCL_COOKIE thinner
compose for a box deploy/docker-compose.yml — missing
guides guides/admin_ui.md, guides/event_delivery.md — missing
event-storming wall wall.json + .github/workflows/wall-tree.yml — missing
C4 model architecture/README.md, c4_diagrams.py same files same
CI .github/workflows/* (GitHub) .github/workflows/ci.yml (GitHub only, ghcr image); no .forgejo/ no CI running on the forge (Actions held)
lint/format/dialyzer config rebar.config (xref, dialyzer) .credo.exs, .formatter.exs, .dialyzer_ignore.exs same

H. Proposed build order for step 3 (one PR per few slices)

  1. PR 1, the store-backed test fixture. Add the HostBookclub.TestStore fixture (port of host_bookclub_test_store.erl), with the initiate, archive and plan_party store cases and the CMD-mesh boundary test. Every later PR uses the fixture.
  2. PR 2, state and events. @behaviour :evoq_state, to_map/from_map and @specs on the 4 state modules. snapshot/from_snapshot on the 4 aggregates, with a round-trip test each. from_map/1, typed @type t and @specs on the 9 events.
  3. PR 3, entry points and handlers. The 9 *_api entry points in their slices; the LiveView calls them instead of minting and enriching inline. The handlers' dispatch/1 takes the built command (%XxxV1{}) and stamps the timestamp, as in E. The policy gets its own slice folder and builds the command first. Store cases for member, book and reading.
  4. PR 4, tests for the event subscribers. The policy's dispatch, each emitter's publish (with a stubbed :macula), projection replay idempotence, the schema contract, the QRY boundary and non-binary ids.
  5. PR 5, the facade. The JSON admin API (Phoenix controllers, same routes as E), with HTTP tests. The service tests E has (health probes, capability answers from the read model, info version), and a LiveView mount/click test.
  6. PR 6, documentation and dependencies. @moduledoc text instead of @moduledoc false across the code. The mcl_om/macula bump to E's line. Health on a Unix socket and the cookie, if the dependency bump makes them free.

Not built without a ruling: a .forgejo/ CI port (the package does it only if the Supervisor rules it), the guides/, deploy/ and wall.json copies, and anything step 2 leaves to a design change.

## Gap table: mcl-bookclub (Erlang, leading) vs mcl-bookclub-phoenix (Elixir) **What was compared:** `mcl-bookclub` main `0ce055a47e96d9c51328ee7dd8e47f6d20f322ca` (E) and `mcl-bookclub-phoenix` main `a93a8b7836e9745ed5bc422317b87dbf8110c64e` (P). I read every module, test and repository-level file on both sides. `file:line` is relative to these prefixes: | Short | E | P | |---|---|---| | `host/` | `apps/host_bookclub/src/` | `apps/host_bookclub/lib/host_bookclub/` | | `prj/` | `apps/project_bookclub/src/` | `apps/project_bookclub/lib/project_bookclub/` | | `qry/` | `apps/query_bookclub/src/` | `apps/query_bookclub/lib/query_bookclub/` | | `fac/` | `apps/mcl_bookclub/src/` | `apps/mcl_bookclub_phoenix/lib/mcl_bookclub_phoenix/` | | `web/` | (none) | `apps/mcl_bookclub_phoenix_web/lib/mcl_bookclub_phoenix_web/` | Status values: **same** (same behaviour, idiom aside), **thinner** (P exists but lacks something E has), **missing** (no P counterpart), **moved** (P puts it in another app, on purpose and with a written reason). ### Summary The two repos have the same domain: the same 4 aggregates, the same 8 command slices, the same events and fields, the same policy, emitters, facts, projections and queries. Every event struct has exactly the fields of its Erlang record (checked field by field). Where P falls short of E is in the following areas: 1. **The API entry points.** E has 9 `{command}_api` modules. P has none. P's LiveView mints ids and enriches the club name inline (`web/admin_live.ex:210-334`). 2. **State and snapshots.** P's state modules do not declare `evoq_state` and have no `to_map`/`from_map`. P's aggregates have no `snapshot`/`from_snapshot`. evoq only snapshots when `snapshot/1` is exported (`reckon-db-org/evoq src/evoq_aggregate.erl:757`), so **a P aggregate never snapshots: every load replays its whole stream.** 3. **Events.** No P event has `from_map/1` or typed fields (`@type t :: %__MODULE__{}`). 4. **The desk's `dispatch`.** E dispatches a built command (`dispatch(Cmd)`) and stamps a timestamp on the evoq command (`evoq_command:new/5`). P's `dispatch/1` takes a raw params map and builds the command inside. It also uses `evoq_command:new/4`, so there is no timestamp metadata. 5. **Tests.** E tests every command slice **through a real reckon-db store** (`store_test_`, with `host/test/host_bookclub_test_store.erl`). It also tests the policy firing on the 5th registration, emitters publishing (meck on macula), the admin HTTP API, projection replay idempotence, the PRJ/QRY schema contract, the department boundaries, and 23 service/image/runtime contract tests. **P's host tests are pure only: none dispatches a command through a store.** P has 0 tests for the policy's dispatch, for an emitter's publish, or for the admin over HTTP. 6. **Elixir idiom.** 70 of 75 P modules say `@moduledoc false` and carry their documentation as `#` comments, so `mix docs` renders nothing. P has 2 `@spec`s in total, against 286 `-spec`s in E. 7. **The JSON admin API** (E `fac/mcl_bookclub_admin.erl`, `POST /api/{plural}/{verb}`, `GET /api/{plural}/:id`) does not exist in P. P has a LiveView instead. 8. **Dependencies have drifted.** E uses `mcl_om ~> 1.6`, `macula ~> 18.0` (`rebar.config:42,48`). P uses `mcl_om ~> 1.4`, `macula ~> 16.0` (`apps/mcl_bookclub_phoenix/mix.exs:37-38`): two macula majors behind, older wire. 9. **Repo and ops files.** P lacks the following, which E has: - health on a Unix socket (`config/sys.config.src:15`, `scripts/health.sh`) - a self-made cookie (`scripts/start.sh:13-24`) - `deploy/docker-compose.yml` - `guides/` (admin_ui, event_delivery) - `wall.json` (the event-storming wall) and its `wall-tree` workflow 10. **CI.** P has only `.github/workflows/ci.yml`, which runs on GitHub and pulls a ghcr.io image. There is no `.forgejo/` workflow. Forge Actions are held on moved repos (`forge-actions-off-until-ported`), so P has no running CI today. ### A. Aggregates, state, status (host) | Item | E file:line | P file:line | Status | Difference | |---|---|---|---|---| | bookclub_aggregate | `host/bookclub_aggregate.erl:15` | `host/bookclub_aggregate.ex:1` | thinner | P has no `snapshot/1`/`from_snapshot/1` (E :50-54). P also has an extra `stream_id/1` (:61) that nothing calls | | book_aggregate | `host/book_aggregate.erl:7` | `host/book_aggregate.ex:1` | thinner | as above (E :38-42); P extra `stream_id/1` :44 | | member_aggregate | `host/member_aggregate.erl:8` | `host/member_aggregate.ex:1` | thinner | as above (E :39-43); P :45 | | reading_aggregate | `host/reading_aggregate.erl:8` | `host/reading_aggregate.ex:1` | thinner | as above (E :39-43); P :46 | | bookclub_state | `host/bookclub_state.erl:11` | `host/bookclub_state.ex:1` | thinner | P does not declare `evoq_state` (E :13). It has no `to_map`/`from_map` (E :61-84), no getters (E :86-104), no typespecs. P `event_data/1` returns the raw event unstripped (P :51 vs E :114-117) | | book_state | `host/book_state.erl:6` | `host/book_state.ex:1` | thinner | same four gaps (E :8, :53-79, :81-111, :113-116) | | member_state | `host/member_state.erl:7` | `host/member_state.ex:1` | thinner | same (E :9, :50-70, :72-94, :96-99) | | reading_state | `host/reading_state.erl:8` | `host/reading_state.ex:1` | thinner | same (E :10, :54-77, :79-105, :107-110) | | bookclub_status (.erl + .hrl) | `host/bookclub_status.erl:1`, `host/bookclub_status.hrl:9` | `host/bookclub_status.ex:1` | same | the flags and their names live in one module (`labels/0` in P, `flag_map/0` in E) | | book_status | `host/book_status.erl:8` | `host/book_status.ex:1` | same | as above | | member_status | `host/member_status.erl:1` | `host/member_status.ex:1` | same | as above | | reading_status | `host/reading_status.erl:1` | `host/reading_status.ex:1` | same | as above | ### B. Command slices (host), 8 desks × command / event / handler / API In every row, the P command and event modules declare `@behaviour :evoq_command` / `:evoq_event` with `@impl`, as E's do. | Slice · item | E file:line | P file:line | Status | Difference | |---|---|---|---|---| | initiate_bookclub · command | `host/initiate_bookclub/initiate_bookclub_v1.erl:8` | `host/initiate_bookclub/initiate_bookclub_v1.ex:1` | same | P `from_map/1` passes a stray `club_name` key into `new/1` (:55); it is ignored, but it is a copy-paste wart | | · event | `host/initiate_bookclub/bookclub_initiated_v1.erl:7` | `host/initiate_bookclub/bookclub_initiated_v1.ex:1` | thinner | P has no `from_map/1` (E :51-58) and no getters (E :61-74); the type is untyped | | · handler | `host/initiate_bookclub/maybe_initiate_bookclub.erl:9` | `host/initiate_bookclub/maybe_initiate_bookclub.ex:1` | thinner | P `dispatch(params)` builds the command inside (:47); E `dispatch(Cmd)` (:57). P has no timestamp metadata (`evoq_command:new/4` :51 vs E `/5` :66-69) | | · API | `host/initiate_bookclub/initiate_bookclub_api.erl:8` | — | **missing** | mints `club_id` when absent (E :15-17). In P this lives in `web/admin_live.ex:210-220` | | archive_bookclub · command | `host/archive_bookclub/archive_bookclub_v1.erl:6` | `host/archive_bookclub/archive_bookclub_v1.ex:1` | same | | | · event | `host/archive_bookclub/bookclub_archived_v1.erl:10` | `host/archive_bookclub/bookclub_archived_v1.ex:1` | thinner | no `from_map`/getters (E :65-98) | | · handler | `host/archive_bookclub/maybe_archive_bookclub.erl:11` | `host/archive_bookclub/maybe_archive_bookclub.ex:1` | thinner | dispatch shape (P :63 vs E :63); P reads `state.club_id` etc. directly (:48-51), where E goes through state getters (:48-51) | | · API | `host/archive_bookclub/archive_bookclub_api.erl:5` | — | **missing** | | | plan_party · command | `host/plan_party/plan_party_v1.erl:6` | `host/plan_party/plan_party_v1.ex:1` | same | | | · event | `host/plan_party/party_planned_v1.erl:7` | `host/plan_party/party_planned_v1.ex:1` | thinner | no `from_map`/getters (E :45-63) | | · handler | `host/plan_party/maybe_plan_party.erl:7` | `host/plan_party/maybe_plan_party.ex:1` | thinner | dispatch shape (P :54 vs E :55); P reads `state.parties_planned` directly (:43) | | · API | `host/plan_party/plan_party_api.erl:4` | — | **missing** | | | register_member · command | `host/register_member/register_member_v1.erl:8` | `host/register_member/register_member_v1.ex:1` | same | | | · event | `host/register_member/member_registered_v1.erl:8` | `host/register_member/member_registered_v1.ex:1` | thinner | no `from_map`/getters (E :52-76) | | · handler | `host/register_member/maybe_register_member.erl:8` | `host/register_member/maybe_register_member.ex:1` | thinner | dispatch shape (P :54 vs E :55) | | · API | `host/register_member/register_member_api.erl:1` | — | **missing** | mints `member_id`. The club-name enrichment is in E's admin (`fac/mcl_bookclub_admin.erl:100-108`) and in P's LiveView (`web/admin_live.ex:325-334`) | | unregister_member · command | `host/unregister_member/unregister_member_v1.erl:8` | `host/unregister_member/unregister_member_v1.ex:1` | same | | | · event | `host/unregister_member/member_unregistered_v1.erl:9` | `host/unregister_member/member_unregistered_v1.ex:1` | thinner | no `from_map`/getters (E :60-93) | | · handler | `host/unregister_member/maybe_unregister_member.erl:9` | `host/unregister_member/maybe_unregister_member.ex:1` | thinner | dispatch shape (P :55 vs E :56) | | · API | `host/unregister_member/unregister_member_api.erl:1` | — | **missing** | | | procure_book · command | `host/procure_book/procure_book_v1.erl:6` | `host/procure_book/procure_book_v1.ex:1` | same | | | · event | `host/procure_book/book_procured_v1.erl:5` | `host/procure_book/book_procured_v1.ex:1` | thinner | no `from_map`/getters (E :55-85) | | · handler | `host/procure_book/maybe_procure_book.erl:6` | `host/procure_book/maybe_procure_book.ex:1` | thinner | dispatch shape (P :55 vs E :56) | | · API | `host/procure_book/procure_book_api.erl:5` | — | **missing** | mints `book_id` (E :10-12) | | retire_book · command | `host/retire_book/retire_book_v1.erl:8` | `host/retire_book/retire_book_v1.ex:1` | same | | | · event | `host/retire_book/book_retired_v1.erl:9` | `host/retire_book/book_retired_v1.ex:1` | thinner | no `from_map`/getters (E :68-107) | | · handler | `host/retire_book/maybe_retire_book.erl:9` | `host/retire_book/maybe_retire_book.ex:1` | thinner | dispatch shape (P :57 vs E :58) | | · API | `host/retire_book/retire_book_api.erl:1` | — | **missing** | | | start_reading · command | `host/start_reading/start_reading_v1.erl:9` | `host/start_reading/start_reading_v1.ex:1` | same | | | · event | `host/start_reading/reading_started_v1.erl:7` | `host/start_reading/reading_started_v1.ex:1` | thinner | no `from_map`/getters (E :47-70) | | · handler | `host/start_reading/maybe_start_reading.erl:8` | `host/start_reading/maybe_start_reading.ex:1` | thinner | dispatch shape (P :53 vs E :54) | | · API | `host/start_reading/start_reading_api.erl:1` | — | **missing** | mints `reading_id` | | finish_reading · command | `host/finish_reading/finish_reading_v1.erl:8` | `host/finish_reading/finish_reading_v1.ex:1` | same | | | · event | `host/finish_reading/reading_finished_v1.erl:10` | `host/finish_reading/reading_finished_v1.ex:1` | thinner | no `from_map`/getters (E :61-94) | | · handler | `host/finish_reading/maybe_finish_reading.erl:9` | `host/finish_reading/maybe_finish_reading.ex:1` | thinner | dispatch shape (P :55 vs E :56) | | · API | `host/finish_reading/finish_reading_api.erl:1` | — | **missing** | | ### C. Policy, emitters, facts, supervision | Item | E file:line | P file:line | Status | Difference | |---|---|---|---|---| | policy on_member_registered_v1_maybe_plan_party | `host/on_member_registered_v1_maybe_plan_party/on_member_registered_v1_maybe_plan_party.erl:21` | `host/on_member_registered_v1_maybe_plan_party.ex:1` | thinner | P is not in a slice folder of its own. It dispatches a raw map (`MaybePlanParty.dispatch(%{club_id: ...})` :59), where E builds `plan_party_v1:new/1` first (:52-62). P logs a string, E a structured map (:65-67) | | emit_member_registered_v1_to_mesh | `host/emit_member_registered_v1_to_mesh/emit_member_registered_v1_to_mesh.erl:19` | `fac/emit_member_registered_v1_to_mesh.ex:1` | moved | P puts the emitters in the facade, because host_bookclub has no mesh SDK (P `fac/supervisor.ex:6-12`). The logic is the same | | emit_book_procured_v1_to_mesh | `host/emit_book_procured_v1_to_mesh/emit_book_procured_v1_to_mesh.erl:1` | `fac/emit_book_procured_v1_to_mesh.ex:1` | moved | as above | | emit_book_retired_v1_to_mesh | `host/emit_book_retired_v1_to_mesh/emit_book_retired_v1_to_mesh.erl:1` | `fac/emit_book_retired_v1_to_mesh.ex:1` | moved | as above | | facts (mcl_bookclub_facts) | `host/mcl_bookclub_facts.erl:18` | `fac/facts.ex:1` | moved | same topics, fields and wire rules | | CMD supervision | `host/host_bookclub_sup.erl:16-46` (policy + 3 emitters) | `host/application.ex:14-27` (policy) + `fac/supervisor.ex:28-36` (emitters) | moved | | | host app module | `host/host_bookclub_app.erl:1` | `host/application.ex:1` | same | | ### D. Facade (service) | Item | E file:line | P file:line | Status | Difference | |---|---|---|---|---| | service (mcl_om_service) | `fac/mcl_bookclub_service.erl:14` | `fac/service.ex:1` | same, one drift | P `info` version is `"0.1.0"` (:17), while the umbrella is `0.2.0` (`mix.exs:7`). E pins info = app vsn by test (`mcl_bookclub_service_tests.erl:52`) | | event store open | `fac/mcl_bookclub_store.erl:13` | `fac/event_store.ex:1` | same | P has no public `ensure/2` for tests (E :34-36) | | app (open store then boot) | `fac/mcl_bookclub_app.erl:18-20` | `fac/application.ex:15-18` | same | | | capability handler get_bookclub_by_id | `fac/mcl_bookclub_get_bookclub_by_id.erl:9` | `fac/get_bookclub_by_id_handler.ex:1` | same | | | facade supervisor | `fac/mcl_bookclub_sup.erl:16-24` (admin listener) | `fac/supervisor.ex:28-36` (emitters) | moved | P's admin is the Phoenix endpoint (`web/application.ex`) | | admin JSON API (`POST /api/{plural}/{verb}`, `GET /api/{plural}/:id`) | `fac/mcl_bookclub_admin.erl:30-34, 63-93` | — | **missing** | P serves only `live "/"` (`web/router.ex:19`) | | admin UI | `apps/mcl_bookclub/priv/admin/index.html:1`, `app.js:6-55` | `web/admin_live.ex:46-107`, `admin_live.html.heex:1` | same | the same 9 tasks and 5 lookups. P adds a live feed over PubSub (`prj/bookclub_changed.ex:1`) | | admin port / LAN bind config | `fac/mcl_bookclub_admin.erl:137-147` | `web/endpoint.ex:1` + `config/runtime.exs` | same | | ### E. Projections (PRJ) and queries (QRY) All 8 projections are `evoq_event_handler` with `replay_policy() -> deliver` on both sides, and both use idempotent `INSERT OR REPLACE` with `event_id` and `version` on the row. | Item | E file:line | P file:line | Status | |---|---|---|---| | read model store (schema) | `prj/bookclub_read_model_store.erl:27-60` | `prj/bookclub_read_model_store.ex:19-52` | same | | bookclub_initiated_v1_to_sqlite_clubs | `prj/bookclub_initiated/bookclub_initiated_v1_to_sqlite_clubs.erl:22` | `prj/bookclub_initiated/bookclub_initiated_v1_to_sqlite_clubs.ex:14` | same (P also broadcasts `BookclubChanged`) | | bookclub_archived_v1_to_sqlite_clubs | `prj/bookclub_archived/bookclub_archived_v1_to_sqlite_clubs.erl:12` | `prj/bookclub_archived/bookclub_archived_v1_to_sqlite_clubs.ex:14` | same | | member_registered_v1_to_sqlite_members | `prj/member_registered/member_registered_v1_to_sqlite_members.erl:9` | `prj/member_registered/member_registered_v1_to_sqlite_members.ex:11` | same | | member_unregistered_v1_to_sqlite_members | `prj/member_unregistered/member_unregistered_v1_to_sqlite_members.erl:9` | `prj/member_unregistered/member_unregistered_v1_to_sqlite_members.ex:11` | same | | book_procured_v1_to_sqlite_books | `prj/book_procured/book_procured_v1_to_sqlite_books.erl:9` | `prj/book_procured/book_procured_v1_to_sqlite_books.ex:11` | same | | book_retired_v1_to_sqlite_books | `prj/book_retired/book_retired_v1_to_sqlite_books.erl:9` | `prj/book_retired/book_retired_v1_to_sqlite_books.ex:11` | same | | reading_started_v1_to_sqlite_readings | `prj/reading_started/reading_started_v1_to_sqlite_readings.erl:10` | `prj/reading_started/reading_started_v1_to_sqlite_readings.ex:11` | same | | reading_finished_v1_to_sqlite_readings | `prj/reading_finished/reading_finished_v1_to_sqlite_readings.erl:10` | `prj/reading_finished/reading_finished_v1_to_sqlite_readings.ex:12` | same | | PRJ supervision | `prj/project_bookclub_sup.erl:1` | `prj/application.ex:1` | same | | query store | `qry/bookclub_query_store.erl:1` | `qry/bookclub_query_store.ex:1` | same | | get_bookclub_by_id | `qry/get_bookclub_by_id/get_bookclub_by_id.erl:11` | `qry/get_bookclub_by_id/get_bookclub_by_id.ex:10` | same | | get_member_by_id | `qry/get_member_by_id/get_member_by_id.erl:8` | `qry/get_member_by_id/get_member_by_id.ex:11` | same | | get_book_by_id | `qry/get_book_by_id/get_book_by_id.erl:8` | `qry/get_book_by_id/get_book_by_id.ex:11` | same | | get_reading_by_id | `qry/get_reading_by_id/get_reading_by_id.erl:7` | `qry/get_reading_by_id/get_reading_by_id.ex:10` | same | | get_readings_by_member | `qry/get_readings_by_member/get_readings_by_member.erl:9` | `qry/get_readings_by_member/get_readings_by_member.ex:12` | same | ### F. Tests E test paths are `apps/<app>/test/<x>_tests.erl`; P test paths are `apps/<app>/test/<x>_test.exs`. "store" means the case dispatches through a real reckon-db store; "pure" means it calls `handle/2` or the module directly. | Test file | E file:line | P file:line | Status | What P lacks | |---|---|---|---|---| | initiate_bookclub | `host_bookclub/test/initiate_bookclub_tests.erl:12` (store), `:20` (pure), `:112` (CMD mesh boundary) | `host_bookclub/test/initiate_bookclub_test.exs:9-44` (pure) | thinner | the store cases (initiated on its own stream, second initiation refused, a rejected id never touches the store); the state round-trip through a map; **the CMD-imports-no-mesh boundary test** | | archive_bookclub | `host_bookclub/test/archive_bookclub_tests.erl:11` (store), `:21` | `host_bookclub/test/archive_bookclub_test.exs:20-75` (pure) | thinner | the store cases (archived; second archive refused; archived club refuses initiation) | | plan_party | `host_bookclub/test/plan_party_tests.erl:11` (store), `:19` | `host_bookclub/test/plan_party_test.exs:19-69` (pure) | thinner | the store cases (incremented count; archived club cannot plan) | | register_member + unregister | `host_bookclub/test/register_member_tests.erl:11` (store), `:22` | `host_bookclub/test/register_member_test.exs:14-103`, `unregister_member_test.exs:26-66` (pure) | thinner | the store cases | | procure_book + retire | `host_bookclub/test/procure_book_tests.erl:11` (store), `:22` | `host_bookclub/test/procure_book_test.exs:14-111`, `retire_book_test.exs:23-63` (pure) | thinner | the store cases | | start_reading + finish | `host_bookclub/test/start_reading_tests.erl:13` (store), `:24` | `host_bookclub/test/start_reading_test.exs:15-85`, `finish_reading_test.exs:22-71` (pure) | thinner | the store cases (the finished reading carries the fold, end to end) | | status | `host_bookclub/test/status_tests.erl:12` | `host_bookclub/test/statuses_test.exs:13-29` | same | | | policy | `host_bookclub/test/on_member_registered_v1_maybe_plan_party_tests.erl:13` (store: the 5th registration plans a party, 4 plan none) | `host_bookclub/test/on_member_registered_v1_maybe_plan_party_test.exs:10-20` (callbacks only) | thinner | **nothing checks that the policy dispatches** | | emitters | `host_bookclub/test/emit_member_registered_v1_to_mesh_tests.erl:12` (store + meck: each of the 3 emitters publishes its fact), `:20` | `mcl_bookclub_phoenix/test/facts_contract_test.exs:52-62` (callbacks only) | thinner | **nothing checks that an emitter publishes** | | admin API entry points | `host_bookclub/test/admin_api_tests.erl:9` (store), `:19` | — | **missing** | follows from the missing `_api` modules | | test store helper | `host_bookclub/test/host_bookclub_test_store.erl:1` | — | **missing** | the fixture every store case uses | | admin over HTTP | `mcl_bookclub/test/mcl_bookclub_admin_tests.erl:12` | `mcl_bookclub_phoenix_web/test/admin_live_test.exs:11-65` (task table + run_task refusals; no LiveView render or event test) | thinner | P has no `Phoenix.LiveViewTest` mount/click test | | service contract | `mcl_bookclub/test/mcl_bookclub_service_tests.erl:27-379` (23 cases) | `mcl_bookclub_phoenix/test/service_test.exs:8-75` (6) + `event_store_test.exs:17-75` (5) | thinner | health probes the stores (:61); supervisor starts/stops (:107); **the capability answers from the read model** (:126); info version = app (:52); sqlite default agreement (:241); runtime/image pins (:260, :273, :287); health on a Unix socket (:340); cookie (:361, :379) | | PRJ: clubs | `project_bookclub/test/bookclub_initiated_v1_to_sqlite_clubs_tests.erl:14` (store), `:23` (schema contract) | `project_bookclub/test/projections_test.exs:52-85` | thinner | **reapplying the same event changes nothing**; the row carries the applied version and event_id; the query columns are all in the PRJ schema; PRJ imports no mesh module | | PRJ: books / members / readings | `project_bookclub/test/book_procured_v1_to_sqlite_books_tests.erl:13`, `member_registered_…_tests.erl:13`, `reading_started_…_tests.erl:13` (store) | `project_bookclub/test/projections_test.exs:116, 176, 228` (handler called directly) | thinner | delivery through a real store | | PRJ status-literal boundary | `project_bookclub/test/bookclub_initiated_v1_to_sqlite_clubs_tests.erl` (`the_prj_department_writes_no_status_literal`) | `project_bookclub/test/division_boundary_test.exs:22` | same | | | QRY get_bookclub_by_id | `query_bookclub/test/get_bookclub_by_id_tests.erl:10`, `:19` (QRY imports no framework/mesh) | `query_bookclub/test/get_bookclub_by_id_test.exs:30-47` | thinner | an archived club is found with its status; a non-binary id is refused; **the QRY boundary test** | | QRY get_member / get_book | `query_bookclub/test/get_member_by_id_tests.erl:10`, `get_book_by_id_tests.erl:10` | `query_bookclub/test/get_member_by_id_test.exs:27-47`, `get_book_by_id_test.exs:27-48` | thinner | a non-binary id is refused | | QRY readings | `query_bookclub/test/get_reading_by_id_tests.erl:11` | `query_bookclub/test/get_reading_by_id_test.exs:27-65`, `get_readings_by_member_test.exs:27-59` | same | | ### G. Repository, release, ops | Item | E | P | Status | |---|---|---|---| | dependencies | `rebar.config:42` mcl_om ~> 1.6, `:48` macula ~> 18.0, `:54` evoq >= 1.26.1 | `apps/mcl_bookclub_phoenix/mix.exs:37` mcl_om ~> 1.4, `:38` macula ~> 16.0, `:46` evoq ~> 1.27; `apps/host_bookclub/mix.exs:30` evoq ~> 1.24 | **drift** | | health on a Unix socket | `config/sys.config.src:13-15`, `scripts/health.sh:1` | — | **missing** | | cookie made when absent | `scripts/start.sh:13-24` | `rel/env.sh.eex` refuses to start without `MCL_COOKIE` | thinner | | compose for a box | `deploy/docker-compose.yml` | — | **missing** | | guides | `guides/admin_ui.md`, `guides/event_delivery.md` | — | **missing** | | event-storming wall | `wall.json` + `.github/workflows/wall-tree.yml` | — | **missing** | | C4 model | `architecture/README.md`, `c4_diagrams.py` | same files | same | | CI | `.github/workflows/*` (GitHub) | `.github/workflows/ci.yml` (GitHub only, ghcr image); no `.forgejo/` | **no CI running on the forge** (Actions held) | | lint/format/dialyzer config | `rebar.config` (xref, dialyzer) | `.credo.exs`, `.formatter.exs`, `.dialyzer_ignore.exs` | same | ### H. Proposed build order for step 3 (one PR per few slices) 1. **PR 1, the store-backed test fixture.** Add the `HostBookclub.TestStore` fixture (port of `host_bookclub_test_store.erl`), with the initiate, archive and plan_party store cases and the CMD-mesh boundary test. Every later PR uses the fixture. 2. **PR 2, state and events.** `@behaviour :evoq_state`, `to_map`/`from_map` and `@spec`s on the 4 state modules. `snapshot`/`from_snapshot` on the 4 aggregates, with a round-trip test each. `from_map/1`, typed `@type t` and `@spec`s on the 9 events. 3. **PR 3, entry points and handlers.** The 9 `*_api` entry points in their slices; the LiveView calls them instead of minting and enriching inline. The handlers' `dispatch/1` takes the built command (`%XxxV1{}`) and stamps the timestamp, as in E. The policy gets its own slice folder and builds the command first. Store cases for member, book and reading. 4. **PR 4, tests for the event subscribers.** The policy's dispatch, each emitter's publish (with a stubbed `:macula`), projection replay idempotence, the schema contract, the QRY boundary and non-binary ids. 5. **PR 5, the facade.** The JSON admin API (Phoenix controllers, same routes as E), with HTTP tests. The service tests E has (health probes, capability answers from the read model, info version), and a LiveView mount/click test. 6. **PR 6, documentation and dependencies.** `@moduledoc` text instead of `@moduledoc false` across the code. The mcl_om/macula bump to E's line. Health on a Unix socket and the cookie, if the dependency bump makes them free. Not built without a ruling: a `.forgejo/` CI port (the package does it only if the Supervisor rules it), the `guides/`, `deploy/` and `wall.json` copies, and anything step 2 leaves to a design change.
Member

Which evoq behaviour should a maybe_<command> handler implement?

Short answer: none of evoq's existing behaviours fits, and evoq has no command-handler behaviour. git log --all -S evoq_command_handler over reckon-db-org/evoq is empty, so there never was one. evoq's own guides list the handler as the one desk file with no behaviour. A handler contract would be a new evoq behaviour, which is a design change for Raf. I stop step 2 here; nothing has been built.

Base: reckon-db-org/evoq main bb1be23 (1.30.8).

1. What mcl-bookclub does today

Each maybe_<command> module is a plain module with three exports and no -behaviour. Example: mcl-bookclub apps/host_bookclub/src/procure_book/maybe_procure_book.erl.

  • handle_from_map/2 (:12-16). The aggregate calls it. book_aggregate:execute/2 routes on command_type and calls guarded(State, Payload, fun maybe_procure_book:handle_from_map/2) (book_aggregate.erl:22-33). evoq calls the aggregate at evoq src/evoq_aggregate.erl:298 (Module:execute(AggState, Command#evoq_command.payload)).
  • handle/2 (:24-46). This is the business rule: given the aggregate state and the typed command, it returns {ok, [EventMap]} | {error, Reason}. It is pure.
  • dispatch/1 (:56-71). It validates, builds evoq_command:new/5 for book_aggregate and the book's stream id, and calls evoq_command_router:dispatch/2 with the store, adapter and consistency. It is the write entry point.

The same three-part shape is copied in all 8 desks of both repos. mcl-bookclub-phoenix has the same three functions, again with no behaviour (host_bookclub/lib/host_bookclub/procure_book/maybe_procure_book.ex:15-72).

2. evoq's behaviours, checked one by one

Behaviour Callbacks (file:line) Fits a maybe_ handler?
evoq_command command_type/0, new/1, to_map/1, optional validate/1, from_map/1 (src/evoq_command.erl:26-34) No. It is the command's data contract, and the *_v1 command modules already implement it. A handler is not a command
evoq_aggregate init/1, execute/2, apply/2, optional state_module/0, snapshot/1, from_snapshot/1 (src/evoq_aggregate.erl:34-46) No. handle/2 is one clause of what execute/2 does, and the aggregate delegates to it. A handler declaring evoq_aggregate would become its own aggregate, with its own state and stream. The aggregate is the consistency boundary that 2-3 desks share (bookclub_aggregate.erl:32-37 routes three desks)
evoq_decision context/1, decide/2, optional retry_budget/0, boundary_key/1, init_decision_model/0, apply_context_event/2 (src/evoq_decision.erl:94-128) No, for these desks. decide(ContextEvents, Command) has the same shape as handle(State, Command), but a decision runs through evoq_decision_runtime:dispatch/3 (src/evoq_decision_runtime.erl:63). It locks on a tag-filter context and appends to the DCB pseudo-stream <<"_dcb">> (:53), not to the aggregate's stream. evoq says so itself: "Mixed-mode use cases (aggregate streams + DCB sharing tags) are not supported" (src/evoq_decision.erl:39-44). Moving the desks there would take their events off the club, book, member and reading streams. It fits cross-cutting checks such as uniqueness and allocation, not these desks
evoq_event_handler, evoq_process_manager, evoq_projection src/evoq_event_handler.erl:48-64, src/evoq_process_manager.erl:90-105, src/evoq_projection.erl:67-89 No. They react to events, not commands
evoq_emitter, evoq_listener, evoq_responder, evoq_requester src/evoq_emitter.erl:25-37, src/evoq_listener.erl:25-34, src/evoq_responder.erl:24-37, src/evoq_requester.erl:23-29 No. They are integration actors. A listener or responder calls maybe_X:dispatch/1 (guides/integration_actors.md:93)

evoq's own documentation leaves the handler without a contract:

  • The "Complete Desk Example" names the behaviour of every desk file that has one (command evoq_command, event evoq_event, fact evoq_fact, emitter evoq_emitter, responder evoq_responder). It lists maybe_initiate_venture.erl # Handler with none, like the API entry point (guides/integration_actors.md:243-251).
  • The handler's shape appears only as naming and examples: guides/event_envelope.md:304, guides/bit_flags.md:328-331.
  • The corpus defines it the same way, with no behaviour: mcl-corpus GLOSSARY.md:150-155. Its stated return, {ok, Event} | {error, Reason}, has drifted from the {ok, [Event]} that the code returns.

3. Why the missing contract matters

Without a behaviour, every service has grown its own handler shape:

  • mcl-bookclub and mcl-chess: handle_from_map/2 + handle(State, Cmd) + dispatch(Cmd) (mcl-chess apps/play_games/src/archive_game/maybe_archive_game.erl:18-35)
  • mcl-kanban: handle_payload/2 + handle(State, Cmd) + dispatch(Cmd) (apps/guide_card_lifecycle/lib/guide_card_lifecycle/claim_card/maybe_claim_card.ex:16-50)
  • macula-realm: handle_from_map/1 + handle(Cmd), with no state (apps/guide_realm_lifecycle/lib/guide_realm_lifecycle/admit_realm_member/maybe_admit_realm_member.ex:24-81)
  • mcl-whiteboard: handle_from_map/1 + handle(Cmd) + dispatch(params) (apps/guide_board_lifecycle/lib/guide_board_lifecycle/place_text/maybe_place_text.ex:10-31)

The forge clones hold about 90 Erlang and about 110 Elixir maybe_* modules (realm 48, kanban 42, whiteboard 12, ...). Each one copies the same do_dispatch block: evoq_command:new + evoq_command_router:dispatch with the store, adapter and consistency. Nothing checks at compile time that a desk exports what its aggregate calls: a typo in fun maybe_x:handle_from_map/2 shows up only when that command first runs.

4. What a new behaviour would be (a design to rule on; not built)

-module(evoq_command_handler).
%% The desk's business rule: the aggregate state and the typed command in,
%% the events (or a refusal) out. Pure. The aggregate calls it from execute/2.
-callback command_module() -> module().            %% the evoq_command it handles
-callback handle(State :: term(), Command :: term()) ->
    {ok, [Event :: map()]} | {error, Reason :: term()}.
%% (A stateless desk, as in realm and whiteboard, would need a handle/1
%%  variant or ignore State: part of the ruling.)
%% Library functions, replacing the copied boilerplate:
%%   evoq_command_handler:handle_from_map(Module, State, Payload)
%%       -> CommandModule:from_map/1, then Module:handle/2
%%   evoq_command_handler:dispatch(Module, Command, AggregateModule, Opts)
%%       -> validate, evoq_command:new/5 with timestamp, evoq_command_router:dispatch/2

Alongside it, an optional evoq_aggregate callback command_handlers() -> #{CommandType :: atom() => module()} would let an aggregate route execute/2 without per-command clauses. The bookclub aggregates keep their lifecycle guard (archived, retired, unregistered, finished) and call the handler only after it.

What it would cost:

  • an evoq minor release (additive and optional, like evoq_emitter's compile-time-only contract, which nothing in evoq calls: src/evoq_emitter.erl:25-37, no caller of fact_module/0 in src/)
  • a section in guides/integration_actors.md and guides/aggregates.md
  • the corpus glossary line
  • adoption desk by desk, which is not a big-bang change

For mcl-bookclub (E) and mcl-bookclub-phoenix (P) it means:

  • 8 handlers each declare it and lose handle_from_map/2, handled/2 and do_dispatch/1
  • 4 aggregates each name their handlers

The ruling needed from Raf:

  1. Add evoq_command_handler to evoq (name and callbacks as above, or his own), and have both bookclubs adopt it (step 4 of #4).
  2. Or keep handlers plain modules and record the shape as a convention in the corpus. Then I make P's handler shape match E's exactly as part of parity, and step 4 is dropped.

5. Side findings on "the fitting evoq behaviour" (both repos)

  • States. E's state modules declare evoq_state (src/evoq_state.erl:36-54). P's do not. That one fits, and it is in the parity build (gap table §A).
  • Emitters use evoq_event_handler, which is right: it is the behaviour evoq's runtime subscribes. They could also declare the compile-time evoq_emitter, but that needs one evoq_fact module per fact, where today mcl_bookclub_facts is one module for three. I am not proposing it without a ruling.
  • Projections use evoq_event_handler with their own sqlite rows, carrying event_id and version and written idempotently. evoq_projection targets evoq_read_model with checkpoints. The event handler is the honest fit for an external sqlite store, so they stay as they are.
## Which evoq behaviour should a `maybe_<command>` handler implement? **Short answer:** none of evoq's existing behaviours fits, and evoq has no command-handler behaviour. `git log --all -S evoq_command_handler` over reckon-db-org/evoq is empty, so there never was one. evoq's own guides list the handler as the one desk file with no behaviour. A handler contract would be a **new evoq behaviour**, which is a design change for Raf. I stop step 2 here; nothing has been built. Base: reckon-db-org/evoq main `bb1be23` (1.30.8). ### 1. What mcl-bookclub does today Each `maybe_<command>` module is a plain module with three exports and no `-behaviour`. Example: `mcl-bookclub apps/host_bookclub/src/procure_book/maybe_procure_book.erl`. - `handle_from_map/2` (:12-16). The aggregate calls it. `book_aggregate:execute/2` routes on `command_type` and calls `guarded(State, Payload, fun maybe_procure_book:handle_from_map/2)` (`book_aggregate.erl:22-33`). evoq calls the aggregate at `evoq src/evoq_aggregate.erl:298` (`Module:execute(AggState, Command#evoq_command.payload)`). - `handle/2` (:24-46). This is the business rule: given the aggregate state and the typed command, it returns `{ok, [EventMap]} | {error, Reason}`. It is pure. - `dispatch/1` (:56-71). It validates, builds `evoq_command:new/5` for `book_aggregate` and the book's stream id, and calls `evoq_command_router:dispatch/2` with the store, adapter and consistency. It is the write entry point. The same three-part shape is copied in all 8 desks of both repos. mcl-bookclub-phoenix has the same three functions, again with no behaviour (`host_bookclub/lib/host_bookclub/procure_book/maybe_procure_book.ex:15-72`). ### 2. evoq's behaviours, checked one by one | Behaviour | Callbacks (file:line) | Fits a `maybe_` handler? | |---|---|---| | `evoq_command` | `command_type/0, new/1, to_map/1`, optional `validate/1, from_map/1` (`src/evoq_command.erl:26-34`) | **No.** It is the command's data contract, and the `*_v1` command modules already implement it. A handler is not a command | | `evoq_aggregate` | `init/1, execute/2, apply/2`, optional `state_module/0, snapshot/1, from_snapshot/1` (`src/evoq_aggregate.erl:34-46`) | **No.** `handle/2` is one clause of what `execute/2` does, and the aggregate delegates to it. A handler declaring `evoq_aggregate` would become its own aggregate, with its own state and stream. The aggregate is the consistency boundary that 2-3 desks share (`bookclub_aggregate.erl:32-37` routes three desks) | | `evoq_decision` | `context/1, decide/2`, optional `retry_budget/0, boundary_key/1, init_decision_model/0, apply_context_event/2` (`src/evoq_decision.erl:94-128`) | **No, for these desks.** `decide(ContextEvents, Command)` has the same shape as `handle(State, Command)`, but a decision runs through `evoq_decision_runtime:dispatch/3` (`src/evoq_decision_runtime.erl:63`). It locks on a tag-filter context and appends to the DCB pseudo-stream `<<"_dcb">>` (:53), not to the aggregate's stream. evoq says so itself: "Mixed-mode use cases (aggregate streams + DCB sharing tags) are not supported" (`src/evoq_decision.erl:39-44`). Moving the desks there would take their events off the club, book, member and reading streams. It fits cross-cutting checks such as uniqueness and allocation, not these desks | | `evoq_event_handler`, `evoq_process_manager`, `evoq_projection` | `src/evoq_event_handler.erl:48-64`, `src/evoq_process_manager.erl:90-105`, `src/evoq_projection.erl:67-89` | **No.** They react to events, not commands | | `evoq_emitter`, `evoq_listener`, `evoq_responder`, `evoq_requester` | `src/evoq_emitter.erl:25-37`, `src/evoq_listener.erl:25-34`, `src/evoq_responder.erl:24-37`, `src/evoq_requester.erl:23-29` | **No.** They are integration actors. A listener or responder *calls* `maybe_X:dispatch/1` (`guides/integration_actors.md:93`) | evoq's own documentation leaves the handler without a contract: - The "Complete Desk Example" names the behaviour of every desk file that has one (command `evoq_command`, event `evoq_event`, fact `evoq_fact`, emitter `evoq_emitter`, responder `evoq_responder`). It lists `maybe_initiate_venture.erl # Handler` with none, like the API entry point (`guides/integration_actors.md:243-251`). - The handler's shape appears only as naming and examples: `guides/event_envelope.md:304`, `guides/bit_flags.md:328-331`. - The corpus defines it the same way, with no behaviour: `mcl-corpus GLOSSARY.md:150-155`. Its stated return, `{ok, Event} | {error, Reason}`, has drifted from the `{ok, [Event]}` that the code returns. ### 3. Why the missing contract matters Without a behaviour, every service has grown its own handler shape: - mcl-bookclub and mcl-chess: `handle_from_map/2` + `handle(State, Cmd)` + `dispatch(Cmd)` (`mcl-chess apps/play_games/src/archive_game/maybe_archive_game.erl:18-35`) - mcl-kanban: `handle_payload/2` + `handle(State, Cmd)` + `dispatch(Cmd)` (`apps/guide_card_lifecycle/lib/guide_card_lifecycle/claim_card/maybe_claim_card.ex:16-50`) - macula-realm: `handle_from_map/1` + `handle(Cmd)`, with no state (`apps/guide_realm_lifecycle/lib/guide_realm_lifecycle/admit_realm_member/maybe_admit_realm_member.ex:24-81`) - mcl-whiteboard: `handle_from_map/1` + `handle(Cmd)` + `dispatch(params)` (`apps/guide_board_lifecycle/lib/guide_board_lifecycle/place_text/maybe_place_text.ex:10-31`) The forge clones hold about 90 Erlang and about 110 Elixir `maybe_*` modules (realm 48, kanban 42, whiteboard 12, ...). Each one copies the same `do_dispatch` block: `evoq_command:new` + `evoq_command_router:dispatch` with the store, adapter and consistency. Nothing checks at compile time that a desk exports what its aggregate calls: a typo in `fun maybe_x:handle_from_map/2` shows up only when that command first runs. ### 4. What a new behaviour would be (a design to rule on; not built) ```erlang -module(evoq_command_handler). %% The desk's business rule: the aggregate state and the typed command in, %% the events (or a refusal) out. Pure. The aggregate calls it from execute/2. -callback command_module() -> module(). %% the evoq_command it handles -callback handle(State :: term(), Command :: term()) -> {ok, [Event :: map()]} | {error, Reason :: term()}. %% (A stateless desk, as in realm and whiteboard, would need a handle/1 %% variant or ignore State: part of the ruling.) %% Library functions, replacing the copied boilerplate: %% evoq_command_handler:handle_from_map(Module, State, Payload) %% -> CommandModule:from_map/1, then Module:handle/2 %% evoq_command_handler:dispatch(Module, Command, AggregateModule, Opts) %% -> validate, evoq_command:new/5 with timestamp, evoq_command_router:dispatch/2 ``` Alongside it, an optional `evoq_aggregate` callback `command_handlers() -> #{CommandType :: atom() => module()}` would let an aggregate route `execute/2` without per-command clauses. The bookclub aggregates keep their lifecycle guard (archived, retired, unregistered, finished) and call the handler only after it. What it would cost: - an evoq minor release (additive and optional, like `evoq_emitter`'s compile-time-only contract, which nothing in evoq calls: `src/evoq_emitter.erl:25-37`, no caller of `fact_module/0` in `src/`) - a section in `guides/integration_actors.md` and `guides/aggregates.md` - the corpus glossary line - adoption desk by desk, which is not a big-bang change For mcl-bookclub (E) and mcl-bookclub-phoenix (P) it means: - 8 handlers each declare it and lose `handle_from_map/2`, `handled/2` and `do_dispatch/1` - 4 aggregates each name their handlers **The ruling needed from Raf:** 1. Add `evoq_command_handler` to evoq (name and callbacks as above, or his own), and have both bookclubs adopt it (step 4 of #4). 2. Or keep handlers plain modules and record the shape as a convention in the corpus. Then I make P's handler shape match E's exactly as part of parity, and step 4 is dropped. ### 5. Side findings on "the fitting evoq behaviour" (both repos) - **States.** E's state modules declare `evoq_state` (`src/evoq_state.erl:36-54`). P's do not. That one fits, and it is in the parity build (gap table §A). - **Emitters** use `evoq_event_handler`, which is right: it is the behaviour evoq's runtime subscribes. They could also declare the compile-time `evoq_emitter`, but that needs one `evoq_fact` module per fact, where today `mcl_bookclub_facts` is one module for three. I am not proposing it without a ruling. - **Projections** use `evoq_event_handler` with their own sqlite rows, carrying `event_id` and `version` and written idempotently. `evoq_projection` targets `evoq_read_model` with checkpoints. The event handler is the honest fit for an external sqlite store, so they stay as they are.
Author
Owner

Raf, 2026-12-01: "move them into host_bookclub...mcl-bookclub-phoenix should be as much aligned with mcl-bookclub as possible!"

Ruling for this issue: the three emit_*_to_mesh emitters move from mcl_bookclub_phoenix into host_bookclub slice folders, named as in mcl-bookclub; host_bookclub takes the macula SDK dependency and the emitters supervision, as in Erlang. Every gap-table row marked "moved" or "thinner" is a gap to close: where Phoenix differs from mcl-bookclub in layout, slice names, app boundaries, supervision or tests, the Erlang shape wins, in idiomatic Elixir.

Raf, 2026-12-01: "move them into host_bookclub...mcl-bookclub-phoenix should be as much aligned with mcl-bookclub as possible!" Ruling for this issue: the three `emit_*_to_mesh` emitters move from `mcl_bookclub_phoenix` into `host_bookclub` slice folders, named as in mcl-bookclub; `host_bookclub` takes the macula SDK dependency and the emitters supervision, as in Erlang. Every gap-table row marked "moved" or "thinner" is a gap to close: where Phoenix differs from mcl-bookclub in layout, slice names, app boundaries, supervision or tests, the Erlang shape wins, in idiomatic Elixir.
Member

"moved" rows, and where they land (DECIDED 2026-12-01 "move them into host_bookclub...mcl-bookclub-phoenix should be as much aligned with mcl-bookclub as possible!")

These are every gap-table row marked moved (gap-table.md lines 100-104 and 115). Each now follows mcl-bookclub's shape:

Row E P today Lands in
emit_member_registered_v1_to_mesh host/emit_member_registered_v1_to_mesh/…erl:19 fac/emit_member_registered_v1_to_mesh.ex PR 4 → host_bookclub/lib/host_bookclub/emit_member_registered_v1_to_mesh/
emit_book_procured_v1_to_mesh host/emit_book_procured_v1_to_mesh/…erl:1 fac/…ex PR 4, same pattern
emit_book_retired_v1_to_mesh host/emit_book_retired_v1_to_mesh/…erl:1 fac/…ex PR 4, same pattern
facts (mcl_bookclub_facts) host/mcl_bookclub_facts.erl:18 fac/facts.ex PR 4 → HostBookclub.MclBookclubFacts in host_bookclub
CMD supervision host/host_bookclub_sup.erl:16-46 (policy + 3 emitters) host/application.ex (policy) + fac/supervisor.ex (emitters) PR 4: host_bookclub's supervisor starts the policy and the 3 emitters, as E's does
facade supervisor fac/mcl_bookclub_sup.erl:16-24 (admin listener) fac/supervisor.ex (emitters) PR 4 loses the emitters. PR 5 adds the JSON admin API, served by the Phoenix endpoint (phoenix's idiom for E's listener)

What goes with them in PR 4:

  • the macula SDK dependency moves into host_bookclub/mix.exs
  • division_boundary_test.exs (PR 1) gets E's exemptions: the emit_*_to_mesh modules and the facts module may name macula, and nothing else in host_bookclub/lib may (as in E's initiate_bookclub_tests.erl:112)
  • PR 4's emitter publish tests (stubbed :macula) then test them in their new home

The 42 "thinner" rows are closed in the PR that owns their area:

  • §A/§B state and events: PR 2 (#11, in CI now)
  • §B entry points and handlers: PR 3
  • §C policy, emitters and facts: PR 4
  • §D facade, §F service tests: PR 5
  • docs and dependencies: PR 6

Each PR body names the gap rows it closes.

## "moved" rows, and where they land (DECIDED 2026-12-01 "move them into host_bookclub...mcl-bookclub-phoenix should be as much aligned with mcl-bookclub as possible!") These are every gap-table row marked **moved** (gap-table.md lines 100-104 and 115). Each now follows mcl-bookclub's shape: | Row | E | P today | Lands in | |---|---|---|---| | emit_member_registered_v1_to_mesh | `host/emit_member_registered_v1_to_mesh/…erl:19` | `fac/emit_member_registered_v1_to_mesh.ex` | **PR 4** → `host_bookclub/lib/host_bookclub/emit_member_registered_v1_to_mesh/` | | emit_book_procured_v1_to_mesh | `host/emit_book_procured_v1_to_mesh/…erl:1` | `fac/…ex` | **PR 4**, same pattern | | emit_book_retired_v1_to_mesh | `host/emit_book_retired_v1_to_mesh/…erl:1` | `fac/…ex` | **PR 4**, same pattern | | facts (`mcl_bookclub_facts`) | `host/mcl_bookclub_facts.erl:18` | `fac/facts.ex` | **PR 4** → `HostBookclub.MclBookclubFacts` in host_bookclub | | CMD supervision | `host/host_bookclub_sup.erl:16-46` (policy + 3 emitters) | `host/application.ex` (policy) + `fac/supervisor.ex` (emitters) | **PR 4**: host_bookclub's supervisor starts the policy and the 3 emitters, as E's does | | facade supervisor | `fac/mcl_bookclub_sup.erl:16-24` (admin listener) | `fac/supervisor.ex` (emitters) | **PR 4** loses the emitters. **PR 5** adds the JSON admin API, served by the Phoenix endpoint (phoenix's idiom for E's listener) | **What goes with them in PR 4:** - the macula SDK dependency moves into `host_bookclub/mix.exs` - `division_boundary_test.exs` (PR 1) gets E's exemptions: the `emit_*_to_mesh` modules and the facts module may name macula, and nothing else in host_bookclub/lib may (as in E's `initiate_bookclub_tests.erl:112`) - PR 4's emitter publish tests (stubbed `:macula`) then test them in their new home **The 42 "thinner" rows** are closed in the PR that owns their area: - §A/§B state and events: PR 2 (#11, in CI now) - §B entry points and handlers: PR 3 - §C policy, emitters and facts: PR 4 - §D facade, §F service tests: PR 5 - docs and dependencies: PR 6 Each PR body names the gap rows it closes.
mercurius referenced this issue from a commit 2026-12-01 15:53:15 +00:00
mercurius referenced this issue from a commit 2026-12-01 15:53:15 +00:00
Member

Deferred to #1, recorded here as ruled: the Erlang twin also asserts that the image builder IS the CI image, digest for digest (mcl_bookclub_service_tests.erl:274, second half). Here ci.yml tests on the forge build of macula-ci-pq ex118, and the Containerfile builder is the ghcr build of the same toolchain. That half holds only once #1 moves the pins to the forge. PR 9 tests everything else in row B: runtime agreement, the digest-pinned builder/runtime pair, and the revision label.

Deferred to #1, recorded here as ruled: the Erlang twin also asserts that the image builder IS the CI image, digest for digest (mcl_bookclub_service_tests.erl:274, second half). Here ci.yml tests on the forge build of macula-ci-pq ex118, and the Containerfile builder is the ghcr build of the same toolchain. That half holds only once #1 moves the pins to the forge. PR 9 tests everything else in row B: runtime agreement, the digest-pinned builder/runtime pair, and the revision label.
Member

Closed: every Done-when line is on main at 63d4a71162. Jupiter checked the Done-when lines against that tip and called #4 closable. Mars gave the GO.

Landed shas:

  • PR 20: 3964d722
  • PR 21: 6bee0640
  • PR 22: c6edff2d
  • PR 25: 26eccd2a
  • PR 26 (#4 PR 9, the image pins as tests): 8c86a55e
  • PR 27 (#4 PR 10, the open Done-when rows: no unused aggregate stream_id/1, the envelope stripped before the fold, the no-cookie/loopback guard): 63d4a711

Accepted exceptions:

  • The facade supervisor: Phoenix's admin is the Phoenix endpoint (web/application.ex), not a listener under a facade supervisor as in mcl-bookclub's mcl_bookclub_sup.erl:16-24.
  • The builder == CI-image digest half of row b is deferred to #1 (stated in image_pins_test.exs and in comment 7574 here).
  • State and event get_* getters are not copied (Supervisor ruling D, 2026-12-01). No verbatim copy of the original ruling is on record anywhere I can read. Mars relayed it today as: "Supervisor ruled on macula-services/mcl-bookclub-phoenix#4 (d): struct field access is the Elixir idiom, as you were already told today, so (d) closes and no getters are added." The gap table records it as an accepted idiom difference.

Found while closing, and left unplaced: #28 (a busy sqlite read crashes the QRY store), with its twin macula-services/mcl-bookclub#15.

Closed: every Done-when line is on main at 63d4a711622e6fc452d77d7b52f457642e0cb5dc. Jupiter checked the Done-when lines against that tip and called #4 closable. Mars gave the GO. Landed shas: - PR 20: 3964d722 - PR 21: 6bee0640 - PR 22: c6edff2d - PR 25: 26eccd2a - PR 26 (#4 PR 9, the image pins as tests): 8c86a55e - PR 27 (#4 PR 10, the open Done-when rows: no unused aggregate stream_id/1, the envelope stripped before the fold, the no-cookie/loopback guard): 63d4a711 Accepted exceptions: - The facade supervisor: Phoenix's admin is the Phoenix endpoint (web/application.ex), not a listener under a facade supervisor as in mcl-bookclub's mcl_bookclub_sup.erl:16-24. - The builder == CI-image digest half of row b is deferred to #1 (stated in image_pins_test.exs and in comment 7574 here). - State and event get_* getters are not copied (Supervisor ruling D, 2026-12-01). No verbatim copy of the original ruling is on record anywhere I can read. Mars relayed it today as: "Supervisor ruled on macula-services/mcl-bookclub-phoenix#4 (d): struct field access is the Elixir idiom, as you were already told today, so (d) closes and no getters are added." The gap table records it as an accepted idiom difference. Found while closing, and left unplaced: #28 (a busy sqlite read crashes the QRY store), with its twin macula-services/mcl-bookclub#15.
Author
Owner

Supervisor's ruling D, given to Mercurius on 2026-12-01 (original wording, for the record): no get_* getters on states and events; Elixir reads struct fields directly; recorded in the gap table as an accepted idiom difference. Raf may overrule.

Supervisor's ruling D, given to Mercurius on 2026-12-01 (original wording, for the record): no get_* getters on states and events; Elixir reads struct fields directly; recorded in the gap table as an accepted idiom difference. Raf may overrule.
Sign in to join this conversation.
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-bookclub-phoenix#4
No description provided.