Skip to content

Graph analysis: god nodes, Leiden communities, layering, integration surface #670

@ako

Description

@ako

Summary

Add architecture/dependency-graph analysis on top of the catalog refs graph, to help understand an app and decide where to intervene (refactoring). Proposal: docs/11-proposals/PROPOSAL_graph_analysis.md.

Targets two refactoring journeys:

  1. Spaghetti → layered/modular — dependency cycles + topological layer numbers + community groupings.
  2. Monolith → multi-app — coarse communities = candidate apps; the cross-community "integration surface" classifies each crossing edge into the OData/REST/event contract a split would require.

Scope

  • mxcli graph-report + CATALOG.graph_* views (god nodes, module coupling/cohesion, dead docs, refkind distribution, entity hotspots).
  • Pure-Go graph engine (no CGO/deps): Leiden communities, Tarjan cycles, topological layering, PageRank, betweenness — refresh catalog communities [resolution n].
  • SHOW COMMUNITIES / SHOW COMMUNITY [MEMBERS] OF.
  • Starlark linter builtins (community_of, layer_of, cycles, module_dependencies, centrality, god_nodes, integration_surface, refs_from) so teams enforce their own architecture policy.

Status

Implemented on branch `misc` (Parts 1 & 2 of the proposal), validated against the `leidenalg` reference (105 communities, exact match) and live test apps; skills + docs-site added. Pending PR/merge.

Deferred follow-ons (out of scope here)

  • Expression/XPath-embedded edges (entities/attributes/enums/constants referenced inside constraints/expressions) — gated behind expression type checking (Expression type checking for mxcli check (microflows + nanoflows) #580); enum/constant nodes fall out of it.
  • Agent-context subgraph — a token-minimal query-scoped subgraph served as an MCP tool (the "71.5x" Graphify pitch) — a sibling proposal.
  • Attribute-level graph nodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions