Harness Intelligence Wiki
Domains

Lefthook Commit Gate Glossary

Canonical language for the HI Catalogue local commit gate

Lefthook Commit Gate Glossary

This page is the durable language surface for the accepted Lefthook integration. The grill status and grill log remain the detailed decision record.

Terms

  • Lefthook: The Evil Martians Git-hook manager distributed through the lefthook package and executable.
  • Commit Gate: A first-class HI Catalogue contribution that applies local checks before Git creates a commit through the normal commit path.
  • Commit Gate Consumer: A consumer with a supported JavaScript package manager and lockfile path plus a complete Quality Command Contract. Python-only and other unsupported consumers are non-applicable.
  • Quality Command Contract: Compiled catalogue output containing one lint command and one read-only format-check command for a Commit Gate Consumer.
  • Commit Gate Opt-Out: Durable project policy (commitGate: "disabled") that prevents future runs from installing or reactivating the Commit Gate. Writing it changes no hook state. The next hi update removes the Managed Hook Script when its digest matches and unsets core.hooksPath only when it is .githooks.
  • Hook Migration Proposal: An HI recommendation to replace a detected existing hook manager with Lefthook. It is not migration approval.
  • Post-Command Handoff: Structured scaffold output that tells the $hi-cli agent which lifecycle work and verification remain after the CLI command returns.
  • Commit Gate Lifecycle Receipt: Retired. CLI 6 migration deletes .devpunks/commit-gate-lifecycle-receipt.json; hi commit-gate verify replaces it and writes nothing.
  • Managed Hook Script and Hook Activation: defined in the baseline video, retro and plan move glossary. Since lefthook 2.2.2, Git runs the Managed Hook Script, not a Lefthook-written .git/hooks/pre-commit.

Relationships and axioms

  • Commit Gate is separate from AI-agent lifecycle hooks and uses Lefthook as its local Git-hook manager.
  • The default policy is enabled. commitGate: "enabled" | "disabled" is stored in .devpunks/settings.json; an absent value means enabled.
  • hi init writes the policy only. hi update materializes a re-enable or runs the Opt-Out. hi commit-gate verify reports the hook state (managed, inactive or other) read-only. (ensure exists only as hi tools ensure.)
  • The normal pre-commit path requires both lint and read-only format-check success. Deliberate bypass remains possible, historical bypass is not tracked, and CI remains the merge authority.
  • Context compilation rejects an applicable consumer without both Quality Command Contract commands. Applicable owner contracts run once, in parallel where independent, aggregate failures, and skip empty scope.
  • HI owns exactly one Lefthook pre-commit command named lint, preserves consumer entries, and returns unsafe conflicts for user decision.
  • A Hook Migration Proposal and authorized agent migration precede dependency, configuration, and installation materialization. Package lifecycle scripts must not perform unreviewed migration.
  • hi commit-gate verify passes only for the managed hook state (core.hooksPath is .githooks and the Managed Hook Script digest matches), the pinned dependency, the active lint configuration and an executable hook. An old .git/hooks/pre-commit is inert while activated; HI reports it and never deletes it.
  • The Installed Record proves desired HI-owned state; hi commit-gate verify proves operational health from live facts each time.

On this page