Skip to content

chore(.dev): add Phase 3 batch step to consolidate ready-to-merge waves#59

Merged
jrphilo merged 1 commit into
mainfrom
chore/loop-phase-3-batch
May 13, 2026
Merged

chore(.dev): add Phase 3 batch step to consolidate ready-to-merge waves#59
jrphilo merged 1 commit into
mainfrom
chore/loop-phase-3-batch

Conversation

@jrphilo
Copy link
Copy Markdown
Collaborator

@jrphilo jrphilo commented May 13, 2026

Summary

Adds a third phase to the dependency loop: after Phase 2 drains, if ≥2 PRs are ralphie:ready-to-merge and share at least one touched file path (in practice always pnpm-lock.yaml), open a single batch PR combining their package.json edits, regenerate the lockfile once, and verify the combined diff. Constituents are closed with ralphie:replaced-by-newer-pr and a comment pointing at the batch.

Avoids the rebase cascade that played out today: 7 ready PRs, merge the first, the other 6 go stale, manually rebase each. Phase 3 turns that into one merge.

New files / flags

  • .dev/PROMPT_dependency_batch.md — the Phase 3 session prompt (consistent shape with Phase 1+2 prompts).
  • .dev/dependency.sh — Phase 3 invocation after Phase 2, plus --batch-only (skip 1+2) and --no-batch (skip 3).
  • .dev/dependency-rules.md — new Phase 3 section: eligibility gates, batchable edit shapes, same-package version conflict rule (take the higher), verification recipe, outcomes table, PR body shape, comment shapes.

Eligibility gates

Phase 3 only proceeds when all hold:

  • ≥2 PRs carry ralphie:ready-to-merge (excluding chore/batch-* head refs — no infinite recursion).
  • At least one pair shares a touched file path. (Disjoint sets — e.g., one npm bump + one github-actions bump — can merge in any order without conflicting, so batching adds no value.)

Failure mode

If the combined verify fails (interaction effects between bumps), Phase 3 discards the batch branch and leaves all constituents individually mergeable with a comment explaining what broke. The maintainer drains serially.

Test plan

  • bash -n .dev/dependency.sh (syntax)
  • .dev/dependency.sh --help prints the new flags
  • After merge: ensure ≥2 PRs are ralphie:ready-to-merge (likely after the next Phase 2 pass), then ./.dev/dependency.sh --batch-only to exercise just Phase 3. Expect one batch PR with auto-merge enabled and the constituents closed.

🤖 Generated with Claude Code

Adds PROMPT_dependency_batch.md and a Phase 3 invocation to
dependency.sh. After Phase 2 drains, if ≥2 PRs are
ralphie:ready-to-merge AND share at least one touched file path
(in practice always pnpm-lock.yaml), Phase 3 opens a single batch
PR off fresh origin/main that combines their package.json edits,
regenerates the lockfile once, verifies the combined diff
(lint/build/check:links), and closes the constituents with
ralphie:replaced-by-newer-pr.

Motivates: today's wave required manually batching #52 and #53
after merge-cascade conflicts. Same pattern will repeat weekly
per the Dependabot schedule; this automates it.

New flags:
- --batch-only: skip Phase 1+2, batch the current ready set.
- --no-batch:   skip Phase 3 entirely.

dependency-rules.md gains a Phase 3 section: eligibility gates
(≥2 ready, ≥1 file overlap), batchable edit shapes
(pnpm.overrides, dependencies versions, same-package version
conflicts take the higher), verification recipe, outcomes table,
batch PR body shape, and constituent comment shapes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 13, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
docs-preview 97b42c6 Commit Preview URL

Branch Preview URL
May 13 2026, 03:36 PM

@jrphilo jrphilo enabled auto-merge (squash) May 13, 2026 15:34
@jrphilo jrphilo merged commit 503caf4 into main May 13, 2026
7 of 8 checks passed
@jrphilo jrphilo deleted the chore/loop-phase-3-batch branch May 13, 2026 15:36
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.

1 participant