Repository navigation
feat(batch): per-stage agent routing and stacked PR grouping - #94
Closed
joctaTorres wants to merge 1 commit into
Closed
joctaTorres wants to merge 1 commit into
joctaTorres wants to merge 1 commit into
Conversation
Let a batch drive different coding agents per lifecycle stage and open
pull requests in configurable groupings, across three phases:
- per-stage-agent-routing: the `agent` setting accepts a scalar or a
partial `{propose, apply, verify}` stage-map at project-config and
manifest scope; resolution merges nearest-wins per stage (mapped ->
scalar -> default) and the engine resolves the adapter per transition.
Invalid stage keys, non-string values, and unknown agent names are
rejected before any spawn.
- whole-batch-pr-opening: `prGrouping: whole-batch` spawns a dedicated
instruction-following PR agent at batch completion that commits the
accumulated work (repo git-log style, semantic by default) and opens
one PR via the self-contained pr-open workflow. Adds `pr` as a fourth
routable stage. No forge-specific code in ratchet; idempotent on rerun
via per-group run-state; failures surface as reported step failures;
doctor warns when grouping is active but no git remote is configured.
- stacked-pr-grouping-modes: `per-phase` / `per-change` open one stacked
PR per unit (group 0 -> batch base, group N -> group N-1's branch).
The engine spawns one PR agent per detected boundary with the resolved
stacked base injected as instruction data, keyed per group so a resumed
loop never double-opens; `batch apply` surfaces and routes the
per-boundary PR steps.
Docs (README + docs/) document the settings, the stacked-base rule, and
carry vertical Mermaid overviews. Full suite green; line coverage 95.51%.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ratchet | 503ca6b | Commit Preview URL Branch Preview URL |
Jul 05 2026, 04:00 PM |
Owner
Author
|
closed in favor of #95 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Delivers the per-stage-agents-and-prs batch — three vertical-slice phases that let a batch drive different coding agents per lifecycle stage and open pull requests in configurable groupings.
Phase 1 — per-stage agent routing
The
agentsetting accepts a scalar or a partial{propose, apply, verify}stage-map at both project-config and manifest scope. Resolution merges nearest-wins per stage (mapped → scalar → default) and the engine resolves the adapter per transition. Invalid stage keys, non-string values, and unknown agent names are rejected before any spawn.Phase 2 — whole-batch PR opening
prGrouping: whole-batchspawns a dedicated instruction-following PR agent at batch completion that commits accumulated work (repo git-log style, semantic by default) and opens one PR via the self-containedpr-openworkflow. Addspras a fourth routable stage. No forge-specific code in ratchet; idempotent on rerun via per-group run-state; failures surface as reported step failures;doctorwarns when grouping is active but no git remote is configured.Phase 3 — stacked PR grouping modes
per-phase/per-changeopen one stacked PR per unit (group 0 → batch base, group N → group N-1's branch). The engine spawns one PR agent per detected boundary with the resolved stacked base injected as instruction data, keyed per group so a resumed loop never double-opens;batch applysurfaces and routes the per-boundary PR steps.Config
Also settable via
ratchet batch config --set <key=value>(scalars) and inspectable withratchet batch config <name> --json.Verification
test/cli-e2e/batch-pr-grouping-modes.test.ts→ exit 0 (4/4); phase hard-gate proof-of-work passedDocs (README +
docs/) document the settings, the stacked-base rule, and carry vertical Mermaid overviews.🤖 Generated with Claude Code