personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

precommit: add pinned ruff-pre-commit hook + document drift gates

`make pre-commit` installed the pre-commit package, but without a
`.pre-commit-config.yaml` the git hook was a silent no-op. Wire it to
`astral-sh/ruff-pre-commit` so staged Python gets gated locally.

Pin the hook rev to `v0.15.2` to match the ruff version in `uv.lock`, and
leave a config comment telling future readers to bump both together on
`make update`.

Run `ruff-format` with `args: [--check]` so the hook stays pass-only and
fails loudly instead of silently reformatting, and keep `ruff-check` on its
default non-fixing behavior. This matches the `make test` format-check gate
and points contributors at `make format` when drift appears.

Document the two drift gates in a new `### Drift prevention` subsection
under `AGENTS.md` §10 and retitle the `make pre-commit` row in §5 to say
it should be run once after cloning to install the ruff format/lint hook.
`CLAUDE.md` and `GEMINI.md` are symlinks to `AGENTS.md`, so one edit covers
all three.

No source files were touched; `ruff format --check .` and `ruff check .`
were already green at 566 files.

Co-Authored-By: Codex <codex@openai.com>

+19 -1
+9
.pre-commit-config.yaml
··· 1 + # Installed by `make pre-commit`. Keep the rev pinned to the ruff version in 2 + # uv.lock so local and hook ruff stay aligned; bump both together on `make update`. 3 + repos: 4 + - repo: https://github.com/astral-sh/ruff-pre-commit 5 + rev: v0.15.2 6 + hooks: 7 + - id: ruff-format 8 + args: [--check] 9 + - id: ruff-check
+10 -1
AGENTS.md
··· 145 145 146 146 | Target | When to use | 147 147 |--------|-------------| 148 - | `make pre-commit` | Install pre-commit hooks (optional; most coders rely on `make ci` directly). | 148 + | `make pre-commit` | Run once after cloning to install the ruff format/lint git hook. | 149 149 | `make versions` | Print versions of Python, uv, and key deps. Diagnostic. | 150 150 151 151 ### Don't use ··· 273 273 - Run `make ci` before every commit. 274 274 - Run `git` commands directly — not `git -C` — you're already in the repo. 275 275 - Don't commit runtime artifacts written under `tests/fixtures/journal/` by `make dev` / `make sandbox` (`.gitignore` covers them; verify with `git status` anyway). 276 + 277 + ### Drift prevention 278 + 279 + Two gates keep the tree format-clean and lint-clean: 280 + 281 + 1. `make test` depends on `format-check` (Makefile:303-309); `make ci` adds `ruff check` and the layer/rename gates. Both block locally. 282 + 2. `.pre-commit-config.yaml` wires the same `ruff format --check` + `ruff check` into a git pre-commit hook. Run `make pre-commit` once after cloning to install it. 283 + 284 + When the hook rejects a commit, run `make format` and re-stage. Do not bypass with `--no-verify` — that re-opens the drift the hook exists to catch. 276 285 277 286 ## 11. Where to go deeper 278 287