Skip to content

Merge a Reported Promotion With --match-head-commit Set to the Reported Head, Not a Fresh Read #2505

Closed

Description

@ptr727

What happened

merge-and-release "The Procedure" step 2 records the promotion's live head, compares it against the head drive-pr's ready report named, and stops to re-ask where they differ. Step 3 then merges with --match-head-commit <recorded-sha>.

On #2502 the head moved between the ready report and the merge. A peer lane squashed #2503 into develop in between. The session read the live head and merged it in one command, so the comparison never ran, and the merge took #2503 to main past the maintainer's go-ahead. --match-head-commit could not catch it, because it was handed the head the same command had just read. The maintainer then chose to release both, but nothing mechanical stopped the merge.

Why it recurs

The comparison is a prose step between two commands. The guard the server enforces, --match-head-commit, protects only against movement after the live read, which is the smaller window. The larger window runs from the report to the read, and it is guarded by nothing but the agent remembering to compare.

Shape of a fix

Where a ready report named a head, pass that reported SHA to --match-head-commit, rather than the live read. The server then refuses a merge whose head moved at any point after the report. The stop-and-re-ask in step 2 becomes the handling of that refusal, rather than a check the agent has to remember. A promotion made ready by hand, which has no report, keeps the live read as it does now.

Activity

  1. added
    skills
    on Oct 7, 2026
  2. added a commit that references this issue on Oct 8, 2026
    d78e614
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    skills

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions