merge guard owns the full merge:pr lifecycle — auto-arm + finalize-from-detected-merged (eliminate FO hand-rolling)#415
Open
clkao wants to merge 2 commits into
Conversation
…om-merge-sentinel + path-scoped archive commit
The verb now owns the whole merge:pr ceremony so the FO invokes one verb per phase:
- AUTO-ARM under both merge:local AND merge:pr (was merge:local only): entering
terminal with an empty mod-block + a merge hook registered sets
mod-block=merge:{hook} and signals armed.
- FINALIZE keys off a local MERGE SENTINEL in pr (pr-merge:{n} / local-merge:{sha})
— the signal a merge landed — never raw pr-presence. A bare/open PR ref (#42)
blocks (await-pr); finalize works EVEN from a non-armed state (the stranded case).
- The verb commits the archive move PATH-SCOPED (staging only the entity's two
rename paths), so a sibling left dirty in the same tree is never swept in.
Fixes the premature-finalize bug (an open-PR entity archived before its PR landed)
the Codex FO surfaced. fo-merge-core.md merge-ceremony prose rewritten to the
one-verb-per-phase flow + the SPACEDOCK_BIN launcher invariant.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…sed) prIndicatesMerged did a bare HasPrefix with no suffix validation, so a garbage sentinel (pr-merge:abc, pr-merge:0, an empty suffix) drove a full finalize+archive — a fail-OPEN hole on an irreversible action. Validate the suffix: pr-merge: finalizes only on a positive integer, local-merge: only on a non-empty SHA-like token; anything else returns false. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Make
spacedock merge guardown the full merge:pr terminal lifecycle so the FO runs one verb per phase instead of hand-rolling the ceremony.What changed
Evidence
go test ./internal/status ./internal/cli: all green (14 MergeGuard tests + TestPRIndicatesMerged + suffix-validation tests).Review guidance
Focus on internal/status/merge.go
prIndicatesMerged— the fail-closed sentinel validation is the high-stakes guard.xdc