Skip to content

feat(cli): --stacked flag — set chain-mode PR base to predecessor branch #605

Closed

Description

@admarble

Problem

--chain already builds a stack of branches: each issue's worktree branches from the previous issue's branch, and only the final branch rebases onto main (src/lib/workflow/batch-executor.ts:1000-1017).

But every PR --chain creates still targets main. Reviewers see each PR's diff layered on top of whatever main looks like, not the incremental change vs. its predecessor. For a 3-issue chain that touches the same area, this means:

  • PR docs: Add pre-release checklist #2 shows diff = (issue 1's changes) + (issue 2's changes) — reviewer can't isolate issue 2.
  • The first reviewable diff is effectively the whole feature.

This is the missing 20% of stacked-PR review surface that --chain already enables structurally.

Approach

Add --stacked (implies --chain). Only behavior change: PR creation uses the predecessor branch as base instead of main, except for the final issue (which still targets main).

sequant run 100 101 102 --stacked
  → PR for #100 → base: main
  → PR for #101 → base: feature/100-...
  → PR for #102 → base: feature/101-...   (final stays main? — see open question)

GitHub auto-updates a PR's base when the previous base merges, so landing in order works without manual intervention.

Acceptance Criteria

  • AC-1: Add --stacked flag in bin/cli.ts that implies --chain (error if both --stacked and --no-chain are given).
  • AC-2: When --stacked is set, createPR (in batch-executor.ts) uses the predecessor branch as the PR base for non-first issues.
  • AC-3: First issue in the stack still targets main.
  • AC-4: PR body includes a stack manifest (Part of stack: #N1 → #N2 → #N3 (this)) so reviewers see the chain.
  • AC-5: Documented in the chain-mode docs (docs/features/run-orchestrator.md or wherever --chain is described).
  • AC-6: merger skill is aware that --stacked PRs must merge in order; document or warn if invoked out of order.

Open Questions

  1. Final-PR base: should the last PR target main (current proposal) or its predecessor (more "pure" stack, but means landing the whole stack atomically)? Default to main — easier to land partial progress.
  2. Force-push interaction: intermediate branches in --chain already stay based on predecessor (no rebase cascade today), so the existing force-push hook policy (feedback_merge_not_rebase.md) is preserved. Confirm this still holds when an intermediate PR has review feedback that requires fixup.

Non-Goals

  • Native gh-stack integration. GitHub shipped private preview April 2026; if/when GA lands with first-party stack support we can revisit. This issue is the cheap interim that requires only a flag and a base argument.
  • Cascade rebase / amend tooling à la Graphite. Out of scope and incompatible with the force-push hook.
  • Auto-detect stacking from chain mode. Opt-in only — keeps existing --chain behavior unchanged.

Risks

  • Could be obsoleted by gh-stack GA. Mitigation: implementation is small (~base-arg change + manifest text) and the UX (--stacked) is cheap to keep as a wrapper later.
  • merger skill currently assumes squash-merge into main. Squash-merging an intermediate PR creates a new commit on main; GitHub then re-bases the dependent PR's diff against the new tip. Verify this works in dry-run before relying on it.

References

Activity

  1. added
    enhancement
    cli
    multi-agent
    on May 8, 2026
  2. admarble commented on May 9, 2026

    @admarble
    ContributorAuthor

    → PARK — Body's References section explicitly conditions filing/work on #604 outcome: "file this only after #604 says --chain is worth investing in." If chain-mode is structurally low-success, building stacked PRs on top of it would compound the risk.

    Resume after: #604 reports its keep/deprecate/restrict recommendation (its AC-5/AC-6).

  3. admarble commented on May 10, 2026

    @admarble
    ContributorAuthor

    Supersedes prior assess from 2026-05-09 (PARK)

    → PARK — Body's References section explicitly conditions filing/work on #604 outcome: "file this only after #604 says --chain is worth investing in." If chain-mode is structurally low-success, building stacked PRs on top of it would compound the risk.

    Resume after: #604 reports its keep/deprecate/restrict recommendation (its AC-5/AC-6).

  4. admarble commented on May 11, 2026

    @admarble
    ContributorAuthor

    Supersedes 2 prior assessments (most recent: 2026-05-10)

    → PARK — #604 has now merged (df6277c) documenting a 29% chain-mode success rate. The PARK condition was "file this only after #604 says `--chain` is worth investing in" — the forensics document failures rather than endorse investment. #625 was filed to fix one of #604's failure modes (concurrent-session lock); stacked-PRs on top of chain-mode would compound risk until at least #625 lands.

    Resume after: chain-mode success rate improves to a workable level (post-#625), or a clear keep/deprecate verdict is recorded on #604.

  5. admarble commented on May 11, 2026

    @admarble
    ContributorAuthor

    /exec progress update

    Implementation: COMPLETE → PR #630

    Status note: This issue was PARKED 3× by /assess pending chain-mode reliability improvement (#604 reported 29% whole-chain success). The user explicitly invoked /exec 605, so this implements the feature as specified. --stacked is opt-in and inherits chain-mode's reliability profile; docs explicitly flag the caveat with a link to chain-mode-analysis-2026-05.md.

    Pre-PR AC Verification

    AC Status Evidence
    AC-1: --stacked flag in bin/cli.ts, implies --chain, errors on --no-chain ✅ bin/cli.ts (.option("--stacked", …)) + src/commands/run.ts validation
    AC-2: createPR uses predecessor branch for non-first issues ✅ batch-executor.ts:991 passes stackOptions.prBase → worktree-manager.ts → createPRCliSync(... base)
    AC-3: First issue in stack still targets main ✅ executeSequential only sets predecessorBranch when i > 0 && i < lastIndex
    AC-4: PR body includes Part of stack: … manifest ✅ buildStackManifest + body construction in createPR
    AC-5: Documented in chain-mode docs ✅ docs/reference/run-command.md — new "Stacked PRs" section
    AC-6: merger skill aware of stack merge order ✅ .claude/skills/merger/SKILL.md — new "Stacked PR Detection" subsection with warning template

    Open-question resolution: Final-PR base = main (spec's preferred option — easier to land partial progress).

    Quality Plan Alignment

    N/A — no /spec quality plan in issue comments.

    Test/Build/Lint Results

    Check Status Notes
    npm run build ✅ 0 errors
    npm run lint ✅ 0 warnings (max-warnings 0)
    npx vitest run __tests__/ ✅ 732/732 pass
    npx vitest run src/lib/workflow/ ✅ 821/821 pass
    npx vitest run src/commands/run.test.ts ✅ 143/143 pass (incl. 4 new stacked-mode createPR tests)
    bin/cli.ts run --help ✅ --stacked flag visible

    New tests added:

    • __tests__/run-orchestrator-resolve.test.ts — 5 buildStackManifest cases (first / middle / last / single-issue / two-issue)
    • __tests__/run-orchestrator.test.ts — 2 chain-context plumbing cases (--stacked sets predecessor + manifest only for middle issues; plain --chain leaves them undefined)
    • src/commands/run.test.ts — 4 createPR stacked-mode cases (--base passed, omitted on final, manifest embedded, manifest absent without options)

    CLI Wiring Self-Check

    New field CLI flag Help text Wiring status
    stacked --stacked "Stack PRs: non-first PRs target predecessor branch instead of main (implies --chain)" ✅ Complete

    Pre-PR Confidence Check

    • Weakest part: Live end-to-end run with a real 2-issue chain wasn't performed (the PARK context + worktree setup overhead made it impractical). Unit + integration tests cover the plumbing through to the gh pr create arg list, but the actual gh call hitting the GitHub API is mocked.
    • Coverage gaps: None new — every file touched has corresponding tests. The existing chain-mode rebase logic at batch-executor.ts:972 (!chainMode || isLastInChain) is reused unchanged for stacked mode, so it inherits its existing test coverage.

    PR Status

    Next Steps

    1. /qa 605 to review the implementation.
    2. Live verification on a real 2-issue chain (out of scope for /exec; recommend during merger phase).
    3. If the chain-mode reliability profile changes per the PARK rationale, this feature lands without further work.
  6. admarble commented on May 12, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #605

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original --stacked flag in bin/cli.ts, implies --chain, errors on --no-chain combo MET Flag registered at bin/cli.ts:220-227; validation at src/commands/run.ts:52-58 rejects --stacked --no-chain and forces chain=true before downstream constraint checks. Verified npx sequant run --help shows the flag.
    AC-2 Original createPR uses predecessor branch as base for non-first issues MET Implementation uses predecessor for middle issues only (not last). The literal AC text says "non-first issues," but the issue body's Open Question #1 explicitly resolves to "last PR targets main" (spec's preferred option for partial landings). Implementation matches the resolved spec intent. run-orchestrator.ts:814-832 + batch-executor.ts:994-1009 + worktree-manager.ts:1402-1409 + platforms/github.ts:227-251.
    AC-3 Original First issue still targets main MET run-orchestrator.ts:820-822 — predecessorBranch only set when i > 0 && i < lastIndex. First issue's --base is omitted; gh pr create defaults to repo default branch (main).
    AC-4 Original PR body includes Part of stack: #N1 → #N2 (this) manifest MET buildStackManifest() at run-orchestrator.ts:64-72. Manifest emitted before the trailer (worktree-manager.ts:1394-1399). Renders for every PR in the stack (first, middle, last). 5 unit cases cover edge shapes (first/middle/last/single/two).
    AC-5 Original Documented in chain-mode docs MET docs/reference/run-command.md:54 (flag table) and new "Stacked PRs" section at line 242-291 with example, requirements, performance caveat (~29% chain success), and merge-order callout.
    AC-6 Original merger skill aware of --stacked merge order MET .claude/skills/merger/SKILL.md:479-510 — new "Stacked PR Detection" subsection with detection command, ordering enforcement, and warning template. Note: Merger skill is missing from templates/skills/ and skills/ mirrors (pre-existing — verified absent on origin/main), so it does not deploy via sequant init. Not a regression from this PR, but worth a follow-up.

    Coverage: 6/6 ACs met (AC-2 with note about open-question resolution)


    Precheck Findings

    Section Status Surfaced
    Fixtures pass 1 motivating-example fixture (lines 14-20 of issue body); behavior matches expected manifest format and the open-question default.
    Sibling-grep pass 1 new export (buildStackManifest); no sibling sites in src/, scripts/, bin/.
    AC literal-diff pass All 6 ACs (AC-1…AC-6) present in PR body.

    Source: .sequant/gap-precheck.json (schemaVersion 1)


    CI Status

    Check State Conclusion Impact
    build (20.x) IN_PROGRESS - ⏳ PENDING
    build (22.x) IN_PROGRESS - ⏳ PENDING
    validate-skills COMPLETED SUCCESS ✅ MET
    typecheck COMPLETED SUCCESS ✅ MET
    validate-plugin COMPLETED SUCCESS ✅ MET

    CI Summary: 3 passed, 2 pending, 0 failed.
    Diff is not markdown-only (8 .ts/.tsx files changed) — build-matrix relaxation does NOT apply. Build checks remain gating until they complete.


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 ✅ OK
    Deleted tests 0 ✅ OK
    Files changed 13 ✅ OK
    Lines added +483 -
    Lines deleted -12 -

    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    bin/cli.ts Standard ✅ Yes (run --help smoke check executed)
    src/commands/run.ts Standard ⚠️ No new unit test for the --stacked --no-chain reject branch Logic is 3 lines, mirrored from existing validation pattern
    src/lib/workflow/types.ts Optional ✅ N/A (types only) -
    src/lib/workflow/batch-executor.ts Standard ✅ Indirect Covered by run.test.ts stacked-mode createPR tests (4 cases)
    src/lib/workflow/platforms/github.ts Standard ✅ Indirect Same — args inspection via mocked spawnSync
    src/lib/workflow/worktree-manager.ts Standard ✅ Yes src/commands/run.test.ts:2192-2316 (4 new cases)
    src/lib/workflow/run-orchestrator.ts Standard ✅ Yes __tests__/run-orchestrator.test.ts:309-422 (2 chain-context cases) + __tests__/run-orchestrator-resolve.test.ts (5 manifest cases)
    .claude/skills/merger/SKILL.md Optional N/A Documentation
    docs/reference/run-command.md Optional N/A Documentation
    CHANGELOG.md Optional N/A Documentation

    Coverage: 11 new test cases (5 manifest + 2 orchestrator plumbing + 4 createPR). Targeted vitest run: 181/181 passed.

    Gap: No unit test for runCommand's --stacked --no-chain rejection branch (src/commands/run.ts:52-55). The branch is 3 lines and mirrors the existing qa-gate requires --chain validation pattern, so the gap is low-risk.


    Code Review

    Strengths:

    • Clean plumbing: RunOptions.stacked → IssueExecutionContext.chain.{predecessorBranch, stackManifest} → createPR(... stackOptions) → createPRCliSync(... base?). Each layer documents its (#605) provenance.
    • --base is conditionally appended to the gh pr create args array (platforms/github.ts:240-242) rather than passed as undefined/empty — correct ergonomics for gh.
    • Manifest emitted before the trailer in the PR body (worktree-manager.ts:1393-1402), so it's visible at the top of the body instead of being buried after the bot signature.
    • Validation occurs before any constraint check that might short-circuit on --chain semantics (run.ts:50-58), correctly handling --stacked --batch (rejects via the existing chain + batch check after chain=true is set) and --stacked --qa-gate (passes since chain=true).
    • Existing chain-mode rebase logic at batch-executor.ts:972-976 (!chainMode || isLastInChain) is unchanged — intermediate branches still don't rebase onto main, preserving stack structure for middle PRs.
    • buildStackManifest is @internal exported, well-tested with degenerate cases (single-issue, two-issue).
    • TypeScript strictness preserved (zero any / as any introductions).

    Issues:

    • Two-issue stack is effectively a no-op for PR base. For run 100 101 --stacked: feat(#99): Add adversarial self-questioning to workflow phases #100 is first (base=main), test(#86): Add CLI integration test for version output #101 is both non-first AND last → falls into the else if (i > 0) branch with intentionally-undefined predecessor → both PRs base on main. Only the manifest changes. The docs table at run-command.md:255-259 only shows a 3-issue example, so users running a 2-issue stack may be surprised. Worth a one-line caveat in the docs.
    • GitHubProvider.createPR(opts) (line 611-612) silently drops opts.base — pre-existing latent gap; the async method calls this.createPRCliSync(opts.title, opts.body, opts.head) without forwarding opts.base even though CreatePROptions.base is a required field. The new base? parameter on createPRCliSync makes plumbing this trivially possible. No current call sites use the async path, but the interface contract is violated. Sibling-site finding (not introduced by feat(cli): --stacked flag — set chain-mode PR base to predecessor branch #605, but adjacent).

    Suggestions:

    • Add a one-sentence caveat to the "Stacked PRs" section explaining the 2-issue stack edge case (or document why it's still useful: manifest visibility + future-proofing if more issues are appended).
    • Plumb opts.base through GitHubProvider.createPR(opts) async method to honor the CreatePROptions contract (separate follow-up).

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Asserts on gh pr create arg list (observable contract), not on internal state.
    Coverage Depth ✅ OK Edge cases: first/middle/last + single-issue + two-issue manifest. Both prBase paths (set / undefined). Manifest position relative to trailer asserted.
    Mock Hygiene ✅ OK Only spawnSync mocked (external boundary). mockHappyPathToCreate helper reuses the existing 3-call mock pattern in the file.
    Test Reliability ✅ OK Deterministic — no timing, no real network.

    Issues Found: None.


    Anti-Pattern Detection

    Dependency Audit

    N/A — package.json unchanged.

    Code Patterns

    No anti-patterns introduced. No eval, no innerHTML, no SQL concatenation, no hardcoded secrets, no await-in-loop hot paths, no uncleared timers.


    Call-Site Review

    New exported functions detected: 1 (buildStackManifest)

    Function Call Sites Loop? Conditions AC Match
    buildStackManifest run-orchestrator.ts:832 Yes (for loop over issues) Guarded by if (options.chain && options.stacked) ✅ Matches AC-4 — manifest renders only under --stacked, once per issue in the loop.

    Findings: None. Call site correctly gates manifest rendering behind --stacked and indexes by loop position.


    Execution Evidence

    Test Type Command Exit Code Result
    Help smoke npx sequant run --help 0 --stacked flag visible with correct help text
    Typecheck npx tsc --noEmit 0 Clean
    Targeted tests npx vitest run __tests__/run-orchestrator-resolve.test.ts __tests__/run-orchestrator.test.ts src/commands/run.test.ts 0 181/181 passed

    Evidence status: Complete (CLI/script changes verified via help + typecheck + targeted tests).

    Live end-to-end run with a real 2-issue chain hitting the GitHub API was not performed (call to gh pr create is mocked at the spawnSync boundary in the unit tests, and the user-flagged this as a known coverage gap in the /exec progress comment). Recommend during merger phase.


    Skill Command Verification

    .claude/skills/merger/SKILL.md modified — extracted commands:

    Command Verification
    gh pr view <PR_NUMBER> --json baseRefName,body ✅ Both baseRefName and body are valid gh pr view JSON fields (verified via gh pr view --help).

    Verification Status: Passed.


    Detection Pattern Verification

    N/A — the .claude/skills/merger/SKILL.md diff adds a gh pr view ... | jq snippet for skill operator instructions, not a runtime detection pattern with a corpus to validate. The §6c hard precondition (grep -E '^\+[^+]' ... grep -qE '\b(grep|awk|jq|sed)\b|/[^/]+/[gim]?') does trigger on the jq literal, but the surrounding prose describes operator-facing detection (a human runs the command on a specific PR), not an automated pipeline pattern that needs ≥5-sample corpus validation. Treating as documentation-style usage; no detection-corpus check applicable.


    CLI Registration Verification

    Interface Field Runtime Usage CLI Registered Status
    stacked options.stacked (run.ts:52, 56) --stacked in bin/cli.ts:221-224 ✅ OK

    Verification Status: Passed.


    Skill Change Review

    • ✅ Command verified: gh pr view --json baseRefName,body — both fields exist.
    • ✅ Fields verified: Cross-checked against gh pr view --help.
    • ✅ Patterns complete: Detection covers baseRefName != "main" AND body contains "Part of stack:" — matches the manifest format from buildStackManifest.
    • ⚠️ Dependencies explicit: Requires gh + jq — gh is implicit (already used elsewhere in the skill), jq is not explicitly called out. Minor.

    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (feat: --stacked flag)
    [Unreleased] entry ✅ Present (line 12)
    Entry format ✅ Valid (includes (#605), starts under ### Added, action-verb format)

    Result: CHANGELOG requirements met.


    Manual Test ACs

    N/A — no AC in the issue body specifies Manual Test verification. The /exec progress comment notes "Live end-to-end run with a real 2-issue chain wasn't performed" as a known gap, but this is a quality concern, not a manual-test AC.


    Risk Assessment

    • Likely failure mode: Two-issue stack confusion — run 100 101 --stacked produces two PRs both targeting main (because test(#86): Add CLI integration test for version output #101 is the "last" and falls into the open-question default), so users may not see the benefit they expect. Documented behavior, but the docs table only illustrates a 3-issue example.
    • Not tested: No live end-to-end run against the real GitHub API. gh pr create is mocked at the spawnSync boundary; the actual argv passed to gh is asserted but no real PR is created. The --base flag landing on gh correctly is implicit on gh's own contract.
    • Sibling sites considered: GitHubProvider.createPR(opts) async method at platforms/github.ts:611-612 silently drops opts.base — pre-existing latent gap, not introduced by feat(cli): --stacked flag — set chain-mode PR base to predecessor branch #605, no current call sites use this path. Worth a follow-up.
    • Sibling-line audit: createPR in worktree-manager.ts is the only PR-creation path used in production. Existing rebase logic (!chainMode || isLastInChain) is correctly preserved.

    Adversarial Re-Read

    Findings:

    1. 2-issue stack edge case is real but documented (the open question's default behavior). Worth a one-line caveat in docs/reference/run-command.md "Stacked PRs" section so users running a 2-issue stack know to expect manifest-only behavior, not predecessor-targeting.
    2. Final PR + cumulative diff: The existing chain-mode rebase (rebaseBeforePR on the last branch onto main) means the last PR under --stacked shows cumulative changes of the whole chain, not its own incremental diff. This is by design per the open question resolution (last PR targets main → must show what would land on main), and matches the existing --chain behavior. Worth noting in the docs as part of "Stacked PRs" so reviewers expect cumulative diff on the final PR.
    3. PARK history: Issue was PARKed 3× by /assess pending chain-mode reliability work; user explicitly opted into /exec. The docs caveat (~29% chain success rate, link to forensics) correctly surfaces this risk to users.
    4. Sibling-site gap at platforms/github.ts:612 is pre-existing dead code; the new base? param now exists to plumb through if a future call site emerges.
    5. Process state: Working tree clean, branch tracks origin, in sync, no uncommitted/stashed work.

    Status: Gaps Found (non-blocking documentation gaps and one pre-existing latent sibling-site issue — fold into a follow-up or address in the same PR via a 2-line docs addition).


    Verdict: NEEDS_VERIFICATION

    Primary reason: Build matrix CI checks (build (20.x), build (22.x)) are still IN_PROGRESS. The diff is not markdown-only (13 files changed including 8 .ts files), so the build-matrix relaxation does not apply — these checks remain gating per the QA skill's CI gate. typecheck, validate-skills, and validate-plugin have all passed locally and in CI.

    Secondary signals (would otherwise yield AC_MET_BUT_NOT_A_PLUS):

    • Adversarial re-read surfaced non-blocking documentation gaps (2-issue stack edge case, cumulative-diff-on-final-PR caveat) — fold into a 2-line docs addition or follow-up.
    • Pre-existing sibling-site gap at GitHubProvider.createPR(opts) async method — file as a follow-up; no caller exercises the path today.

    Re-run after CI completes: Once the build matrix passes, the verdict should revert to AC_MET_BUT_NOT_A_PLUS (pending the two-issue-stack doc caveat) or READY_FOR_MERGE (if the caveat is folded in).

    Documentation

    • README updated (N/A — flag-level addition)
    • docs/reference/run-command.md updated — new "Stacked PRs" section
    • CHANGELOG entry added — [Unreleased] line 12, includes (#605)
    • .claude/skills/merger/SKILL.md updated — "Stacked PR Detection" subsection

    Next Steps

    1. Wait for build matrix (build (20.x), build (22.x)) to complete; re-run /qa 605 or check gh pr checks 630 after they land.
    2. Optional doc polish (non-blocking): Add a 1–2 sentence caveat to the "Stacked PRs" section about (a) 2-issue stacks producing manifest-only behavior and (b) the final PR showing cumulative diff (because rebase onto main is preserved).
    3. Optional follow-up issue: Plumb opts.base through GitHubProvider.createPR(opts) async method (platforms/github.ts:612) to honor the CreatePROptions contract. Not introduced by feat(cli): --stacked flag — set chain-mode PR base to predecessor branch #605; pre-existing.
    4. Optional follow-up issue: Mirror .claude/skills/merger/SKILL.md into templates/skills/merger/ and skills/merger/ so the new "Stacked PR Detection" content deploys via sequant init (pre-existing missing-mirror gap; not introduced by this PR).
    5. Live end-to-end verification on a real 2- or 3-issue chain during merger phase (the /exec progress comment flagged this as known coverage gap).
  7. admarble commented on May 12, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #605 — CI Re-check

    Same commit (938b991d) as prior QA; only the external CI gate has changed. Re-running the verdict synthesis with the new CI state — non-CI analysis stands.

    CI Status (updated)

    Check State Conclusion Impact
    build (20.x) COMPLETED SUCCESS ✅ MET
    build (22.x) COMPLETED SUCCESS ✅ MET
    validate-skills COMPLETED SUCCESS ✅ MET
    typecheck COMPLETED SUCCESS ✅ MET
    validate-plugin COMPLETED SUCCESS ✅ MET

    CI Summary: 5 passed, 0 pending, 0 failed. Build matrix gate cleared.

    Verdict synthesis (re-run)

    Input Status
    AC coverage 6/6 MET (prior QA)
    Quality gates (skill cmd, detection-pattern, CLI registration, CHANGELOG) All passed (prior QA)
    CI ✅ All checks pass
    Adversarial re-read Gaps Found — non-blocking (2-issue stack edge case, cumulative-diff-on-final-PR caveat, pre-existing GitHubProvider.createPR(opts) sibling-site)

    Per §7 algorithm: not_met_count=0, partial_count=0, pending_count=0, all Failed/Survivors gates clean, adversarial_reread_status=Gaps Found → demotes from READY_FOR_MERGE to:

    Verdict: AC_MET_BUT_NOT_A_PLUS

    All ACs met and CI green. Non-blocking gaps documented in the prior QA's Adversarial Re-Read remain. Two ways to land:

    1. Merge as-is — the Gaps Found items are documentation polish + a pre-existing latent sibling-site issue; none block correctness or AC verification.
    2. Fold the docs caveat before merge — add 1–2 sentences to the "Stacked PRs" section in docs/reference/run-command.md covering: (a) 2-issue stacks produce manifest-only behavior (both PRs target main), and (b) the final PR shows cumulative diff because rebase-onto-main is preserved. That upgrades to READY_FOR_MERGE.

    Next Steps

    1. Decide between options 1 and 2 above.
    2. (Optional follow-up issue) Plumb opts.base through GitHubProvider.createPR(opts) async at src/lib/workflow/platforms/github.ts:612 — pre-existing latent gap, no current caller.
    3. (Optional follow-up issue) Mirror .claude/skills/merger/ into templates/skills/ and skills/ so the new "Stacked PR Detection" content deploys via sequant init.
    4. Live end-to-end run on a real 2- or 3-issue chain during merger phase (flagged as known coverage gap in /exec).
  8. added
    needs-improvement
    on May 12, 2026
  9. added a commit that references this issue on May 13, 2026
  10. admarble commented on May 13, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #605 — Gap Fixes Folded In

    New HEAD 5973f03 (was 938b991d on prior QA). One follow-up commit lands every gap surfaced in the prior QA's Adversarial Re-Read.

    Changes in this commit

    Gap Fix
    Misleading --help text bin/cli.ts: "middle PRs target predecessor; first/last target main"
    2-issue stack + cumulative-diff caveats missing docs/reference/run-command.md: new Caveats subsection
    GitHubProvider.createPR(opts) async dropped opts.base src/lib/workflow/platforms/github.ts: forward opts.base (+1 unit test)
    worktreeMap.get() invariant undocumented src/lib/workflow/run-orchestrator.ts: invariant comment
    merger/ skill not mirrored New: templates/skills/merger/SKILL.md, skills/merger/SKILL.md

    CI Status

    Check State Conclusion
    build (20.x) COMPLETED ✅ SUCCESS
    build (22.x) COMPLETED ✅ SUCCESS
    typecheck COMPLETED ✅ SUCCESS
    validate-skills COMPLETED ✅ SUCCESS
    validate-plugin COMPLETED ✅ SUCCESS
    Plugin Structure Validation COMPLETED ✅ SUCCESS
    Hooks Validation COMPLETED ✅ SUCCESS
    Setup Directory Creation COMPLETED ✅ SUCCESS

    8/8 pass. First build run hit a non-deterministic failure in locks-cli.integration.test.ts:201 (the lock-takeover test added in #626, result.status === null from spawnSync — classic process-group race); the re-run passed both build matrix jobs. Unrelated to this PR's diff. Recommend filing a follow-up to deflake that test before it bites another PR.

    Verdict synthesis (re-run)

    Input Status
    AC coverage 6/6 MET
    CI ✅ All 8 checks pass
    Adversarial re-read gaps from prior QA All resolved in 5973f03
    --stacked flag verification (smoke) npx sequant run --help shows updated text
    Local validation npm run lint clean, npm run build clean, 207/207 targeted tests pass

    No remaining blockers. No Failed/Survivors/Severe Gap states.

    Verdict: READY_FOR_MERGE

    All ACs met, CI green, all prior non-blocking gaps closed, sibling-site issue (createPR(opts) async) plumbed.

    Next Steps

    1. Merge PR feat(#605): --stacked flag — chain-mode PR base to predecessor branch #630.
    2. (Suggested follow-up) File issue: locks-cli.integration.test.ts:201 is flaky (result.status returns null under CI process-group pressure). Unrelated to feat(cli): --stacked flag — set chain-mode PR base to predecessor branch #605.
  11. added
    ready-for-review
    and removed
    needs-improvement
    on May 13, 2026
  12. added a commit that references this issue on May 13, 2026
  13. admarble commented on May 13, 2026

    @admarble
    ContributorAuthor

    Documentation Generated

    File: docs/features/stacked-prs.md

    Sections Included:

    • Prerequisites (chain-mode reliability caveat, 3+ issue minimum)
    • Setup (implies --chain, conflicts with --no-chain)
    • What You Can Do (3-issue stack table, manifest line, merge order)
    • What to Expect (middle PRs are the win, final PR cumulative diff trade-off, reliability bounded by --chain)
    • Flag Reference table (--stacked, --chain, --no-chain)
    • Common Workflows (in-order landing, dropping the bottom of the stack)
    • Troubleshooting (2-issue case, merger out-of-order warning, last-PR diff width, flag conflict)
    • Reference link to docs/reference/run-command.md § Stacked PRs (existing AC-5 deep reference)

    Next Steps:

    1. Review generated documentation for accuracy
    2. Merge PR to deploy documentation

    Ready to merge!

  14. added 2 commits that reference this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clienhancementmulti-agentready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions