v0.5.0 — Leiden+CPM
BREAKING CHANGE
- Settings field rename — every
louvain_*config knob and
CLAUDE_SQL_LOUVAIN_*env var is gone. Replace withleiden_*equivalents.
Parquet schema gainsis_medoid,coherence,gamma_usedcolumns; removes
nothing. Newcommunity_profile.parquetsidecar appears at
~/.claude/community_profile.parqueton 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-γ viaOptimiser.resolution_profile- longest-plateau picker. Determinism preserved via
settings.seedflowing
into bothfind_partition(seed=...)andOptimiser.set_rng_seed(...).
- longest-plateau picker. Determinism preserved via
Feat
- cli: agent-first
communitysubcommand. 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 tosession_communitiesif present.--top-k N— partner of--neighbors-of(default 15).--dry-run— pure-SQL candidate count + plan JSON.- Mutual-exclusion:
--neighbors-ofwith--gamma/--force/--dry-run
exits 64 with a structured JSON error.
- sql_views: register
community_profileview + thread the new parquet
path throughregister_analytics.
Fix
- cli: use
math.isnanfor NaN detection in the community quality log
line (resolves Semgrepuseless-eqeqfinding flagged via CodeQL).
Tests
- 18 new tests in
tests/test_community_worker_coverage.pycovering 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, thecommunity_top_topicsmacro
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.md—cz bumpwalks 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 throughgetattr
with# noqa: B009.
PR: #28