detect_communities
Identifies tightly-coupled file clusters by running Leiden community detection on the dependency graph, outputting communities and modularity.
Instructions
Run Leiden community detection on the file dependency graph. Identifies tightly-coupled file clusters (modules). Mutates the community index (stores results); idempotent. Deterministic — same seed produces identical assignments across runs. Use before get_communities or get_community. Returns JSON: { communities: [{ id, files, size }], modularity, seed }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resolution | No | Resolution parameter — higher values produce more communities (default 1.0) | |
| seed | No | PRNG seed for the Leiden node-shuffle. Same seed reproduces identical community IDs across runs. Default 0. |