Grilling
Lefthook Pre-Commit Catalogue Grill Status
- 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 | Completion | Locked direction | Still open |
|---|
| Product identity and promise | 100% | Commit Gate protects the normal local path; deliberate bypass remains possible, historical bypass is not tracked, and CI remains merge authority. | None |
| Consumer eligibility | 100% | Every Commit Gate Consumer has a supported JavaScript package-manager/lockfile path and complete Quality Command Contract; unsupported consumers are non-applicable. | None |
| Policy authority | 100% | commitGate stores enabled or disabled; absent means enabled. hi check reports exact policy and health states read-only. | None |
| Harness ownership boundary | 100% | Commit Gate is a first-class contribution; it owns only lint in shared Lefthook config and preserves consumer entries. | None |
| Materialization lifecycle | 100% | Handoff completion requires live proof stored separately in a Commit Gate Lifecycle Receipt; failed follow-through remains unresolved. | None |
| Gate command contract | 100% | Applicable owner contracts run once, in parallel where independent, aggregate failures, and skip empty scope. | None |
| Coexistence and drift | 100% | Existing Lefthook config keeps consumer entries; HI adds lint; hi check distinguishes exact conflict and drift states. | None |
| Dependency and runtime | 100% | Lefthook is project-local and pinned for Commit Gate Consumers; no second installation authority exists. | None |
Overall completion: 100%.
| Branch | Evidence anchors | Applicable dimensions | Open technical decisions | Grounding |
|---|
| Product identity and promise | research report, upstream Lefthook 2.1.10 docs; apps/cli/src/features/repository-check/application.ts | boundary, invariant, observability | none for R6 | grounded |
| Consumer eligibility | apps/cli/src/integrations/repository-detector.ts; apps/cli/src/scaffold/output.ts:lintTargetManifests; apps/cli/src/update/run.ts:dependencyLockfileCommand | topology, boundary, module shape | none | grounded |
| Policy authority | apps/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 flow | persistence, ownership, dependency direction | none | grounded |
| Harness ownership boundary | packages/scaffold/src/context-plan.ts:ContributionKind; apps/cli/src/data/catalog/hooks.ts:hookCatalog; harness projection adapters; scaffold receipts | topology, seams, boundary, module shape | none for R5 | grounded |
| Materialization lifecycle | apps/cli/src/features/scaffold-state/receipt.ts; apps/cli/src/features/scaffold-state/apply.ts; $hi-cli post-command flow; Lefthook npm postinstall | lifecycle, persistence, injection | none | grounded |
| Gate command contract | upstream staged-file behavior; apps/cli/scripts/staged-verification-selector.mjs | invariant, boundary, module shape | none for R6 | grounded |
| Coexistence and drift | Lefthook uninstall/install and npm postinstall source; scaffold receipts; repository check contract | ownership, seam, lifecycle, persistence | none for R6 | grounded |
| Dependency and runtime | Lefthook npm postinstall; scaffold planned dependencies; scaffold receipts; repository check contract | dependency direction, injection, lifecycle | none | grounded |
- Round: R7
- Current frontier: empty
- Shared-understanding confirmation: confirmed
| Question id | Prerequisites | Question | State |
|---|
| Q1 | none | Does “left-hook” mean the published lefthook package? | answered |
| Q2 | none | Must selected catalogue contributions resolve explicit lint and format-check commands for Commit Gate? | answered |
| Q3 | none | Is the default-on or opted-out choice durable project policy? | answered |
| Q4 | none | Is the Git commit gate a first-class contribution separate from agent lifecycle hooks? | answered |
| Q5 | none | Is “before any commit” a bypassable local gate or a non-bypassable policy promise? | answered |
| Q6 | Q3, Q4 | Does opt-out remove execution and all receipt-proven HI-owned gate state? | answered |
| Q7 | Q3, Q4 | Does hi ensure reconcile policy and owned Commit Gate state in one operation? | answered |
| Q8 | Q1, Q4 | Is Lefthook an HI-managed project-local dev dependency? | answered |
| Q9 | Q4 | Does a different existing hook manager stop reconciliation for human choice? | answered |
| Q10 | Q2, Q5 | Does Commit Gate run only against staged paths and owning workspaces? | answered |
| Q11 | Q6, Q9 | Is $hi-cli disable guidance ownership-aware? | answered |
| Q12 | Q6, Q7 | Do scaffold/update/check consume opt-out without reactivation? | answered |
| Q13 | Q9 | Does migration require an exact proposal and explicit human acceptance? | answered |
| Q14 | Q8 | Does the baseline pin the exact Lefthook version? | answered |
| Q15 | Q10 | Does Commit Gate reuse the existing staged workspace-selection semantics? | answered |
| Q16 | Q6, Q8, Q11, Q12 | How does opt-out remain durable despite Lefthook npm postinstall? | answered |
| Q17 | Q9, Q13 | Must migration finish before scaffold adds the Lefthook dependency? | answered |
| Q18 | Q3, Q7, Q12, Q16 | What settings value and re-enable lifecycle represent Commit Gate policy? | answered |
| Q19 | Q4, Q9, Q13, Q16, Q17 | How does HI coexist with an existing Lefthook configuration? | answered |
| Q20 | Q8, Q12, Q14, Q17 | How do scaffold and check prove hook installation health? | answered |
| Q21 | Q2, Q10, Q15 | Do lint and format-check run in parallel and report both failures? | answered |
| Q22 | Q10, Q15 | Does an empty applicable staged scope succeed without starting tools? | answered |
| Q23 | Q10, Q15, Q21, Q22 | How does lint dispatch contracts across several owners? | answered |
| Q24 | Q5 | Does HI avoid historical bypass attestation and report only current health? | answered |
| Q25 | Q8, Q14, Q19, Q20 | What evidence completes a Post-Command Handoff? | answered |
| Q26 | Q20 | How is missing or failed agent follow-through represented? | answered |
| Q27 | Q12, Q16, Q17, Q19, Q20 | Which read-only Commit Gate health states does hi check report? | answered |
| Q28 | Q25, Q26, Q27 | Where does durable operational Commit Gate proof live? | answered |
| Q29 | Q2, Q8, Q14 | Are consumers without a supported JavaScript package-manager path applicable? | answered |
- 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.
- 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.
- 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.
- “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.