feat(mwp-1): Phase 2 — authoritative generation backfill via _resolve_generation_with_backfill
Adds _resolve_generation_with_backfill(session, pids, *, inline_gen, db_gen): - Walks musehub_commits.parent_ids toward roots for any pid whose generation is not in inline_gen or db_gen. - Stops at the first commit already in musehub_commit_graph (bounded walk). - Computes generations bottom-up in topological order (Kahn's algorithm). - Upserts all newly computed rows into musehub_commit_graph. - Raises ValueError([MWP1] integrity error) if any pid is absent from musehub_commits (fast-forward push invariant violated). - Returns max(gen for pid in pids); caller adds +1.
Both call sites now await this function instead of silently writing 0: - wire_push_unpack_mpack step 9b (line ~935) - _build_commit_graph_from_raw (line ~1340)
Test results — all 8 GREEN: MWP1_01 GREEN (was RED: _build_commit_graph_from_raw backfills correctly) MWP1_02 GREEN (root guard untouched) MWP1_03 GREEN (was RED: push-path backfills C3 then sets C4=3) MWP1_04 GREEN (seam: backfill warning still fires, root case clean) MWP1_05 GREEN (seam: push-path backfill warning fires) MWP1_07 GREEN (chain C1..C5 all get correct generations after one push) MWP1_08 GREEN (absent parent raises ValueError with [MWP1] integrity error) MWP1_09 GREEN (1000-commit chain backfills to C999=999, stops at C0 anchor)
musehub#106 muse#58
Semantic Changes
10 symbols
0 comments
muse hub commit comment sha256:e7097592983d62d4acf97d03e05f44d6f96541aecd65b141fe7f525d0cb088cc --body "your comment"
No comments yet. Be the first to start the discussion.