feat(mwp-1): Phase 3 — repair_corrupt_commit_generations for pre-existing RC-1 artefacts
Adds repair_corrupt_commit_generations(session) -> dict: - Queries musehub_commit_graph WHERE generation=0 AND cardinality(parent_ids)>0 to find all rows corrupted by the old RC-1 bug (both call sites pre-Phase-2). - Fetches external parent gens from the graph as walk anchors. - Falls back to _resolve_generation_with_backfill for any external parent not found in the graph at all. - Topologically sorts (Kahn's) the corrupt set and recomputes bottom-up. - Bulk-upserts corrected rows (only updates generation column). - Idempotent: second call finds zero corrupt rows and returns immediately. - Returns {total_corrupt, repaired}.
Test results — all 10 GREEN: MWP1_10 GREEN: 4-commit scenario (C1=root, C2/C3/C4 corrupt) repair produces C1=0, C2=1, C3=2, C4=3 MWP1_11 GREEN: first call fixes C2,C3 → second call is a no-op (0 corrupt)
musehub#106 muse#58
Semantic Changes
7 symbols
0 comments
muse hub commit comment sha256:667089b438359d91efd6337e44c0bcb653deaf6ad3937861c5d2707457ff0aae --body "your comment"
No comments yet. Be the first to start the discussion.