Improve community detection quality with typed Leiden - #314
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
compass.community-quality/1evidence across normal, cluster-only, viewer, MCP, and immutable-history pathsMotivation
The prior Louvain path treated most relationship evidence alike and could not demonstrate whether a changed partition improved connectivity, separation, stability, or reviewed planted expectations. This change implements the phased community-detection quality design while preserving Base Graph identity, direction, multiplicity, anchors, and provenance.
The fixed Leiden profile improves exact planted recovery from 7/12 to 10/12 and mean ARI from 0.746 to 0.901 in the matched fixture comparison. It records one false merge and one false split versus seven and three under compatibility Louvain. Automatic multi-resolution selection remains outside production because the compact timing gate did not qualify it.
Verification
All listed checks passed before rebasing onto current main. After rebase, 77 graph unit tests, 14 history round-trip tests, 10 cluster-only tests, formatting, and
cargo check -p compass-cli --lib --lockedpassed. A repeated full CLI test build was interrupted by the mounted build volume filling while unpacking parser sources; the narrower post-rebase CLI check then passed from a cleaned worktree-specific target.The available pinned
kachereal-repository timing attempt did not reach a completed publication in either clustered or--no-clustercontrol form, so no real-corpus clustering performance claim is made. This omission is recorded in the qualification report.Compatibility and documentation
Community membership, IDs, labels, architecture grouping, and derived reports can change when the new profile rebuilds a graph. Existing historical realizations remain immutable. The complete profile now participates in build identity, and strict readers validate the quality artifact schema, profile, graph generation, and digest.
Updated documentation includes the technical design, community-detection concept, qualification report, command/output references, compatibility ledger, migration guide, changelog, and performance notes.
Checklist
MIT OR Apache-2.0