Skip to content

fix(ce-babysit-pr): own managed stacks with postures and opt-in ship - #1331

Merged
tmchow merged 12 commits into
mainfrom
tmchow/ce-handoff-stack-posture
Aug 5, 2026
Merged

fix(ce-babysit-pr): own managed stacks with postures and opt-in ship#1331
tmchow merged 12 commits into
mainfrom
tmchow/ce-handoff-stack-posture

Conversation

@tmchow

@tmchow tmchow commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

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 stack by hand.

This PR makes that ownership first-class:

  • ce-babysit-pr takes a run posture: target (named PR only), stack-ready (drive the confirmed stack to ready; never merge), or stack-land (same traversal, plus authorized prefix land via gh stack merge + sync). Settled is not merged — a green layer can stay OPEN while babysit continues upstack.
  • ce-commit-push-pr can 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.
  • Recoverable upstack propagation — do not true-stop for unproven atomic multi-ref push. Current gh stack push may update branches non-atomically (github/gh-stack#216). Before a target-push delegate, record manager-ordered open branches + remote OIDs; after gh 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

Decision Why it matters
Settled ≠ merged Agents must not merge just to babysit the next layer
stack-land is explicit land auth Merge stays off by default; selecting that posture is the yes
Prefix land = bottom-most open settled Matches gh stack merge atomicity; never land an upstack PR while downstack is still open
Just-landed MERGED = layer transition Landing one PR must not end the whole babysit run
Stacks are opt-in on ship No proactive stack suggestions; soft-dep on gh stack CLI
Recoverability over impossible atomicity proof Unblocks review-on-stack against today's CLI without assuming all-or-none

Plan: docs/plans/2026-08-05-001-feat-babysit-stack-posture-ship-plan.md
Eval scenarios (AE1–AE6): docs/plans/2026-08-05-001-feat-babysit-stack-posture-ship-eval-scenarios.md

How to try it

# Own a confirmed managed stack until ready (no auto-merge)
/ce-babysit-pr posture:stack-ready

# Own the stack and land settled prefixes when green
/ce-babysit-pr posture:stack-land

# Ship with clear stack intent → submit + babysit handoff with posture
/ce-commit-push-pr

Test plan

  • Contract tests for babysit + commit-push-pr
  • bun run release:validate
  • Full bun run test (2905 pass after recoverability change)
  • Lightweight behavioral checks on critical paths (continue without merge; refuse nonsense stack; stack-ready never merges)
  • Recoverable-propagation behavioral evals (iteration-2): non-atomic path, partial-push residual, conflict abort — 22/22 current vs 15/22 prior HEAD
  • Explicit one-shot full-stack land intent (deferred; separate Change)

Post-Deploy Monitoring & Validation

No additional operational monitoring required — skill prose and docs only.

Known Residuals

  • Minor — land step hardcodes --squash. Repos that disallow squash may fail at land time until merge-method override is documented.
  • Encoding explicit “merge all together / no partial prefixes” as a written one-operation top-endpoint rule remains deferred.
  • Prefer atomic all-or-none when gh-stack#216 lands 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

  • Model: Cursor · Cursor Grok 4.5

tmchow added 2 commits August 5, 2026 01:12
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.
@cursor

cursor Bot commented Aug 5, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Skill-contract changes govern merge authorization (stack-land), multi-PR traversal, and gh stack CLI behavior—mistakes could merge or advance stacks incorrectly, but scope is documentation and tests only with explicit posture gates.

Overview
Adds first-class ownership of confirmed GitHub managed PR stacks in skill prose—no new orchestrator or app code.

ce-babysit-pr introduces run postures via posture:target|stack-ready|stack-land: default single-PR babysit; stack-ready continues upstack after a layer looks ready without merging (settled ≠ merged); stack-land authorizes prefix land with gh stack merge + sync, treating a just-landed PR as a layer transition rather than ending the run. New references/stack-commands.md; watch-loop and Step 7 upstack maintenance shift from hard-stopping on unproven atomic multi-ref push to a pre-push baseline + post-push re-probe with recoverable partial-push residuals (github/gh-stack#216).

ce-commit-push-pr adds opt-in stack mode (references/stack-submit.md): gh stack submit --auto --open when intent is clear, refuse nonsense stacks, hand off babysit on the bottom open non-draft PR with derived posture. lfg avoids a second bare pipeline babysit when step 8 already handed off stack scope.

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.

Comment thread skills/ce-babysit-pr/references/stack-commands.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: 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".

Comment thread skills/ce-commit-push-pr/references/stack-submit.md
Comment thread skills/ce-commit-push-pr/SKILL.md Outdated
Comment thread skills/ce-babysit-pr/SKILL.md Outdated
Comment thread skills/ce-babysit-pr/references/watch-loop.md
Comment thread skills/ce-babysit-pr/SKILL.md
Comment thread skills/ce-commit-push-pr/SKILL.md Outdated
Comment thread skills/ce-babysit-pr/SKILL.md
Comment thread skills/ce-babysit-pr/SKILL.md
Quote branch placeholders, land before advance under stack-land, keep
pipeline/resume posture, guard draft --open, and submit mid-stack ships.
Comment thread skills/ce-commit-push-pr/SKILL.md
@tmchow tmchow changed the title feat(ce-babysit-pr): stack postures and opt-in ship stack mode feat(ce-babysit-pr): own managed stacks with postures and opt-in ship Aug 5, 2026

@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: 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".

Comment thread skills/ce-babysit-pr/SKILL.md Outdated
Comment thread skills/ce-commit-push-pr/SKILL.md Outdated
…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.
Comment thread skills/ce-babysit-pr/SKILL.md Outdated
Comment thread skills/ce-babysit-pr/SKILL.md Outdated
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.
Comment thread skills/lfg/SKILL.md Outdated
Comment thread skills/lfg/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: 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".

Comment thread skills/ce-commit-push-pr/SKILL.md Outdated
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.

@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: 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".

Comment thread skills/ce-babysit-pr/references/stack-commands.md Outdated
Hard-coded origin breaks fork/upstream stacks; recipes must use the
resolved tracking remote from the babysit protocol.

@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: 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".

Comment thread skills/ce-commit-push-pr/references/stack-submit.md Outdated
tmchow added 2 commits August 5, 2026 13:09
… tip

Avoid hard-coded origin/<parent> when the tracking remote differs or the
parent tip is still local before first submit.

@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 9b8e7d4. Configure here.

Comment thread skills/ce-commit-push-pr/references/stack-submit.md Outdated
tmchow added 2 commits August 5, 2026 13:13
…flow

Stack-layer base selection must not defer to branch-creation.md's
origin/<base> path, which would undo the authoritative parent-tip rule.

@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.

Stale comment

Comment thread skills/ce-commit-push-pr/references/stack-submit.md Outdated
Defense-in-depth for agent-copied checkout: use -- and quotes so
hostile branch names cannot expand in the shell recipe.
@tmchow
tmchow merged commit 1a58b4a into main Aug 5, 2026
5 checks passed
@tmchow tmchow changed the title feat(ce-babysit-pr): own managed stacks with postures and opt-in ship fix(ce-babysit-pr): own managed stacks with postures and opt-in ship Aug 5, 2026
@github-actions github-actions Bot mentioned this pull request Aug 5, 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