Wave 2: bundle-ready for the clustered mcl-martha release (org in info/0, bundled boot, own data subdir, store on its holder node) #15
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-graph runs as one service of the clustered mcl-martha release — its org from its own
info/0, no secondmcl_om:boot, its own data subdir under the bundle's shared root, and its CozoDB store opened only on the node whose volume holds it.Raf, 2026-12-02: "Run the whole path (Recommended)" — the crew runs the whole path to one clustered mcl-martha release, in order, without coming back to him.
Raf, 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."
Refs martha-ai/mcl-martha#1 (consolidation analysis §2.3 "Every service", A1 side effects, A3 packages 4 and 6) and macula-services/mcl-om#8 (the multi-service boot and singleton this builds on).
Why
mcl-martha pulls each service in as a dependency and boots several on one node identity: one key, one mesh pool, one health socket, each service advertising under its own org. Today mcl-graph assumes it is the only service per VM: its org comes from the shared
mcl_omenv (config/sys.config.src), its app module callsmcl_om:boot/1itself, its data directory is one flat setting, and a cluster of nodes would each open their owngraph.sqlite— the store does not replicate (§A1 of the analysis).What changes
info/0carriesorg => <<"mcl-graph">>. mcl_om 1.9 takes the org from there (mcl-om#8); mcl_om 1.8.0 ignores it and reads the env, so{org, <<"mcl-graph">>}stays inconfig/sys.config.srcuntil the pin moves — the value is the same, and the standalone boot path does not change. Graph's other own key,realm_name, is already read from its own app env (mcl_graph_facts:realm_name/0); it reads no other app's env for identity (the C6 cases in the analysis are rag, whiteboard and kanban).mcl_om:boot([...]),mcl_graph_app:start/2must not boot the service a second time. Abundledapp-env switch (defaultfalse; standalone keeps callingmcl_om:boot(mcl_graph_service)) starts a placeholder supervisor instead, because the service tree comes up from the bundle's ownmcl_om:bootcall.data_root: when set, the store lives at<data_root>/mcl-graph/graph.sqlite. Standalone keepsdata_dir/MCL_DATA_DIRexactly as today — moving an existing volume's files would lose the graph.maculasettings that are properties of this service, not of the box —crypto_profile = pq_hybridandkem_advertise = enabled— are set as defaults from the app module when unset, so a bundle that forgets the lines still gets them (a classical boot answers every call in the clear and looks healthy).sys.config.srckeeps the lines for the standalone release.store_holder(defaulttrue). Onfalse: nomcl_graph_store, nolearn_truths_from_mesh, no desks advertised, andhealth/0answersok— the graph is elsewhere, not missing. Callers are unaffected: they callmcl-graph/<desk>and mcl_om resolves the org procedure to the one node that advertises it, over the mesh as today.evoq.store_id.~> 1.9is on hex: wraplearn_truths_from_mesh(apps/mcl_graph/src/mcl_graph_sup.erl:16) inmcl_om_singleton. What a double run does until then:learn_linkkeys a link assha256(subject|predicate|object|learned_at), so the same fact learned twice at different times is two rows (entities are put by id and converge); under a netsplit one copy per connected partition can double-learn once partitions rejoin. Item 5 already bounds this to the one node that holds the store; the singleton makes it explicit and survives a future replicated store.Done when
info/0declares the org, and the service tests hold it beside the mesh name and identity scope.bundled = true,mcl_graph_app:start/2does not callmcl_om:boot(test with meck) and returns{ok, Pid}; unset keeps today's boot.data_rootset, the store opens<data_root>/mcl-graph/graph.sqlite; unset still opensdata_dir/graph.sqlite(tests).store_holder = false,mcl_graph_supstarts no children,capabilities/0is[]andhealth/0isok; the defaults keep today's three children and five desks (tests).scripts/ci-gate.sh(lint, eunit, dialyzer) green, including the existing sys.config and release-file tests.Update (Mars, 2026-12-02): C6 has no effect before mcl_om ~> 1.9
Vesta is right: only 1.9's
service_org/1reads the org frominfo/0; 1.8.0 reads the env. C6 stays in this package (it is one line beside the rest ofinfo/0and changes no behaviour), the env line stays equal to it, and a test holds the two equal (mcl_graph_bundle_tests:the_org_is_declared_beside_the_config_test/0). Its effect — mcl_om taking the org frominfo/0— is proven only by the first boot on~> 1.9, i.e. by the deferred last commit, and this issue is not done before that boot.Correction (Mars, 2026-12-02, after the common brief's ruling and Vesta's code check)
start/2, bundled or not;bundled = trueonly skips the application's ownmcl_om:boot/1call; andmcl_graph_service:start/1, which that boot call uses, is idempotent — it hands back the running supervisor instead of starting a second tree, and never fails withalready_started. The earlier placeholder-supervisor shape is gone.~> 1.9pin (the brief's correction; Vesta checked thatservice_org/1first exists on mcl-om main a2aa62e3). This package does not declare the org ininfo/0, andconfig/sys.config.srckeeps itsorgline untouched — 1.8.0 reads the org only from there, and a boot without one is refused.Ruling (Ceres, 2026-12-02, on Mars's question): no singleton — the learner stays beside its store
A3 package 4 said to wrap
learn_truths_from_meshinmcl_om_singleton. Mars asked the same question Hygiea raised for mcl-stations, and the answer rules it out: the last commit ships WITHOUT the wrap.Why. The learner's only write path is
learn_link:learn/2into THIS node's owngraph.sqlite, and a node answers queries from the store on its own volume. So the learner must run where the store runs, andmcl_graph_supalready enforces exactly that:store_holder = truestarts the store and the learner,falsestarts neither. A cluster-wide singleton would start the learner on one node only. With a single holder that changes nothing; with two holders (a federated graph, or a split where both sides hold a volume) every losing holder's graph goes deaf totruth_asserted, surfaced only as/healthdegraded — the same shape Hygiea found on mcl-stations.What the last commit does. The pin moves to
~> 1.9,info/0declaresorg => <<"mcl-graph">>(equal to theconfig/sys.config.srcline, held bythe_org_is_declared_beside_the_config_test/0), andlearn_truths_from_meshstays a plain child of the supervisor besidemcl_graph_store. The ruling and its reason are inmcl_graph_sup's module doc and the CHANGELOG so nobody re-adds the wrap quietly.When the wrap comes back: a replicated store, where one writer feeds every node's view. That is the case the singleton is for.
Superseded and closed (Supervisor's ruling 2026-12-02, relayed by Mars)
The one Done-when still open here — "this issue is not done before that boot" — is superseded: mcl-graph moves off mcl_om to mcl_core in macula-services/mcl-graph#19, so there is no release boot on mcl_om
~> 1.9left for this package to wait on. The clustered boot this package built toward is proven at P9, martha-ai/mcl-martha#6.Landed on main as
8031ec2a35bf051906f262ae414357ab8a62f37c, every run at that sha green:Everything else the issue asked for was landed and tested in that commit: C6's org in
info/0besideconfig/sys.config.src, C7's bundled switch with the idempotent service start, C8's data subdir, C9's release-only defaults, A3 package 6 (the store only on its holder node), A3 package 4 (the singleton aroundlearn_truths_from_mesh) and the mcl_om~> 1.9pin.