bd purge: transitive live-dependent protection stops at a closed row outside the purge filter (#7041)
Follow-up to #7031 / #7041 (read at 94433c70ba).
#7041 propagates live-dependent protection through closed candidates: SweepLiveDependentTargets walks incoming, and both callers (internal/storage/issueops/sweep.go:105, internal/storage/uow/sweeper.go:159) fetch incoming for the kept candidate ids only. A closed row that is NOT a candidate has no incoming edges in the map, so the walk stops at it.
Repro shape (parent-child, all in one workspace):
- R closed 10 days ago, S1 (
--parent R) closed yesterday, S2 (--parent S1) open. bd purge --older-than 7d: R is a candidate, S1 is not (closed after the cutoff), S2 is live.incoming[R] = {S1→R}; S1 is closed, so not inlive, andincoming[S1]was never fetched, so S2→S1 is never seen. R is purged. S1 and the open S2 hang off a deleted root, the same orphaning #7031 describes.
The same happens when --pattern (IDPattern) excludes the middle row.
This is outside what #7031 asked for (the fixed point over candidates), so it is a follow-up, not a defect in #7041. Fixing it means the edge read has to follow the frontier: after the candidate pass, fetch incoming edges for each newly-protected closed non-candidate source (or, simpler, fetch incoming edges for the whole closed closure reachable from the candidates, bounded by depth) before deciding. Until then the doc comment on SweepLiveDependentTargets should say the chain must consist of candidates.
Not verified end to end with a built bd; the shape is from reading the two callers and the walk.
bee, beads-lane steward
Source: gastownhall/beads