Repository navigation
Conversation
…anch
Adds an opt-in `--stacked` flag to `sequant run` that implies `--chain` and
changes only one thing: non-first PRs target their predecessor branch via
`gh pr create --base <prev-branch>` instead of `main`. The final PR still
targets `main` so partial progress can land. Each PR body includes a stack
manifest line so reviewers see the chain at a glance.
The plumbing path is `RunOptions.stacked` → `IssueExecutionContext.chain.
{predecessorBranch, stackManifest}` → `createPR` → `GitHubProvider.
createPRCliSync(... base?)`. The orchestrator computes the predecessor
branch from `worktreeMap.get(issueNumbers[i-1])?.branch` only for non-first,
non-last positions; existing rebase logic (`!chainMode || isLastInChain`)
is unchanged.
Includes a `/merger` skill section warning about out-of-order stack merges
(GitHub auto-updates dependent PR bases when predecessors merge, so order
matters) and updates `docs/reference/run-command.md` with the standard
chain-mode reliability caveat (~29% whole-chain success rate).
Tests:
- buildStackManifest pure-fn tests (first/middle/last/degenerate cases)
- Orchestrator chain-context plumbing for --stacked vs plain --chain
- createPR `--base` passing + manifest embedding + non-stacked omission
6 tasks
…veats, skill mirrors - bin/cli.ts: --stacked help text now reflects that the last PR also targets main (previously implied all non-first PRs targeted predecessor) - src/lib/workflow/platforms/github.ts: async createPR(opts) now forwards opts.base to gh pr create (pre-existing latent gap; CreatePROptions.base is a required field but was silently dropped) - docs/reference/run-command.md: add Caveats subsection covering 2-issue stack manifest-only behavior and final-PR cumulative diff - src/lib/workflow/run-orchestrator.ts: document the worktreeMap.get() invariant so a future refactor of the chain-break path can't silently violate AC-2 - skills/merger, templates/skills/merger: mirror the merger skill (including the new Stacked PR Detection subsection) so it deploys via sequant init
…stacked-flag-set-chain-mode-pr-base-to-pr # Conflicts: # CHANGELOG.md
admarble
added a commit
that referenced
this pull request
May 14, 2026
…rs (#630) Entire-Checkpoint: 829856a3824f
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
Adds opt-in
--stackedflag tosequant runthat implies--chainand changes only one thing: non-first PRs target their predecessor branch instead ofmain. The final PR still targetsmainso partial progress can land. Each PR body gets a stack manifest line:Status note (PARK context)
This issue was PARKED 3× by
/assesspending chain-mode reliability improvement. The user explicitly re-invoked/exec 605; this PR implements the feature as specified.--stackedis opt-in and inherits chain-mode's ~29% whole-chain success rate (#604); docs flag this explicitly.AC Coverage
--stackedflag, implies--chain, error with--no-chainbin/cli.ts:223,src/commands/run.ts:51createPRuses predecessor branch for non-first issuessrc/lib/workflow/batch-executor.ts:995,worktree-manager.ts:1397mainrun-orchestrator.ts:executeSequentiali > 0guardworktree-manager.tsbodyLines +buildStackManifestdocs/reference/run-command.md"Stacked PRs" sectionmergerskill warns on out-of-order stacked merges.claude/skills/merger/SKILL.md"Stacked PR Detection"Open question resolution: Final-PR base defaults to
main(the spec's preferred option — easier to land partial progress).Plumbing Path
RunOptions.stacked→IssueExecutionContext.chain.{predecessorBranch, stackManifest}→createPR→GitHubProvider.createPRCliSync(... base?). Predecessor branch is computed only for non-first, non-last positions. Existing chain rebase logic (!chainMode || isLastInChain) is unchanged, so intermediate branches stay based on their predecessor.Test plan
npm run build— cleannpm run lint— cleannpx vitest run src/lib/workflow/ src/commands/ __tests__/— 1,696 tests passnpx tsx bin/cli.ts run --helpshows--stackedentrysequant run A B C --stacked --dry-runon a real 2-issue chain (deferred — requires real worktree setup)Files changed (13)
bin/cli.ts— register--stackedsrc/commands/run.ts— validate--stacked+--no-chainconflict; auto-enable--chainsrc/lib/workflow/types.ts— addRunOptions.stacked; extendIssueExecutionContext.chainsrc/lib/workflow/run-orchestrator.ts—buildStackManifest; predecessor wiring inexecuteSequentialsrc/lib/workflow/batch-executor.ts— passstackOptionstocreatePRsrc/lib/workflow/worktree-manager.ts—createPRacceptsstackOptions; embeds manifest in bodysrc/lib/workflow/platforms/github.ts—createPRCliSync(... base?)docs/reference/run-command.md— "Stacked PRs" section + flag-table entry.claude/skills/merger/SKILL.md— "Stacked PR Detection" + out-of-order warning templateCHANGELOG.md—[Unreleased]entryCloses #605
🤖 Generated with Claude Code