Wave 2: kanban names its own store, org, keys and data root, and boots under the bundle #11

Closed
opened 2026-12-02 06:54:59 +00:00 by juno · 4 comments
Member

Purpose (feature): mcl-kanban runs as one service inside the single mcl-martha release — it dispatches to its own store by id, reads its own org and its own crew keys from its own app env, takes its data subdir from one shared root, and leaves the boot to the bundle — while its own standalone release keeps working exactly as it does today.

DECIDED 2026-12-02 "Run the whole path (Recommended)" (Raf: the crew runs the whole path to one clustered mcl-martha release, in order, without coming back to him).
DECIDED 2026-12-02 "trust on sight. mcl-martha services should auto-cluster over LAN, no mcl-station required. Distributed Erlang offers us all we need." (the direction; the LAN realm and mcl-martha's own release are out of this issue)

Why

One release hosting several services needs each service to stop assuming it is alone in a VM (ANALYSIS_2026-12-01_mcl-martha-consolidation.md §2.1, §2.3). For kanban that is five conflicts plus the migration bin/start runs:

today evidence
C2 evoq.store_id is one app env per VM; every dispatch falls back to it apps/guide_card_lifecycle/lib/guide_card_lifecycle/live_state.ex:10; the 16 :evoq_router.dispatch() sites take the env
C6 the org and the crew keys are read from another app's env crew_facts.ex:42,69, crew_standing_reconciler.ex:49, realm_signature.ex:46, config/runtime.exs:59
C7 the service app boots mcl_om itself apps/mcl_kanban/lib/mcl_kanban/application.ex:14-15
C8 the data dir is read straight off MCL_DATA_DIR apps/mcl_kanban/lib/mcl_kanban/service.ex:200, config/runtime.exs:12-22
C9 release-only defaults live in config/runtime.exs, which a dependency does not carry config/runtime.exs:39-74
migration rel/overlays/bin/start:6-7 runs ./migrate; a bundle runs no such script rel/overlays/bin/migrate, ProjectBoards.Release.migrate/0

What changes

  1. C2 — the store is named on every call. A :guide_card_lifecycle config key holds the store id; all 16 dispatch sites pass it in the dispatch opts (:evoq_router.dispatch/2), and LiveState.of/2 starts its aggregate in that store. The :evoq, :store_id env stays set — evoq still falls back to it for a projection replay that carries no store (evoq_projection.erl:680) — but no read of the service's own goes through it. evoq_aggregate_registry:get_or_start/2 and evoq_aggregate:start_link/2 are deprecated for exactly this reason.
  2. C6 — own org, own keys. MclKanban.Service.info/0 gains org: "mcl-kanban". mcl_om reads that key (mcl-om#8, released in mcl_om 1.9.0, which this branch pins), so a bundle takes each service's org from the service itself; the standalone release still sets its :mcl_om, :org env, which 1.9.0 falls back to only when a service's info/0 carries no org. The four crew keys move to :guide_card_lifecycle, with their defaults in that app's application/0 env.
  3. C7 — a bundled switch. :mcl_kanban, :bundled (default false). False: boot as today. True: the app opens its store, starts its own tree, and leaves the boot to the bundle. MclKanban.Service.start/1 is idempotent, so a boot that already started the tree is answered with the running supervisor.
  4. C8 — one root, one subdir. A data root from MCL_DATA_DIR and a per-service subdir from app env; the store dir, kanban.sqlite3 and identity/identity.key all land under <root>/<kanban subdir>.
  5. C9 — defaults into the app. The release-only defaults move into the app's application/0 env; config/runtime.exs sets only what the deploy names.
  6. The migration runs from the app's start too. :project_boards, :migrate_on_start (true in a release), reusing ProjectBoards.Release.migrate/0. bin/start keeps calling it explicitly, and a second call with nothing pending is a no-op.
  7. Standalone unchanged. The release's :mcl_om, :org, the evoq env and the loopback HTTP bind stay exactly as they are.

Out of scope (deliberately)

  • A3 package 4, the mcl_om_singleton wrap of CrewStandingReconciler (found in review, Mars relaying Jupiter, 2026-12-02). The reconcile is a PER-STORE side effect, not a mesh-wide one: it reads CrewAggregate.current/0, which is LiveState.of/2 on THIS node's store, and the discharge it may run dispatches into that same store. With the store per node (:single, A3 package 2) a singleton would reconcile one node's roster and leave every other node's crews unreconciled. It therefore lands with kanban's A3 package 2, the clustered store — not before. What a double run does then, for the record: under a netsplit the singleton runs one copy per connected partition; each copy keeps its own counts, so each side counts only the answers it received, and a crew is discharged only after the realm told that side unknown_crew unknown_limit times in a row — both sides discharge on the same evidence, and reckon-db's version check settles the duplicate append (whether evoq retries the loser is unconfirmed, analysis A1).
  • The reckon-db store mode. It stays :single (service.ex:202). A3 package 2 must not ship before reckon-db#2 (R1: a cold-start join resets a non-empty joiner's data).
  • mcl-martha's own release, the LAN realm, the Elixir bump (stays 1.18), whiteboard's renames.

Done when

  • A dispatch reaches the store kanban names even with :evoq, :store_id set to a different atom: a test sets a foreign store in that env and the command still lands in :mcl_kanban_store.
  • GuideCardLifecycle.LiveState.of/2 starts its aggregate in that same store, whatever the env says.
  • MclKanban.Service.info/0 carries org: "mcl-kanban", and the standalone release's :mcl_om, :org is unchanged.
  • A test sets a conflicting :mcl_om value for each of the four crew keys and the board reads its own from :guide_card_lifecycle: CrewFacts.realm_name/0, CrewFacts.configured_publisher/0, CrewStandingReconciler.unknown_limit/0, RealmSignature.configured_key/0.
  • With :mcl_kanban, :bundled true the boot function is never called — a test passes a spy boot function and asserts it stayed uncalled; with false it is called once with MclKanban.Service.
  • The store dir and kanban.sqlite3 fall under <data root>/<kanban subdir>, all from app env. identity/identity.key stays at <data root>/identity/identity.key: one node identity shared by every service in a bundle, never one per service.
  • ProjectBoards.Release.migrate/0 runs at app start when :project_boards, :migrate_on_start is true, and a failure fails the boot before anything reads the read model.
  • The existing suite passes; a test that pinned one of the four crew keys under :mcl_om moves that pin to :guide_card_lifecycle with the key.
  • The standalone release still migrates then starts.
  • OTP 28; no test reaches an outside service.

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

Purpose (feature): mcl-kanban runs as one service inside the single mcl-martha release — it dispatches to its own store by id, reads its own org and its own crew keys from its own app env, takes its data subdir from one shared root, and leaves the boot to the bundle — while its own standalone release keeps working exactly as it does today. DECIDED 2026-12-02 "Run the whole path (Recommended)" (Raf: the crew runs the whole path to one clustered mcl-martha release, in order, without coming back to him). DECIDED 2026-12-02 "trust on sight. mcl-martha services should auto-cluster over LAN, no mcl-station required. Distributed Erlang offers us all we need." (the direction; the LAN realm and mcl-martha's own release are out of this issue) ## Why One release hosting several services needs each service to stop assuming it is alone in a VM (`ANALYSIS_2026-12-01_mcl-martha-consolidation.md` §2.1, §2.3). For kanban that is five conflicts plus the migration `bin/start` runs: | | today | evidence | |---|---|---| | C2 | `evoq.store_id` is one app env per VM; every dispatch falls back to it | `apps/guide_card_lifecycle/lib/guide_card_lifecycle/live_state.ex:10`; the 16 `:evoq_router.dispatch()` sites take the env | | C6 | the org and the crew keys are read from another app's env | `crew_facts.ex:42,69`, `crew_standing_reconciler.ex:49`, `realm_signature.ex:46`, `config/runtime.exs:59` | | C7 | the service app boots mcl_om itself | `apps/mcl_kanban/lib/mcl_kanban/application.ex:14-15` | | C8 | the data dir is read straight off `MCL_DATA_DIR` | `apps/mcl_kanban/lib/mcl_kanban/service.ex:200`, `config/runtime.exs:12-22` | | C9 | release-only defaults live in `config/runtime.exs`, which a dependency does not carry | `config/runtime.exs:39-74` | | migration | `rel/overlays/bin/start:6-7` runs `./migrate`; a bundle runs no such script | `rel/overlays/bin/migrate`, `ProjectBoards.Release.migrate/0` | ## What changes 1. **C2 — the store is named on every call.** A `:guide_card_lifecycle` config key holds the store id; all 16 dispatch sites pass it in the dispatch opts (`:evoq_router.dispatch/2`), and `LiveState.of/2` starts its aggregate in that store. The `:evoq, :store_id` env stays set — evoq still falls back to it for a projection replay that carries no store (`evoq_projection.erl:680`) — but no read of the service's own goes through it. `evoq_aggregate_registry:get_or_start/2` and `evoq_aggregate:start_link/2` are deprecated for exactly this reason. 2. **C6 — own org, own keys.** `MclKanban.Service.info/0` gains `org: "mcl-kanban"`. mcl_om reads that key (mcl-om#8, released in mcl_om 1.9.0, which this branch pins), so a bundle takes each service's org from the service itself; the standalone release still sets its `:mcl_om, :org` env, which 1.9.0 falls back to only when a service's `info/0` carries no `org`. The four crew keys move to `:guide_card_lifecycle`, with their defaults in that app's `application/0` env. 3. **C7 — a bundled switch.** `:mcl_kanban, :bundled` (default false). False: boot as today. True: the app opens its store, starts its own tree, and leaves the boot to the bundle. `MclKanban.Service.start/1` is idempotent, so a boot that already started the tree is answered with the running supervisor. 4. **C8 — one root, one subdir.** A data root from `MCL_DATA_DIR` and a per-service subdir from app env; the store dir, `kanban.sqlite3` and `identity/identity.key` all land under `<root>/<kanban subdir>`. 5. **C9 — defaults into the app.** The release-only defaults move into the app's `application/0` env; `config/runtime.exs` sets only what the deploy names. 6. **The migration runs from the app's start too.** `:project_boards, :migrate_on_start` (true in a release), reusing `ProjectBoards.Release.migrate/0`. `bin/start` keeps calling it explicitly, and a second call with nothing pending is a no-op. 7. **Standalone unchanged.** The release's `:mcl_om, :org`, the evoq env and the loopback HTTP bind stay exactly as they are. ## Out of scope (deliberately) - **A3 package 4, the `mcl_om_singleton` wrap of `CrewStandingReconciler`** (found in review, Mars relaying Jupiter, 2026-12-02). The reconcile is a PER-STORE side effect, not a mesh-wide one: it reads `CrewAggregate.current/0`, which is `LiveState.of/2` on THIS node's store, and the discharge it may run dispatches into that same store. With the store per node (`:single`, A3 package 2) a singleton would reconcile one node's roster and leave every other node's crews unreconciled. **It therefore lands with kanban's A3 package 2, the clustered store** — not before. What a double run does then, for the record: under a netsplit the singleton runs one copy per connected partition; each copy keeps its own `counts`, so each side counts only the answers it received, and a crew is discharged only after the realm told that side `unknown_crew` `unknown_limit` times in a row — both sides discharge on the same evidence, and reckon-db's version check settles the duplicate append (whether evoq retries the loser is unconfirmed, analysis A1). - **The reckon-db store `mode`.** It stays `:single` (`service.ex:202`). A3 package 2 must not ship before reckon-db#2 (R1: a cold-start join resets a non-empty joiner's data). - mcl-martha's own release, the LAN realm, the Elixir bump (stays 1.18), whiteboard's renames. ## Done when - A dispatch reaches the store kanban names even with `:evoq, :store_id` set to a different atom: a test sets a foreign store in that env and the command still lands in `:mcl_kanban_store`. - `GuideCardLifecycle.LiveState.of/2` starts its aggregate in that same store, whatever the env says. - `MclKanban.Service.info/0` carries `org: "mcl-kanban"`, and the standalone release's `:mcl_om, :org` is unchanged. - A test sets a conflicting `:mcl_om` value for each of the four crew keys and the board reads its own from `:guide_card_lifecycle`: `CrewFacts.realm_name/0`, `CrewFacts.configured_publisher/0`, `CrewStandingReconciler.unknown_limit/0`, `RealmSignature.configured_key/0`. - With `:mcl_kanban, :bundled` true the boot function is never called — a test passes a spy boot function and asserts it stayed uncalled; with false it is called once with `MclKanban.Service`. - The store dir and `kanban.sqlite3` fall under `<data root>/<kanban subdir>`, all from app env. `identity/identity.key` stays at `<data root>/identity/identity.key`: one node identity shared by every service in a bundle, never one per service. - `ProjectBoards.Release.migrate/0` runs at app start when `:project_boards, :migrate_on_start` is true, and a failure fails the boot before anything reads the read model. - The existing suite passes; a test that pinned one of the four crew keys under `:mcl_om` moves that pin to `:guide_card_lifecycle` with the key. - The standalone release still migrates then starts. - OTP 28; no test reaches an outside service. Refs martha-ai/mcl-martha#1 Refs macula-services/mcl-om#8 Refs macula-services/mcl-kanban#13
Author
Member

Correction to my own Done-when, made before any code for C8 was written: I had put identity/identity.key under the per-service subdir. That is wrong and would be harmful in a bundle.

The identity key is the NODE's: one key, one pool, one health socket for the whole release (analysis §2.3, mcl_om). Two services each writing their own key under their own subdir would give one node two identities, which the station drops and the SDK ping-pongs on (analysis A1).

So the corrected line is: the store dir and kanban.sqlite3 fall under <data root>/<kanban subdir>; identity/identity.key stays at <data root>/identity/identity.key, shared by every service, as it is today. The issue body carries the corrected line.

Correction to my own Done-when, made before any code for C8 was written: I had put `identity/identity.key` under the per-service subdir. That is wrong and would be harmful in a bundle. The identity key is the NODE's: one key, one pool, one health socket for the whole release (analysis §2.3, mcl_om). Two services each writing their own key under their own subdir would give one node two identities, which the station drops and the SDK ping-pongs on (analysis A1). So the corrected line is: the store dir and `kanban.sqlite3` fall under `<data root>/<kanban subdir>`; `identity/identity.key` stays at `<data root>/identity/identity.key`, shared by every service, as it is today. The issue body carries the corrected line.
Author
Member

Status: the branch is pushed and PR 12 is open (juno/11-wave2-bundle, tip 53898af767, base origin/main 16080f6).

Everything in the issue is built and green locally: 242 / 28 / 22 / 62 / 37 tests, 0 failures; mix format --check-formatted, mix credo, mix dialyzer clean; and a real standalone release built and booted, migrated, answered /health with "org":"mcl-kanban", and kept its data at the root with no subdir.

gates cannot go green on the forge yet, and it is not this package

The pull_request runs are 6631 (ci.yml) and 6630 (c4-model.yml), both still waiting on the runner. But the same gates job is ALREADY red on main, before this branch: run 6432 (push, 16080f6 at 2026-12-01T15:59:19Z), job 26461, died at step 0 with exec: "node": executable file not found in $PATH on actions/checkout@v4.

That is exactly mcl-kanban#4 ("ci.yml gates: the job dies at step 0 -- a JavaScript checkout in an image that carries no node"), and its fix is already written and parked on PR 5 / branch juno/4-gates-plain-shell-checkout (tip 96f95d875c), stopped one commit short of green by the HOME problem recorded there. gates still uses actions/checkout@v4, actions/cache@v4 and actions/upload-artifact@v4 in the macula-ci image.

So this package needs a ruling before it can meet "green CI on the forge": land #4's fix first (PR 5), or something else the dispatcher decides. I have not folded #4's fix into this branch; that would be scope past the ruling.

Status: the branch is pushed and PR 12 is open (juno/11-wave2-bundle, tip 53898af76782777d85a31cc41a20fc43a01e8097, base origin/main 16080f6). Everything in the issue is built and green locally: 242 / 28 / 22 / 62 / 37 tests, 0 failures; `mix format --check-formatted`, `mix credo`, `mix dialyzer` clean; and a real standalone release built and booted, migrated, answered `/health` with "org":"mcl-kanban", and kept its data at the root with no subdir. ## `gates` cannot go green on the forge yet, and it is not this package The pull_request runs are 6631 (ci.yml) and 6630 (c4-model.yml), both still `waiting` on the runner. But the same `gates` job is ALREADY red on `main`, before this branch: run 6432 (push, 16080f6 at 2026-12-01T15:59:19Z), job 26461, died at step 0 with `exec: "node": executable file not found in $PATH` on `actions/checkout@v4`. That is exactly mcl-kanban#4 ("ci.yml gates: the job dies at step 0 -- a JavaScript checkout in an image that carries no node"), and its fix is already written and parked on PR 5 / branch `juno/4-gates-plain-shell-checkout` (tip 96f95d875c6f3f71c3ceff3f971b9a516420873f), stopped one commit short of green by the HOME problem recorded there. `gates` still uses `actions/checkout@v4`, `actions/cache@v4` and `actions/upload-artifact@v4` in the macula-ci image. So this package needs a ruling before it can meet "green CI on the forge": land #4's fix first (PR 5), or something else the dispatcher decides. I have not folded #4's fix into this branch; that would be scope past the ruling.
Author
Member

The PR's runs finished, on tip 53898af767:

run 6631 (ci.yml, pull_request)

  • gates job 27168 -- failure, and it is #4, not this branch: step 0, exec: "node": executable file not found in $PATH on actions/checkout@v4, the same 24-line death as main's job 26461. My code never ran.
  • Dependency advisories job 27169 -- success
  • elixir in . (container) job 27174 -- success
  • image, attest, guard, elixir in . -- skipped

run 6630 (c4-model.yml, pull_request)

  • jobs 27165 and 27166 -- success

So every job that can run on this branch is green; the only red is the JavaScript-checkout gate that mcl-kanban#4 owns. Holding at "PR 12 open" until the Supervisor's ruling on the order (Mars recommended placing #4 on me first: its HOME commit, a green gates, review and land, then this branch merges origin/main and re-pushes).

The PR's runs finished, on tip 53898af76782777d85a31cc41a20fc43a01e8097: **run 6631 (ci.yml, pull_request)** - `gates` job 27168 -- **failure**, and it is #4, not this branch: step 0, `exec: "node": executable file not found in $PATH` on `actions/checkout@v4`, the same 24-line death as main's job 26461. My code never ran. - `Dependency advisories` job 27169 -- success - `elixir in . (container)` job 27174 -- success - `image`, `attest`, `guard`, `elixir in .` -- skipped **run 6630 (c4-model.yml, pull_request)** - jobs 27165 and 27166 -- success So every job that can run on this branch is green; the only red is the JavaScript-checkout gate that mcl-kanban#4 owns. Holding at "PR 12 open" until the Supervisor's ruling on the order (Mars recommended placing #4 on me first: its HOME commit, a green gates, review and land, then this branch merges origin/main and re-pushes).
Author
Member

Landed on main at 88efed42eb (PR 12, closed merged). Forge on the main push: runs 6789 (c4-model) and 6790 (gates + advisories) green, and on the PR head 6777/6776.

Delivered: C2 (the store named on every dispatch and in LiveState), C6 (org in info/0, crew keys off :mcl_om, on mcl_om ~> 1.9), C7 (bundled switch, idempotent start/1), C8 (one data root plus subdir), C9 (defaults in the app), the migration from the app start, and the #13 toolchain repin to the forge's macula-pub images. The A3 package 4 singleton wrap stays out by decision (review): the reconcile reads and writes THIS node's store, so it lands with kanban's A3 package 2 (clustered store), which this issue records.

Landed on main at 88efed42eba950f379a463b730f5e2d536b52bd9 (PR 12, closed merged). Forge on the main push: runs 6789 (c4-model) and 6790 (gates + advisories) green, and on the PR head 6777/6776. Delivered: C2 (the store named on every dispatch and in LiveState), C6 (org in info/0, crew keys off :mcl_om, on mcl_om ~> 1.9), C7 (bundled switch, idempotent start/1), C8 (one data root plus subdir), C9 (defaults in the app), the migration from the app start, and the #13 toolchain repin to the forge's macula-pub images. The A3 package 4 singleton wrap stays out by decision (review): the reconcile reads and writes THIS node's store, so it lands with kanban's A3 package 2 (clustered store), which this issue records.
juno closed this issue 2026-12-02 10:21:16 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
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-kanban#11
No description provided.