Skip to content

docs(readme): document label-reuse sidecar and Leiden/Louvain fallback - #3936

Open
ffffff55 wants to merge 1 commit into
Graphify-Labs:v8from
ffffff55:docs/labels-sig-and-louvain-fallback
Open

ffffff55 wants to merge 1 commit into
Graphify-Labs:v8from
ffffff55:docs/labels-sig-and-louvain-fallback

Conversation

@ffffff55

Copy link
Copy Markdown

Addresses items 3 and 5 of #3859 (items 1, 2, and 4 are already covered by #3926).

What

Three README additions, README-only (+4/−2):

  1. Concepts table — the Communities row no longer presents Leiden as the only algorithm; it now notes the silent networkx Louvain fallback when the optional leiden extra is not installed.
  2. Extras table, leiden row — documents the fallback and that switching algorithms reshuffles every community, so a full graphify label run is needed for fresh names.
  3. New "Label reuse after re-clustering" callout next to the existing "Community names" one — documents .graphify_labels.json.sig: a saved label is reused only while its community's membership signature is unchanged; changed or new communities get hub-derived placeholder names until graphify label runs again; after the community set changes (a different --resolution, or installing the leiden extra), a full graphify label is the only way to refresh every name.

Why

From #3859: the .sig sidecar decides which labels survive a re-cluster but was not documented anywhere in the README (cf. #3808), and the README described Leiden as the clustering algorithm without mentioning the Louvain fallback — each cost the reporter a failed run or a wrong assumption.

How checked

  • Facts verified against the code: the .graphify_labels.json + .sig write/reuse path in graphify/cli.py (community_member_sigs reuse guard, hub-fill for changed communities), the graspologic → networkx Louvain fallback chain in graphify/cluster.py::_partition, and the leiden extra in pyproject.toml.
  • uv run pre-commit run --files README.md — passes (skillgen-check Passed; ruff has no files to check).
  • Tables keep their column counts; no trailing whitespace; no other files touched.

Graphify-Labs#3859 items 3 and 5 (items 1, 2, 4 are covered by Graphify-Labs#3926):

- Concepts table: note the silent networkx Louvain fallback when the
  optional `leiden` extra is not installed, instead of presenting
  Leiden as the only algorithm.
- Extras table `leiden` row: document the fallback and that switching
  algorithms reshuffles every community, so a full `graphify label`
  run is needed for fresh names.
- New 'Label reuse after re-clustering' callout documenting
  .graphify_labels.json.sig: labels survive a re-cluster only while a
  community's membership signature is unchanged; changed/new
  communities get hub-derived placeholders until a full `graphify
  label` run.

Facts verified against graphify/cli.py (labels + .sig write/reuse),
graphify/cluster.py::_partition and pyproject.toml.
@github-actions

Copy link
Copy Markdown

Thanks for the pull request, @ffffff55. A maintainer will review it soon.

Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions.

A couple of things that speed up review: make sure the test suite passes on Python 3.10 and 3.13, and that the change keeps extraction deterministic.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).


Graphify review — findings

Documents that community detection falls back to networkx Louvain when the optional leiden extra isn't installed, and that switching backends later reshuffles every community. Also explains that saved labels in .graphify_labels.json are reused on cluster-only/update only when a community's membership signature is unchanged. Changed or new communities get hub-derived placeholder names until a full graphify label run.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 24 functions depend on the 24 functions this change touches.

Health — grade A; no new coupling hotspots.

Verification — 24 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 24 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

308 of 308 test file(s) selected (100%) via static blast radius.

Escalated to a full run for safety — the selection is not trustworthy on its own (see below). CI should run the whole suite.

  • tests/test_affected_cli.py — full-run-safety
  • tests/test_affected_member_seed.py — full-run-safety
  • tests/test_agents_platform.py — full-run-safety
  • tests/test_analyze.py — full-run-safety
  • tests/test_anthropic_custom_endpoint.py — full-run-safety
  • tests/test_antigravity_install.py — full-run-safety
  • tests/test_apm_fallback_version.py — full-run-safety
  • tests/test_architecture_doc.py — full-run-safety
  • tests/test_astro_extraction.py — full-run-safety
  • tests/test_astro_import_ids.py — full-run-safety
  • tests/test_atomic_canvas_export.py — full-run-safety
  • tests/test_atomic_version_stamp.py — full-run-safety
  • tests/test_atomic_writes.py — full-run-safety
  • tests/test_backend_env_isolation.py — full-run-safety
  • tests/test_backend_extras.py — full-run-safety
  • tests/test_benchmark.py — full-run-safety
  • tests/test_benchmark_raw_graph.py — full-run-safety
  • tests/test_blade_extractor.py — full-run-safety
  • tests/test_build.py — full-run-safety
  • tests/test_build_merge_dedup_scope.py — full-run-safety
  • tests/test_build_merge_hyperedges_and_prune.py — full-run-safety
  • tests/test_build_merge_shrink_guard.py — full-run-safety
  • tests/test_builtin_global_type_refs.py — full-run-safety
  • tests/test_cache.py — full-run-safety
  • tests/test_callflow_html.py — full-run-safety
  • tests/test_cargo_introspect.py — full-run-safety
  • tests/test_cargo_missing_manifest.py — full-run-safety
  • tests/test_carried_hyperedge_remap.py — full-run-safety
  • tests/test_case_sensitive_resolution.py — full-run-safety
  • tests/test_charmap_encoding.py — full-run-safety
  • tests/test_chunking.py — full-run-safety
  • tests/test_cjs_module_extension.py — full-run-safety
  • tests/test_claude_cli_backend.py — full-run-safety
  • tests/test_claude_md.py — full-run-safety
  • tests/test_cli_broken_pipe.py — full-run-safety
  • tests/test_cli_export.py — full-run-safety
  • tests/test_cli_help.py — full-run-safety
  • tests/test_cluster.py — full-run-safety
  • tests/test_cobol_extractor.py — full-run-safety
  • tests/test_codebuddy.py — full-run-safety
  • tests/test_community_hub_labels.py — full-run-safety
  • tests/test_community_labels_skill.py — full-run-safety
  • tests/test_confidence.py — full-run-safety
  • tests/test_corrupt_graph_json.py — full-run-safety
  • tests/test_cpp_nested_and_cli.py — full-run-safety
  • tests/test_cpp_objc_cross_file_calls.py — full-run-safety
  • tests/test_cpp_preprocess.py — full-run-safety
  • tests/test_cross_extension_reexport_self_cycle.py — full-run-safety
  • tests/test_cross_language_call_resolution.py — full-run-safety
  • tests/test_cross_repo_external_call_guards.py — full-run-safety
  • … and 258 more

non-code file(s) changed (README.md) → running the full suite for safety (a code graph can't see config/fixture/data deps)

changed code file(s) with no mapped test (README.md) — a coverage gap or a missing link — running the full suite rather than only the selected tests

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant