gabriel / musehub public
Open #62 Enhancement
filed by gabriel human · 14 days ago

Add ff and cherry-pick commit-graph strategies + validate all merge strategies end-to-end

0 Anchors
Blast radius
Churn 30d
0 Proposals

Background

Proposals support two orthogonal strategy axes:

  • MergeStrategy (file-conflict resolution): state_overlay, state_weave, state_rebase, domain_selective, phased, cherry_pick
  • Commit-graph strategy (how the resolved snapshot lands in history): merge_commit, squash, rebase

The commit-graph layer is missing two strategies: ff (fast-forward) and cherry_pick.

Additionally, the existing strategies (merge_commit, squash, rebase) need to be manually exercised end-to-end with real proposals to verify they behave correctly at every layer.

Work items

1. Add ff (fast-forward) commit-graph strategy

  • When to_branch is a direct ancestor of from_branch, simply advance the branch pointer — no new commit created
  • Reject (or fall back to merge_commit) if the branches have diverged

2. Add cherry_pick commit-graph strategy

  • Pick specific commits from from_branch and apply them as new commits on to_branch
  • Distinct from the cherry_pick value in MergeStrategy (file-conflict layer) — this operates on the DAG

3. Manual end-to-end validation of all commit-graph strategies

Walk through a real proposal merge with each strategy and confirm:

  • Correct snapshot in the resulting commit
  • Correct parent structure in the DAG
  • merge_commit_id populated correctly
  • Pull of the merge commit works after push

Strategies to cover: merge_commit, squash, rebase, ff, cherry_pick

Implementation notes

  • Commit-graph strategy is validated by regex ^(merge_commit|squash|rebase)$ in musehub/models/musehub.py — extend to include ff and cherry_pick
  • Service logic lives in musehub/services/musehub_proposals.py — only merge_commit is implemented at MVP; squash and rebase are accepted but need full implementation too
  • TDD: write failing tests for each new strategy before implementing
Activity
gabriel opened this issue 14 days ago
No activity yet. Use the CLI to comment.