Skip to content

feat(cli): Ralph loop lands branches with a merge, preserving each ticket's commits - #71

Merged
4lgn merged 2 commits into
masterfrom
claude/cool-hawking-js1lrw
Sep 17, 2026
Merged

4lgn merged 2 commits into
masterfrom
claude/cool-hawking-js1lrw

Conversation

@4lgn

@4lgn 4lgn commented Sep 17, 2026

Copy link
Copy Markdown
Member

What & why

The Ralph loop's landing squashed each ticket into a single commit on the shared integration base. This change keeps all of the branch's commits instead.

The loop-owned landing (ADR-0032) used git merge --squash, collapsing every finished ralph/<n>-* branch into one commit. It now lands with git merge --no-ff, so each ticket's own commits — the push-after-every-green-step history — are preserved beneath one labelled merge commit.

What changed

  • The land is a non-fast-forward merge: git merge --no-ff origin/<branch> -m "<title> (#n)" -m "Closes #n" -m "Landed by the Ralph loop…". The merge commit still carries the Conventional Commit title, the (#n) reference, and the Closes #n trailer, so the ticket→commit trail and the auto-close keyword are intact; the branch's commits are reachable beneath it.
  • Everything else about the landing is unchanged — the serialized lander, the fast gate on the merged tree, remote verification, checkpoints, and the baseMoved re-sync (a conflict or a gate-fail hands back as before). --no-ff has the same success/conflict surface the squash did, so throughput doesn't regress.
  • Empty land: a merge that reports "Already up to date" (the branch adds nothing) is reported failed, as the empty squash was.

Trade-off

The integration base is no longer one linear commit per ticket — it carries a merge commit per ticket with the branch's commits beneath, WIP checkpoints included (which is what "keep all the commits" means). git log --first-parent gives the one-line-per-ticket view; reverting a ticket is git revert -m 1 <merge>.

The single-ticket /launch-implement PR flow is untouched — a one-ticket PR squash-merged into the default branch is a separate, conventional choice, not the loop's shared-branch landing.

Files

  • packages/cli/assets/ralph.workflow.js — Land dispatch, schema descriptions, comments (+ mirrored example)
  • launch-ralph / launch-ralph-implement skills — landing section, policy lines, hand-off note (+ mirrored examples)
  • packages/cli/src/lib/seeds.ts — seeded loop summary (+ generated example)
  • docs/adr/2026-09-17-ralph-land-preserves-commits.md — new ADR (amends ADR-0032 and ADR-0022); registry index regenerated
  • packages/cli/tests/add-ralph.test.ts — asserts git merge --no-ff, no --squash

Validation

pnpm build clean · pnpm test — 256 passed · launchrail adr index regenerated and idempotent.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WCjoCBSGLqPnNRQdkh2Qr5


Generated by Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…cket's commits

The loop-owned landing used `git merge --squash`, collapsing every ticket
into one commit on the integration base. Land with `git merge --no-ff`
instead, so the branch's own commits (the push-after-every-green-step
history) are preserved beneath one labelled merge commit that still carries
the Conventional Commit title, `(#n)`, and the `Closes #n` trailer.

Everything else about the landing is unchanged: the serialized lander, the
fast gate on the merged tree, remote verification, checkpoints, and the
base-moved re-sync (a conflict or a gate-fail hands back as before). An
"Already up to date" merge is the empty-land case, still reported `failed`.

The parallel copies move together: the ralph workflow's Land dispatch, the
launch-ralph landing section and policy lines, the launch-ralph-implement
hand-off note, and the seeded loop summary. Adds
2026-09-17-ralph-land-preserves-commits.md (amends ADR-0032 and ADR-0022)
and regenerates the ADR registry index.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCjoCBSGLqPnNRQdkh2Qr5
Resolve the docs/adr/README.md conflict by regenerating the registry index
with `launchrail adr index`, so both new dated ADRs are listed: master's
design-fidelity-build and this branch's ralph-land-preserves-commits. The
launch-ralph-implement skill auto-merged cleanly — master's design-fidelity
additions to items 1 and 5, this branch's merge-not-squash change to item 7.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCjoCBSGLqPnNRQdkh2Qr5
@4lgn
4lgn merged commit de3ea95 into master Sep 17, 2026
2 checks passed
@4lgn
4lgn deleted the claude/cool-hawking-js1lrw branch September 17, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants