Skip to content

feat(automode): held-PR pipeline 3b — held PR + gh-native merge detection#31

Merged
Ecko95 merged 8 commits into
gitsfrom
feat/automode-held-pr-merge-detect
Jun 20, 2026
Merged

feat(automode): held-PR pipeline 3b — held PR + gh-native merge detection#31
Ecko95 merged 8 commits into
gitsfrom
feat/automode-held-pr-merge-detect

Conversation

@Ecko95

@Ecko95 Ecko95 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Plan 3b of the autonomous-toggle roadmap — closes the autonomous loop (builds on 3a, PR #29). Plan: docs/superpowers/plans/2026-06-20-automode-held-pr-3b-pr-merge-detect.md.

What this does

When the goal queue drains at roadmap end (no queued, no running, ≥1 slice landed this run), the AutomodeDriver idle branch:

  1. Opens one held PR auto/<integrationBranch> → gits via the new AutomodeHeldPr service (idempotent: list-first, then gh pr create, never gh pr merge).
  2. Records heldPrUrl/heldPrNumber in persisted run state.
  3. On later ticks, polls GitHubCli.getPullRequest().state — when GitHub reports "merged", marks the run complete (runMerged) and stops.

Fail-closed: no integration branch / nothing landed → no PR; open failure → halt.

Design decision (changed from the original ask)

Merge detection is gh-native via GitHubCli.getPullRequest().state === "merged", not the git merge-base/cherry patch-id cascade. Reason discovered during implementation: GitVcsDriver.execute is git-only (can't run gh), and GitHubCli already exposes authoritative PR merge state (handles merge/squash/rebase uniformly + branch deletion). Simpler, less code, no pushed-SHA tracking. Approved at the 2026-06-20 checkpoint.

New surfaces

  • contracts: AutomodeSnapshot.{heldPrUrl,heldPrNumber,runMerged} (back-compat decoding defaults) + AutomodeRecordHeldPrInput.
  • supervisor: persisted run state + recordHeldPr / markRunMerged.
  • AutomodeHeldPr service + layer (open_held_pr, detect_merge) over GitHubCli.

v1 simplifications (documented)

One terminal run (resettable/per-project runs are Plan 7); gh repo derived from a completed goal's repo (single-repo v1); base fixed to gits.

Verification

  • 114 targeted tests pass; full repo typecheck green (tsgo --force, 14/14); lint 0 errors.

🤖 Generated with Claude Code

Ecko95 and others added 7 commits June 20, 2026 18:50
Closes the autonomous loop: on queue drain, open one held PR auto/<id> →
gits (no auto-merge) and poll GitHubCli.getPullRequest().state for merge,
then mark the run complete. Decision: gh-native detection via GitHubCli
(GitVcsDriver.execute is git-only), not the git patch-id cascade.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Jun 20, 2026
@Ecko95
Ecko95 merged commit bd5d35f into gits Jun 20, 2026
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant