Skip to content

fix: preserve removed cluster members#657

Open
ApexWorm wants to merge 4 commits into
peteromallet:mainfrom
ApexWorm:fix/cluster-membership-resurrection
Open

fix: preserve removed cluster members#657
ApexWorm wants to merge 4 commits into
peteromallet:mainfrom
ApexWorm:fix/cluster-membership-resurrection

Conversation

@ApexWorm

Copy link
Copy Markdown

Problem: Cluster removal and resolve can remove a member in memory, then normalize it back from historical cluster_add events before the new removal is durably represented. This leaves resolved members in active clusters and can restore stale focus.

Fix: Keep focus cleanup pure so it cannot normalize a just-mutated membership. When purge_ids removes cluster members, append system cluster_remove journal entries before persistence so later normalization retains the removal.

Verification: python3 -m pytest -q desloppify/tests/plan/test_skip.py desloppify/tests/plan/test_schema_migrations.py desloppify/tests/plan/test_auto_cluster.py desloppify/tests/commands/plan/test_cluster_ops_direct.py desloppify/tests/commands/plan/test_cluster_ux.py; python3 -m ruff check desloppify/engine/_plan/operations/lifecycle.py desloppify/tests/plan/test_skip.py

@ApexWorm
ApexWorm force-pushed the fix/cluster-membership-resurrection branch from b55f1e0 to 8253380 Compare July 18, 2026 18:34
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