Skip to main content

Module community

Module community 

Source
Expand description

Community detection on the code graph.

A hardened Leiden engine (leiden) clusters files into cohesive modules, with robustness passes for super-hubs and oversized/low-cohesion communities (hardening) and stable ids across rebuilds (stable_ids). The engine is storage-agnostic: it runs on the PropertyGraph (SQLite) and on any GraphProvider, so ctx_architecture and the dashboard graph view share one implementation and report identical community ids.

Structs§

Community
CommunityResult

Functions§

detect_communities
Detect communities on the PropertyGraph (ids are deterministic but not remapped to a previous run). Prefer detect_communities_stable when a project root is available.
detect_communities_for_provider
Detect communities on any GraphProvider (PropertyGraph or graph index) with stable ids. This is the entry point for the dashboard graph view.
detect_communities_stable
Detect communities on the PropertyGraph with ids kept stable across rebuilds (remapped to, and persisted alongside, the project’s previous assignment).