Skip to content

Finish clustering infrastructure (libcluster + horde) #187

@bleuropa

Description

@bleuropa

Context

Loomkin.Teams.Cluster, Teams.Distributed, and Teams.Migration were introduced in Epic 5.6 (541e4a4, 2026-02-28). The code is well-structured and tested (13 tests passing), but clustering is completely inert — the dependencies were never added and the setup docs were accidentally deleted.

See docs/clustering-status.md for the full audit.

Current state (~70% complete)

Working:

  • Conditional startup via Cluster.enabled?() in Teams.Supervisor
  • Graceful degradation — all Code.ensure_loaded? checks fall back to local-only
  • Manager/migration route through Distributed API correctly
  • Typed signals for node join/leave exist
  • 13 comprehensive tests

Missing:

  • Add {:libcluster, "~> 3.3"} and {:horde, "~> 0.9"} to mix.exs
  • Add clustering config to config/dev.exs and config/runtime.exs
  • Wire libcluster event hooks to Cluster.handle_node_join/1 / handle_node_leave/1
  • Surface connected_nodes/0 and agent_count_per_node/0 somewhere (UI or monitoring)
  • Remove or connect orphaned utility functions (local_node/0, etc.)
  • Restore setup documentation (original docs/clustering-deps.md was deleted in 90b1f86)

Priority

Low — single-node is fine for current usage. Becomes important when scaling to multi-node production (Fly.io topology is already pre-coded).

Labels

infrastructure, tech-debt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions