Skip to content

Goal: Make the driver-side rescue reachable for CLOSED-but-unmerged PRs. The goa - #348

Merged
linhdmn merged 1 commit into
mainfrom
devagent/TASK-mty0vgkg-oerc
Sep 12, 2026
Merged

linhdmn merged 1 commit into
mainfrom
devagent/TASK-mty0vgkg-oerc

Conversation

@linhdmn

@linhdmn linhdmn commented Sep 12, 2026

Copy link
Copy Markdown
Member

Automated task via devagent task.

Prompt

Goal: Make the driver-side rescue reachable for CLOSED-but-unmerged PRs. The goal-text derivation (internal/loopdriver/run.go:413-431) assigns pick.mergePR only when prView reads state==OPEN, and openPROfIssue (issues.go:208) returns only OPEN PRs, so verifyAndMergeRescue's OPEN guard (run.go:807) can never receive a closed number — extend both ends. Extend prView to decode baseRefName/headRefName; when a goal-named PR is CLOSED, unmerged, based on main, and its head ref still exists on origin, take it as the merge subject; then let verifyAndMergeRescue reopen it (gh pr reopen, repo-scoped, bounded, drain-tolerant), re-read state, and merge via mergePRBounded. Base-superseded or reopen-refused → 0, never a fabricated ship. Cover both with run_test.go's fake-gh harness; go test ./internal/loopdriver/ passes.

Repo policy: every PR keeps docs/PRD.md current — update the sections this change affects (status claims, architecture notes, roadmap/completion notes) and bump the Last updated footer in the same PR. A PR that changes repo state without reflecting it in docs/PRD.md is incomplete.

PRD state update (repo policy)

  • docs/PRD.md sections touched by this change are updated to the post-PR state
  • the Last updated footer reflects this change

@linhdmn
linhdmn merged commit 85449da into main Sep 12, 2026
7 checks passed
@linhdmn
linhdmn deleted the devagent/TASK-mty0vgkg-oerc branch September 12, 2026 07:21
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