Harness Intelligence Wiki
Grilling

Lefthook Pre-Commit Catalogue Grill Status

Lefthook Pre-Commit Catalogue Grill Status

Evidence Basis

  • Source request: make Lefthook default-on for HI Catalogue consumers, expose an opt-out through hi init and hi ensure, and require lint plus format to pass before commit.
  • Research: Lefthook Pre-Commit Catalogue Integration Research.
  • Current branch: feat/pre-commit-hooks.
  • Accepted scope clarification: default-on applies to Commit Gate Consumers; Python-only and other consumers without a supported JavaScript package-manager and lockfile path are non-applicable for this integration.

Branch Dashboard

BranchCompletionLocked directionStill open
Product identity and promise100%Commit Gate protects the normal local path; deliberate bypass remains possible, historical bypass is not tracked, and CI remains merge authority.None
Consumer eligibility100%Every Commit Gate Consumer has a supported JavaScript package-manager/lockfile path and complete Quality Command Contract; unsupported consumers are non-applicable.None
Policy authority100%commitGate stores enabled or disabled; absent means enabled. hi check reports exact policy and health states read-only.None
Harness ownership boundary100%Commit Gate is a first-class contribution; it owns only lint in shared Lefthook config and preserves consumer entries.None
Materialization lifecycle100%Handoff completion requires live proof stored separately in a Commit Gate Lifecycle Receipt; failed follow-through remains unresolved.None
Gate command contract100%Applicable owner contracts run once, in parallel where independent, aggregate failures, and skip empty scope.None
Coexistence and drift100%Existing Lefthook config keeps consumer entries; HI adds lint; hi check distinguishes exact conflict and drift states.None
Dependency and runtime100%Lefthook is project-local and pinned for Commit Gate Consumers; no second installation authority exists.None

Overall completion: 100%.

Technical Grounding

BranchEvidence anchorsApplicable dimensionsOpen technical decisionsGrounding
Product identity and promiseresearch report, upstream Lefthook 2.1.10 docs; apps/cli/src/features/repository-check/application.tsboundary, invariant, observabilitynone for R6grounded
Consumer eligibilityapps/cli/src/integrations/repository-detector.ts; apps/cli/src/scaffold/output.ts:lintTargetManifests; apps/cli/src/update/run.ts:dependencyLockfileCommandtopology, boundary, module shapenonegrounded
Policy authorityapps/cli/src/features/project-settings/model.ts:ProjectSettingsDocument; apps/cli/src/features/scaffold-state/receipt.ts; apps/cli/src/features/repository-check/port.ts; $hi-cli post-command flowpersistence, ownership, dependency directionnonegrounded
Harness ownership boundarypackages/scaffold/src/context-plan.ts:ContributionKind; apps/cli/src/data/catalog/hooks.ts:hookCatalog; harness projection adapters; scaffold receiptstopology, seams, boundary, module shapenone for R5grounded
Materialization lifecycleapps/cli/src/features/scaffold-state/receipt.ts; apps/cli/src/features/scaffold-state/apply.ts; $hi-cli post-command flow; Lefthook npm postinstalllifecycle, persistence, injectionnonegrounded
Gate command contractupstream staged-file behavior; apps/cli/scripts/staged-verification-selector.mjsinvariant, boundary, module shapenone for R6grounded
Coexistence and driftLefthook uninstall/install and npm postinstall source; scaffold receipts; repository check contractownership, seam, lifecycle, persistencenone for R6grounded
Dependency and runtimeLefthook npm postinstall; scaffold planned dependencies; scaffold receipts; repository check contractdependency direction, injection, lifecyclenonegrounded

Current Round

  • Round: R7
  • Current frontier: empty
  • Shared-understanding confirmation: confirmed
Question idPrerequisitesQuestionState
Q1noneDoes “left-hook” mean the published lefthook package?answered
Q2noneMust selected catalogue contributions resolve explicit lint and format-check commands for Commit Gate?answered
Q3noneIs the default-on or opted-out choice durable project policy?answered
Q4noneIs the Git commit gate a first-class contribution separate from agent lifecycle hooks?answered
Q5noneIs “before any commit” a bypassable local gate or a non-bypassable policy promise?answered
Q6Q3, Q4Does opt-out remove execution and all receipt-proven HI-owned gate state?answered
Q7Q3, Q4Does hi ensure reconcile policy and owned Commit Gate state in one operation?answered
Q8Q1, Q4Is Lefthook an HI-managed project-local dev dependency?answered
Q9Q4Does a different existing hook manager stop reconciliation for human choice?answered
Q10Q2, Q5Does Commit Gate run only against staged paths and owning workspaces?answered
Q11Q6, Q9Is $hi-cli disable guidance ownership-aware?answered
Q12Q6, Q7Do scaffold/update/check consume opt-out without reactivation?answered
Q13Q9Does migration require an exact proposal and explicit human acceptance?answered
Q14Q8Does the baseline pin the exact Lefthook version?answered
Q15Q10Does Commit Gate reuse the existing staged workspace-selection semantics?answered
Q16Q6, Q8, Q11, Q12How does opt-out remain durable despite Lefthook npm postinstall?answered
Q17Q9, Q13Must migration finish before scaffold adds the Lefthook dependency?answered
Q18Q3, Q7, Q12, Q16What settings value and re-enable lifecycle represent Commit Gate policy?answered
Q19Q4, Q9, Q13, Q16, Q17How does HI coexist with an existing Lefthook configuration?answered
Q20Q8, Q12, Q14, Q17How do scaffold and check prove hook installation health?answered
Q21Q2, Q10, Q15Do lint and format-check run in parallel and report both failures?answered
Q22Q10, Q15Does an empty applicable staged scope succeed without starting tools?answered
Q23Q10, Q15, Q21, Q22How does lint dispatch contracts across several owners?answered
Q24Q5Does HI avoid historical bypass attestation and report only current health?answered
Q25Q8, Q14, Q19, Q20What evidence completes a Post-Command Handoff?answered
Q26Q20How is missing or failed agent follow-through represented?answered
Q27Q12, Q16, Q17, Q19, Q20Which read-only Commit Gate health states does hi check report?answered
Q28Q25, Q26, Q27Where does durable operational Commit Gate proof live?answered
Q29Q2, Q8, Q14Are consumers without a supported JavaScript package-manager path applicable?answered

Glossary

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.
  • 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 that prevents future scaffold runs from installing or reactivating the Commit Gate; persisting it does not itself mutate current hook state.
  • 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: Durable operational proof bound to the exact desired Commit Gate state and agent-verified dependency, configuration, and installed-hook facts.
  • Commit Gate Consumer: An HI Catalogue consumer with a supported JavaScript package-manager and lockfile path plus a complete Quality Command Contract.

Relationships

  • A Commit Gate is separate from an AI-agent lifecycle hook.
  • A Commit Gate uses Lefthook as its local Git-hook manager.
  • Selected catalogue contributions resolve a Quality Command Contract; a Commit Gate consumes it.
  • hi ensure persists Commit Gate Opt-Out; scaffold-capable commands consume it.
  • A Hook Migration Proposal and authorized agent migration precede Commit Gate dependency, configuration, and installation materialization.
  • Scaffold emits a Post-Command Handoff; the $hi-cli agent completes its lifecycle work and verifies hook installation.
  • The Commit Gate preserves consumer-owned Lefthook entries and adds the HI-owned lint command; unsafe conflicts require user decision.
  • A Post-Command Handoff becomes complete only after the agent verifies the pinned dependency, active lint configuration, and installed Lefthook hook.
  • The managed scaffold receipt proves HI-owned desired state; the Commit Gate Lifecycle Receipt proves operational Commit Gate health.

Axioms

  • The target integration is default-on.
  • A user can opt out through hi init or hi ensure.
  • A normal pre-commit path requires both lint and format success before Git creates the commit.
  • Commit Gate policy is durable typed project state in .devpunks/settings.json.
  • Deliberate local bypass remains possible; CI remains merge authority.
  • Context compilation rejects an applicable Commit Gate consumer whose Quality Command Contract lacks either command.
  • Persisting Commit Gate Opt-Out does not itself uninstall or mutate current hook state; $hi-cli agent follow-through applies the ownership-safe disable path.
  • Future scaffold/update must not restore an HI-owned Commit Gate while Commit Gate Opt-Out remains selected.
  • The canonical $hi-cli guidance tells an operator how to disable the current pre-commit hook; delivery must change the shared source first and sync it into Harness projections.
  • A Hook Migration Proposal does not authorize migration.
  • $hi-cli owns safe migration guidance; the agent owns the proposal and authorized migration follow-through; the CLI owns evidence and policy.
  • The selected HI baseline pins the exact reviewed Lefthook dependency version.
  • Package lifecycle scripts must not perform an unreviewed hook-manager migration.
  • Lint and format-check run in parallel and report both failures from one commit attempt.
  • An empty or non-applicable staged scope succeeds without starting quality tools.
  • HI's owned Lefthook pre-commit command is named exactly lint.
  • Each applicable workspace owner runs its complete Quality Command Contract exactly once unless compiled evidence identifies one shared execution scope.
  • HI reports current Commit Gate health but does not claim historical deliberate-bypass detection.
  • Missing or failed agent follow-through remains an unresolved Post-Command Handoff and keeps the $hi-cli scaffold branch incomplete.
  • hi check reports exact Commit Gate health states without repair.
  • Python-only and other consumers without a supported JavaScript package-manager and lockfile path are not Commit Gate Consumers for this integration.
  • Any relevant desired or observed state change makes the Commit Gate Lifecycle Receipt stale and requires agent re-verification.

Flagged Ambiguities

  • “HI receives the lint and format commands” is the accepted target contract. Current catalogue schemas do not carry it yet; delivery must add the Quality Command Contract.
  • “lint and format packs” currently refers to lint assets plus the format-edited-file lifecycle hook; they are separate contribution types and do not form one executable quality contract. Resolution: the Quality Command Contract is separate compiled output.
  • “format passes” is resolved as a read-only format-check. Commit Gate does not format or restage files.
  • “all HI Catalogue consumers” is resolved as all Commit Gate Consumers for this integration; unsupported non-JavaScript-package-manager consumers are non-applicable.

Parked Branches

  • None.

On this page