Git drift hook¶
Keep committed harness files honest by installing a git pre-commit hook that runs the drift gate on every commit.
Install¶
This writes .git/hooks/pre-commit. The installed hook is a thin stub that execs
adept hook run — all the logic stays in the CLI.
You can also install it at init time:
Modes¶
| Mode | Behavior on drift |
|---|---|
fail (default) |
The commit is blocked; you fix drift and re-commit. |
fix |
adept auto-adopts / re-renders the drift and re-stages the files, then the commit proceeds. |
Under the hood, fix mode runs adept hook run --fix.
Safety¶
adeptonly overwrites a pre-commit hook it wrote itself (marked with an internaladept-managedmarker). It refuses to clobber a hand-written hook — remove it or install manually if you already have one.- The hook assumes a standard
.git/directory. In a worktree or submodule (where.gitis a file pointing elsewhere), install the hook manually. - The installed hook calls
adeptfrom$PATH— that's the install-time contract, so make sureadeptis on thePATHof whoever commits.
Running the gate manually / in CI¶
The same gate the hook invokes:
For CI, prefer adept status, which exits 2 when anything is out of sync: