Wave 2: kanban names its own store, org, keys and data root, and boots under the bundle #11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 migrationbin/startruns:evoq.store_idis one app env per VM; every dispatch falls back to itapps/guide_card_lifecycle/lib/guide_card_lifecycle/live_state.ex:10; the 16:evoq_router.dispatch()sites take the envcrew_facts.ex:42,69,crew_standing_reconciler.ex:49,realm_signature.ex:46,config/runtime.exs:59apps/mcl_kanban/lib/mcl_kanban/application.ex:14-15MCL_DATA_DIRapps/mcl_kanban/lib/mcl_kanban/service.ex:200,config/runtime.exs:12-22config/runtime.exs, which a dependency does not carryconfig/runtime.exs:39-74rel/overlays/bin/start:6-7runs./migrate; a bundle runs no such scriptrel/overlays/bin/migrate,ProjectBoards.Release.migrate/0What changes
:guide_card_lifecycleconfig key holds the store id; all 16 dispatch sites pass it in the dispatch opts (:evoq_router.dispatch/2), andLiveState.of/2starts its aggregate in that store. The:evoq, :store_idenv 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/2andevoq_aggregate:start_link/2are deprecated for exactly this reason.MclKanban.Service.info/0gainsorg: "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, :orgenv, which 1.9.0 falls back to only when a service'sinfo/0carries noorg. The four crew keys move to:guide_card_lifecycle, with their defaults in that app'sapplication/0env.: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/1is idempotent, so a boot that already started the tree is answered with the running supervisor.MCL_DATA_DIRand a per-service subdir from app env; the store dir,kanban.sqlite3andidentity/identity.keyall land under<root>/<kanban subdir>.application/0env;config/runtime.exssets only what the deploy names.:project_boards, :migrate_on_start(true in a release), reusingProjectBoards.Release.migrate/0.bin/startkeeps calling it explicitly, and a second call with nothing pending is a no-op.:mcl_om, :org, the evoq env and the loopback HTTP bind stay exactly as they are.Out of scope (deliberately)
mcl_om_singletonwrap ofCrewStandingReconciler(found in review, Mars relaying Jupiter, 2026-12-02). The reconcile is a PER-STORE side effect, not a mesh-wide one: it readsCrewAggregate.current/0, which isLiveState.of/2on 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 owncounts, so each side counts only the answers it received, and a crew is discharged only after the realm told that sideunknown_crewunknown_limittimes 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).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).Done when
:evoq, :store_idset 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/2starts its aggregate in that same store, whatever the env says.MclKanban.Service.info/0carriesorg: "mcl-kanban", and the standalone release's:mcl_om, :orgis unchanged.:mcl_omvalue 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.:mcl_kanban, :bundledtrue the boot function is never called — a test passes a spy boot function and asserts it stayed uncalled; with false it is called once withMclKanban.Service.kanban.sqlite3fall under<data root>/<kanban subdir>, all from app env.identity/identity.keystays at<data root>/identity/identity.key: one node identity shared by every service in a bundle, never one per service.ProjectBoards.Release.migrate/0runs at app start when:project_boards, :migrate_on_startis true, and a failure fails the boot before anything reads the read model.:mcl_ommoves that pin to:guide_card_lifecyclewith the key.Refs martha-ai/mcl-martha#1
Refs macula-services/mcl-om#8
Refs macula-services/mcl-kanban#13
Correction to my own Done-when, made before any code for C8 was written: I had put
identity/identity.keyunder 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.sqlite3fall under<data root>/<kanban subdir>;identity/identity.keystays at<data root>/identity/identity.key, shared by every service, as it is today. The issue body carries the corrected line.Status: the branch is pushed and PR 12 is open (juno/11-wave2-bundle, tip
53898af767, base origin/main16080f6).Everything in the issue is built and green locally: 242 / 28 / 22 / 62 / 37 tests, 0 failures;
mix format --check-formatted,mix credo,mix dialyzerclean; and a real standalone release built and booted, migrated, answered/healthwith "org":"mcl-kanban", and kept its data at the root with no subdir.gatescannot go green on the forge yet, and it is not this packageThe pull_request runs are 6631 (ci.yml) and 6630 (c4-model.yml), both still
waitingon the runner. But the samegatesjob is ALREADY red onmain, before this branch: run 6432 (push,16080f6at 2026-12-01T15:59:19Z), job 26461, died at step 0 withexec: "node": executable file not found in $PATHonactions/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(tip96f95d875c), stopped one commit short of green by the HOME problem recorded there.gatesstill usesactions/checkout@v4,actions/cache@v4andactions/upload-artifact@v4in 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.
The PR's runs finished, on tip
53898af767:run 6631 (ci.yml, pull_request)
gatesjob 27168 -- failure, and it is #4, not this branch: step 0,exec: "node": executable file not found in $PATHonactions/checkout@v4, the same 24-line death as main's job 26461. My code never ran.Dependency advisoriesjob 27169 -- successelixir in . (container)job 27174 -- successimage,attest,guard,elixir in .-- skippedrun 6630 (c4-model.yml, pull_request)
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).
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.