Skip to content

feat(guardrails): opt-in git commit-msg hook for tool-agnostic subject enforcement #919

Description

@kyle-sexton

f1 depth layer — heavyweight trust-surface review (writes to consumer .git/hooks). Setup installs a commit-msg hook enforcing the resolved subject pattern regardless of tool/shell (editor commits, -F <file>, humans outside Claude).

  • Never clobber an existing commit-msg (chain-or-refuse); detect core.hooksPath/lefthook/husky-managed repos and say so; sentinel-mark the installed hook and exclude it as a convention source (echo-cycle).
  • Two-lane install: personal .git/hooks/ (default) vs committed core.hooksPath (team opt-in) — note guardrails' own block-no-verify blocks core.hooksPath=; resolve that interaction.
  • Handle the A1 + block-no-verify deadlock (agent can neither pass nor --no-verify): designed exit + test. Also collides with the operator's machine-local commit-msg gate — must chain.
  • Depends on #S1; ships last.

Part of #912. Contract + design in #912 — do not diverge.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: securitySecurity-relevant: vulnerability, hardening, or disclosure follow-up.priority: highSignificant impact, or blocks an imminent release; staff this cycle.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions