Skip to content

feat: automatically merge green yolo pull requests - #4663

Closed
mdc2122 wants to merge 3 commits into
kunchenguid:mainfrom
mdc2122:fm/yolo-automerge
Closed

mdc2122 wants to merge 3 commits into
kunchenguid:mainfrom
mdc2122:fm/yolo-automerge

Conversation

@mdc2122

@mdc2122 mdc2122 commented Sep 16, 2026

Copy link
Copy Markdown

Intent

When a task's merge poll confirms its PR is green and mergeable AND the task's recorded yolo=on, merge it automatically through bin/fm-pr-merge.sh instead of only reporting the still-open PR and waiting for firstmate's next turn. Captain's word: approved 2026-09-16.

What Changed

  • Automatically invokes bin/fm-pr-merge.sh from the watcher when an open PR is green, mergeable, and recorded with yolo=on.
  • Adds bounded, signal-safe merge supervision with configurable FM_YOLO_MERGE_TIMEOUT, while preserving polling for refused, queued, failed, or rebound merges.
  • Updates merge-authority documentation and expands security tests for successful, red, queued, stalled, and re-registered PR scenarios.

Risk Assessment

✅ Low: The change is bounded to the authorized yolo merge-poll path, preserves guarded live verification and timeout handling, and I found no concrete reachable correctness, authorization, privacy, or simplification defect.

Testing

The focused executable was run against the local stub-forge watcher product. Six pre-yolo merge-poll checks completed, then the queued yolo watcher scenario hung until forcibly terminated; no source changes or transient worktree artifacts remain.

  • Live validation: ⚠️ inconclusive - 1 of 6 scenarios driven live against the product
Scenario Result Live Evidence
A green, mergeable PR on a yolo task merges automatically through fm-pr-merge.sh and records its landing ⏸️ untested no The executable test hangs before this scenario completes; provide a working bounded stub-forge/PTY environment or fix the queued watcher hang, then rerun.
A task without yolo enabled, or a red/unmergeable PR, does not attempt a forge merge ⏸️ untested no The same executable run stalls before the yolo scenario block completes; rerun after resolving the queued watcher hang.
A queued yolo merge retains its authority and armed poll without reporting a landing ⏸️ untested no The test stalls inside this scenario under the hard timeout.
Replacing a task PR during merge confirmation preserves the replacement poll ⏸️ untested no Execution does not reach completion of the yolo scenario block because the queued watcher hangs first.
A stalled merge verification times out and watcher control checks continue ⏸️ untested no Execution does not reach this scenario before the queued watcher hang.
Existing canonical PR and merge-poll safety regressions continue to pass before the yolo block ✅ pass live fm-pr-check-security bounded run
Evidence: fm-pr-check-security bounded run
Focused executable output reached six existing merge-poll checks, then exceeded the hard timeout before the yolo scenarios completed.
- Outcome: ⚠️ 2 warnings across 1 run (2m34s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 2 warnings
  • ⚠️ tests/fm-pr-check-security.test.sh:2370 - The focused end-to-end merge-poll executable still hangs at the queued yolo watcher scenario under a hard timeout. The requested yolo auto-merge, non-yolo/red refusal, queued authority retention, PR replacement, and stalled verification scenarios could not be driven to completion.
  • ⚠️ live validation verdict: inconclusive (1 of 6 scenarios were driven live against the product); untested: A green, mergeable PR on a yolo task merges automatically through fm-pr-merge.sh and records its landing, A task without yolo enabled, or a red/unmergeable PR, does not attempt a forge merge, A queued yolo merge retains its authority and armed poll without reporting a landing, Replacing a task PR during merge confirmation preserves the replacement poll, A stalled merge verification times out and watcher control checks continue
  • Live validation: ⚠️ inconclusive - 1 of 6 scenarios driven live against the product
Scenario Result Live Evidence
A green, mergeable PR on a yolo task merges automatically through fm-pr-merge.sh and records its landing ⏸️ untested no The executable test hangs before this scenario completes; provide a working bounded stub-forge/PTY environment or fix the queued watcher hang, then rerun.
A task without yolo enabled, or a red/unmergeable PR, does not attempt a forge merge ⏸️ untested no The same executable run stalls before the yolo scenario block completes; rerun after resolving the queued watcher hang.
A queued yolo merge retains its authority and armed poll without reporting a landing ⏸️ untested no The test stalls inside this scenario under the hard timeout.
Replacing a task PR during merge confirmation preserves the replacement poll ⏸️ untested no Execution does not reach completion of the yolo scenario block because the queued watcher hangs first.
A stalled merge verification times out and watcher control checks continue ⏸️ untested no Execution does not reach this scenario before the queued watcher hang.
Existing canonical PR and merge-poll safety regressions continue to pass before the yolo block ✅ pass live fm-pr-check-security bounded run
  • python3 subprocess hard-bounded run of bash tests/fm-pr-check-security.test.sh (35–90 second timeout)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

When a task's merge poll finds the PR still open and the task meta records
yolo=on, the watcher now invokes bin/fm-pr-merge.sh itself instead of only
reporting the still-open PR and waiting for a firstmate turn. The merge
path's own live verification remains the only green check: a red,
unmergeable, or unverifiable PR is refused there and the poll stays armed.
A confirmed landing is recognized by the merge-notified marker the merge
path commits with its durable outcome, so a queued or unconfirmed
acceptance keeps polling and the landed wake is emitted exactly once.

The task's recorded yolo posture now resolves as standing merge authority
ahead of the away-posture record, which is consulted only for a task
without it.
@mdc2122

mdc2122 commented Sep 26, 2026

Copy link
Copy Markdown
Author

Superseded by #5726, rebased onto current main and reconciled with #5534.

@mdc2122 mdc2122 closed this Sep 26, 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