Skip to content

fix(guardrails): let git-generated Merge and Revert subjects pass the commit-msg hook #7966

Closed

Description

@kyle-sexton

This was generated by AI during attend-queue.

Refs: #5948

Agent Brief

Type: Bug
Summary: The guardrails commit-msg convention hook accepts the subjects git itself writes for merges and reverts.

Current behavior:
The hook exempts only subjects starting fixup! , squash! or amend! . git merge runs the commit-msg hook (https://git-scm.com/docs/githooks), so under the bundled Conventional Commits pattern a non-fast-forward merge (Merge branch 'x') or a git revert (Revert "feat: y") is rejected. The hook's tests have no merge or revert case.

Desired behavior:
A subject starting Merge or Revert " exits 0 before the pattern check, the same way the autosquash forms do. Every other subject is still checked against the team pattern, and a violating one still exits 1 with the existing fix text. The hook's header comment lists the new exemptions. The failure text never suggests skipping the hook.

Key interfaces:

  • commit-msg convention hook: its set of exempt subject prefixes grows from the three autosquash forms to five.
  • The hook's test suite: gains merge, revert and still-violating cases.

Acceptance criteria:

  • The PR's CI runs test-bash and it passes.
  • The commit-msg convention hook's test file has a case where subject Merge branch 'x' exits 0 under the bundled Conventional Commits pattern.
  • That test file has a case where subject Revert "feat: y" exits 0 under the same pattern.
  • That test file has a case where a non-conforming subject such as update stuff still exits 1.
  • A guardrails fragment exists (scripts/new-changelog-fragment.sh guardrails patch), and scripts/check-changelog-fragments.sh --check passes.

Lane notes:

  • Known: the end-to-end installer cases in commit-msg-convention.test.sh fail in the lane sandbox with "hook managers conflict" (run 39105934408). They exercise install.mjs, not the exemption. The lane runs only the new cases locally, does not treat the installer failures as its own, and lets the PR's CI test-bash job be the check.
  • Start from the partial branch work-resolve-issue/issue-7966-39105934408-1 (on origin at 73967b2d8d).
  • No Hold: body line is required: plugin git-hooks/ is not a protected path. The exemption case lives at commit-msg-convention.sh:86.

Out of scope:

  • The hook's bash shebang and its bash call to the resolver (a sibling item).
  • The shared git-hooks installer and its dispatcher.
  • The convention-pattern resolver and its shared copies.
  • The config-hook install lane and the user conventions layer.
  • The agent-side block-convention-violation guard.

This was generated by AI during backlog shaping. Split from #5948; the owner approved filing it in an attended backlog-shaping session on 2026-10-18.

Activity

  1. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.
    on Oct 18, 2026
  2. added theissue type on Oct 18, 2026
  3. added
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    and removed
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Oct 18, 2026
  4. added
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    and removed
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    on Oct 18, 2026
  5. melodic-automation-lanes commented on Oct 18, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane stopped partway through this issue and needs a person.

    Why, in the run's own words:

    The run reported done but left a required check undone, so it is not finished.

    What the run says it did not do:

    • The test file does not pass as a whole: 5 end-to-end installer cases (installer installs the entry, resolver asset beside the copy, git commit refuses off-convention subjects x2, verify reports ok) fail with 'hook managers conflict' in this sandbox. They exercise install.mjs, not the changed code. I
    • The PR body must carry Hold: a human merges this per the issue's acceptance criteria; the lane writes the PR body, so I did not add it.
    • The changelog fragment was written by hand because HEAD is detached and new-changelog-fragment needs a branch name; check-changelog-fragments accepts it.
    • shellcheck and the repo build/lint could not be run: the sandbox blocked the call.

    Partial work is on the branch work-resolve-issue/issue-7966-39105934408-1.

    Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/39105934408

    To retry, remove needs-human and add agent-ready again.

  6. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    and removed
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Oct 22, 2026
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

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions