feat: close out issues when their devloop PR merges - #2
Merged
Merged
Conversation
A human-merged devloop PR now completes its issue's lifecycle: ledger completion entry (not counted as an attempt) + issue close. Same carve-out as /retry's close_pr — the merge IS the human's verdict; devloop executes it, never judges its own work. - ledger: MERGED marker + merged() producer, outside MARKERS - forge: complete_issue() (base docstring cites the precedent), gh impl - core: handle_merge() — devloop/issue-N branch mapping, no-op otherwise - cli: devloop merged (GITHUB_EVENT_PATH, silent no-op off-CI) - workflow template: pull_request closed trigger, YAML-gated to merged devloop branches - tests, CONTEXT.md (Closeout), README guardrail note, CHANGELOG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A human-merged devloop PR (
devloop/issue-Nbranch) now completes its issue's lifecycle: devloop posts adevloop PR merged #Pledger entry and closes the issue. Today nothing listens to merge events — merged issues linger open and become re-buildable ghosts on the next sweep.Why it's not a guardrail breach
close_issuestays human-only for everything else. This path gets the same carve-out/retry'sclose_prgot: the human's merge IS the judgment that the work is done — devloop executes that act, never judges its own work. The handler fires only from a real forge merge event, never agent output.Changes
ledger.py:MERGEDmarker +merged()producer — deliberately outsideMARKERS, socount()never mistakes a merge for an attemptforge/base.py:complete_issue()with carve-out docstring; GitHub adapter:gh issue closecore.py:handle_merge()— deterministicdevloop/issue-N→ issue mapping, no-op on any other branch or malformed numbercli.py:devloop merged— reads $GITHUB_EVENT_PATH, silent exit off-CI (zero token spend)deploy/github-actions.yml:pull_request: types: [closed]trigger, YAML-gated tomerged == true+devloop/head branch so unrelated merges cost nothingCloseoutterm, README guardrail paragraph, CHANGELOGVerification
New test:
test_merged_pr_completes_issue— merge → ledger + close; non-devloop branch → no-op; malformed branch → no-op;close_issuestill raises for other callers; merge marker not counted as an attempt.