Skip to content

feat: per-worktree graphify graph via pre-commit post-* hooks - #23

Merged
mariushelf merged 4 commits into
mainfrom
feat/graphify
Oct 19, 2026
Merged

mariushelf merged 4 commits into
mainfrom
feat/graphify

Conversation

@mariushelf

@mariushelf mariushelf commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

What

Generated projects now keep their own graphify code graph (graphify-out/) current, per git worktree, without committing it.

  • default_stages: [pre-commit] keeps other hooks off the post-* stages; install with uv run pre-commit install --allow-missing-config so checking out commits without a config still works; pre-commit is a dev dependency; copier runs uv lock so --frozen works.
  • pre-commit local hook graphify on post-commit, post-checkout, post-merge, post-rewrite; default_install_hook_types makes a plain pre-commit install set all of them up (min pre-commit bumped to 3.2.0).
  • scripts/graphify-update.sh runs uv run --frozen graphify update . (AST only, no LLM) detached in the background, coalescing triggers through a portable mkdir lock plus a dirty marker (stale locks recovered, log appended and capped; works without flock), and always exits 0.
  • graphifyy>=0.9.92 in the dev group; graphify-out/ in .gitignore; new "Code Graph" section in AGENTS.md; README setup note.

Why

  • Hooks live in pre-commit, so linked worktrees work (graphify hook install skips them and adds a merge driver and .gitattributes).
  • GRAPHIFY_NO_AUTO_REFRESH=1 is set so graphify does not rewrite the user's global agent skill files with the project's pinned version.

Tests

  • Rendered config, dependency, .gitignore, AGENTS.md, executable script.
  • Script exits 0 with no uv/graphify on PATH and when uv fails.
  • Integration: render, uv sync, pre-commit install, commit, poll for graphify-out/graph.json, then git worktree add and poll for the new worktree's own graph. Passed locally: post-checkout fires on git worktree add. Full suite: 38 passed.

Not verified

  • macOS itself (script uses only POSIX tools; the no-setsid path is untested). Windows needs Git Bash (documented).
  • The integration test needs network and uvx; it is skipped if uv or the network is missing.

🤖 Generated with Claude Code

mariushelf and others added 4 commits October 19, 2026 01:09
…* hooks

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…onfig)

Restrict other hooks to the pre-commit stage, install with
--allow-missing-config, replace flock with a portable mkdir lock plus dirty
marker, create uv.lock at generation time, and add pre-commit to dev deps.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mariushelf
mariushelf merged commit c4d1b8d into main Oct 19, 2026
4 checks passed
@mariushelf
mariushelf deleted the feat/graphify branch October 19, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant