Skip to content

fix(ce-commit-push-pr): construct retrospective stacks - #1338

Merged
tmchow merged 5 commits into
mainfrom
tmchow/verify-stacked-pr-support
Aug 6, 2026
Merged

fix(ce-commit-push-pr): construct retrospective stacks#1338
tmchow merged 5 commits into
mainfrom
tmchow/verify-stacked-pr-support

Conversation

@tmchow

@tmchow tmchow commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stack intent now works for completed work, not only branches already registered with gh stack. When no topology exists, ce-commit-push-pr derives the smallest useful linear dependency layers and constructs them before the ordinary single-branch commit flow. It proceeds when one safe topology is clear and asks before ambiguous review boundaries, hunk-level splits, or published-history rewrites.

Existing managed-stack submission and the ce-babysit-pr handoff remain unchanged.

Design decisions

  • Inspect the complete committed and working change set; do not impose a numeric layer cap.
  • Keep automatic splits to whole-file groups or existing commit boundaries.
  • Reuse the existing fresh-base safeguards for the bottom layer, while every upstack branch starts from its immediate parent.
  • Verify manager order and complete top-layer content before submission.

Validation

  • bun run test — 2,908 passed, 0 failed.
  • bun run release:validate — release metadata is in sync.
  • bun run plugin:validate — strict marketplace and plugin validation passed.
  • Four dry-run behavioral evals covered a clear two-layer split, ambiguous sibling commits, published mixed history, and a justified four-layer stack.
  • An isolated local clone completed gh stack init → bottom commit → gh stack add → top commit → gh stack view --json without pushing.

New concepts

Retrospective stack construction

A PR stack can be designed after implementation by partitioning completed work into dependency-ordered review units. The bottom PR provides a coherent foundation; each later PR adds one independently reviewable outcome on its immediate parent.

This skill derives boundaries from the complete change set rather than a fixed PR count. It does not use retrospective stacking when the work is one logical change or when only artificial, hunk-level slices are possible.

Security Disclosure

This changes skill guidance for local git and gh stack mutations. Automatic construction is limited to safe local topology; published-history rewrites require explicit confirmation. No credential, permission, dependency, or executable-code changes.

Agent Disclosure

  • Model: Codex · GPT-5

@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes agent guidance for local git branch/commit/rewrite operations and stack submission; safeguards require confirmation for ambiguous splits and published-history rewrites, but mistaken automation could still mutate local history.

Overview
/ce-commit-push-pr stack mode now covers completed work on a single branch, not only repos that already have a gh stack topology. When stack intent is on and no managed stack exists, the skill derives the smallest useful linear review layers (whole-file groups or existing commit boundaries), builds them with gh stack init / gh stack add before ordinary Step 3, and defers gh stack submit and per-PR metadata to Step 5 only.

references/stack-submit.md adds a full Retrospective construction section: bottom-layer base rules (default branch vs feature branch, recovery refs, stash/restore for uncommitted splits), confirmation gates for ambiguous topologies, hunk splits, and published-history rewrites (mode:pipeline surfaces residuals instead of guessing), plus post-submit gh pr edit "<pr-url>" per new PR using PR-mode description composition. pr_teaching_archive on blocks submit until the user reruns with archive:off.

SKILL.md, docs, and pr-description-writing.md are aligned with the two-phase flow (construction vs submit), Step 3 skip when layers are already committed, and removal of per-layer base:<ref> for description base resolution. Contract tests in commit-push-pr-contract.test.ts are expanded to lock in the new stack behavior.

Reviewed by Cursor Bugbot for commit 195b100. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread skills/ce-commit-push-pr/SKILL.md Outdated
Comment thread skills/ce-commit-push-pr/references/stack-submit.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13a8b1cb6b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/ce-commit-push-pr/SKILL.md Outdated
Comment thread skills/ce-commit-push-pr/references/stack-submit.md Outdated
Address PR review feedback (#1338)

- defer stack submission until Step 5
- return a pipeline residual for confirmation-gated rewrites
Comment thread skills/ce-commit-push-pr/references/stack-submit.md
Comment thread skills/ce-commit-push-pr/SKILL.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2018e86363

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/ce-commit-push-pr/SKILL.md Outdated
Comment thread skills/ce-commit-push-pr/references/stack-submit.md Outdated
Address PR review feedback (#1338)

- compose metadata against each immediate parent
- keep feature-branch commits out of the bottom layer

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e7c4691. Configure here.

Comment thread skills/ce-commit-push-pr/references/pr-description-writing.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7c4691a75

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/ce-commit-push-pr/references/stack-submit.md Outdated
Comment thread skills/ce-commit-push-pr/references/stack-submit.md Outdated
Comment thread skills/ce-commit-push-pr/references/stack-submit.md Outdated
Address PR review feedback (#1338)

- keep retrospective work focused on topology construction
- describe new stack PRs by explicit URL after submit
- preserve existing stack PR metadata without rewrite intent

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf78c27b86

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/ce-commit-push-pr/references/stack-submit.md
Address PR review feedback (#1338)

Stop before stack submission when explainer archival would require post-submit branch mutations.
@tmchow
tmchow merged commit 2651279 into main Aug 6, 2026
7 of 8 checks passed
@github-actions github-actions Bot mentioned this pull request Aug 6, 2026
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