Skip to content

Bug: graphify hook install loses community labels on rebuild #705

Closed

Description

@ddein

Description

When using graphify hook install, the post-commit hook triggers _rebuild_code() which overwrites human-readable community labels with generic placeholder names.

Steps to reproduce

  1. Run /graphify . — communities get human-readable labels (e.g. "Domain Models & Enums")
  2. Install hook: graphify hook install
  3. Make any code change and commit
  4. Hook triggers rebuild → GRAPH_REPORT.md and graph.html now show generic "Community N" labels

Root cause

  • Full pipeline (Step 5) writes .graphify_labels.json, then Step 9 cleanup deletes it
  • _rebuild_code() in watch.py hardcodes labels = {cid: "Community " + str(cid)} instead of reading persisted labels
  • graph.json stores community IDs per node but no community_labels mapping

Expected behavior

Hook rebuild should preserve human-readable community labels.

Possible fix options

  1. Don't delete .graphify_labels.json in Step 9 cleanup, and make _rebuild_code() read it
  2. Or store community_labels directly inside graph.json

Additional note

.graphify_incremental.json is also not cleaned up after --update — should be added to Step 9 cleanup.

Activity

  1. safishamsi commented on May 4, 2026

    @safishamsi
    Member

    Fixed in v0.7.5: hook rebuild now reads .graphify_labels.json to preserve community labels.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions