Skip to content

v0.5.0 — Leiden+CPM

Choose a tag to compare

@theagenticguy theagenticguy released this 11 May 01:12
· 48 commits to main since this release
3285082

BREAKING CHANGE

  • Settings field rename — every louvain_* config knob and
    CLAUDE_SQL_LOUVAIN_* env var is gone. Replace with leiden_* equivalents.
    Parquet schema gains is_medoid, coherence, gamma_used columns; removes
    nothing. New community_profile.parquet sidecar appears at
    ~/.claude/community_profile.parquet on auto-γ runs.

Refactor

  • communities: replace Louvain with Leiden+CPM (leidenalg + igraph
    mutual-kNN cosine graph). CPM γ has closed-form cosine-density semantics;
    resolution-limit-free at this scale. Auto-γ via Optimiser.resolution_profile
    • longest-plateau picker. Determinism preserved via settings.seed flowing
      into both find_partition(seed=...) and Optimiser.set_rng_seed(...).

Feat

  • cli: agent-first community subcommand. New flags:
    • --gamma FLOAT — explicit CPM γ; skips the resolution profile.
    • --resolution {coarse,medium,fine} — pick alternate γ plateaus from the
      same profile (no extra Leiden runs).
    • --neighbors-of <session_id> — early-return path that bypasses Leiden,
      returns top-k cosine neighbors joined to session_communities if present.
    • --top-k N — partner of --neighbors-of (default 15).
    • --dry-run — pure-SQL candidate count + plan JSON.
    • Mutual-exclusion: --neighbors-of with --gamma/--force/--dry-run
      exits 64 with a structured JSON error.
  • sql_views: register community_profile view + thread the new parquet
    path through register_analytics.

Fix

  • cli: use math.isnan for NaN detection in the community quality log
    line (resolves Semgrep useless-eqeq finding flagged via CodeQL).

Tests

  • 18 new tests in tests/test_community_worker_coverage.py covering error
    branches, fallback paths, and the full CLI flag matrix. community_worker.py
    coverage: 86% → 98%. Project coverage rises rather than dips.

Docs

  • CLAUDE.md: Leiden+CPM note replaces the historical Louvain note. Documents
    the warn-only connectivity policy, the community_top_topics macro
    delegation for top terms (no frozen columns), and the leidenalg/igraph
    version pins.
  • README + cookbook + research notes + skill md updated end-to-end.

Compounded lessons (.erpaval/solutions/)

  • best-practices/rebase-before-bump.mdcz bump walks local history only;
    fetch + log against origin/main before any release bump.
  • conventions/uv-version-pin-via-mise.md[tool.uv] required-version
    bumps need PATH adjustment for git hooks if mise activate hasn't reloaded.
  • api-patterns/leidenalg-getattr-shim.md — leidenalg 0.11 + igraph 1.0
    stubs don't expose .quality()/.membership; route through getattr
    with # noqa: B009.

PR: #28