fix(merge): proper 3-way merge for dependencies - removals win (bd-ndye)

CRITICAL: Fixed dependency resurrection bug that caused removed/orphaned
dependencies to keep coming back after sync.

Root cause: mergeDependencies() was doing a union (additive only) and
completely ignored the base parameter. This meant any dependency present
in either left or right would be included, even if it was intentionally
removed.

Fix: Proper 3-way merge where REMOVALS ARE AUTHORITATIVE:
- If dep was in base and removed by left OR right → stays removed
- If dep wasn't in base and added by left OR right → included
- If dep was in base and both still have it → included

This fixes months of issues with orphaned parent-child relationships
being resurrected during git sync operations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-18 23:20:49 -08:00
parent 45bb38770a
commit 5ad1c80f7e
4 changed files with 130 additions and 32 deletions

View File

@@ -9,13 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.30.6] - 2025-12-18
## [0.30.6] - 2025-12-18
### Added
- **`bd graph` dependency counts** (bd-6v2) - Graph command shows dependency counts using subgraph formatting
- **`types.StatusPinned`** - New status for persistent beads that survive cleanup
### Fixed
- **CRITICAL: Dependency resurrection bug** (bd-ndye) - Fixed 3-way merge to respect dependency removals
- `mergeDependencies` was using union (additive-only) instead of proper 3-way merge
- Now removals are authoritative: if either left or right removes a dep, it stays removed
- This prevented orphaned parent-child relationships from being permanently removed
## [0.30.5] - 2025-12-18
### Removed