fix(ce-babysit-pr): own managed stacks with postures and opt-in ship - #1331
Conversation
Agents can own confirmed managed stacks via target/stack-ready/stack-land in babysit, and submit stacks from commit-push-pr only when intent is clear. Settled stays distinct from merged; land requires stack-land.
When posture is already stack-ready or stack-land, begin at the lowest unsettled downstack layer without asking so traversal stays downstack-to-upstack.
PR SummaryMedium Risk Overview
Docs, README inventory, an implementation plan, and contract tests pin posture, merge carve-out, handoff, and stack-submit invariants; eval scenario doc for AE1–AE6. Reviewed by Cursor Bugbot for commit 0886db4. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c7790116f
ℹ️ 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".
Quote branch placeholders, land before advance under stack-land, keep pipeline/resume posture, guard draft --open, and submit mid-stack ships.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f70909a7e
ℹ️ 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".
…cking Current gh stack push may update branches non-atomically (github/gh-stack#216), so requiring proven atomicity blocked ordinary managed-stack review resolution. Record a pre-push OID baseline and re-probe after push for recoverable residuals.
Exclude the pushed target from baseline OID divergence checks, fail closed when the pre-push baseline cannot be recorded, wait for actual MERGED after merge-queue enqueue, and skip LFG's second babysit after a stack handoff.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 626fa3641e
ℹ️ 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".
Do not DONE on babysit-started alone after a stack handoff, and point the user-facing resume at the bottom PR with the same stack posture.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f242bed071
ℹ️ 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".
Hard-coded origin breaks fork/upstream stacks; recipes must use the resolved tracking remote from the babysit protocol.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f07a87b38a
ℹ️ 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".
… tip Avoid hard-coded origin/<parent> when the tracking remote differs or the parent tip is still local before first submit.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9b8e7d4. Configure here.
…flow Stack-layer base selection must not defer to branch-creation.md's origin/<base> path, which would undo the authoritative parent-tip rule.
Defense-in-depth for agent-copied checkout: use -- and quotes so hostile branch names cannot expand in the shell recipe.

Summary
Agents could already detect a GitHub managed PR stack and keep dependents in sync after a push. They could not own the stack as a babysit run: keep going upstack after a layer looks ready without merging, or land settled prefixes when the user asked to land. Opening a multi-PR stack from ship was also outside the skill — you had to drive
gh stackby hand.This PR makes that ownership first-class:
ce-babysit-prtakes a run posture:target(named PR only),stack-ready(drive the confirmed stack to ready; never merge), orstack-land(same traversal, plus authorized prefix land viagh stack merge+ sync). Settled is not merged — a green layer can stay OPEN while babysit continues upstack.ce-commit-push-prcan submit a stack only when intent is clear (gh stack submit), then hand off babysit on the bottom open non-draft PR with the matching posture. Nonsense one-concern “stacks” are refused.gh stack pushmay update branches non-atomically (github/gh-stack#216). Before a target-push delegate, record manager-ordered open branches + remote OIDs; aftergh stack push, re-probe heads, treat partial updates as observed progress, and return a precise recoverable residual. Prefer all-or-none when an installed manager later proves atomic push; never raw-force; keep conflict abort +needs-human.Design decisions
stack-landis explicit land authgh stack mergeatomicity; never land an upstack PR while downstack is still opengh stackCLIPlan:
docs/plans/2026-08-05-001-feat-babysit-stack-posture-ship-plan.mdEval scenarios (AE1–AE6):
docs/plans/2026-08-05-001-feat-babysit-stack-posture-ship-eval-scenarios.mdHow to try it
Test plan
bun run release:validatebun run test(2905 pass after recoverability change)Post-Deploy Monitoring & Validation
No additional operational monitoring required — skill prose and docs only.
Known Residuals
--squash. Repos that disallow squash may fail at land time until merge-method override is documented.gh-stack#216lands in a release agents actually run; recoverability remains required.Security Disclosure
Quoted branch placeholders in stack rebase recipes (branch names treated as data, not raw shell). No other security-relevant changes.
Agent Disclosure